:root {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: #000;
  background: var(--surface, #f2f2f7);
  --yellow: #e4ab00;
  --line: #c6c6c8;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overscroll-behavior: none; }
body { height: 100dvh; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: none; color: var(--yellow); padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #e4ab00; outline-offset: 3px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
#app { height: 100%; max-width: 430px; margin: auto; position: relative; overflow: hidden; background: var(--surface, #f2f2f7); }
.screen { height: 100%; display: flex; flex-direction: column; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
.hidden { display: none !important; }
.home-nav, .note-nav { display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0 16px; flex-shrink: 0; }
.text-button { display: inline-flex; align-items: center; gap: 1px; font-size: 17px; font-weight: 400; min-height: 44px; }
.text-button svg { margin-left: -13px; width: 24px; height: 24px; margin-right: 0; }
.icon-button, .toolbar-symbol { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; }
.home-nav > .icon-button { margin-right: -8px; }
.home-nav .icon-button svg, .nav-actions .icon-button svg { width: 24px; height: 24px; }
.home-content { padding: 5px 16px 26px; overflow: auto; flex: 1; min-height: 0; scrollbar-width: none; }
.home-content::-webkit-scrollbar { display: none; }
h1 { margin: 0 0 10px; font-size: 34px; line-height: 41px; letter-spacing: .1px; font-weight: 700; }
.search { height: 36px; border-radius: 10px; background: #e3e3e8; display: flex; align-items: center; gap: 7px; padding: 0 8px; margin-bottom: 24px; color: #818187; }
.search > svg { width: 20px; height: 20px; stroke-width: 1.7; }
.search .search-mic { width: 21px; height: 23px; margin-left: 2px; }
.search input { background: none; border: 0; outline: none; width: 100%; min-width: 0; font-size: 17px; color: #000; padding: 0; height: 100%; }
.search input::placeholder { color: #818187; opacity: 1; }
.section-label { font-size: 20px; font-weight: 700; line-height: 25px; letter-spacing: -.25px; margin: 0 3px 9px; display: flex; align-items: center; gap: 7px; }
.section-label svg { width: 16px; height: 18px; color: var(--yellow); }
.note-list { background: #fff; border-radius: 10px; overflow: hidden; }
.note-row { display: block; text-align: left; color: #000; padding: 10px 14px 10px 28px; width: 100%; position: relative; height: 61px; }
.note-row + .note-row::before { content: ""; position: absolute; top: 0; left: 28px; right: 0; border-top: .5px solid var(--line); }
.note-row:active { background: #e5e5ea; }
.note-row h2 { font-size: 17px; line-height: 21px; font-weight: 600; letter-spacing: -.2px; margin: 0 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row p { font-size: 15px; line-height: 19px; color: #8e8e93; margin: 0; display: flex; gap: 8px; white-space: nowrap; overflow: hidden; letter-spacing: -.1px; }
.note-row p > span:first-child { flex-shrink: 0; }
.note-row .preview { overflow: hidden; text-overflow: ellipsis; }
.other-label { margin-top: 25px; }
.home-footer, .note-footer { display: flex; align-items: center; justify-content: space-between; height: 49px; flex-shrink: 0; padding: 0 12px; }
.home-footer { position: relative; justify-content: flex-end; border-top: .5px solid #b8b8bb; background: rgba(249, 249, 250, .96); }
.home-footer #note-count { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 15px; color: #000; white-space: nowrap; }
.home-footer .icon-button svg, .note-footer .icon-button:last-child svg { width: 25px; height: 25px; }
#empty-search { text-align: center; color: #8e8e93; margin: 50px 0; font-size: 17px; }
#note { background: #fff; }
.note-nav { background: #fff; z-index: 2; padding-left: 16px; padding-right: 16px; }
.nav-actions { display: flex; gap: 10px; margin-right: -8px; }
.note-footer { color: var(--yellow); background: #fff; z-index: 2; }
.note-footer svg { width: 26px; height: 26px; stroke-width: 1.55; }
#viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; cursor: default; background: #fff; }
#paper { position: absolute; inset: 0; pointer-events: none; }
.paper-header { position: absolute; top: 0; left: 24px; right: 24px; will-change: transform; }
.paper-header .note-date { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-size: 13px; line-height: 18px; color: #c7c7cc; }
.paper-header h1 { font-size: 28px; line-height: 34px; font-weight: 700; color: #454545; letter-spacing: .1px; margin: 10px 0 0; }
.word-row { position: absolute; left: 24px; right: 24px; display: flex; gap: 12px; height: 26px; align-items: center; will-change: transform; font-size: 17px; line-height: 26px; color: #484848; letter-spacing: 0; }
.word-row span { white-space: nowrap; }
#scroll-thumb { position: absolute; right: 3px; top: 0; width: 3px; height: 32px; border-radius: 4px; background: rgba(90, 90, 95, .4); opacity: 0; transition: opacity .2s; pointer-events: none; }
#scroll-thumb.active { opacity: 1; }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #f2f2f7; color: #8e8e93; font-size: 15px; z-index: 5; }
.loading[hidden] { display: none; }
.folder-row { display: flex; align-items: center; padding: 13px 16px; background: #fff; border-radius: 10px; width: 100%; gap: 12px; font-size: 17px; }
.folder-row span { color: #000; flex: 1; text-align: left; }
.folder-row small { color: #8e8e93; font-size: 17px; }
.folder-row svg:last-child { color: #c7c7cc; width: 16px; }
.folder-row svg:first-child { width: 25px; }
dialog { padding: 0; border: 0; border-radius: 14px; width: min(320px, calc(100vw - 48px)); background: rgba(249,249,249,.98); color: #1c1c1e; box-shadow: 0 18px 80px #0002; }
dialog::backdrop { background: #0005; backdrop-filter: blur(3px); }
dialog h2 { font-size: 17px; font-weight: 600; margin: 20px 20px 7px; text-align: center; }
dialog form > p { font-size: 13px; line-height: 1.45; margin: 0 22px 16px; text-align: center; }
#spectator-name { display: block; width: calc(100% - 40px); margin: 0 20px; background: #fff; border: 1px solid #c9c9cc; border-radius: 6px; padding: 7px 9px; outline: none; font-size: 16px; }
.feedback { color: #8d6920; min-height: 15px; margin-top: 10px !important; margin-bottom: 12px !important; }
.feedback.error { color: #b52d28; }
.dialog-actions { display: flex; border-top: .5px solid #aaa; height: 44px; }
.dialog-actions button { width: 50%; font-size: 17px; }
.dialog-actions button + button { border-left: .5px solid #aaa; font-weight: 600; }
.dialog-actions button:disabled { opacity: .4; }
.settings-dialog { width: min(560px, calc(100vw - 24px)); max-height: 88dvh; background: #f2f2f7; border-radius: 16px; }
.settings-dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; background: #f9f9fb; position: sticky; top: 0; z-index: 1; border-bottom: .5px solid #c6c6c8; }
.settings-dialog > header h2 { margin: 0; text-align: left; font-size: 18px; }
.settings-body { padding: 4px 20px 24px; font-size: 14px; line-height: 1.6; }
.settings-intro { color: #77777c; }
.settings-body h3 { font-size: 17px; margin: 24px 0 8px; }
.settings-body ol { padding-left: 20px; }
.settings-body li { padding: 0 0 9px 3px; }
.settings-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-radius: 10px; padding: 14px; margin: 10px 0; flex-wrap: wrap; }
.settings-card strong { margin-left: auto; }
.settings-card button { font-size: 13px; }
.settings-card select { max-width: 180px; background: #f2f2f7; border: 0; padding: 6px; color: #5b5b61; border-radius: 6px; font-size: 13px; }
.small { font-size: 12px; color: #7c7c82; }
.secondary-button { border: 1px solid #d9c080; border-radius: 10px; padding: 11px 14px; width: 100%; margin: 14px 0 20px; background: #fff; }
.settings-body details { font-size: 13px; color: #7c7c82; }
#dictionary-info { white-space: pre-line; }
#toast { position: fixed; bottom: calc(80px + var(--safe-bottom)); left: 50%; transform: translate(-50%, 10px); border-radius: 13px; padding: 12px 18px; color: #fff; background: #303034ee; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; max-width: 85vw; z-index: 20; text-align: center; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
#editor { flex: 1; min-height: 0; padding: 10px 24px 20px; overflow: auto; }
#editor[hidden] { display: none; }
#editor .note-date { display: none; }
#edit-title { display: block; border: 0; width: 100%; font-size: 28px; line-height: 34px; font-weight: 700; margin: 0 0 12px; padding: 0; background: none; outline: 0; color: #454545; }
#edit-body { display: block; border: 0; width: 100%; height: 60vh; resize: none; font-size: 17px; line-height: 26px; padding: 0; margin: 0; background: none; outline: 0; color: #484848; }
@media (min-width: 600px) {
  body { padding: 24px 0; background: #e8e8ed; }
  #app { height: calc(100dvh - 48px); border-radius: 24px; box-shadow: 0 16px 60px #0000000c; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 350px) { .word-row { font-size: 16px; gap: 10px; } }
