/* peng.nestio.cloud — 빠타 대화방
   Copyright (c) 2026 Winner Brothers Group. Developer: Jason Lee (이정훈)
   색: 얼음빛 바탕 · 깊은 남색 글자 · 부리 노랑(빠타 표시와 보내기) */
:root {
  --bg: #edf2f7;
  --panel: #ffffff;
  --panel-2: #f6f9fc;
  --ink: #16233b;
  --ink-2: #4b5a77;
  --ink-3: #7b88a1;
  --line: #d5dde8;
  --beak: #f5b800;
  --beak-ink: #2b2000;
  --beak-soft: #fff4cc;
  --sea: #2763a8;
  --mine: #16233b;
  --mine-ink: #f3f6fb;
  --ok: #1d8f5a;
  --warn: #c47417;
  --danger: #c13f37;
  --shadow: 0 1px 2px rgba(22, 35, 59, .08), 0 4px 16px rgba(22, 35, 59, .06);
  --r-bubble: 16px;
  --r-ctl: 10px;
  --top-h: 96px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1626; --panel: #16223a; --panel-2: #1b2943; --ink: #e8eef7; --ink-2: #aab6cc; --ink-3: #7d8aa3;
    --line: #283753; --beak: #ffc61a; --beak-ink: #231a00; --beak-soft: #3a3118; --sea: #79aef0;
    --mine: #2a3f66; --mine-ink: #f3f6fb; --ok: #44c486; --warn: #f0a443; --danger: #ef6b62;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1626; --panel: #16223a; --panel-2: #1b2943; --ink: #e8eef7; --ink-2: #aab6cc; --ink-3: #7d8aa3;
  --line: #283753; --beak: #ffc61a; --beak-ink: #231a00; --beak-soft: #3a3118; --sea: #79aef0;
  --mine: #2a3f66; --mine-ink: #f3f6fb; --ok: #44c486; --warn: #f0a443; --danger: #ef6b62;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  word-break: keep-all; overflow-wrap: anywhere; overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--sea); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 빠타 표시: 남색 동그라미에 노란 부리 */
.mark { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; right: -3px; top: 9px; width: 9px; height: 6px; background: var(--beak); border-radius: 0 6px 6px 0; }

/* 시작 화면 */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); font-size: 14px; }
.boot-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); position: relative; animation: bob 1.2s ease-in-out infinite; }
.boot-mark::after { content: ""; position: absolute; right: -6px; top: 16px; width: 16px; height: 10px; background: var(--beak); border-radius: 0 10px 10px 0; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* 로그인 */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 24px 22px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.brand-lg { display: flex; align-items: center; gap: 12px; font-size: 30px; letter-spacing: -.8px; }
.brand-lg .mark { width: 34px; height: 34px; } .brand-lg .mark::after { top: 13px; width: 13px; height: 9px; right: -5px; }
.login-sub { margin: -6px 0 8px; color: var(--ink-2); }
.login-card label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.login-card input { height: 48px; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 14px; background: var(--panel-2); font-size: 16px; color: var(--ink); }
.form-err { min-height: 1.2em; margin: 0; color: var(--danger); font-size: 14px; }
.btn-primary { height: 50px; border-radius: var(--r-ctl); background: var(--ink); color: var(--panel); font-weight: 700; font-size: 16px; }
.btn-primary:disabled { opacity: .6; }
.fine { margin: 4px 0 0; text-align: center; color: var(--ink-3); font-size: 12px; }

/* 앱 뼈대 */
.app { height: 100dvh; display: flex; flex-direction: column; max-width: 1040px; margin: 0 auto; background: var(--bg); }
@media (min-width: 1041px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.top { flex: none; background: var(--panel); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); position: relative; z-index: 5; }
.top-row { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 8px 0 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; letter-spacing: -.5px; }
.sp { flex: 1; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.presence { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); max-width: 46vw; }
.presence span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.presence.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.presence.auto i { background: var(--warn); }
.tabs { display: flex; padding: 0 8px; }
.tabs button { position: relative; flex: 1; height: 42px; font-size: 15px; color: var(--ink-3); font-weight: 600; max-width: 160px; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--beak); }
.tabs em { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--beak); color: var(--beak-ink); font-size: 11px; font-weight: 800; vertical-align: 1px; }
.net-banner { flex: none; background: var(--warn); color: #fff; font-size: 13px; text-align: center; padding: 6px 12px; }

.views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }

/* 대화 */
.chat { display: flex; flex-direction: column; }
.scroller { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 6px; -webkit-overflow-scrolling: touch; }
.sentinel { height: 1px; }
.older-state { text-align: center; color: var(--ink-3); font-size: 13px; min-height: 8px; padding: 4px 0; }
.msg-list { display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; flex-direction: column; }
.msg.mine .who { display: none; }
.day { align-self: center; margin: 16px 0 8px; font-size: 12px; color: var(--ink-3); background: var(--panel); border: 1px solid var(--line); padding: 2px 12px; border-radius: 12px; }

.msg { display: flex; gap: 8px; max-width: 100%; margin-top: 10px; }
.msg.cont { margin-top: 2px; }
.msg .ava { width: 32px; flex: none; }
.msg .ava .mark { width: 30px; height: 30px; margin-top: 2px; } .msg .ava .mark::after { top: 12px; width: 11px; height: 8px; right: -4px; }
.msg .ava .person { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.msg.cont .ava > * { visibility: hidden; height: 0; }
.msg .col { min-width: 0; max-width: min(720px, calc(100% - 44px)); display: flex; flex-direction: column; align-items: flex-start; }
.msg .who { font-size: 13px; color: var(--ink-2); margin: 0 0 3px 2px; display: flex; gap: 6px; align-items: baseline; }
.msg .who b { color: var(--ink); font-weight: 700; }
.msg.cont .who { display: none; }
.bubble { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 4px var(--r-bubble) var(--r-bubble) var(--r-bubble); padding: 9px 13px; box-shadow: var(--shadow); max-width: 100%; min-width: 0; }
.msg.cont .bubble { border-top-left-radius: var(--r-bubble); }
.msg.bbata .bubble { border-left: 3px solid var(--beak); }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .ava { display: none; }
.msg.mine .col { align-items: flex-end; max-width: min(720px, 88%); }
.msg.mine .bubble { background: var(--mine); color: var(--mine-ink); border-color: transparent; border-radius: var(--r-bubble) 4px var(--r-bubble) var(--r-bubble); }
.msg.mine.cont .bubble { border-top-right-radius: var(--r-bubble); }
.msg.mine .bubble a { color: #a9cdfa; }
.msg.mine .bubble code { background: rgba(255,255,255,.12); }
.meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--ink-3); margin: 3px 4px 0; }
.meta .auto-tag { color: var(--warn); }
.msg.pending .bubble { opacity: .65; }
.msg.failed .meta { color: var(--danger); }
.msg.deleted .bubble { background: transparent; box-shadow: none; color: var(--ink-3); font-size: 14px; border-style: dashed; }
.msg.flash .bubble { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--beak); } 100% { box-shadow: var(--shadow); } }
.msg.system { justify-content: center; margin: 12px 0 4px; }
.msg.system .sys { font-size: 13px; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; max-width: 92%; text-align: center; }
.msg.system .sys blockquote { margin: 4px 0 0; padding: 0; border: 0; color: var(--ink-3); }

.req-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; padding: 3px 10px 3px 8px; border-radius: 12px; background: var(--beak-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--beak) 50%, transparent); max-width: 100%; }
.req-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.st.open { color: var(--sea); border-color: color-mix(in srgb, var(--sea) 40%, transparent); }
.st.doing { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.st.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.st.cancel, .st.hold { color: var(--ink-3); }

/* 마크다운 본문 */
.md { font-size: 15.5px; line-height: 1.65; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .6em; white-space: pre-wrap; }
.md h1, .md h2, .md h3, .md h4 { margin: .9em 0 .35em; line-height: 1.35; letter-spacing: -.3px; }
.md h1 { font-size: 1.25em; } .md h2 { font-size: 1.14em; } .md h3, .md h4 { font-size: 1.04em; }
.md ul, .md ol { margin: .2em 0 .6em; padding-left: 1.35em; }
.md li { margin: .15em 0; }
.md blockquote { margin: .4em 0 .7em; padding: .1em 0 .1em .8em; border-left: 3px solid var(--line); color: var(--ink-2); }
.md code { font: .88em/1.5 "JetBrains Mono", D2Coding, Consolas, ui-monospace, monospace; background: var(--panel-2); border-radius: 5px; padding: .08em .35em; }
.md pre { position: relative; margin: .5em 0 .7em; background: #0f1a2c; color: #e6edf7; border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.md pre code { background: none; padding: 0; color: inherit; white-space: pre; }
.md pre .copy { position: absolute; top: 6px; right: 6px; font-size: 11.5px; color: #c9d4e6; background: rgba(255,255,255,.08); border-radius: 6px; padding: 2px 8px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
.md .tbl { overflow-x: auto; margin: .4em 0 .7em; }
.md table { border-collapse: collapse; font-size: 14px; min-width: 60%; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); font-weight: 700; }
.msg.mine .md th { background: rgba(255,255,255,.08); } .msg.mine .md th, .msg.mine .md td { border-color: rgba(255,255,255,.2); }
.md img { max-width: 100%; border-radius: 8px; }

/* 첨부 */
.files { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 100%; }
.msg.mine .files { align-items: flex-end; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; width: min(360px, 72vw); }
.imgs.one { grid-template-columns: 1fr; width: min(320px, 72vw); }
.imgs button { display: block; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); aspect-ratio: 1; }
.imgs.one button { aspect-ratio: auto; max-height: 420px; }
.imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgs.one img { height: auto; max-height: 420px; object-fit: contain; }
.fchip { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink); max-width: min(360px, 78vw); box-shadow: var(--shadow); }
.fchip .ext { flex: none; width: 36px; height: 40px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: var(--ink-2); text-transform: lowercase; }
.fchip .fn { min-width: 0; display: grid; }
.fchip .fn b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchip .fn small { color: var(--ink-3); font-size: 12px; }
.files video, .files audio { max-width: min(360px, 78vw); border-radius: 10px; }

.typing { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13.5px; padding: 10px 4px 4px 42px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--beak); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.jump-new { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--composer-h, 120px) + 10px); background: var(--ink); color: var(--panel); border-radius: 18px; padding: 7px 16px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); z-index: 3; }

/* 입력창 */
.composer { flex: none; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 8px calc(6px + env(safe-area-inset-bottom)); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.input-wrap { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 22px; padding: 0 14px; }
.input-wrap:focus-within { border-color: var(--ink-3); }
#input { display: block; width: 100%; border: 0; outline: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.5; padding: 9px 0; max-height: 40vh; min-height: 42px; }
.send { width: 42px; height: 42px; border-radius: 50%; background: var(--beak); color: var(--beak-ink); display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; stroke-width: 2; fill: var(--beak-ink); }
.send:disabled { opacity: .45; }
#btnMic.rec { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
#btnMic.busy { opacity: .5; pointer-events: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 25%, transparent); } }
.composer-opts { display: flex; align-items: center; gap: 12px; padding: 6px 6px 0 52px; min-height: 28px; }
.req-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.req-toggle input { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; }
.req-toggle:has(input:checked) { color: var(--ink); font-weight: 700; }
.hint { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.attach-list { display: flex; gap: 6px; overflow-x: auto; padding: 2px 4px 8px; }
.att { position: relative; flex: none; display: flex; align-items: center; gap: 6px; max-width: 220px; height: 44px; padding: 0 30px 0 6px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.att img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.att span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--line); font-size: 13px; line-height: 22px; text-align: center; }
.upload-bar { position: relative; height: 22px; border-radius: 11px; background: var(--panel-2); overflow: hidden; margin: 0 4px 8px; font-size: 12px; }
.upload-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--beak); transition: width .2s; }
.upload-bar span { position: relative; display: block; text-align: center; line-height: 22px; color: var(--ink); font-weight: 600; }
.drop-zone { position: absolute; inset: 10px; border: 3px dashed var(--beak); border-radius: 18px; background: color-mix(in srgb, var(--panel) 85%, transparent); display: grid; place-items: center; font-size: 18px; font-weight: 700; z-index: 10; pointer-events: none; }

/* 작업 · 자료 목록 */
.list-view { overflow-y: auto; padding: 0 0 calc(24px + env(safe-area-inset-bottom)); }
.filter-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; overflow-x: auto; padding: 12px 12px 10px; background: var(--bg); scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar button { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; color: var(--ink-2); }
.filter-bar button.on { background: var(--ink); border-color: var(--ink); color: var(--panel); font-weight: 700; }
.filter-bar b { font-weight: 800; margin-left: 5px; }
.filter-bar b:empty { display: none; }
.cards { display: grid; gap: 8px; padding: 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow); text-align: left; width: 100%; display: grid; gap: 6px; }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.card-top .num { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 700; letter-spacing: -.2px; }
.card .res { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.empty { text-align: center; color: var(--ink-3); padding: 48px 20px; font-size: 14.5px; line-height: 1.7; }
.empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

.file-search { padding: 0 12px 8px; }
.file-search input { width: 100%; height: 42px; border-radius: 21px; border: 1px solid var(--line); background: var(--panel); padding: 0 16px; font-size: 15px; }
.file-summary { padding: 0 16px 8px; font-size: 12.5px; color: var(--ink-3); }
.file-list { display: grid; gap: 1px; margin: 0 12px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.file-list:empty { display: none; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); min-width: 0; }
.frow .thumb { width: 44px; height: 44px; border-radius: 8px; flex: none; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; font-size: 10.5px; font-weight: 800; color: var(--ink-2); }
.frow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.frow .fi { flex: 1; min-width: 0; display: grid; gap: 1px; }
.frow .fi b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .fi small { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .out-tag { color: var(--warn); font-weight: 700; }
.frow .acts { display: flex; gap: 2px; flex: none; }
.frow .acts a, .frow .acts button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.frow .acts svg { width: 19px; height: 19px; }

/* 시트 */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(10, 18, 32, .45); }
.sheet-card { position: relative; width: min(640px, 100%); max-height: 88dvh; display: flex; flex-direction: column; background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); padding-bottom: env(safe-area-inset-bottom); animation: up .2s ease-out; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 18px; } }
@keyframes up { from { transform: translateY(24px); opacity: .4; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 18px; border-bottom: 1px solid var(--line); }
.sheet-head b { flex: 1; font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 14px 18px 20px; }
.sheet-body .field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.sheet-body input[type=password], .sheet-body input[type=search], .sheet-body textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; background: var(--panel-2); font-size: 16px; }
.btn { height: 42px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; font-size: 14.5px; }
.btn.dark { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 12px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.logs { list-style: none; padding: 0; margin: 10px 0; border-left: 2px solid var(--line); }
.logs li { position: relative; padding: 0 0 10px 14px; font-size: 13.5px; }
.logs li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--ink-3); }
.logs small { color: var(--ink-3); }
.sec-title { font-size: 13px; color: var(--ink-3); margin: 16px 0 6px; font-weight: 600; }
.search-results .sr { display: block; width: 100%; text-align: left; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.search-results .sr small { color: var(--ink-3); font-size: 12px; }
.search-results .sr p { margin: 2px 0 0; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: var(--beak-soft); color: inherit; }
.menu-list { display: grid; gap: 2px; }
.menu-list button { text-align: left; padding: 12px 6px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.about { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

/* 메시지 메뉴 */
.ctx { position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; min-width: 180px; }
.ctx button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; }
.ctx button:hover { background: var(--panel-2); }
.ctx button.danger { color: var(--danger); }

/* 사진 보기 */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(5, 10, 20, .94); display: grid; grid-template-rows: 1fr auto; }
.viewer img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; align-self: center; justify-self: center; min-height: 0; }
.viewer-bar { display: flex; gap: 14px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); color: #dfe6f1; font-size: 14px; }
.viewer-bar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar a, .viewer-bar button { color: #fff; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 9px 16px; border-radius: 20px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }

@media (min-width: 760px) {
  .scroller { padding: 10px 24px 8px; }
  .cards { padding: 0 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .filter-bar { padding: 14px 24px 12px; }
  .file-list, .file-search { margin-left: 24px; margin-right: 24px; } .file-search { padding: 0 0 8px; }
  .file-summary { padding: 0 28px 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
