:root {
  --bg: #fff;
  --side: #f5f5f7;
  --fill: #f2f2f4;
  --press: #e8e8ed;
  --deep: #dcdce2;
  --line: rgba(0, 0, 0, .08);
  --glass: rgba(255, 255, 255, .9);
  --ink: #1d1d1f;
  --ink2: #6e6e73;
  --ink3: #a1a1a6;
  --red: #d70015;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --kb: 0px;
  color-scheme: light;
}

:root[data-tone="warm"] { --bg: #faf7f5; --side: #f5f1ee; --fill: #f0ecea; --press: #e8e3df; --deep: #dcd4ce; --glass: rgba(250, 247, 245, .9); }
:root[data-tone="rose"] { --bg: #fdf8f8; --side: #f9f0f0; --fill: #f5e9e9; --press: #eedede; --deep: #e6cfcf; --glass: rgba(253, 248, 248, .9); }

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* Pinned, because iOS can leave the page scrolled after the phone is turned. */
html, body { position: fixed; inset: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", sans-serif;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: default; touch-action: manipulation; }
svg { display: block; }

/* layout */
#app { display: grid; grid-template-columns: 216px 312px minmax(0, 1fr); height: 100%; }
#side { background: var(--side); display: flex; flex-direction: column; min-height: 0; padding-top: var(--safe-t); }
#list { display: flex; flex-direction: column; min-height: 0; position: relative; border-right: 1px solid var(--line); }
#note { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; background: var(--bg); }

/* sidebar */
.side-top { height: 56px; display: flex; align-items: center; gap: 9px; padding: 0 20px; flex: none; }
.logo { width: 28px; height: 28px; flex: none; }
.brand { font-size: 13px; font-weight: 500; color: var(--ink2); letter-spacing: -.02em; white-space: nowrap; }
.side-scroll { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.nav {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  height: 36px; padding: 0 12px; border-radius: 9px; text-align: left; transition: background .12s;
}
.nav span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav em { font-style: normal; color: var(--ink3); font-size: 13px; font-variant-numeric: tabular-nums; flex: none; margin-left: 8px; }
.nav.on { background: var(--press); font-weight: 600; }
.nav.quiet { margin-top: 14px; color: var(--ink2); }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 30px; margin-top: 18px; padding: 0 6px 0 12px; color: var(--ink3); font-size: 12px; font-weight: 600;
}
.tiny { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--ink2); }
.nav.folder { justify-content: flex-start; gap: 12px; height: 60px; padding: 0 14px; margin-top: 6px; border-radius: 14px; background: var(--press); }
.nav.folder.on { background: var(--deep); font-weight: 400; }
.nav.folder svg { flex: none; color: var(--ink2); }
.nav.folder span { display: block; min-width: 0; }
.nav.folder b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.nav.folder small { display: block; color: var(--ink2); font-size: 12px; line-height: 1.3; }
.side-status { flex: none; padding: 0 10px 10px; }
.status {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px 0 13px; border-radius: 17px;
  background: var(--fill); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); transition: background .2s; }
.status.live i { background: #30b158; }
.status svg { color: var(--ink2); }
.side-status .status { display: flex; width: 100%; background: var(--press); }
.side-top .status { background: var(--press); }
.side-status .status span { flex: 1; text-align: left; }

/* note list */
.list-head { flex: none; padding: calc(10px + var(--safe-t)) 16px 8px; }
.list-title { display: flex; align-items: center; height: 40px; gap: 4px; }
.list-title h1 { flex: 1; font-size: 20px; font-weight: 700; letter-spacing: -.03em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-left: 4px; }
.search { display: block; margin-top: 8px; }
.search input, #findQ {
  width: 100%; height: 36px; padding: 0 12px; border: 0; outline: 0; border-radius: 10px;
  background: var(--fill); -webkit-appearance: none; appearance: none;
}
.search input::placeholder, #findQ::placeholder { color: var(--ink3); }
.search input::-webkit-search-cancel-button, #findQ::-webkit-search-cancel-button { display: none; }
#rows { flex: 1; overflow-y: auto; padding: 4px 8px 16px; overscroll-behavior: contain; }
.row {
  display: flex; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; text-align: left;
  transition: background .12s;
}
.row + .row { margin-top: 1px; }
.row.on { background: var(--fill); }
.row .txt { flex: 1; min-width: 0; }
.row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row p { color: var(--ink2); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 1px; word-break: break-all; }
.row time { color: var(--ink3); font-size: 12px; display: block; margin-top: 4px; }
.row mark { background: #ffe066; color: inherit; border-radius: 3px; }
.row img { flex: none; width: 52px; height: 52px; object-fit: cover; border-radius: 9px; background: var(--fill); align-self: center; }
.row .pin { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); vertical-align: 3px; margin-right: 6px; }
.empty { padding: 56px 24px; text-align: center; color: var(--ink3); }

/* note bar and toolbar */
.note-bar { flex: none; display: flex; align-items: center; gap: 4px; height: 56px; padding: var(--safe-t) 12px 0; }
.icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--ink); transition: background .12s, transform .12s; }
#tools { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
#tools::-webkit-scrollbar { display: none; }
#tools > :first-child { margin-left: auto; }
#tools > :last-child { margin-right: auto; }
.t {
  flex: none; min-width: 34px; height: 34px; padding: 0 7px; display: grid; place-items: center;
  border-radius: 9px; font-size: 15px; color: var(--ink); transition: background .12s;
}
.t.on { background: var(--press); }
.t:disabled { opacity: .3; }
.t b, .t i, .t u, .t s { font-size: 15px; line-height: 1; font-family: Georgia, "Times New Roman", serif; }
.t b { font-family: inherit; font-weight: 700; }
.t .chip { font-weight: 600; font-size: 14px; line-height: 1; padding: 3px 5px; border-radius: 5px; }
.t .chip.hl { background: #fff3bf; }
.t .chip.fg { box-shadow: inset 0 -2px 0 var(--ink); padding: 3px 3px 4px; border-radius: 0; }
.sep { flex: none; width: 1px; height: 16px; background: var(--line); margin: 0 6px; }

/* find in a note */
#findBar { flex: none; display: flex; align-items: center; gap: 2px; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 40px 8px; }
#findQ { flex: 1; min-width: 0; margin-right: 4px; }
#findNum { flex: none; min-width: 44px; text-align: center; color: var(--ink2); font-size: 13px; font-variant-numeric: tabular-nums; }
#findBar .icon:disabled { opacity: .3; }
::highlight(find) { background-color: #ffe066; }
::highlight(find-now) { background-color: #ffb020; }

/* paper */
#paper { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sheet { max-width: 720px; margin: 0 auto; padding: 18px 40px 40vh; }
#stamp { display: block; text-align: center; color: var(--ink3); font-size: 12px; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
#title {
  display: block; width: 100%; border: 0; outline: 0; padding: 0; resize: none; overflow: hidden;
  background: none; font-size: 30px; line-height: 1.28; font-weight: 700; letter-spacing: -.035em;
}
#title::placeholder { color: var(--ink3); }
#editor { margin-top: 14px; outline: 0; font-size: 16px; line-height: 1.72; min-height: 40vh; letter-spacing: -.01em; }
#editor.painting { cursor: copy; }
#editor.vacant::before { content: attr(data-placeholder); color: var(--ink3); position: absolute; pointer-events: none; }
#editor > * + * { margin-top: .35em; }
#editor p, #editor div { min-height: 1em; }
#editor h1 { font-size: 24px; line-height: 1.35; font-weight: 700; letter-spacing: -.03em; margin-top: 1em; }
#editor h2 { font-size: 19px; line-height: 1.4; font-weight: 700; letter-spacing: -.025em; margin-top: .9em; }
#editor h3 { font-size: 16px; font-weight: 700; margin-top: .8em; }
#editor ul, #editor ol { padding-left: 1.4em; }
#editor ul.check { list-style: none; padding-left: 1.75em; }
#editor ul.check li { position: relative; }
#editor ul.check li::before {
  content: ""; position: absolute; left: -1.75em; top: .34em; width: 1.05em; height: 1.05em;
  border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink3);
}
#editor ul.check li[data-done]::before {
  box-shadow: none; background: var(--ink) center/62% no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#editor ul.check li[data-done] { color: var(--ink3); text-decoration: line-through; }
#editor blockquote { border-left: 2px solid var(--ink); padding-left: 14px; color: var(--ink2); }
#editor a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--ink3); }
#editor hr { border: 0; height: 1px; background: var(--line); margin: 1.4em 0; }
#editor img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 10px 0; }
#editor pre { background: var(--fill); padding: 12px 14px; border-radius: 10px; overflow-x: auto; font: 13.5px/1.6 ui-monospace, Menlo, Consolas, monospace; }
#editor table { border-collapse: collapse; width: 100%; font-size: 15px; }
#editor td, #editor th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
#blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink3); background: var(--bg); }
#note.open #blank { display: none; }
#note:not(.open) .note-bar, #note:not(.open) #paper { visibility: hidden; }

/* popovers and sheets */
.pop {
  position: fixed; z-index: 30; min-width: 196px; max-height: 70vh; overflow-y: auto; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 12px 32px rgba(0, 0, 0, .12);
  animation: rise .18s var(--ease);
}
.pop h6 { font-size: 11px; font-weight: 600; color: var(--ink3); padding: 8px 10px 4px; }
.pop .item { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; padding: 5px 10px; border-radius: 8px; text-align: left; white-space: nowrap; }
.pop .item.danger { color: var(--red); }
.pop hr { border: 0; height: 1px; background: var(--line); margin: 5px 8px; }
.swatches { display: grid; grid-template-columns: repeat(4, 34px); gap: 6px; padding: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.swatch.bg { box-shadow: inset 0 0 0 .5px var(--line); }
.modal { position: relative; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--fill); color: var(--ink2); }
.modal-x:active { background: var(--press); }
.modal-x svg { width: 16px; height: 16px; }
.scrim { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .28); animation: fade .2s; }
.modal {
  width: 100%; max-width: 440px; max-height: min(84dvh, 720px); overflow-y: auto; background: var(--bg);
  border-radius: 20px; padding: 24px; animation: rise .28s var(--ease);
}
.modal.small { max-width: 340px; }
.modal h2 { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.modal .sub { color: var(--ink2); margin-top: 4px; }
.modal section { margin-top: 24px; }
.modal h3 { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.field { width: 100%; height: 46px; padding: 0 14px; border: 0; outline: 0; border-radius: 12px; background: var(--fill); margin-top: 14px; }
.btns { display: flex; gap: 8px; margin-top: 18px; }
.btn, .primary { flex: 1; height: 48px; border-radius: 13px; font-weight: 600; text-align: center; background: var(--fill); transition: transform .12s, background .12s; }
.primary { background: var(--ink); color: #fff; }
.btn.danger { color: var(--red); }
.btn:active, .primary:active, .icon:active, .row:active, .nav:active { transform: scale(.98); }
.dev { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 12px; }
.dev + .dev { border-top: 1px solid var(--line); }
.dev b { display: block; font-weight: 600; }
.dev small { color: var(--ink3); font-size: 12.5px; }
.dev small.on { color: var(--ink2); }
.link { color: var(--ink2); font-size: 13px; flex: none; }
.rowbtn { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 44px; text-align: left; }
.rowbtn + .rowbtn { border-top: 1px solid var(--line); }
.rowbtn span { color: var(--ink3); font-size: 13px; }
.porter-step { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.porter-step span { color: var(--ink2); }
a.rowbtn { color: inherit; text-decoration: none; }
a.rowbtn + a.rowbtn { border-top: 1px solid var(--line); }
.qr { display: block; width: 200px; height: 200px; margin: 22px auto 0; }
.qr svg { width: 100%; height: 100%; }
.code { text-align: center; font-size: 32px; font-weight: 700; letter-spacing: .08em; margin-top: 18px; font-variant-numeric: tabular-nums; }
.note-small { color: var(--ink2); font-size: 13px; text-align: center; margin-top: 6px; }
.tip { background: var(--fill); border-radius: 12px; padding: 12px 14px; color: var(--ink2); font-size: 13px; margin-top: 18px; }
.recovery { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--fill); font: 600 15px/1.7 ui-monospace, Menlo, monospace; text-align: center; word-spacing: .2em; user-select: all; }
#rows .tip { display: block; width: calc(100% - 24px); margin: 8px 12px; text-align: left; }
.ver { display: block; width: 100%; padding: 10px 0; text-align: left; }
.ver + .ver { border-top: 1px solid var(--line); }
.ver small { display: block; color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* pairing */
#pair { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.pair-box { width: 100%; max-width: 340px; animation: rise .5s var(--ease); }
.pair-box h1 { font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.3; }
.pair-box > p { color: var(--ink2); margin-top: 8px; }
#pairCode, #pairName { display: block; width: 100%; border: 0; outline: 0; background: var(--fill); border-radius: 14px; }
#pairCode { height: 68px; margin-top: 30px; text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .24em; font-variant-numeric: tabular-nums; }
#pairCode::placeholder { color: #d1d1d6; }
#pairName { height: 50px; margin-top: 8px; padding: 0 16px; }
.pair-box .primary { width: 100%; height: 54px; margin-top: 14px; }
.err { color: var(--red); font-size: 13px; text-align: center; min-height: 20px; margin-top: 12px; }

#toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(26px + var(--safe-b) + var(--kb)); transform: translate(-50%, 12px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; pointer-events: none; white-space: nowrap;
  transition: opacity .2s, transform .3s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }

@media (hover: hover) {
  .nav:hover:not(.on), .row:hover:not(.on), .t:hover:not(.on), .icon:hover, .tiny:hover, .pop .item:hover { background: var(--fill); }
  .nav:hover:not(.on), .tiny:hover, .status:hover { background: var(--press); }
  .nav.folder:hover:not(.on), .side-status .status:hover { background: var(--deep); }
  .pop .item:hover { background: rgba(0, 0, 0, .05); }
}

.only-m { display: none; }

.tones { display: flex; justify-content: center; gap: 14px; margin-top: 22px; }
.tone { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .14); }
.tone[data-tone="gray"] { background: #e8e8ed; }
.tone[data-tone="warm"] { background: #ece4dd; }
.tone[data-tone="rose"] { background: #f3dcdc; }
.tone[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }

/* phones: one screen at a time, pushed sideways like a native app */
@media (max-width: 760px) {
  .only-m { display: grid; }
  input, textarea { font-size: 16px; } /* smaller text makes iOS zoom the page on focus */
  .status.only-m { display: inline-flex; }
  .side-top .status { margin-left: auto; }
  .hide-m { display: none; }
  #app { display: block; position: relative; overflow: hidden; }
  #side, #list, #note { position: absolute; inset: 0; transition: transform .38s var(--ease); will-change: transform; background: var(--bg); }
  #list { border: 0; }
  body[data-view="folders"] #list, body[data-view="folders"] #note { transform: translateX(100%); }
  body[data-view="list"] #side { transform: translateX(-30%); }
  body[data-view="list"] #note { transform: translateX(100%); }
  body[data-view="note"] #side { transform: translateX(-30%); }
  body[data-view="note"] #list { transform: translateX(-30%); }
  #side { background: var(--side); }
  .side-top { height: 72px; align-items: flex-end; padding: 0 12px 8px 20px; }
  .logo { width: 34px; height: 34px; }
  .brand { font-size: 15px; }
  .nav { height: 44px; }
  .list-head { padding-left: 12px; padding-right: 12px; }
  .list-title h1 { font-size: 28px; text-align: left; }
  .row { padding: 12px; }
  #fab {
    position: absolute; right: 20px; bottom: calc(20px + var(--safe-b)); width: 54px; height: 54px; border-radius: 50%;
    background: var(--ink); color: #fff; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); transition: transform .15s;
  }
  #fab:active { transform: scale(.93); }
  .note-bar { justify-content: space-between; }
  #tools {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(50px + var(--safe-b)); gap: 0; padding: 0 4px var(--safe-b); justify-content: flex-start;
    background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 -.5px 0 var(--line);
    transform: translateY(calc(var(--kb) * -1));
  }
  body[data-view="note"].typing #tools { padding-bottom: 0; height: 50px; }
  #paper { margin-bottom: calc(var(--kb) + 50px + var(--safe-b)); } /* ends where the toolbar starts */
  .typing #paper { margin-bottom: calc(var(--kb) + 50px); }
  #findBar { padding: 0 12px 8px; }
  body:not([data-view="note"]) #tools { display: none; }
  .t { min-width: 30px; height: 38px; padding: 0 2px; }
  .sep { margin: 0 3px; }
  .sheet { padding: 4px 20px 45vh; }
  #title { font-size: 27px; }
  #editor { font-size: 17px; }
  .scrim { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; padding-bottom: calc(24px + var(--safe-b)); animation-name: slideup; }
  .modal.small { max-width: none; }
  .pop { left: 12px !important; right: 12px !important; top: auto !important; bottom: calc(60px + var(--kb) + var(--safe-b)); min-width: 0; }
  .swatches { grid-template-columns: repeat(8, 1fr); justify-items: center; }
}
@keyframes slideup { from { transform: translateY(100%); } }

/* the library */
#room { position: fixed; inset: 0; z-index: 25; background: #f6ecec; overflow: hidden; }
#roomView { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.room-bar {
  position: absolute; top: calc(8px + var(--safe-t)); left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; height: 32px; pointer-events: none;
}
.room-count { height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 .5px var(--line); font-size: 13px; font-weight: 600; line-height: 30px; white-space: nowrap; }
#roomPick { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#roomPick svg { flex: none; opacity: .6; }
#roomLang { min-width: 36px; font-weight: 700; letter-spacing: .02em; }
@media (max-width: 520px) { #roomAvatar { display: none; } .room-bar { gap: 5px; } .room-btn { padding: 0 9px; } }
#roomFocus { background: var(--ink); color: var(--bg); box-shadow: none; }
.room-btn { height: 30px; padding: 0 11px; border-radius: 9px; background: var(--glass); box-shadow: 0 0 0 .5px var(--line); font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: auto; }
.room-btn:active { background: var(--press); }
#roomHint {
  position: absolute; left: 50%; bottom: calc(76px + var(--safe-b)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.room-dock {
  position: absolute; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 16px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(120, 92, 92, .16), 0 0 0 .5px var(--line);
}
.room-dock button { height: 38px; padding: 0 13px; border-radius: 12px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.room-dock button:first-child { background: var(--ink); color: var(--bg); }
.room-dock button:active { background: var(--press); }
.room-back {
  position: fixed; z-index: 24; left: 16px; bottom: calc(16px + var(--safe-b)); display: none; align-items: center; gap: 7px; height: 40px; padding: 0 12px 0 13px;
  border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 4px 14px rgba(110, 84, 84, .16), 0 0 0 .5px var(--line); font-size: 14px; font-weight: 600; color: var(--ink);
}
.room-back kbd { font: 500 11px/1 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink3); padding: 3px 5px; border-radius: 5px; background: var(--fill); }
.room-back:active { transform: scale(.97); background: var(--press); }
body:not(.in-room) #app:not([hidden]) ~ .room-back { display: inline-flex; }
@media (max-width: 760px) {
  .room-back kbd { display: none; }
  .room-back { left: 14px; bottom: calc(20px + var(--safe-b)); }
  body[data-view="note"] .room-back { display: none !important; }
}
.avatars { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin-top: 14px; }
.avatar { display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 12px; background: var(--fill); font-size: 12px; color: var(--ink2); }
.avatar.on { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.avatar i { display: block; width: 75px; height: 109px; background-size: 600px auto; background-position: 0 -873px; background-repeat: no-repeat; }

@media print {
  #side, #list, .note-bar, #findBar { display: none; }
  #app { display: block; }
  html, body { position: static; }
  html, body, #note, #paper { height: auto; overflow: visible; }
}

.room-gate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.room-gate-card { width: min(100%, 340px); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.room-gate-logo { font-size: 44px; font-weight: 800; letter-spacing: -.04em; }
.room-gate-card h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.room-gate-card p { margin: 0 0 6px; color: var(--ink2); font-size: 14px; line-height: 1.5; }
.room-gate-card .primary:disabled { opacity: .4; }
.room-gate-share { height: 44px; border-radius: 12px; background: var(--fill); font-size: 15px; font-weight: 600; }
.room-gate-share:active { background: var(--press); }
.room-gate-card .primary, .room-gate-card .field { flex: none; height: 48px; }

.room-feedback { position: absolute; top: calc(48px + var(--safe-t)); right: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .55); color: var(--ink2); box-shadow: 0 0 0 .5px var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.room-feedback:active { background: var(--press); }
.room-feedback[hidden] { display: none; }
.room-gate-err { margin: 0; color: #c0392b; font-size: 13px; }
.fb-opts { display: grid; gap: 2px; margin: 12px 0 10px; }
.fb-opt { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 4px; font-size: 15px; text-align: left; }
.fb-opt i { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid var(--ink3); flex: none; }
.fb-opt.on i { border: 5px solid var(--ink); }
.fb-note { margin: 4px 0 8px; color: var(--ink2); font-size: 13px; }
.fb-text { width: 100%; min-height: 96px; padding: 10px 12px; resize: none; font: inherit; height: auto; margin-bottom: 12px; }
.modal .primary:disabled { opacity: .4; }
