:root {
  --ink: #1c1c1e;
  --ink-2: #48484d;
  --ink-3: #6e6e73;
  --hair: rgb(60 60 67 / .16);
  --fill: rgb(118 118 128 / .14);
  --fill-2: rgb(118 118 128 / .24);
  --accent: #0071e3;
  --accent-soft: rgb(0 113 227 / .13);
  --red: #d70015;
  --green: #17803d;
  --glass: rgb(246 248 252 / .62);
  --card: rgb(255 255 255 / .8);
  --blur: blur(32px) saturate(185%);
  --edge: inset 0 0 0 .5px rgb(255 255 255 / .75), inset 0 1px 0 rgb(255 255 255 / .85);
  --float: 0 24px 60px rgb(6 18 48 / .3), 0 4px 14px rgb(6 18 48 / .14);
  --vh: 100dvh;
  --vt: 0px;
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
html { background: #1d5fd1; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, .radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
::placeholder { color: var(--ink-3); }
.sprite { position: absolute; width: 0; height: 0; }
svg { width: 20px; height: 20px; flex: none; }

.wall { position: fixed; inset: 0; z-index: -1; }
.wall-img { position: absolute; inset: 0; background: url(assets/wallpaper.webp) 10% 72% / cover no-repeat; }
.dusk { position: absolute; inset: 0; background: linear-gradient(#0b1440, #3a2a68 58%, #c9602f); opacity: var(--dusk, 0); will-change: opacity; }
@media (max-aspect-ratio: 1/1) {
  .wall-img { background-size: auto 118%; background-position: 67% 100%; }
}

.app {
  position: fixed;
  left: 50%;
  top: var(--vt);
  width: min(100vw, 480px);
  height: var(--vh);
  transform: translateX(-50%);
  overflow: hidden;
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* 공통 창 */
.win, .taskbar, .balloon, .toast {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.win { background: var(--glass); border-radius: 26px; box-shadow: var(--edge), var(--float); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.title-bar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 8px 4px 16px; font-weight: 600; font-size: 14px; flex: none; }
.title-text { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lights { display: flex; gap: 7px; flex: none; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .14); }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.win-ctl { position: relative; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; background: var(--fill); border: 0; border-radius: 50%; color: var(--ink-2); flex: none; }
.win-ctl::after { content: ""; position: absolute; inset: -6px; }
.win-ctl svg { width: 17px; height: 17px; }
.win-ctl:active { background: var(--fill-2); }
.btn { min-height: 44px; min-width: 76px; padding: 8px 18px; background: var(--fill); border: 0; border-radius: 14px; font-weight: 600; transition: transform .12s, background .12s; }
.btn:active:not(:disabled) { transform: scale(.97); background: var(--fill-2); }
.btn:disabled { color: var(--ink-3); opacity: .65; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgb(0 113 227 / .32), inset 0 1px 0 rgb(255 255 255 / .28); }
.btn.primary:active:not(:disabled) { background: #0062c4; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.big { width: 100%; min-height: 54px; border-radius: 17px; font-size: 18px; font-weight: 700; }
.row-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 첫 화면 */
.hero { flex: 1; min-height: 0; padding: calc(env(safe-area-inset-top) + clamp(24px, 7vh, 72px)) 26px 0; color: #fff; text-shadow: 0 1px 3px rgb(0 28 96 / .6), 0 2px 18px rgb(0 28 96 / .65); }
.hero h1 { font-size: clamp(42px, 13vw, 58px); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; }
.hero p { margin-top: 12px; font-size: 16px; font-weight: 500; word-break: keep-all; }
.start { margin: 0 10px 8px; padding: 16px 14px 14px; flex: none; }
.start-line { font-size: 15px; font-weight: 600; text-align: center; word-break: keep-all; margin-bottom: 12px; }
.group { border: 0; margin-bottom: 12px; }
.group legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; background: var(--fill); border-radius: 15px; }
.radio { position: relative; display: block; cursor: pointer; }
.radio input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.radio span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--ink-2); transition: background .15s; }
.radio small { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-top: 1px; }
.radio input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgb(0 0 0 / .14), 0 0 0 .5px rgb(0 0 0 / .05); }
.best { font-size: 13px; color: var(--ink-2); text-align: center; }
.best:not(:empty) { margin-top: 10px; }
.fan-note { color: #fff; text-align: center; font-size: 12px; font-weight: 500; padding: 0 12px 8px; text-shadow: 0 1px 6px rgb(0 40 0 / .75); flex: none; }

/* 하단 Dock */
.taskbar { display: flex; align-items: center; gap: 2px; flex: none; margin: 0 8px calc(8px + env(safe-area-inset-bottom)); padding: 6px; border-radius: 26px; background: var(--glass); box-shadow: var(--edge), var(--float); }
.task-app { position: relative; flex: 1; min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; background: none; border: 0; border-radius: 18px; font-size: 11px; font-weight: 500; color: var(--ink); text-decoration: none; }
.task-app svg { width: 32px; height: 32px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .2)); }
.task-app:active { background: var(--fill); }
.task-app.pending { background: var(--accent-soft); font-weight: 700; }
.task-app.pending svg { animation: bounce 1s ease-in-out infinite; }
.task-app b { position: absolute; top: 0; left: calc(50% + 7px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #ff3b30; color: #fff; font-size: 12px; line-height: 19px; text-align: center; box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.tray { padding: 0 12px 0 8px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
@keyframes bounce { 50% { transform: translateY(-4px); } }

/* 작성 창 */
.work { padding: calc(env(safe-area-inset-top) + 8px) 8px 0; }
.work .taskbar { margin-left: 0; margin-right: 0; }
.composer { flex: 1; margin-bottom: 8px; }
.countdown { padding: 4px 11px; border-radius: 12px; background: var(--fill); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown.danger { background: #ff3b30; color: #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .68; } }
.tool-bar { display: flex; gap: 6px; padding: 2px 10px 8px; flex: none; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 0 11px; background: var(--fill); border: 0; border-radius: 13px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tool:active { background: var(--fill-2); }
.tool.icon { width: 40px; padding: 0; flex: none; }
.tool[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); }
.tool.main { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgb(0 113 227 / .3); }
.tool.main:active { background: #0062c4; }
.tool.urgent { color: var(--red); font-weight: 800; font-size: 19px; }
.tool svg { width: 18px; height: 18px; }
.blocks { display: flex; gap: 2px; height: 4px; margin: 0 14px 8px; flex: none; }
.blocks i { flex: 1; border-radius: 2px; background: var(--accent); }
.blocks i.off { background: var(--fill-2); }
.blocks.danger i:not(.off) { background: #ff3b30; }
.fields { margin: 0 8px 6px; padding: 0 12px; background: var(--card); border-radius: 15px; flex: none; }
.field-row { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.field-row + .field-row { border-top: .5px solid var(--hair); }
.field-btn { width: 44px; font-size: 13px; font-weight: 500; color: var(--ink-3); flex: none; }
.field { flex: 1; min-width: 0; padding: 6px 0; border: 0; background: none; font-size: 14px; color: var(--ink-2); }
input.field { font-size: 16px; color: var(--ink); outline: none; }
.ref { max-height: 132px; overflow-y: auto; margin: 0 8px 6px; padding: 7px 8px; background: rgb(255 244 200 / .82); border-radius: 15px; line-height: 1.5; font-size: 14px; position: relative; flex: none; overscroll-behavior: contain; }
.ref.closed { display: none; }
.ref-line { padding: 1px 6px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: #5b5a55; }
.ref-line.active { background: var(--accent); color: #fff; }
.ref-line .ok { color: var(--green); font-weight: 700; }
.ref-line.active .ok { color: #b6ffcb; }
.ref-line .bad { color: var(--red); text-decoration: underline; font-weight: 700; }
.ref-line.active .bad { color: #ffc7c2; }
.ref-img { display: block; width: 100%; text-align: left; background: rgb(255 255 255 / .6); border: 1px dashed rgb(120 100 40 / .55); border-radius: 10px; margin: 4px 0; padding: 5px 9px; font-size: 13px; font-weight: 500; min-height: 32px; }
.ref-img.done { border-style: solid; border-color: var(--green); color: var(--green); font-weight: 700; }
.body-wrap { flex: 1; min-height: 80px; position: relative; margin: 0 8px; padding: 4px; background: var(--card); border-radius: 15px; display: flex; }
#body { flex: 1; width: 100%; resize: none; border: 0; outline: 0; background: transparent; padding: 6px 8px 24px; font-size: 16px; line-height: 1.5; }
.sent-from { position: absolute; left: 13px; bottom: 7px; color: var(--ink-3); font-size: 11px; pointer-events: none; }
.status-bar { display: flex; gap: 10px; flex: none; padding: 6px 16px 9px; font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.status-bar .grow { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; }

/* 키보드가 열렸을 때 */
.kb .to-row, .kb .sent-from, .kb .status-bar, .kb .fan-note, .kb .lights { display: none; }
.kb .title-bar { min-height: 40px; padding: 3px 6px 2px 12px; }
.kb .title-text { text-align: left; }
.kb .ref { max-height: 56px; font-size: 13px; padding: 4px 6px; margin-bottom: 4px; }
.kb .field-row { min-height: 36px; }
.kb .fields { margin-bottom: 4px; }
.kb .taskbar { margin-bottom: 4px; padding: 3px; border-radius: 20px; }
.kb .task-app { min-height: 38px; }
.kb .task-app span { display: none; }
.kb .task-app svg { width: 26px; height: 26px; }
.kb .task-app b { top: -1px; }
.kb .tool { min-height: 34px; }
.kb .tool.icon { width: 34px; }
.kb .tool-bar { padding-bottom: 4px; }
.kb .blocks { margin-bottom: 4px; }
.kb .work { padding-top: 4px; }
.kb .composer { margin-bottom: 4px; padding-bottom: 6px; }
.kb .hero { padding-top: 16px; }
.kb .dlg { max-height: calc(var(--vh) - 8px); }

/* 알림 배너 */
.balloon { position: absolute; z-index: 20; left: 14px; right: 14px; top: calc(env(safe-area-inset-top) + 10px); display: flex; align-items: center; gap: 11px; padding: 11px 13px; text-align: left; background: rgb(250 251 254 / .76); border: 0; border-radius: 22px; box-shadow: var(--edge), var(--float); animation: drop-in .32s cubic-bezier(.2, .9, .3, 1.2); }
.balloon svg { width: 38px; height: 38px; }
.balloon div { min-width: 0; flex: 1; }
.balloon small { display: block; font-size: 12px; color: var(--ink-2); }
.balloon b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes drop-in { from { transform: translateY(-110%); opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(26px); opacity: 0; } }
@keyframes zoom-in { from { transform: scale(.94); opacity: 0; } }

/* 대화상자 */
.overlay { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgb(8 16 40 / .24); }
.call-overlay { z-index: 40; align-items: center; background: rgb(8 16 40 / .46); }
.box-overlay { z-index: 50; align-items: center; background: rgb(8 16 40 / .3); }
.dlg { width: 100%; max-height: 88%; background: rgb(246 248 252 / .78); animation: sheet-in .22s ease-out; }
.call, .box { background: rgb(246 248 252 / .78); animation: zoom-in .18s ease-out; }
.dlg-scroll { overflow-y: auto; padding: 8px 12px 14px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.time-bar { height: 4px; margin: 0 14px 4px; background: var(--fill-2); border-radius: 2px; overflow: hidden; flex: none; }
.time-bar i { display: block; height: 100%; background: var(--accent); }
.time-bar.danger i { background: #ff3b30; }
.mail-meta { display: grid; grid-template-columns: 62px 1fr; gap: 6px 4px; align-items: baseline; padding: 10px 12px; margin-bottom: 10px; background: var(--card); border-radius: 15px; font-size: 14px; }
.mail-meta span:nth-child(odd) { font-size: 13px; color: var(--ink-3); }
.mail-meta span:nth-child(even) { font-weight: 500; overflow-wrap: anywhere; }
.task-text { white-space: pre-wrap; line-height: 1.55; margin-bottom: 10px; word-break: keep-all; }
.say { font-size: 13px; color: var(--ink-2); margin: 10px 0 8px; }
.say b { display: inline-block; background: var(--accent-soft); color: var(--accent); padding: 2px 9px; margin-left: 3px; border-radius: 8px; font-size: 15px; font-weight: 700; }
.chat { background: rgb(160 188 214 / .62); padding: 12px; border-radius: 17px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bubble { background: #fff; padding: 8px 12px; border-radius: 15px; border-top-left-radius: 5px; max-width: 86%; }
.reply-row { display: flex; gap: 6px; }
.reply-input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 14px; border: 0; border-radius: 23px; background: #fff; font-size: 16px; outline: 0; box-shadow: inset 0 0 0 .5px var(--hair); }
.reply-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.send-round { min-width: 72px; background: var(--accent); color: #fff; border: 0; border-radius: 23px; font-weight: 700; }
.send-round:active { background: #0062c4; }
.reply-row.is-chat .send-round { background: #fbd500; color: #2a2118; }
.typo-text { padding: 10px 12px; background: var(--card); border-radius: 15px; line-height: 2.2; word-break: keep-all; }
.word { background: none; border: 0; border-radius: 6px; padding: 4px 0; font-size: 15px; }
.word:active { background: var(--accent-soft); }
.word.fixed { background: rgb(52 199 89 / .24); color: var(--green); font-weight: 700; padding-inline: 4px; }
.sort-list { display: flex; flex-direction: column; gap: 8px; }
.sort-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; background: var(--card); border-radius: 14px; font-weight: 500; box-shadow: 0 1px 3px rgb(0 0 0 / .08); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; position: relative; }
.sort-row.dragging { background: var(--accent); color: #fff; z-index: 2; box-shadow: 0 10px 24px rgb(0 60 140 / .35); }
.grip { display: grid; gap: 3px; opacity: .45; }
.grip i { display: block; width: 16px; height: 2px; border-radius: 1px; background: currentColor; }
.swipe-list { background: var(--card); border-radius: 15px; overflow: hidden; }
.swipe-slot { position: relative; overflow: hidden; border-bottom: .5px solid var(--hair); }
.swipe-slot:last-child { border-bottom: 0; }
.swipe-slot.gone { display: none; }
.swipe-bg { position: absolute; inset: 0; background: #ff3b30; color: #fff; display: flex; align-items: center; justify-content: flex-end; padding-right: 16px; font-weight: 700; }
.swipe-row { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 54px; padding: 6px 13px; background: #fff; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; transition: transform .12s; }
.swipe-row b { font-weight: 600; }
.swipe-row small { color: var(--ink-3); font-size: 12px; }
.sign-pad { position: relative; height: 128px; background: #fff; border-radius: 15px; box-shadow: inset 0 0 0 .5px var(--hair); }
.sign-pad canvas { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); touch-action: none; }
.sign-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #b4b4ba; font-size: 24px; pointer-events: none; }
.grid-sheet { display: grid; grid-template-columns: 76px 1fr; background: rgb(60 60 67 / .18); gap: .5px; border-radius: 15px; overflow: hidden; }
.cell { background: #fff; min-height: 44px; display: flex; align-items: center; padding: 0 12px; }
.cell.head { background: #f2f3f7; justify-content: center; font-size: 13px; color: var(--ink-2); }
.cell.name { background: #f2f3f7; justify-content: center; font-weight: 700; }
.cell input { width: 100%; border: 0; outline: 0; font-size: 16px; text-align: right; background: transparent; }
.drag-token { display: flex; align-items: center; min-height: 48px; padding: 6px 12px; background: #fff; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: 0 2px 8px rgb(0 0 0 / .12), inset 0 0 0 1px var(--accent-soft); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; overflow-wrap: anywhere; position: relative; }
.drag-token.dragging { background: var(--accent); color: #fff; z-index: 5; opacity: .94; box-shadow: 0 12px 26px rgb(0 60 140 / .36); }
.drop-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.zone { min-height: 72px; padding: 6px; background: rgb(94 170 255 / .3); color: #0b4a94; border: 0; border-radius: 15px; font-size: 14px; font-weight: 600; word-break: keep-all; }
.zone.over { background: var(--accent); color: #fff; }
.zone.filled { background: rgb(52 199 89 / .35); color: var(--green); }
.task-list button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 6px; padding: 6px 12px; background: var(--card); border: 0; border-radius: 15px; text-align: left; }
.task-list button svg { width: 34px; height: 34px; }
.task-list span { flex: 1; min-width: 0; }
.task-list b, .task-list small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-list b { font-weight: 600; }
.task-list small { font-size: 12px; color: var(--ink-3); }
.help-list { display: grid; gap: 10px; padding-left: 20px; line-height: 1.55; word-break: keep-all; }
.help-list b { font-weight: 700; }

/* 파일 열기 */
.path { display: flex; align-items: center; gap: 7px; padding: 0 16px 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); flex: none; }
.path svg { width: 18px; height: 18px; }
.file-list { max-height: 38vh; overflow-y: auto; padding: 4px; background: var(--card); border-radius: 15px; flex: none; overscroll-behavior: contain; }
.kb .file-list { max-height: 26vh; }
.file-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 4px 8px; background: none; border: 0; border-radius: 11px; text-align: left; font-size: 14px; }
.file-row img { width: 34px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; box-shadow: 0 0 0 .5px rgb(0 0 0 / .18); }
.file-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-row small { font-size: 12px; color: var(--ink-3); }
.file-row.sel { background: var(--accent); color: #fff; }
.file-row.sel small { color: #dcebff; }
.file-foot { display: flex; gap: 12px; align-items: center; padding: 10px 2px 2px; flex: none; }
.file-preview { width: 84px; height: 104px; object-fit: contain; background: #fff; border-radius: 10px; flex: none; box-shadow: 0 2px 10px rgb(0 0 0 / .18); }
.file-foot p { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }

/* 전화 */
.call { width: min(100%, 360px); }
.call-top { text-align: center; padding: 26px 12px 10px; }
.call-top small { font-size: 13px; color: var(--ink-2); }
.call-top h2 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0; }
.call-state { font-size: 14px; color: var(--ink-2); }
.call-stage { padding: 10px 14px 16px; display: grid; gap: 10px; }
.slide-track { position: relative; height: 60px; padding: 4px; background: var(--fill-2); border-radius: 30px; touch-action: none; }
.slide-label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 40px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.knob { position: relative; width: 52px; height: 52px; display: grid; place-items: center; background: #fff; border: 0; border-radius: 50%; box-shadow: 0 3px 9px rgb(0 0 0 / .24); touch-action: none; cursor: grab; }
.knob svg { width: 36px; height: 36px; }
.call-decline { min-height: 46px; background: #ff3b30; color: #fff; border: 0; border-radius: 15px; font-weight: 700; }
.call-line { min-height: 68px; padding: 10px 14px; background: var(--card); border-radius: 15px; display: grid; place-items: center; text-align: center; word-break: keep-all; }
.call-yes { min-height: 56px; font-weight: 700; font-size: 18px; background: var(--accent); color: #fff; }
.call-yes:active:not(:disabled) { background: #0062c4; }

/* 메시지 상자 */
.box { width: min(100%, 340px); }
.box-body { display: flex; gap: 12px; align-items: center; padding: 8px 18px 16px; line-height: 1.5; word-break: keep-all; }
.box-body svg { width: 36px; height: 36px; }
.box-actions { display: flex; gap: 8px; padding: 0 12px 12px; }
.box-actions:empty { display: none; }
.box-actions .btn { flex: 1; }
.copy-bar { margin: 0 18px 20px; height: 6px; background: var(--fill-2); border-radius: 3px; overflow: hidden; }
.copy-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); animation: fill .85s ease-in-out forwards; }
@keyframes fill { to { width: 100%; } }

.toast { position: absolute; z-index: 60; left: 50%; top: 92px; transform: translateX(-50%); width: max-content; max-width: 90%; padding: 8px 16px; background: rgb(28 28 30 / .78); color: #fff; border-radius: 20px; font-size: 14px; font-weight: 500; text-align: center; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.kb .toast { top: 30px; }

/* 결과 */
.result { padding: calc(env(safe-area-inset-top) + 8px) 8px calc(8px + env(safe-area-inset-bottom)); }
.browser { flex: 1; }
.address { flex: 1; min-width: 0; margin-right: 8px; padding: 7px 12px; background: var(--fill); border-radius: 12px; font-size: 13px; font-weight: 500; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 18px; overscroll-behavior: contain; }
.result-note { background: rgb(255 244 200 / .9); border-radius: 13px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; word-break: keep-all; }
.rank { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 4px 0; }
.rank h2 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.rank strong { font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--accent); white-space: nowrap; }
.rank-line { margin: 2px 4px 12px; font-size: 14px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; color: var(--ink-2); text-align: center; margin-bottom: 12px; }
.stats div { padding: 9px 2px; background: var(--card); border-radius: 14px; }
.stats b { display: block; font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.post { background: rgb(255 255 255 / .94); border-radius: 19px; overflow: hidden; box-shadow: 0 4px 18px rgb(6 18 48 / .1); }
.post-label { color: var(--accent); font-weight: 700; padding: 12px 14px 0; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post-label em { font-style: normal; background: var(--fill); color: var(--ink-2); padding: 2px 9px; border-radius: 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.post-title { font-size: 20px; font-weight: 700; letter-spacing: -.015em; padding: 8px 14px 4px; overflow-wrap: anywhere; word-break: keep-all; line-height: 1.32; }
.post-meta { padding: 0 14px 11px; color: var(--ink-3); font-size: 12px; border-bottom: .5px solid var(--hair); }
.post-body { padding: 12px 14px; line-height: 1.65; overflow-wrap: anywhere; min-height: 80px; }
.post-body p { min-height: 1.65em; white-space: pre-wrap; }
.post-body img { display: block; max-width: 100%; max-height: 460px; margin: 10px auto; border-radius: 12px; box-shadow: 0 2px 12px rgb(0 0 0 / .14); }
.post-empty { color: var(--ink-3); }
.post-sent { color: var(--ink-3); font-size: 12px; padding: 0 14px 12px; }
.post-warn { background: #f4f5f8; color: var(--ink-2); font-size: 12px; padding: 8px 14px; word-break: keep-all; }
.comments { margin-top: 14px; padding: 12px 14px; background: var(--card); border-radius: 17px; }
.comments h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.comments li { padding: 8px 0; font-size: 14px; line-height: 1.45; }
.comments li + li { border-top: .5px solid var(--hair); }
.comments b { display: block; color: var(--accent); font-size: 13px; font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.actions .btn { background: var(--card); }
.actions .btn.primary { background: var(--accent); }
.actions .full { grid-column: 1 / -1; }
.share-state { min-height: 18px; font-size: 13px; color: var(--ink-2); text-align: center; margin-top: 8px; overflow-wrap: anywhere; }

.shake { animation: shake .28s ease-in-out; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (max-height: 640px) {
  .hero h1 { font-size: 36px; }
  .hero p { margin-top: 6px; font-size: 14px; }
  .ref { max-height: 84px; }
  .to-row { display: none; }
}
@media (max-width: 359px) {
  .tool-bar { gap: 4px; padding-inline: 8px; }
  .tool { padding: 0 8px; font-size: 13px; }
  #saveBtn { display: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgb(246 248 252 / .94); }
  .balloon { background: rgb(250 251 254 / .97); }
  .dlg, .call, .box { background: rgb(246 248 252 / .97); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .copy-bar i { width: 100%; }
}
