/* Hermes Inbox — workbench layout modelled on VS Code / Zed: title bar, activity bar, side bar,
   editor, auxiliary (Hermes) bar, status bar. Dense by default: no outer margins, no card gutters. */
[hidden] { display: none !important; }
:root {
  --bg: #ffffff; --bg2: #f6f7f9; --bg3: #eceef2; --fg: #1f2329; --mut: #6b7280; --line: #e3e5e9;
  --acc: #4f46e5; --acc-bg: #eef0ff; --ok: #15803d; --no: #b91c1c; --warn: #b45309; --sel: #e4e7fb;
  --lw: 300px; --rw: 380px; --tb: 36px; --sb: 24px; --ab: 46px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1d22; --bg2: #202329; --bg3: #2a2e36; --fg: #e5e7eb; --mut: #9aa3b2; --line: #30343c;
    --acc: #8b83f7; --acc-bg: #2b2a4a; --ok: #4ade80; --no: #f87171; --warn: #fbbf24; --sel: #33355a;
    color-scheme: dark;
  }
}

/* Manual theme override — data-theme on <html> wins over OS preference */
[data-theme="dark"] {
  --bg: #1b1d22; --bg2: #202329; --bg3: #2a2e36; --fg: #e5e7eb; --mut: #9aa3b2; --line: #30343c;
  --acc: #8b83f7; --acc-bg: #2b2a4a; --ok: #4ade80; --no: #f87171; --warn: #fbbf24; --sel: #33355a;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ffffff; --bg2: #f6f7f9; --bg3: #eceef2; --fg: #1f2329; --mut: #6b7280; --line: #e3e5e9;
  --acc: #4f46e5; --acc-bg: #eef0ff; --ok: #15803d; --no: #b91c1c; --warn: #b45309; --sel: #e4e7fb;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
@font-face { font-family: "Pretendard"; src: url(/static/vendor/PretendardVariable.woff2) format("woff2-variations"), url(/static/vendor/PretendardVariable.woff2) format("woff2");
  font-weight: 45 920; font-style: normal; font-display: swap; }
:root { --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "D2Coding", Menlo, Consolas, monospace; }
body { background: var(--bg); color: var(--fg); font: 14px/1.6 var(--font); letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 6px; padding: 6px 12px; background: var(--acc); color: #fff; font-weight: 600; }
button.ghost, .icon { background: transparent; color: var(--fg); font-weight: 400; }
button.ok { background: var(--ok); } button.no { background: var(--no); } button.sec { background: var(--bg3); color: var(--fg); }
input[type=text], input[type=password], input[type=search], textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: -1px; }
textarea { min-height: 64px; resize: vertical; }
code { font-size: 12px; background: var(--bg3); padding: 0 4px; border-radius: 4px; }
.mut { color: var(--mut); } .err { color: var(--no); }
.chip { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--bg3); font-size: 11px; line-height: 18px; white-space: nowrap; }
.s-결재, .s-완료 { color: var(--ok); } .s-반려 { color: var(--no); } .s-대기 { color: var(--warn); }

/* ── workbench grid ─────────────────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-rows: var(--tb) minmax(0, 1fr) var(--sb); height: 100vh; overflow: hidden; }
.titlebar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 8px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; white-space: nowrap; color: var(--fg); }
.tb-search { justify-self: center; width: min(560px, 100%); }
.tb-search input { padding: 3px 10px; background: var(--bg); text-align: center; }
.tb-right { display: flex; gap: 2px; align-items: center; }
.icon { width: 28px; height: 28px; padding: 0; border-radius: 6px; display: inline-grid; place-items: center; font-size: 15px; color: var(--mut); }
.icon:hover { background: var(--bg3); color: var(--fg); } .icon.on { color: var(--fg); background: var(--bg3); }
.workbench { display: grid; grid-template-columns: var(--ab) var(--lw) 4px minmax(0, 1fr) 4px var(--rw); min-height: 0; }
.activity { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; background: var(--bg2); border-right: 1px solid var(--line); }
.activity .icon { width: 36px; height: 36px; position: relative; } .activity .sv { width: 22px; height: 22px; }
.activity .icon.on::before { content: ""; position: absolute; left: -5px; top: 6px; bottom: 6px; width: 2px; background: var(--acc); border-radius: 2px; }
.activity .badge { position: absolute; right: 1px; bottom: 1px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--acc); color: #fff; font-size: 10px; line-height: 15px; text-align: center; padding: 0 3px; }
.activity .spacer { flex: 1; }
.sidebar, .aux { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg2); }
.sidebar { border-right: 1px solid var(--line); } .aux { border-left: 1px solid var(--line); }
.sash { cursor: col-resize; position: relative; z-index: 3; margin: 0 -2px; }
.sash:hover, .dragging .sash.active { background: var(--acc); opacity: .5; }
.dragging, .dragging * { user-select: none; cursor: col-resize !important; } .dragging iframe { pointer-events: none; }
.pane-head { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); flex: none; }
.pane-head .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-head .icon { width: 24px; height: 24px; font-size: 13px; }
.pane-body { flex: 1; overflow: auto; min-height: 0; }
.view { display: none; flex-direction: column; min-height: 0; flex: 1; }
html.v-inbox .view-inbox, html.v-explorer .view-explorer, html.v-library .view-library, html.v-search .view-search, html.v-recent .view-recent { display: flex; }

/* states: hide / maximize */
/* Every state keeps the same six tracks as plain lengths (only the editor is 1fr), so the browser can
   animate grid-template-columns between them; hidden panes shrink to 0px and fade instead of vanishing. */
html.sb-off .workbench { grid-template-columns: var(--ab) 0px 0px minmax(0, 1fr) 4px var(--rw); }
html.aux-off .workbench { grid-template-columns: var(--ab) var(--lw) 4px minmax(0, 1fr) 0px 0px; }
html.sb-off.aux-off .workbench, html.max-editor .workbench { grid-template-columns: var(--ab) 0px 0px minmax(0, 1fr) 0px 0px; }
html.max-aux .workbench { grid-template-columns: var(--ab) 0px 0px minmax(0, 1fr) 0px calc(100vw - var(--ab)); }
.workbench { transition: grid-template-columns .26s cubic-bezier(.2, .8, .2, 1); }
.sidebar, .aux, .editor, .sash { overflow: hidden; transition: opacity .2s ease, visibility 0s linear 0s; }
html.sb-off .sidebar, html.sb-off .sash-l, html.aux-off .aux, html.aux-off .sash-r,
html.max-editor .sidebar, html.max-editor .sash, html.max-editor .aux,
html.max-aux .sidebar, html.max-aux .sash, html.max-aux .editor {
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s ease, visibility 0s linear .26s; }
body.dragging .workbench, html.no-anim .workbench, html.no-anim .sidebar, html.no-anim .aux, html.no-anim .editor { transition: none !important; }
.sidebar .view, .aux .apane { min-width: 220px; }

/* ── side bar lists ─────────────────────────────────────────────────────────────────────────── */
.sec-head { display: flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--fg); cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--bg2); z-index: 1; }
.sec-head .n { margin-left: auto; } .sec-head::before { content: "▾"; width: 12px; color: var(--mut); }
details.sec:not([open]) > .sec-head::before { content: "▸"; }
details.sec > summary { list-style: none; } details.sec > summary::-webkit-details-marker { display: none; }
.items { list-style: none; margin: 0 0 6px; padding: 0; }
.items a { display: block; padding: 3px 12px 3px 20px; color: var(--fg); text-decoration: none; border-left: 2px solid transparent; }
.items a:hover { background: var(--bg3); } .items a.on { background: var(--sel); border-left-color: var(--acc); }
.items .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items .s { display: flex; gap: 6px; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; }
.empty { padding: 4px 20px; color: var(--mut); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree .row { display: flex; align-items: center; gap: 4px; height: 22px; padding-right: 8px; white-space: nowrap; color: var(--fg); cursor: pointer; text-decoration: none; }
.tree .row:hover { background: var(--bg3); text-decoration: none; } .tree .row.on { background: var(--sel); }
.tree .tw { width: 14px; flex: none; color: var(--mut); text-align: center; font-size: 10px; }
.tree .nm { overflow: hidden; text-overflow: ellipsis; }
.filter { padding: 4px 8px 6px; flex: none; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 8px 6px; } .chips a.on { background: var(--acc); color: #fff; }

/* ── editor ─────────────────────────────────────────────────────────────────────────────────── */
.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.tabs { display: flex; align-items: stretch; height: 35px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--bg); border-right: 1px solid var(--line); border-top: 2px solid var(--acc); max-width: 60%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.tab-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.tab-actions a, .tab-actions button { font-size: 12px; padding: 3px 9px; border-radius: 5px; background: var(--bg3); color: var(--fg); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tab-actions a.primary, .tab-actions button.primary { background: var(--acc); color: #fff; }
.crumbs { display: flex; align-items: center; gap: 4px; padding: 3px 14px; font-size: 12px; color: var(--mut); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; flex: none; }
.crumbs a { color: var(--mut); } .crumbs a:hover { color: var(--fg); } .crumbs .sep { opacity: .6; } .crumbs .meta { margin-left: auto; }
.editor-body { flex: 1; overflow: auto; min-height: 0; }
.editor-body.fill { overflow: hidden; display: flex; flex-direction: column; }
.editor-body.fill iframe { flex: 1; width: 100%; border: 0; min-height: 0; }
.doc { padding: 16px 28px 48px; width: 100%; }
.doc h1 { font-size: 22px; margin: 4px 0 12px; } .doc h2 { font-size: 17px; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); } .doc h3 { font-size: 14px; margin: 16px 0 6px; }
.doc table { border-collapse: collapse; margin: 8px 0; } .doc th, .doc td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg2); } .doc blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--acc); background: var(--bg2); }
.doc pre { white-space: pre-wrap; background: var(--bg2); padding: 10px; border-radius: 6px; }
.doc img { max-width: 100%; }
.fm { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 28px; font-size: 12px; color: var(--mut); border-bottom: 1px solid var(--line); background: var(--bg2); }
.fm b { color: var(--fg); font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 100%; }
.split > .main { min-width: 0; }
.panel { border-left: 1px solid var(--line); background: var(--bg2); padding: 12px 14px; position: sticky; top: 0; align-self: start; max-height: 100%; overflow: auto; }
.panel h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; color: var(--mut); letter-spacing: .05em; } .panel h4:first-child { margin-top: 0; }
.panel .row2 { display: flex; gap: 6px; } .panel .row2 > * { flex: 1; }
.panel ul { list-style: none; padding: 0; margin: 0; } .panel li { padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; } .kv dt { color: var(--mut); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.flash { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: var(--acc-bg); }
.flash.err { background: color-mix(in srgb, var(--no) 14%, var(--bg)); color: var(--fg); }
.form { padding: 12px 28px 40px; }
.form h2 { font-size: 15px; margin: 18px 0 6px; } .form h3 { font-size: 13px; margin: 16px 0 4px; font-weight: 600; }
.field { margin: 6px 0 10px; } .field > label, .field > .lbl { display: block; font-size: 12px; color: var(--mut); margin-bottom: 3px; }
.opt { display: inline-flex; gap: 6px; align-items: center; margin: 2px 16px 2px 0; }
.note { font-size: 12px; color: var(--mut); margin: 4px 0; }
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th { white-space: nowrap; position: sticky; top: 0; background: var(--bg2); font-size: 11px; text-transform: uppercase; color: var(--mut); text-align: left; padding: 5px 14px; border-bottom: 1px solid var(--line); z-index: 1; }
.grid-table td { padding: 4px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid-table td.name { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.grid-table tr:hover td { background: var(--bg2); }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 100%; }
.dash section { overflow: auto; }
.dash section { border-right: 1px solid var(--line); min-width: 0; } .dash h3 { margin: 0; padding: 8px 14px; font-size: 12px; text-transform: uppercase; color: var(--mut); border-bottom: 1px solid var(--line); background: var(--bg2); }
.dash .items a { padding: 6px 14px; border-bottom: 1px solid var(--line); }

/* ── Hermes (auxiliary bar) ─────────────────────────────────────────────────────────────────── */
.ctx { padding: 0 12px 6px; font-size: 12px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
#chat-log { flex: 1; overflow-y: auto; padding: 4px 12px 8px; min-height: 0; }
.cm { margin: 8px 0; overflow-wrap: anywhere; }
.cm-user { margin-left: 15%; padding: 6px 10px; border-radius: 10px; background: var(--acc); color: #fff; white-space: pre-wrap; }
.cm-assistant { padding: 2px 0; } .cm-assistant .cm-body > :first-child { margin-top: 0; } .cm-body p { margin: .35em 0; } .cm-body pre { white-space: pre-wrap; background: var(--bg3); padding: 8px; border-radius: 6px; }
.cm-tools .chip { margin: 0 4px 4px 0; }
#chat-form { padding: 8px 12px 10px; border-top: 1px solid var(--line); flex: none; }
#chat-form textarea { min-height: 56px; max-height: 40vh; }
.chat-hint { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11px; color: var(--mut); }
.chat-empty { color: var(--mut); padding: 8px 0; }

/* ── status bar ─────────────────────────────────────────────────────────────────────────────── */
.statusbar { display: flex; align-items: center; gap: 14px; padding: 0 10px; background: var(--acc); color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; }
.statusbar a { color: #fff; } .statusbar .r { margin-left: auto; opacity: .85; }

/* ── xlsx table viewer ──────────────────────────────────────────────────────────────────────── */
.xl-wrap { overflow: auto; } table.xl { border-collapse: collapse; table-layout: fixed; font-size: 12px; width: max-content; }
table.xl td, table.xl th { border: 1px solid var(--line); padding: 2px 6px; vertical-align: top; overflow: hidden; }
table.xl thead th { position: sticky; top: 0; background: var(--bg2); z-index: 1; text-align: center; font-weight: 500; color: var(--mut); }
table.xl tbody th { position: sticky; left: 0; background: var(--bg2); color: var(--mut); font-weight: 400; text-align: right; }
.xl-dd { color: var(--acc); font-size: 10px; } .xl-tabs { padding: 6px 14px; } .card { padding: 8px 14px; }
.card h2 { font-size: 14px; margin: 6px 0; }

/* ── standalone pages (login, anonymous link) ───────────────────────────────────────────────── */
.solo { display: grid; grid-template-rows: var(--tb) minmax(0, 1fr) var(--sb); height: 100vh; }
.solo .titlebar { grid-template-columns: auto 1fr auto; }
.center-card { max-width: 380px; margin: 12vh auto; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
.center-card h1 { font-size: 18px; margin: 0 0 12px; }

/* ── narrow screens: side and Hermes become overlays ───────────────────────────────────────── */
@media (max-width: 900px) {
  .workbench, html.sb-off .workbench, html.aux-off .workbench, html.sb-off.aux-off .workbench { grid-template-columns: var(--ab) 0 0 minmax(0, 1fr) 0 0; }
  .sidebar, .aux, .sash { display: none; }
  html.m-sb .sidebar { display: flex; position: fixed; top: var(--tb); bottom: var(--sb); left: var(--ab); width: min(86vw, 360px); z-index: 20; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
  html.m-aux .aux { display: flex; position: fixed; top: var(--tb); bottom: var(--sb); right: 0; width: min(94vw, 460px); z-index: 20; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
  .split { grid-template-columns: minmax(0, 1fr); } .panel { position: static; border-left: 0; border-top: 1px solid var(--line); }
  .doc, .form { padding-left: 14px; padding-right: 14px; } .tb-search { display: none; }
}

.sv { display: block; } .i-min { display: none; }
html.max-editor [data-cmd="max-editor"] .i-max, html.max-aux [data-cmd="max-aux"] .i-max { display: none; }
html.max-editor [data-cmd="max-editor"] .i-min, html.max-aux [data-cmd="max-aux"] .i-min { display: block; }
@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr); height: auto; } }
/* fixed grid slots: hidden panes must not let the others slide into their columns */
.workbench > .activity { grid-column: 1; grid-row: 1; } .workbench > .sidebar { grid-column: 2; grid-row: 1; }
.workbench > .sash-l { grid-column: 3; grid-row: 1; } .workbench > .editor { grid-column: 4; grid-row: 1; }
.workbench > .sash-r { grid-column: 5; grid-row: 1; } .workbench > .aux { grid-column: 6; grid-row: 1; }
.choice { display: flex; gap: 8px; align-items: flex-start; padding: 5px 8px; margin: 3px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: pointer; }
.choice:hover { border-color: var(--acc); } .choice input { margin-top: 3px; flex: none; } .choice span { min-width: 0; overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--acc); background: var(--acc-bg); }
.panel .lbl { font-size: 12px; color: var(--mut); margin-bottom: 2px; }
/* auxiliary bar tabs: Hermes · 채널 · 담당자 */
.aux-tabs { display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 6px; border-bottom: 1px solid var(--line); flex: none; }
.aux-tabs .spacer { flex: 1; }
.atab { background: transparent; color: var(--mut); font-weight: 600; font-size: 12px; padding: 6px 10px; border-radius: 0; border-bottom: 2px solid transparent; }
.atab:hover { color: var(--fg); }
html.at-hermes [data-atab="hermes"], html.at-channel [data-atab="channel"], html.at-dm [data-atab="dm"] { color: var(--fg); border-bottom-color: var(--acc); }
.apane { display: none; flex-direction: column; flex: 1; min-height: 0; }
html.at-hermes .apane-hermes, html.at-channel .apane-channel, html.at-dm .apane-dm { display: flex; }
html:not(.at-hermes) .only-hermes { display: none; }
.bz-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 12px; flex: none; }
.bz-head select { font: inherit; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--fg); max-width: 60%; }
.bz-all { display: flex; gap: 4px; align-items: center; margin-left: auto; color: var(--mut); } .bz-note { white-space: nowrap; }
.bz-log { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 0 8px; }
.bz-msg { padding: 5px 12px; } .bz-msg:hover { background: var(--bg3); }
.bz-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; } .bz-meta b { color: var(--fg); } .bz-msg.me .bz-meta b { color: var(--acc); }
.bz-meta .t { color: var(--mut); font-size: 11px; } .bz-meta .act { margin-left: auto; visibility: hidden; font-size: 11px; color: var(--acc); cursor: pointer; }
.bz-msg:hover .act { visibility: visible; }
.bz-body { overflow-wrap: anywhere; } .bz-body p { margin: .2em 0; } .bz-body pre { white-space: pre-wrap; background: var(--bg3); padding: 6px; border-radius: 6px; }
.bz-thread { border-bottom: 1px solid var(--line); padding: 2px 0 4px; }
.bz-replies { margin-left: 22px; border-left: 2px solid var(--line); }
.bz-more { margin: 0 12px 2px 34px; font-size: 12px; color: var(--acc); cursor: pointer; background: none; padding: 0; font-weight: 500; }
.bz-form { padding: 8px 12px 10px; border-top: 1px solid var(--line); flex: none; } .bz-form textarea { min-height: 52px; max-height: 35vh; }
.bz-reply { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mut); margin-bottom: 4px; } .bz-reply span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bz-ctx { display: flex; gap: 4px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 70%; }
.apane-dm .bz-msg.me { text-align: right; } .apane-dm .bz-msg.me .bz-meta { justify-content: flex-end; } .apane-dm .bz-msg.me .bz-meta .act { margin-left: 0; }
.tb-left { display: flex; align-items: center; gap: 2px; } .tb-left .brand { margin-right: 8px; } .icon:disabled { opacity: .35; cursor: default; background: transparent; }
.tbadge { margin-left: 4px; display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--no); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.bz-msg { position: relative; } .bz-msg.new { box-shadow: inset 3px 0 0 var(--acc); background: var(--acc-bg); }
.bz-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; } .bz-rx:empty { display: none; }
.bz-rx .rx { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; height: 22px; border-radius: 11px; background: var(--bg3); color: var(--fg); font-size: 12px; font-weight: 500; border: 1px solid transparent; }
.bz-rx .rx.me { border-color: var(--acc); background: var(--acc-bg); } .bz-rx img, .bz-bar img { width: 16px; height: 16px; }
.bz-bar { position: absolute; right: 8px; top: -12px; display: none; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 2; }
.bz-msg:hover .bz-bar { display: flex; } .bz-bar button { background: transparent; padding: 2px 4px; color: var(--fg); font-weight: 400; } .bz-bar button:hover { background: var(--bg3); }
.bz-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; } .bz-img { max-width: 220px; max-height: 160px; border-radius: 6px; border: 1px solid var(--line); }
.bz-file { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg2); }
.bz-form { position: relative; } .bz-mention { position: absolute; left: 12px; right: 12px; bottom: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15); max-height: 220px; overflow: auto; z-index: 5; }
.bz-mention .mi { padding: 5px 10px; cursor: pointer; } .bz-mention .mi.on, .bz-mention .mi:hover { background: var(--sel); }
.bz-filechip { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; } .bz-clip { width: 26px; height: 26px; }
/* Hermes (LibreChat-style) */
.lc-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex: none; }
.lc-sess { flex: 1; min-width: 0; text-align: left; background: var(--bg3); color: var(--fg); font-weight: 600; font-size: 12px; padding: 4px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lc-model { max-width: 46%; font: inherit; font-size: 12px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.lc-drawer { border-bottom: 1px solid var(--line); max-height: 45%; overflow: auto; flex: none; background: var(--bg); }
.lc-dhead { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 12px; position: sticky; top: 0; background: var(--bg); }
.lc-list { list-style: none; margin: 0; padding: 0 0 6px; } .lc-list li { display: flex; align-items: center; } .lc-list li.on { background: var(--sel); }
.lc-list a { flex: 1; min-width: 0; display: block; padding: 4px 12px; color: var(--fg); text-decoration: none; } .lc-list a:hover { background: var(--bg3); }
.lc-list .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lc-list .s { font-size: 11px; color: var(--mut); }
.lc-list .lc-del { visibility: hidden; } .lc-list li:hover .lc-del { visibility: visible; }
.cm-assistant { position: relative; } .cm-act { display: flex; gap: 6px; margin-top: 2px; visibility: hidden; } .cm-assistant:hover .cm-act { visibility: visible; }
.cm-act button { background: transparent; color: var(--mut); font-size: 11px; padding: 0 4px; font-weight: 500; } .cm-act button:hover { color: var(--fg); }
/* Buzz admin panels */
.bz-chsel { max-width: 45%; } .bz-rel { display: flex; gap: 4px; align-items: center; color: var(--mut); white-space: nowrap; margin-left: auto; }
.bz-quote { font-size: 11px; color: var(--mut); border-left: 2px solid var(--line); padding-left: 6px; margin: 1px 0 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bz-panel { border-bottom: 1px solid var(--line); padding: 8px 12px; background: var(--bg); max-height: 50%; overflow: auto; flex: none; font-size: 12px; }
.bz-ph { color: var(--mut); margin-bottom: 6px; } .bz-mlist { list-style: none; margin: 0 0 6px; padding: 0; }
.bz-mlist li { display: flex; align-items: center; gap: 6px; padding: 2px 0; } .bz-mlist .nm { flex: 1; } .bz-mlist .star { color: var(--warn); font-size: 14px; }
.bz-add { display: flex; gap: 6px; } .bz-add select { flex: 1; min-width: 0; font: inherit; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.bz-add button { padding: 3px 10px; }
/* project picker + notifications */
.proj { margin-left: 8px; font: inherit; font-weight: 600; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); max-width: 180px; }
.noti-wrap { position: relative; } #noti-btn { position: relative; }
.nbadge { position: absolute; right: -2px; top: -2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--no); color: #fff; font-size: 10px; line-height: 15px; text-align: center; }
.noti { position: absolute; right: 0; top: 32px; width: min(460px, 92vw); max-height: 70vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 50; }
.noti-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.noti-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; } .noti-chips .chip { color: var(--fg); text-decoration: none; cursor: pointer; } .noti-chips .chip.on { background: var(--acc); color: #fff; }
.noti-read { font-size: 12px; padding: 2px 6px; color: var(--acc); }
.noti-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.noti-list a { display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.noti-list a:hover { background: var(--bg2); } .noti-list a.new { background: var(--acc-bg); }
.noti-list .ni { width: 18px; text-align: center; flex: none; } .noti-list .nb { flex: 1; min-width: 0; }
.noti-list .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noti-list .s { display: block; font-size: 12px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noti-list .nt { font-size: 11px; color: var(--mut); flex: none; }
/* same-name files: format chips */
.fmts { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.fmt { display: inline-block; padding: 0 5px; margin-left: 3px; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; line-height: 15px; color: var(--mut); text-transform: uppercase; text-decoration: none; cursor: pointer; background: var(--bg); }
.fmt:hover { color: var(--acc); border-color: var(--acc); text-decoration: none; } .fmt.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.tab-actions .fmts a.fmt { padding: 0 6px; font-size: 11px; line-height: 18px; background: var(--bg); }
.tab-actions .fmts a.fmt.on { background: var(--acc); color: #fff; }

/* small motion for tab switches and overlays */
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slidein-l { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slidein-r { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
html.at-hermes .apane-hermes, html.at-channel .apane-channel, html.at-dm .apane-dm,
html.v-inbox .view-inbox, html.v-explorer .view-explorer, html.v-library .view-library, html.v-search .view-search, html.v-recent .view-recent { animation: fadein .18s ease; }
.noti:not([hidden]), .lc-drawer:not([hidden]), .bz-panel:not([hidden]) { animation: fadein .16s ease; }
@media (max-width: 900px) {
  html.m-sb .sidebar { animation: slidein-l .2s ease; visibility: visible; opacity: 1; }
  html.m-aux .aux { animation: slidein-r .2s ease; visibility: visible; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* answering status */
.bz-typing { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 12px; font-size: 12px; color: var(--mut); border-top: 1px solid var(--line); flex: none; }
.bz-typing .on { color: var(--acc); font-weight: 600; } .bz-typing .wait { color: var(--warn); }
.dots { display: inline-flex; gap: 2px; font-style: normal; vertical-align: middle; }
.dots b { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dot 1s infinite ease-in-out; }
.dots b:nth-child(2) { animation-delay: .15s; } .dots b:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.bz-thread.answering { box-shadow: inset 3px 0 0 var(--acc); }
.bz-thread.answering::after { content: "답변 작성 중…"; display: block; margin: 0 12px 4px 34px; font-size: 11px; color: var(--acc); }
/* terminal panel (bottom of the editor, VS Code style) */
:root { --th: 280px; }
.tpanel { flex: none; height: 0; display: flex; flex-direction: column; border-top: 0 solid var(--line); background: var(--bg); overflow: hidden;
  transition: height .26s cubic-bezier(.2, .8, .2, 1); position: relative; }
html.term-on .tpanel { height: var(--th); border-top-width: 1px; }
html.term-on.term-max .tpanel { height: 100%; }
html.term-on.term-max .editor > .tabs, html.term-on.term-max .editor > .crumbs, html.term-on.term-max .editor > .editor-body,
html.term-on.term-max .editor > .etabs, html.term-on.term-max .editor > .epane, html.term-on.term-max .editor > .egroups { display: none !important; }
body.dragging .tpanel, html.no-anim .tpanel { transition: none; }
.tsash { position: absolute; left: 0; right: 0; top: 0; height: 5px; cursor: row-resize; z-index: 3; } .tsash:hover { background: var(--acc); opacity: .5; }
.thead { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); flex: none; font-size: 12px; }
.ttitle { font-weight: 700; font-size: 11px; letter-spacing: .05em; color: var(--mut); text-transform: uppercase; }
.ttabs { display: flex; gap: 2px; overflow-x: auto; } .thead .spacer { flex: 1; }
.ttab { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 5px; cursor: pointer; color: var(--mut); white-space: nowrap; }
.ttab.on { background: var(--bg3); color: var(--fg); } .ttab .x { width: 18px; height: 18px; font-size: 11px; visibility: hidden; } .ttab:hover .x, .ttab.on .x { visibility: visible; }
.tbody { flex: 1; min-height: 0; position: relative; }
.tviews, .tview { position: absolute; inset: 0; } .tview { padding: 4px 0 0 8px; }
.tview .xterm { height: 100%; } .tview .xterm-viewport { background: transparent !important; }
.tlogin { max-width: 520px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.tlogin .row2 { display: flex; gap: 6px; } .tlogin input { flex: 1; } .tlogin .err { color: var(--no); min-height: 1em; }
/* settings */
.settings { padding: 16px 24px 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 14px; align-items: start; }
.settings > p { grid-column: 1 / -1; margin: 0 0 4px; }
.set { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.set > header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 14px; }
.set .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mut); flex: none; }
.set.ok .dot { background: var(--ok); } .set.warn .dot { background: var(--warn); } .set.err .dot { background: var(--no); } .set.loading .dot { animation: pulse 1s infinite; }
.set .st-sum { flex: 1; font-size: 12px; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.set.err .st-sum { color: var(--no); } .set.warn .st-sum { color: var(--warn); }
.set-body { padding: 8px 12px 12px; }
.set-rows { width: 100%; border-collapse: collapse; font-size: 12.5px; } .set-rows td { padding: 4px 6px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.set-rows .k { color: var(--mut); white-space: nowrap; width: 1%; } .set-rows .v { overflow-wrap: anywhere; } .set-rows .s { width: 1%; text-align: center; }
.set-rows tr.ok .s { color: var(--ok); } .set-rows tr.warn .s { color: var(--warn); } .set-rows tr.err .s { color: var(--no); } .set-rows tr.err .v { color: var(--no); }
.set-vars { display: grid; gap: 6px; margin-top: 8px; } .set-var { display: grid; grid-template-columns: 130px 1fr auto; gap: 6px; align-items: center; font-size: 12px; }
.set-var label { color: var(--mut); } .set-var input[readonly] { background: var(--bg2); color: var(--mut); }
.set-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .sa { display: inline-flex; gap: 4px; } .sa-in { width: 170px; }
.set-acts button { font-size: 12px; padding: 5px 10px; }
.set-out { margin: 8px 0 0; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; white-space: pre-wrap; max-height: 320px; overflow: auto; }
.tree-refresh.spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 자료실 view, file actions, context menu, text editor */
.tree .st-root > .row .st-off { margin-left: auto; font-size: 10px; color: var(--no); }
.tree .row { position: relative; }
.tree .row-acts { display: none; margin-left: auto; gap: 1px; flex: none; }
.tree .row:hover .row-acts, .tree .row:focus-within .row-acts { display: inline-flex; }
.tree .row-acts button { border: 0; background: none; padding: 0 3px; height: 18px; font-size: 12px; line-height: 18px; color: var(--mut); cursor: pointer; border-radius: 3px; }
.tree .row-acts button:hover { background: var(--bg2); color: var(--fg); }
.tree .rn { flex: 1; min-width: 60px; height: 19px; font: inherit; padding: 0 4px; border: 1px solid var(--acc); border-radius: 3px; background: var(--bg); color: var(--fg); outline: none; }
.pane-foot { flex: none; padding: 5px 12px; font-size: 11px; color: var(--mut); border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctxmenu { position: fixed; z-index: 1000; min-width: 160px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.ctxmenu button { text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 5px; font: inherit; font-size: 13px; color: var(--fg); cursor: pointer; }
.ctxmenu button:hover { background: var(--sel); }
.fedit { display: flex; flex: 1; min-height: 0; height: 100%; }
.fe-ta { flex: 1; width: 100%; border: 0; outline: none; resize: none; padding: 16px 24px; background: var(--bg); color: var(--fg);
  font: 14px/1.65 ui-monospace, "SF Mono", "D2Coding", Menlo, Consolas, monospace; tab-size: 4; }
.fe-state { font-size: 12px; margin-right: 6px; }

/* /system — BSM-CLIENT integrated */
.sys { display: flex; flex-direction: column; min-height: 100%; }
.sys-tabs { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 6px 16px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.sys-tabs button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 14px; color: var(--mut); border-bottom: 2px solid transparent; cursor: pointer; }
.sys-tabs button.on { color: var(--fg); border-bottom-color: var(--acc); font-weight: 600; }
.sys-tabs .cnt { margin-left: 6px; padding: 0 6px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; }
.sys-tabs .sp { flex: 1; } .sys-upd { font-size: 12px; }
.sys-pane { padding: 16px 20px 40px; font-size: 14px; }
.sys-pane h4 { margin: 18px 0 8px; font-size: 13px; }
.sys-head { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sys-head b { font-size: 17px; }
.sys-err { padding: 16px; border: 1px solid var(--no); border-radius: 10px; color: var(--no); }
.sys-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sys-bar select, .sys-bar button, .sv-acts button, .sv-acts a { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none; }
.sys-pane button.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.sys-pane button:disabled { opacity: .5; cursor: default; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; }
.g-grid.two { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.g-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); min-width: 0; }
.g-card h4 { margin: 0 0 6px; font-size: 12px; color: var(--mut); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-big { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; } .g-big small { font-size: 14px; color: var(--mut); margin-left: 2px; }
.g-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-bar { height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; margin: 6px 0 4px; flex: 1; min-width: 60px; }
.g-bar i { display: block; height: 100%; background: var(--ok); transition: width .4s ease; }
.g-bar.warn i { background: var(--warn); } .g-bar.err i { background: var(--no); }
.g-sub { font-size: 12px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; }
.g-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 4px 0; }
.g-name { width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-val { white-space: nowrap; color: var(--mut); } .g-val.warn { color: var(--warn); } .g-val.err { color: var(--no); font-weight: 600; }
.chart { width: 100%; height: 120px; display: block; } .chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-legend { display: flex; gap: 12px; font-size: 12px; margin-bottom: 4px; } .ch-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.sv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 16px; font-size: 13px; color: var(--fg); text-decoration: none; }
.sv-badge { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 11px; line-height: 18px; font-weight: 600; background: var(--bg3); color: var(--mut); }
.sv-badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.sv-badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.sv-badge.err { background: color-mix(in srgb, var(--no) 16%, transparent); color: var(--no); }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); } .err-t { color: var(--no); }
.svc { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.sv-title { font-size: 15px; } .sv-meta { font-size: 13px; margin-top: 3px; }
.sv-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.sv-boot { font-size: 12px; color: var(--mut); display: inline-flex; align-items: center; gap: 4px; }
.sv-log, .lg-out { grid-column: 1 / -1; margin: 6px 0 0; max-height: 420px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--bg2);
  font: 12px/1.5 ui-monospace, "SF Mono", "D2Coding", Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.lg-out { max-height: calc(100vh - 230px); min-height: 300px; }
.lg-WARN { color: var(--warn); } .lg-ERROR { color: var(--no); font-weight: 600; }
.sys-t { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.sys-t th, .sys-t td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sys-t th { color: var(--mut); font-weight: 600; font-size: 12px; } .sys-t.kv th { width: 160px; }
.sys-toast { position: fixed; right: 20px; bottom: 40px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .25s ease; }
.sys-toast.on { opacity: 1; transform: none; } .sys-toast.bad { background: var(--no); color: #fff; }
@media (max-width: 700px) { .svc { grid-template-columns: 1fr; } .sv-acts { justify-content: flex-start; } .g-grid.two { grid-template-columns: 1fr; } }
.sys-t td:not(.mut) { white-space: nowrap; } .g-card + .sys-bar { margin-top: 12px; }

/* drag & drop */
.dz-on { outline: 2px dashed var(--acc); outline-offset: -4px; background: color-mix(in srgb, var(--acc) 6%, transparent); }
.tree .row.dz-row { background: color-mix(in srgb, var(--acc) 22%, transparent); }
.dnd-toast { position: fixed; left: 50%; bottom: 36px; z-index: 1000; transform: translate(-50%, 8px); padding: 8px 14px; border-radius: 8px; background: var(--fg); color: var(--bg);
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.dnd-toast.on { opacity: 1; transform: translate(-50%, 0); } .dnd-toast.bad { background: var(--no); color: #fff; }

/* /storage */
.stg { padding: 16px 24px 48px; max-width: 1100px; font-size: 14px; }
.stg h3 { margin: 24px 0 10px; font-size: 15px; }
.stg-item { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.stg-ic { font-size: 22px; text-align: center; } .stg-main .mut { font-size: 12px; margin-top: 2px; word-break: break-all; }
.stg-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stg-acts a, .stg-acts button, .stg-fa button, .stg-type { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none; }
.stg button.primary { background: var(--acc); border-color: var(--acc); color: #fff; } .stg button:disabled { opacity: .5; }
.stg-out { grid-column: 1 / -1; margin: 6px 0 0; max-height: 300px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--bg2); font: 12px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.stg-types { display: flex; flex-wrap: wrap; gap: 8px; }
.stg-type { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.stg-type.on { border-color: var(--acc); background: var(--acc-bg); }
.stg-form { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; max-width: 640px; }
.stg-form h4 { margin: 0; } .stg-form p { margin: 0; font-size: 13px; }
.stg-form label { display: grid; gap: 4px; font-size: 13px; } .stg-form label.chk { display: flex; align-items: center; gap: 6px; }
.stg-form input:not([type=checkbox]), .stg-form textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.stg-form textarea { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.stg-fa { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .stg-msg { font-size: 13px; white-space: pre-wrap; }
@media (max-width: 700px) { .stg-item { grid-template-columns: 36px 1fr; } .stg-acts { grid-column: 1 / -1; justify-content: flex-start; } }
.stg-oauth { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
.stg-step { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.stg-step > b { width: 20px; height: 20px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 11px; display: inline-grid; place-items: center; flex: none; }
.stg-step .stg-cb { flex: 1; min-width: 260px; font: 12px ui-monospace, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.stg-manual { font-size: 13px; } .stg-manual summary { cursor: pointer; color: var(--mut); } .stg-manual ol { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; }
.stg code { font-size: 12px; background: var(--bg3); padding: 1px 5px; border-radius: 4px; word-break: break-all; }


/* typography unified with the Hermes chat (Pretendard · 15px/1.72 for reading, 13–14px for chrome) */
.items a { padding: 4px 12px 4px 20px; font-size: 13.5px; } .items .s { font-size: 12px; }
.tree .row { height: 26px; font-size: 13.5px; } .tree .tw { font-size: 11px; }
.pane-head { font-size: 11.5px; letter-spacing: .04em; }
.sec-head { font-size: 11.5px; padding: 4px 8px; }
.tab-actions a, .tab-actions button { font-size: 13px; padding: 4px 10px; }
.crumbs { font-size: 13px; padding: 5px 16px; }
.doc { font-size: 15px; line-height: 1.72; padding: 20px 32px 56px; }
.doc p, .doc li { margin: .45em 0; } .doc ul, .doc ol { padding-left: 1.4em; }
.doc h1 { font-size: 1.6em; line-height: 1.3; margin: .2em 0 .7em; } .doc h2 { font-size: 1.3em; line-height: 1.35; margin: 1.4em 0 .5em; }
.doc h3 { font-size: 1.12em; margin: 1.2em 0 .4em; } .doc h4 { font-size: 1em; margin: 1em 0 .3em; }
.doc table { font-size: .93em; } .doc th, .doc td { padding: 7px 11px; }
.doc code { font-family: var(--mono); font-size: .88em; } .doc pre { font-family: var(--mono); font-size: 13px; line-height: 1.55; padding: 12px 14px; border-radius: 10px; }
.doc blockquote { border-radius: 0 8px 8px 0; padding: 6px 14px; }
.fm { font-size: 13px; padding: 8px 32px; }
.kv { font-size: 13px; gap: 4px 12px; }
.panel h4 { font-size: 12px; } .field > label, .field > .lbl { font-size: 13px; } .note { font-size: 13px; }
.form h2 { font-size: 16px; } .form h3 { font-size: 14px; }
.grid-table { font-size: 14px; } .grid-table th { font-size: 12px; } .dash h3 { font-size: 12.5px; }
.chip { font-size: 12px; line-height: 20px; }
code { font-family: var(--mono); font-size: .9em; }
.set, .sys-pane, .stg { font-size: 14px; }

/* Buzz channel / DM: the same reading style as the Hermes chat */
.bz-log { padding: 6px 0 10px; }
.bz-msg { padding: 8px 14px; }
.bz-meta { font-size: 13px; gap: 8px; margin-bottom: 2px; } .bz-meta b { font-weight: 650; } .bz-meta .t { font-size: 12px; } .bz-meta .act { font-size: 12px; }
.bz-body { font-size: 15px; line-height: 1.68; color: var(--fg); }
.bz-body p { margin: .3em 0; } .bz-body ul, .bz-body ol { margin: .3em 0; padding-left: 1.3em; } .bz-body li { margin: .15em 0; }
.bz-body h1, .bz-body h2, .bz-body h3, .bz-body h4 { font-size: 1.05em; margin: .7em 0 .3em; line-height: 1.4; }
.bz-body a { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.bz-body code { font-family: var(--mono); font-size: .86em; background: var(--bg3); padding: .1em .35em; border-radius: 5px; }
.bz-body pre { font-family: var(--mono); font-size: 13px; line-height: 1.55; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); overflow-x: auto; white-space: pre-wrap; }
.bz-body pre code { background: transparent; padding: 0; }
.bz-body blockquote { margin: .4em 0; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--mut); }
.bz-body table { border-collapse: collapse; font-size: .92em; margin: .4em 0; display: block; overflow-x: auto; } .bz-body th, .bz-body td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.bz-body hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
.bz-quote { font-size: 12.5px; padding: 2px 8px; margin: 2px 0 4px; border-radius: 0 6px 6px 0; background: var(--bg2); }
.bz-thread { padding: 4px 0 6px; } .bz-replies { margin-left: 26px; }
.bz-more { font-size: 13px; margin-left: 40px; }
.bz-head { font-size: 13px; padding: 7px 12px; } .bz-panel { font-size: 13px; }
.bz-form textarea { font-size: 15px; line-height: 1.6; font-family: var(--font); }
.bz-typing { font-size: 12.5px; } .bz-reply { font-size: 13px; }

/* editor tabs (VS Code style): one strip, one pane per open document / tool page */
.etabs { display: flex; align-items: stretch; height: 38px; flex: none; background: var(--bg2); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.etabs::-webkit-scrollbar { height: 3px; } .etabs::-webkit-scrollbar-thumb { background: var(--line); }
.etab { display: flex; align-items: center; gap: 7px; padding: 0 6px 0 12px; min-width: 110px; max-width: 240px; flex: none; cursor: pointer; user-select: none;
  border-right: 1px solid var(--line); border-top: 2px solid transparent; color: var(--mut); font-size: 13.5px; position: relative; }
.etab:hover { background: var(--bg3); color: var(--fg); }
.etab.on { background: var(--bg); color: var(--fg); border-top-color: var(--acc); font-weight: 600; margin-bottom: -1px; }
.etab .ei { flex: none; font-size: 14px; } .etab .et { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etab .ex { flex: none; width: 22px; height: 22px; padding: 0; border-radius: 5px; background: transparent; color: var(--mut); font-size: 16px; line-height: 20px; font-weight: 400; visibility: hidden; }
.etab:hover .ex, .etab.on .ex { visibility: visible; } .etab .ex:hover { background: var(--bg3); color: var(--fg); }
.epane { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
.epane[hidden] { display: none !important; }
.epane > .tabs { display: contents; } .epane .tab { display: none; }
.epane .tab-actions { grid-column: 2; grid-row: 1; margin: 0; padding: 4px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.epane .tab-actions:empty { display: none; }
.epane > .crumbs { grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--line); }
.epane > .editor-body { grid-column: 1 / -1; grid-row: 2; }
.epane:not(:has(> .crumbs)) .tab-actions { grid-column: 1 / -1; justify-content: flex-end; }
.etab .ed { flex: none; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--mut); }

/* Buzz message footer: reactions + tools below the text, never over it */
.bz-foot { display: flex; align-items: center; gap: 8px; min-height: 24px; margin-top: 4px; }
.bz-foot .bz-rx { margin: 0; flex: 1; min-width: 0; } .bz-foot .bz-rx:empty { display: block; }
.bz-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; opacity: 0; transition: opacity .12s ease; }
.bz-msg:hover .bz-tools, .bz-msg:focus-within .bz-tools { opacity: 1; }
.bz-msg .bz-bar { position: static; display: flex; box-shadow: none; border: 0; padding: 0; background: transparent; gap: 1px; }
.bz-msg:hover .bz-bar { display: flex; }
.bz-bar button { width: 26px; height: 24px; padding: 0; border-radius: 6px; display: inline-grid; place-items: center; }
.bz-tools .act { visibility: visible; background: transparent; color: var(--acc); font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin: 0; }
.bz-tools .act:hover, .bz-bar button:hover { background: var(--bg3); }
@media (hover: none) { .bz-tools { opacity: 1; } }
html:fullscreen [data-cmd="fullscreen"] { color: var(--acc); background: var(--acc-bg); }

/* document paths and @mentions in Buzz / Hermes messages */
a.doclink { color: var(--acc); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; overflow-wrap: anywhere; }
.mention { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--acc-bg); color: var(--acc); font-weight: 650; line-height: 1.45; }
.mention.me { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }

/* exec-approval popup */
.apv { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgba(0,0,0,.35); animation: fadein .15s ease; }
.apv[hidden] { display: none !important; }
.apv-card { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--bg); color: var(--fg); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 2px solid var(--warn); padding: 18px 20px; display: grid; gap: 12px; font-size: 14px; }
.apv-head { display: flex; gap: 12px; align-items: flex-start; } .apv-ic { font-size: 26px; line-height: 1; } .apv-head b { font-size: 16px; }
.apv-head > div { flex: 1; } .apv-who { font-size: 13px; margin-top: 2px; }
.apv-left { font: 600 14px var(--mono); color: var(--warn); padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); white-space: nowrap; }
.apv-left.urgent { color: #fff; background: var(--no); animation: apvpulse 1s infinite; }
@keyframes apvpulse { 50% { opacity: .6; } }
.apv-cmd { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font: 13px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }
.apv-reason { font-size: 13px; line-height: 1.55; max-height: 90px; overflow: auto; }
.apv-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.apv-b { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); font-weight: 500; text-align: left; }
.apv-b img { width: 28px; height: 28px; flex: none; } .apv-b span { display: grid; line-height: 1.25; } .apv-b small { font-size: 11.5px; color: var(--mut); }
.apv-b:hover { border-color: var(--acc); background: var(--acc-bg); } .apv-deny:hover { border-color: var(--no); background: color-mix(in srgb, var(--no) 10%, transparent); }
.apv-b:disabled { opacity: .5; }
.apv-foot { display: flex; gap: 8px; align-items: center; } .apv-foot .apv-n { margin-right: auto; font-size: 13px; }
.apv-foot .ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); font-weight: 500; padding: 5px 12px; }
.apv-msg { font-size: 13px; color: var(--acc); min-height: 1em; } .apv-msg:empty { display: none; }
@media (max-width: 640px) { .apv-acts { grid-template-columns: 1fr 1fr; } }
.sys-tabs .sys-re { margin-left: 10px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 500; }
.sys-tabs .sys-re.spin { opacity: .6; } .sys-tabs .sys-re:hover { background: var(--bg3); }

/* Notion-like markdown editor (Milkdown Crepe) in the inbox look */
.fedit.fe-md { flex-direction: column; overflow: auto; }
.fe-md .crepe-host { flex: 1; min-height: 0; }
.fe-md .crepe-host .milkdown {
  --crepe-color-background: var(--bg); --crepe-color-on-background: var(--fg); --crepe-color-surface: var(--bg2); --crepe-color-surface-low: var(--bg3);
  --crepe-color-on-surface: var(--fg); --crepe-color-on-surface-variant: var(--mut); --crepe-color-outline: var(--line); --crepe-color-primary: var(--acc);
  --crepe-color-secondary: var(--acc-bg); --crepe-color-on-secondary: var(--fg); --crepe-color-inverse: var(--fg); --crepe-color-on-inverse: var(--bg);
  --crepe-color-inline-code: var(--no); --crepe-color-error: var(--no); --crepe-color-hover: var(--bg3); --crepe-color-selected: var(--sel);
  --crepe-color-inline-area: var(--bg3); --crepe-base-font-size: 15px;
  --crepe-font-title: var(--font); --crepe-font-default: var(--font); --crepe-font-code: var(--mono);
  background: var(--bg);
}
.fe-md .crepe-host .milkdown .ProseMirror { padding: 24px 72px 120px; line-height: 1.72; }
.fe-md .crepe-host .milkdown .ProseMirror h1 { font-size: 1.6em; } .fe-md .crepe-host .milkdown .ProseMirror h2 { font-size: 1.3em; }
.fe-md .crepe-host .milkdown .ProseMirror h3 { font-size: 1.12em; }
.fe-note { margin: 8px 16px 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.fe-fm { margin: 10px 16px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); font-size: 13px; }
.fe-fm summary { padding: 6px 12px; cursor: pointer; color: var(--mut); }
.fe-fm textarea { display: block; width: 100%; min-height: 120px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; background: var(--bg); font: 13px/1.6 var(--mono); padding: 10px 12px; resize: vertical; }
.fe-loading { padding: 24px 32px; }
@media (max-width: 900px) { .fe-md .crepe-host .milkdown .ProseMirror { padding: 16px 24px 80px; } }
.fe-md .crepe-host .milkdown .ProseMirror { max-width: none; }
.fe-md .crepe-host .milkdown .ProseMirror :is(h1, h2, h3, h4, h5, h6) { font-weight: 700; letter-spacing: -0.01em; }
.fe-md .crepe-host .milkdown .ProseMirror h2 { border-bottom: 1px solid var(--line); padding-bottom: 4px; }

/* terminal groups: split panes with draggable dividers */
.tviews { display: block; }
.tgroup { position: absolute; inset: 0; display: flex; flex-direction: row; }
.tgroup.col { flex-direction: column; } .tgroup[hidden] { display: none; }
.tcell { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid transparent; }
.tgroup > .tcell:only-child .tchead { display: none; }
.tcell.on { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.tchead { display: flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 10px; font-size: 12px; color: var(--mut); flex: none; border-bottom: 1px solid var(--line); }
.tchead .sp { flex: 1; } .tchead .icon { width: 22px; height: 22px; font-size: 12px; visibility: hidden; }
.tcell:hover .tchead .icon, .tcell.on .tchead .icon { visibility: visible; } .tcell.on .tchead { color: var(--fg); }
.tcell .tview { position: relative; inset: auto; flex: 1; min-height: 0; }
.tsplit { flex: none; width: 5px; cursor: col-resize; background: var(--line); background-clip: content-box; padding: 0 2px; }
.tgroup.col > .tsplit { width: auto; height: 5px; cursor: row-resize; padding: 2px 0; }
.tsplit:hover, body.dragging .tsplit:active { background-color: var(--acc); }

/* terminal panel on the right of the editor */
html.term-right .editor { display: grid; grid-template-columns: minmax(0, 1fr) 0px; grid-template-rows: auto minmax(0, 1fr); }
html.term-right.term-on .editor { grid-template-columns: minmax(0, 1fr) var(--tw, 560px); }
html.term-right .editor > .egroups { grid-column: 1; grid-row: 1 / span 2; }
html.term-right .tpanel { grid-column: 2; grid-row: 1 / span 2; height: auto !important; border-top-width: 0 !important; border-left: 1px solid var(--line); transition: none; }
html.term-right .tsash { top: 0; bottom: 0; left: 0; right: auto; width: 5px; height: auto; cursor: col-resize; }
html.term-right.term-on.term-max .editor { grid-template-columns: 0px minmax(0, 1fr); }
.etabs-close { flex: none; align-self: center; margin-right: 6px; padding: 3px 10px; border-radius: 6px;
  background: var(--bg2); color: var(--mut); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); box-shadow: -8px 0 8px var(--bg2); }
.etabs-close:hover { color: var(--fg); background: var(--bg3); } .etabs-close[hidden] { display: none; }

/* content width: full (default) or narrow (comfortable reading, centred) */
.etabs-width { flex: none; align-self: center; margin-right: 6px; padding: 3px 10px; border-radius: 6px;
  background: var(--bg2); color: var(--mut); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); box-shadow: -8px 0 8px var(--bg2); white-space: nowrap; }
.etabs-width:hover { color: var(--fg); background: var(--bg3); } .etabs-width.on { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); }
html.w-narrow { --read-w: 880px; }
html.w-narrow .editor-body .doc, html.w-narrow .editor-body .form { max-width: var(--read-w); margin-left: auto; margin-right: auto; }
html.w-narrow .editor-body .fm { padding-left: max(32px, calc((100% - var(--read-w)) / 2 + 32px)); padding-right: max(32px, calc((100% - var(--read-w)) / 2 + 32px)); }
html.w-narrow .fe-md .crepe-host .milkdown .ProseMirror { max-width: calc(var(--read-w) + 144px); margin: 0 auto; }
html.w-narrow .fe-fm, html.w-narrow .fe-note { max-width: var(--read-w); margin-left: auto; margin-right: auto; }
html.w-narrow .fedit:not(.fe-md) .fe-ta { padding-left: max(24px, calc((100% - var(--read-w)) / 2)); padding-right: max(24px, calc((100% - var(--read-w)) / 2)); }
.etabs-acts { position: sticky; right: 0; margin-left: auto; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 6px 0 10px;
  background: var(--bg2); box-shadow: -10px 0 10px var(--bg2); }
.etabs-acts > button { margin: 0; box-shadow: none; }
.tab-actions .w-toggle { background: var(--bg3); color: var(--fg); border: 0; } .tab-actions .w-toggle.on { color: var(--acc); background: var(--acc-bg); }

/* animate full ↔ narrow: every width is a length on both sides (100% ↔ 880px), so it can transition */
.editor-body .doc, .editor-body .form { max-width: 100%; margin-left: auto; margin-right: auto; transition: max-width .38s cubic-bezier(.2, .8, .2, 1); }
.editor-body .fm, .fedit:not(.fe-md) .fe-ta { transition: padding .38s cubic-bezier(.2, .8, .2, 1); }
.fe-md .crepe-host .milkdown .ProseMirror { max-width: 100%; margin: 0 auto; transition: max-width .38s cubic-bezier(.2, .8, .2, 1); }
.fe-fm, .fe-note { transition: max-width .38s cubic-bezier(.2, .8, .2, 1); }
html:not(.w-narrow) .fe-fm, html:not(.w-narrow) .fe-note { max-width: 100%; }
html.w-narrow .fe-fm, html.w-narrow .fe-note { margin-left: auto; margin-right: auto; }
html.no-anim .editor-body .doc, html.no-anim .editor-body .form, html.no-anim .editor-body .fm, html.no-anim .fe-ta, html.no-anim .ProseMirror { transition: none !important; }
.tab-actions .w-toggle { transition: background .2s ease, color .2s ease; }

/* content full screen (max-editor): only the document toolbar and the content; Esc returns */
.app { transition: grid-template-rows .26s cubic-bezier(.2, .8, .2, 1); }
html.max-editor .app { grid-template-rows: 0px minmax(0, 1fr) 0px; }
html.max-editor .titlebar, html.max-editor .statusbar, html.max-editor .activity { overflow: hidden; border: 0; }
html.max-editor .workbench { grid-template-columns: 0px 0px 0px minmax(0, 1fr) 0px 0px; }
html.max-editor .egroup > .etabs, html.max-editor .editor > .tpanel { display: none !important; }
html.max-editor.term-right .editor { grid-template-columns: minmax(0, 1fr) 0px; }
.tab-actions .max-toggle { background: var(--bg3); color: var(--fg); border: 0; transition: background .2s ease, color .2s ease; }
.tab-actions .max-toggle.on { background: var(--acc); color: #fff; }
/* the frontmatter box / notice keep the text width in narrow mode (a flex column with auto margins shrank them to their content) */
.fe-md .fe-fm, .fe-md .fe-note { box-sizing: border-box; width: calc(100% - 32px); align-self: center; }
html.w-narrow .fe-md .fe-fm, html.w-narrow .fe-md .fe-note { width: min(calc(100% - 32px), var(--read-w)); }
.inbox-refresh.spinning { animation: spin .8s linear infinite; }

/* Buzz: floating jump-to-bottom (new messages) */
.apane.bz { position: relative; }
.bz-jump { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 4; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18); animation: jumpin .2s ease; }
.bz-jump.fresh { background: var(--acc); color: #fff; border-color: var(--acc); }
.bz-jump[hidden] { display: none; }
@keyframes jumpin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

  border-bottom: 0; border-right: 1px solid var(--line); }
.bz-meta b.bz-who { cursor: pointer; border-radius: 4px; } .bz-meta b.bz-who:hover, .bz-meta b.bz-who:focus-visible { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; outline: none; }

/* Buzz panes: .bz-main holds the usual column; in focus mode a thread pane opens on the right (Buzz/Mattermost) */
.bz-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.bz-tpane { display: none; }
.bz-thead { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.bz-thead b { font-size: 15px; } .bz-tsub { flex: 1; min-width: 0; color: var(--mut); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bz-tlog { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; }
.bz-tsep { display: flex; align-items: center; gap: 10px; margin: 6px 16px; font-size: 12.5px; color: var(--mut); }
.bz-tsep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.bz-tform { flex: none; padding: 10px 14px 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.bz-tform textarea { font: 15px/1.6 var(--font); min-height: 64px; resize: vertical; }
.bz-tbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.bz-tsum { display: inline-flex; margin: 0 14px 6px 14px; padding: 3px 10px; border-radius: 6px; background: transparent; color: var(--acc); font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.bz-tsum:hover { background: var(--acc-bg); border-color: color-mix(in srgb, var(--acc) 30%, transparent); }
.bz-tsum.new { background: var(--acc-bg); }

/* ── focus mode (chat maximised): a messenger. Hermes = conversation list | chat; channel/DM = messages | thread.
   Column widths (--fcl, --ftw) are dragged with .fsash and kept as window fractions like the other panels. ── */
html.max-aux .app { grid-template-rows: 0px minmax(0, 1fr) 0px; }
html.max-aux .titlebar, html.max-aux .statusbar, html.max-aux .activity { overflow: hidden; border: 0; }
html.max-aux .workbench { grid-template-columns: 0px 0px 0px 0px 0px 100vw; }
html.max-aux .aux { border-left: 0; }
html.max-aux .aux-tabs { height: 42px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.fsash { display: none; }
html.max-aux .fsash { display: block; flex: none; width: 5px; cursor: col-resize; position: relative; z-index: 2; background: transparent; }
html.max-aux .fsash::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: var(--line); }
html.max-aux .fsash:hover::after, body.dragging .fsash.active::after { left: 1px; width: 3px; background: var(--acc); }
/* Hermes: list | chat */
html.max-aux.at-hermes .hc { display: grid; grid-template-columns: var(--fcl, 280px) 5px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
html.max-aux .hc > .hc-drawer, html.max-aux .hc > .hc-drawer[hidden] { display: flex !important; flex-direction: column; grid-column: 1; grid-row: 1 / span 3;
  max-height: none; height: 100%; border: 0; background: var(--bg2); overflow: hidden; }
html.max-aux .hc > .hc-drawer .hc-list { flex: 1; overflow-y: auto; }
html.max-aux .hc > .fsash { grid-column: 2; grid-row: 1 / span 3; }
html.max-aux .hc > .hc-head { grid-column: 3; grid-row: 1; justify-content: center; height: 48px; }
html.max-aux .hc > .hc-log { grid-column: 3; grid-row: 2; }
html.max-aux .hc > .hc-composer { grid-column: 3; grid-row: 3; width: 100%; max-width: 880px; margin: 0 auto; padding: 6px 20px 22px; }
html.max-aux .hc-dhead { position: static; flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 14px 10px; background: transparent; }
html.max-aux .hc-scope { display: flex; gap: 4px; } html.max-aux .hc-scope a { white-space: nowrap; flex: 1; text-align: center; }
html.max-aux .hc-list li { margin: 0 8px; border-radius: 8px; }
/* channel / DM: messages | thread */
html.max-aux .apane.bz { flex-direction: row; }
html.max-aux .bz-main .bz-head { padding: 0 20px; height: 48px; }
html.max-aux .bz-main .bz-msg { padding: 10px 24px; }
html.max-aux .bz-main .bz-tsum { margin-left: 24px; }
html.max-aux .bz-main .bz-form { padding: 10px 20px 18px; }
html.max-aux .bz-main .bz-typing { padding: 4px 24px; }
html.max-aux .bz-main .bz-panel { padding: 10px 20px; }
html.max-aux .apane.bz:not(.thread-open) > .fsash { display: none; }
html.max-aux .apane.bz.thread-open .bz-tpane { display: flex; flex-direction: column; flex: none; width: var(--ftw, 460px); min-width: 0; min-height: 0; background: var(--bg); }
html.max-aux .bz-thead { height: 48px; }
html.max-aux .bz-thread.flat { border-bottom: 0; padding: 0; }
html.max-aux .bz-thread.flat.sel > .bz-msg:first-child { background: var(--acc-bg); box-shadow: inset 3px 0 0 var(--acc); }
html.max-aux .bz-tlog .bz-msg { padding: 10px 18px; }
@media (max-width: 900px) {
  html.max-aux.at-hermes .hc { grid-template-columns: minmax(0, 1fr); }
  html.max-aux .hc > .hc-drawer, html.max-aux .hc > .fsash { display: none !important; } html.max-aux .hc > * { grid-column: 1 !important; }
  html.max-aux .apane.bz.thread-open .bz-main { display: none; } html.max-aux .apane.bz.thread-open .bz-tpane { width: 100%; }
}

/* document popup (chat focus mode) */
.docpop { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; background: rgba(0,0,0,.32); animation: fadein .15s ease; }
.docpop[hidden] { display: none !important; }
.docpop-card { width: min(1100px, calc(100vw - 48px)); height: calc(100vh - 64px); display: flex; flex-direction: column; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.3); overflow: hidden; }
.docpop-head { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line); background: var(--bg2); flex: none; }
.docpop-t { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docpop-tab { padding: 4px 12px; border-radius: 6px; background: var(--bg3); color: var(--fg); font-size: 13px; font-weight: 500; }
.docpop-body { flex: 1; min-height: 0; display: flex; }
.docpop-body .docpop-pane { flex: 1; min-height: 0; }
@media (max-width: 700px) { .docpop-card { width: 100vw; height: 100vh; border-radius: 0; } }

/* focus mode: channel / 담당자 list on the left of the channel and DM tabs */
.bz-nav, .bz-nav-sash { display: none; }
html.max-aux:is(.at-channel, .at-dm) .aux { display: grid; grid-template-columns: var(--fnv, 250px) 5px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
html.max-aux:is(.at-channel, .at-dm) .aux > .aux-tabs { grid-column: 1 / -1; grid-row: 1; }
html.max-aux:is(.at-channel, .at-dm) .aux > .bz-nav { display: flex; grid-column: 1; grid-row: 2; min-height: 0; background: var(--bg2); }
html.max-aux:is(.at-channel, .at-dm) .aux > .bz-nav-sash { display: block; grid-column: 2; grid-row: 2; }
html.max-aux:is(.at-channel, .at-dm) .aux > .apane { grid-column: 3; grid-row: 2; min-width: 0; }
.bz-nav-scroll { flex: 1; overflow-y: auto; padding: 10px 8px 24px; }
.bz-nav-h { font: 600 11.5px var(--font); letter-spacing: .05em; color: var(--mut); padding: 10px 10px 6px; }
.bz-nav ul { list-style: none; margin: 0; padding: 0; }
.bz-nav li { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 7px; cursor: pointer; color: var(--fg); font-size: 14px; }
.bz-nav li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bz-nav li .h { color: var(--mut); font-weight: 600; width: 16px; text-align: center; }
.bz-nav li .av { width: 22px; height: 22px; border-radius: 6px; background: var(--bg3); color: var(--mut); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.bz-nav li:hover, .bz-nav li:focus-visible { background: var(--bg3); outline: none; }
.bz-nav li.on { background: var(--acc); color: #fff; } .bz-nav li.on .h { color: #fff; } .bz-nav li.on .av { background: rgba(255,255,255,.25); color: #fff; }
.bz-nav details summary { list-style: none; cursor: pointer; font-size: 12.5px; color: var(--mut); padding: 6px 10px 4px; }
.bz-nav details summary::before { content: "▾ "; } .bz-nav details:not([open]) summary::before { content: "▸ "; }
html.max-aux .bz-main .bz-chsel, html.max-aux .bz-main .bz-agent { display: none; }   /* the side list replaces the pickers */
@media (max-width: 900px) { html.max-aux:is(.at-channel, .at-dm) .aux { grid-template-columns: minmax(0, 1fr); }
  html.max-aux:is(.at-channel, .at-dm) .aux > .bz-nav, html.max-aux:is(.at-channel, .at-dm) .aux > .bz-nav-sash { display: none; }
  html.max-aux:is(.at-channel, .at-dm) .aux > .apane { grid-column: 1; } html.max-aux .bz-main .bz-chsel, html.max-aux .bz-main .bz-agent { display: inline-block; } }
.bz-title { display: none; } html.max-aux .bz-main .bz-title { display: inline; font-size: 15.5px; margin-right: 2px; }

/* editor groups (split by dragging tabs) */
.egroups { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: row; }
.egroups.col { flex-direction: column; }
.egroup { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1 1 0; }
.egroups.multi .egroup:not(.focus) .etab.on { border-top-color: color-mix(in srgb, var(--acc) 35%, transparent); }
.egroups.multi .egroup:not(.focus) > .etabs { background: color-mix(in srgb, var(--bg2) 70%, var(--bg)); }
.gsash { flex: none; width: 5px; cursor: col-resize; position: relative; z-index: 3; }
.gsash::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: var(--line); }
.egroups.col > .gsash { width: auto; height: 5px; cursor: row-resize; } .egroups.col > .gsash::after { left: 0; right: 0; top: 2px; bottom: auto; width: auto; height: 1px; }
.gsash:hover::after, .gsash.active::after { background: var(--acc); width: 3px; left: 1px; } .egroups.col > .gsash:hover::after { height: 3px; width: auto; top: 1px; left: 0; }
.gdrop { position: absolute; z-index: 20; pointer-events: none; background: color-mix(in srgb, var(--acc) 16%, transparent); border: 2px solid color-mix(in srgb, var(--acc) 55%, transparent);
  border-radius: 6px; transition: all .12s ease; top: 38px; left: 0; right: 0; bottom: 0; }
.gdrop[hidden] { display: none; }
.gdrop[data-z="left"] { right: 50%; } .gdrop[data-z="right"] { left: 50%; } .gdrop[data-z="bottom"] { top: calc(38px + (100% - 38px) / 2); } .gdrop[data-z="top"] { bottom: 50%; }
.etab.dropbefore { box-shadow: inset 3px 0 0 var(--acc); }
body.tab-dragging .epane { pointer-events: none; }   /* so iframes (Collabora) don't swallow the drag */
.etabs-split { padding: 3px 9px; border-radius: 6px; background: var(--bg2); color: var(--mut); font-size: 13px; border: 1px solid var(--line); }
.etabs-split:hover { color: var(--fg); background: var(--bg3); }

/* editor groups adapt to their own width (container queries): narrow groups stack the approval panel,
   put the document tools on their own scrollable row, and use tighter page margins */
.egroup { container-type: inline-size; container-name: eg; }
.etabs-close.icon-only { padding: 3px 9px; font-size: 13px; }
@container eg (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .panel { order: -1; position: static; max-height: none; border-left: 0; border-bottom: 1px solid var(--line); }
}
@container eg (max-width: 680px) {
  .epane { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .epane .tab-actions { grid-column: 1; grid-row: 1; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .epane .tab-actions::-webkit-scrollbar { display: none; }
  .epane > .crumbs { grid-column: 1; grid-row: 2; }
  .epane > .editor-body { grid-column: 1; grid-row: 3; }
  .epane:not(:has(> .crumbs)) .tab-actions { justify-content: flex-start; }
  .doc { padding: 16px 20px 40px; font-size: 14.5px; }
  .fm { padding: 8px 20px; }
  .form { padding: 10px 20px 32px; }
  .doc h1 { font-size: 1.4em; }
  .etab { min-width: 90px; }
}
@container eg (max-width: 440px) {
  .tab-actions .w-toggle, .tab-actions .max-toggle { font-size: 0; padding: 4px 8px; }
  .tab-actions .w-toggle::before { content: "↔"; font-size: 13px; } .tab-actions .max-toggle::before { content: "⛶"; font-size: 13px; }
}
.egroups.multi > .egroup { min-width: 240px; }
.egroups.multi.col > .egroup { min-width: 0; min-height: 160px; }
@container eg (max-width: 860px) {
  .dash { grid-template-columns: minmax(0, 1fr); height: auto; }   /* Inbox: 결재 대기 · 자료 요청 · 최근 처리 stacked */
  .dash section { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .editor-body .doc table { display: block; overflow-x: auto; }
}
html.max-aux .bz-msg.opens { cursor: pointer; } html.max-aux .bz-msg.opens:hover { background: var(--bg3); }
.bz-loading { display: flex; align-items: center; gap: 10px; padding: 28px 24px; color: var(--mut); font-size: 14px; }
.bz-loading .spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
html.max-aux .bz-main .bz-agent-cfg { margin-right: auto; }

/* ══ phones (≤700px): readable type, ≥40px touch targets, one thing at a time. Desktop sizes are untouched. ══ */
.m-only { display: none !important; }
.m-backdrop { display: none; }
@media (max-width: 700px) {
  :root { --tb: 52px; --sb: 0px; --ab: 0px; }
  .d-only { display: none !important; }
  .m-only { display: inline-grid !important; }
  body { font-size: 16px; }
  input, textarea, select { font-size: 16px !important; }          /* iOS zooms into smaller inputs */
  .app { grid-template-rows: var(--tb) minmax(0, 1fr) 0px; height: 100dvh; }
  .statusbar { display: none; }
  /* header: ☰ · logo · project · bell · chat */
  .titlebar { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 0 6px; padding-top: env(safe-area-inset-top, 0px); }
  .tb-search { display: none; }
  .tb-left { gap: 4px; min-width: 0; } .tb-right { gap: 2px; }
  .titlebar .icon { width: 42px; height: 42px; font-size: 18px; } .titlebar .sv { width: 22px; height: 22px; }
  .brand { font-size: 16px; white-space: nowrap; }
  .proj { max-width: 38vw; height: 36px; padding: 0 6px; }
  /* the editor gets the whole width; the activity bar + side bar become one drawer from the left */
  .workbench, html.sb-off .workbench, html.aux-off .workbench, html.sb-off.aux-off .workbench, html.max-editor .workbench, html.max-aux .workbench {
    grid-template-columns: 0 0 0 minmax(0, 1fr) 0 0; }
  .activity { display: none; }
  html.m-sb .activity { display: flex; position: fixed; z-index: 31; top: var(--tb); bottom: 0; left: 0; width: 56px; background: var(--bg2); border-right: 1px solid var(--line);
    animation: slidein-l .2s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
  html.m-sb .activity .icon { width: 48px; height: 48px; } html.m-sb .activity .sv { width: 24px; height: 24px; }
  html.m-sb .sidebar { left: 56px; top: var(--tb); bottom: 0; width: min(calc(100vw - 96px), 360px); z-index: 30; }
  html.m-aux .aux { top: var(--tb); bottom: 0; width: 100vw; z-index: 30; }
  .m-backdrop { position: fixed; inset: var(--tb) 0 0 0; z-index: 25; background: rgba(0,0,0,.35); }
  html.m-sb .m-backdrop, html.m-aux .m-backdrop { display: block; animation: fadein .15s ease; }
  /* touch-friendly lists */
  .pane-head { height: 46px; font-size: 12.5px; } .pane-head .icon { width: 40px; height: 40px; font-size: 16px; }
  .items a { padding: 10px 14px 10px 18px; font-size: 15.5px; } .items .s { font-size: 13px; }
  .sec-head { font-size: 12.5px; padding: 10px 12px; }
  .tree .row { height: 42px; font-size: 15.5px; } .tree .tw { width: 22px; font-size: 13px; }
  .tree .row-acts { display: inline-flex; } .tree .row-acts button { width: 34px; height: 34px; font-size: 15px; }
  .filter input { height: 42px; }
  /* editor: one group at a time, bigger tabs */
  .egroup:not(.focus) { display: none !important; } .gsash { display: none !important; }
  .egroups.multi > .egroup { min-width: 0; }
  .etabs { height: 46px; } .etab { min-width: 120px; max-width: 70vw; font-size: 14.5px; padding-left: 14px; }
  .etab .ex { visibility: visible; width: 34px; height: 34px; font-size: 20px; }
  .etabs-split { display: none; }
  .etabs-close { font-size: 13.5px; padding: 6px 12px; }
  .tab-actions a, .tab-actions button { font-size: 14px; padding: 8px 12px; min-height: 36px; }
  .crumbs { font-size: 13.5px; padding: 6px 14px; }
  .doc { font-size: 16.5px; line-height: 1.75; padding: 18px 16px 64px; }
  .doc h1 { font-size: 1.45em; } .doc h2 { font-size: 1.25em; }
  .fm { font-size: 13.5px; padding: 8px 16px; max-height: 30vh; overflow: auto; }
  .form { padding: 12px 16px 40px; } .panel { padding: 14px 16px; }
  .choice { padding: 10px 12px; font-size: 15.5px; } .choice input { width: 20px; height: 20px; }
  .panel button, .form button { min-height: 44px; font-size: 15.5px; }
  .dash { grid-template-columns: minmax(0, 1fr); } .dash .items a { padding: 12px 16px; }
  /* chat & messenger */
  .aux-tabs { height: 48px; } .aux-tabs .atab { font-size: 15px; padding: 0 14px; height: 48px; } .aux-tabs .icon { width: 42px; height: 42px; }
  .hc { --hc-font: 16px; } .hc-head { height: 50px; } .hc-sess { font-size: 15.5px; }
  .hc-composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .hc-send, .hc-stop { width: 42px; height: 42px; } .hc-hint, .hc-ctxm span { display: none; }
  .hc-list .t { font-size: 15.5px; } .hc-list li a { padding: 12px 14px; }
  .bz-body { font-size: 16px; } .bz-meta { font-size: 14px; } .bz-msg { padding: 10px 14px; }
  .bz-tools { opacity: 1; } .bz-bar button { width: 34px; height: 32px; } .bz-tools .act { font-size: 14px; padding: 6px 10px; }
  .bz-head { min-height: 46px; font-size: 14px; } .bz-form { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .bz-form button, .bz-tform button { min-height: 40px; padding: 0 16px; }
  .bz-jump { bottom: 140px; font-size: 14px; padding: 9px 16px; }
  /* overlays and popups */
  .apv-card { width: 100vw; max-height: 100dvh; border-radius: 0; } .apv-acts { grid-template-columns: 1fr 1fr; } .apv-b { min-height: 56px; }
  .docpop-card { width: 100vw; height: 100dvh; border-radius: 0; }
  .noti { position: fixed; left: 0; right: 0; top: var(--tb); width: auto; max-height: calc(100dvh - var(--tb)); border-radius: 0; }
  .ctxmenu button { padding: 12px 16px; font-size: 15.5px; }
  /* terminal: full width, taller default; split/position controls hidden */
  .tsplitbtn, .tpos { display: none !important; }
  html.term-on .tpanel { height: min(60dvh, var(--th)); }
  /* settings / system / storage: single column */
  .settings, .sys-pane, .stg { padding: 12px; } .g-grid, .g-grid.two { grid-template-columns: minmax(0, 1fr); }
  .sys-tabs { overflow-x: auto; } .sys-tabs button { padding: 10px 12px; font-size: 14.5px; white-space: nowrap; }
}
@media (max-width: 700px) { .tab-actions .w-toggle { display: none; } }

/* phones in focus mode (html.imm): content only; header/tools slide down on a small scroll up, the message box
   slides up when pulling past the bottom of a conversation */
@media (max-width: 700px) {
  html.imm.max-aux .aux { top: 0 !important; bottom: 0; }
  html.imm .aux-tabs { position: fixed; top: 0; left: 0; right: 0; z-index: 36; background: var(--bg); transform: translateY(-100%); transition: transform .22s ease; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
  html.imm .hc-head, html.imm .bz-main .bz-head, html.imm .bz-thead { position: fixed; top: calc(var(--atabs-h, 48px) - 1px); left: 0; right: 0; z-index: 35; background: var(--bg);
    transform: translateY(calc(-100% - var(--atabs-h, 48px))); transition: transform .22s ease; box-shadow: 0 2px 10px rgba(0,0,0,.10); }
  html.imm.imm-head .aux-tabs, html.imm.imm-head .hc-head, html.imm.imm-head .bz-main .bz-head, html.imm.imm-head .bz-thead { transform: none; }
  html.imm .hc-composer, html.imm .bz-main .bz-form, html.imm .bz-tform { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--bg);
    max-width: none !important; margin: 0 !important; transform: translateY(110%); transition: transform .22s ease; box-shadow: 0 -2px 12px rgba(0,0,0,.12); }
  html.imm.imm-input .hc-composer, html.imm.imm-input .bz-main .bz-form, html.imm.imm-input .bz-tform { transform: none; }
  html.imm.imm-input .hc-log, html.imm.imm-input .bz-log, html.imm.imm-input .bz-tlog { padding-bottom: 170px; }
  html.imm .bz-typing, html.imm .bz-nav, html.imm .bz-nav-sash, html.imm .bz-jump { display: none !important; }
  html.imm .hc > .hc-drawer, html.imm .hc > .fsash { display: none !important; }
  /* documents */
  html.imm.max-editor .epane > .tabs > .tab-actions, html.imm.max-editor .epane .tab-actions { position: fixed; top: 0; left: 0; right: 0; z-index: 36; background: var(--bg);
    transform: translateY(-100%); transition: transform .22s ease; box-shadow: 0 2px 10px rgba(0,0,0,.12); padding: 6px 10px; }
  html.imm.max-editor .epane > .crumbs { position: fixed; top: 50px; left: 0; right: 0; z-index: 35; background: var(--bg2);
    transform: translateY(calc(-100% - 50px)); transition: transform .22s ease; }
  html.imm.max-editor.imm-head .epane .tab-actions, html.imm.max-editor.imm-head .epane > .crumbs { transform: none; }
}
@media (max-width: 700px) {   /* BSM (시스템) tabs follow the header in phone focus mode */
  html.imm.max-editor .sys-tabs { position: fixed; top: 50px; left: 0; right: 0; z-index: 34; background: var(--bg); padding: 0 8px;
    transform: translateY(calc(-100% - 50px)); transition: transform .22s ease; box-shadow: 0 2px 10px rgba(0,0,0,.10); }
  html.imm.max-editor.imm-head .sys-tabs { transform: none; }
}

/* phones: header, tabs and document tools fold away while reading down (html.ahide), back on scroll up */
@media (max-width: 700px) {
  .egroup > .etabs { transition: height .22s ease, border-width .22s ease; }
  .epane .tab-actions, .epane > .crumbs { max-height: 64px; transition: max-height .22s ease, padding .22s ease, opacity .22s ease; }
  html.ahide:not(.imm) .app { grid-template-rows: 0px minmax(0, 1fr) 0px; }
  html.ahide:not(.imm) .titlebar { overflow: hidden; border-bottom-width: 0; }
  html.ahide:not(.imm) .egroup > .etabs { height: 0; border-bottom-width: 0; overflow: hidden; }
  html.ahide:not(.imm) .epane .tab-actions, html.ahide:not(.imm) .epane > .crumbs { max-height: 0; padding-top: 0; padding-bottom: 0; border-bottom-width: 0; opacity: 0; overflow: hidden; }
  html.ahide:not(.imm) .sys-tabs { display: none; }
}

/* phones: the conversation list is a shaded sheet over the chat (opened with ☰), also in focus mode */
@media (max-width: 900px) {
  html .hc > .hc-drawer:not([hidden]) { display: flex !important; flex-direction: column; position: absolute; left: 0; right: 0; top: 50px; z-index: 30;
    max-height: min(72dvh, 560px); height: auto; grid-column: auto !important; grid-row: auto !important;
    background: color-mix(in srgb, var(--bg2) 88%, var(--fg) 6%); border-bottom: 1px solid var(--line); box-shadow: 0 14px 32px rgba(0,0,0,.22);
    border-radius: 0 0 14px 14px; overflow: hidden; animation: fadein .15s ease; }
  html .hc > .hc-drawer:not([hidden]) .hc-list { flex: 1; overflow-y: auto; }
  html .hc > .hc-drawer[hidden], html.max-aux .hc > .hc-drawer[hidden] { display: none !important; }
  html .hc-list li.on { background: color-mix(in srgb, var(--acc) 18%, transparent); }
  html.max-aux.at-hermes .hc { grid-template-columns: minmax(0, 1fr) !important; }
  html.max-aux .hc > .fsash { display: none !important; }
  html.max-aux .hc > .hc-head, html.max-aux .hc > .hc-log, html.max-aux .hc > .hc-composer { grid-column: 1 !important; }
  html.imm .hc > .hc-drawer:not([hidden]) { top: calc(var(--atabs-h, 48px) + 50px); }   /* under the slid-in tabs + header */
}

/* phones, normal mode: reading a conversation down folds the header and the message box (html.chide) */
@media (max-width: 900px) {
  .aux-tabs, .hc-head, .bz-main .bz-head, .bz-thead, .hc-composer, .bz-main .bz-form, .bz-tform { transition: max-height .22s ease, padding .22s ease, opacity .2s ease; }
  html.chide:not(.imm) .aux-tabs, html.chide:not(.imm) .hc-head, html.chide:not(.imm) .bz-main .bz-head, html.chide:not(.imm) .bz-thead,
  html.chide:not(.imm):not(.cbot) .hc-composer, html.chide:not(.imm):not(.cbot) .bz-main .bz-form, html.chide:not(.imm):not(.cbot) .bz-tform,
  html.chide:not(.imm):not(.cbot) .bz-typing {   /* .cbot: at the bottom of a conversation the message box stays */
    max-height: 0 !important; min-height: 0 !important; height: auto !important; padding-top: 0 !important; padding-bottom: 0 !important;
    border-width: 0 !important; opacity: 0; overflow: hidden !important; }
  .aux-tabs, .hc-head, .bz-main .bz-head, .bz-thead { max-height: 64px; } .hc-composer, .bz-main .bz-form, .bz-tform { max-height: 340px; }
}
@media (max-width: 700px) {
  html.chide:not(.imm) .app { grid-template-rows: 0px minmax(0, 1fr) 0px; }
  html.chide:not(.imm) .titlebar { overflow: hidden; border-bottom-width: 0; }
  html.chide:not(.imm).m-aux .aux { top: 0; }
  html.chide:not(.imm) .m-backdrop { inset: 0; }
}

/* phones: chat composer — context line, a roomy input, then [model][ … ][■][↑] */
@media (max-width: 700px) {
  .hc-box { padding: 8px 10px 8px; border-radius: 18px; }
  .hc-ctx { font-size: 12.5px; padding: 0 2px 6px; }
  .hc-here { font-size: 12px; padding: 4px 9px; }
  .hc-input { min-height: 44px; font-size: 16px; line-height: 1.5; padding: 4px 2px; }
  .hc-bar { gap: 8px; margin-top: 4px; }
  .hc-bar .hc-model { flex: 0 1 auto; max-width: 46%; height: 36px; font-size: 14px !important; padding: 0 8px; border-radius: 10px; }
  .hc-bar .hc-hint { display: block !important; flex: 1; min-width: 0; height: 0; visibility: hidden; }   /* spacer: buttons to the right */
  .hc-bar .hc-ctxm { flex: none; } .hc-bar .hc-ctxm i { width: 40px; }
  .hc-bar .hc-send, .hc-bar .hc-stop { flex: none; width: 42px; height: 42px; font-size: 18px; }
  .bz-form .chat-hint { gap: 10px; } .bz-form textarea { min-height: 52px; }
}

/* phones: the menu drawer also opens over a document in focus mode (swipe right) */
@media (max-width: 700px) {
  html.max-editor.m-sb .sidebar { opacity: 1; visibility: visible; pointer-events: auto; }
  html.imm.m-sb .sidebar, html.imm.m-sb .activity, html.imm.m-sb .m-backdrop { top: 0; }
}
/* phones: BSM (시스템) tables scroll sideways inside the page instead of widening it */
@media (max-width: 700px) {
  .sys, .sys-pane { min-width: 0; max-width: 100vw; overflow-x: hidden; }
  .sys-pane .sys-t { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sys-pane .sys-t.kv { display: table; table-layout: fixed; }
  .sys-pane .sys-t.kv th { width: 34%; } .sys-pane .sys-t.kv td { white-space: normal; overflow-wrap: anywhere; }
  .sys-pane pre, .sys-pane .sys-bar { max-width: 100%; overflow-x: auto; }
}

/* phones: document tables — wide ones become cards (one per row); the table view keeps a sticky first column */
.mt-toggle { display: none; }
@media (max-width: 700px) {
  .doc table { font-size: .9em; word-break: keep-all; overflow-wrap: anywhere; }
  .editor-body .doc table:not(.mt-cards) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc table:not(.mt-cards) th, .doc table:not(.mt-cards) td { min-width: 5.5em; }
  .doc table:not(.mt-cards) th:first-child, .doc table:not(.mt-cards) td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: 1px 0 0 var(--line); }
  .doc table:not(.mt-cards) th:first-child { background: var(--bg2); }
  .mt-toggle { display: inline-flex; margin: 10px 0 0; padding: 4px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--mut); font: inherit; font-size: 12.5px; }
  .doc table.mt-cards, .doc table.mt-cards > thead, .doc table.mt-cards > tbody, .doc table.mt-cards tr, .doc table.mt-cards td, .doc table.mt-cards th { display: block; }
  .doc table.mt-cards { border: 0; margin: 4px 0 12px; font-size: 1em; overflow: visible; }
  .doc table.mt-cards tr.mt-head { display: none; }
  .doc table.mt-cards tr { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 4px 14px; background: var(--bg2); }
  .doc table.mt-cards td, .doc table.mt-cards th { border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; min-width: 0;
    display: grid; grid-template-columns: minmax(4.5em, 32%) minmax(0, 1fr); gap: 12px; text-align: left; }
  .doc table.mt-cards td:last-child, .doc table.mt-cards th:last-child { border-bottom: 0; }
  .doc table.mt-cards td::before, .doc table.mt-cards th::before { content: attr(data-label); color: var(--mut); font-size: .86em; font-weight: 600; }
  .doc table.mt-cards td:first-child, .doc table.mt-cards th:first-child { font-weight: 650; }
  .doc table.mt-cards td:empty { display: none; }
}

/* 보고서 (보고함) */
.items a.rp-new .t { font-weight: 650; }
.rp-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--acc); vertical-align: middle; }
.chip.rp-kind { font-size: 11px; padding: 0 6px; margin-right: 4px; }
.sec-head .rp-n { background: var(--acc); color: #fff; }
select.mv-proj { height: 28px; max-width: 170px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; padding: 0 6px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: flex; gap: 12px; align-items: center;
  max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: fadein .18s ease; transition: opacity .4s ease; }
.toast a { color: inherit; font-weight: 650; text-decoration: underline; } .toast.out { opacity: 0; }
.chip.rc-new { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 40%, transparent); } .chip.rc-mod { color: var(--mut); }
/* Inbox dashboard: 결재 대기 · 자료 요청 · 보고서 on top, 최근 문서 · 최근 자료실 · 최근 처리 below */
.dash { grid-auto-rows: minmax(0, 1fr); }
.dash section:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
@container eg (max-width: 860px) { .dash { grid-auto-rows: auto; } }

/* 전체 프로젝트 현황 (Inbox, all projects) */
.home { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.home > .dash { flex: 1; min-height: 360px; height: auto; }
.ov { border-bottom: 1px solid var(--line); background: var(--bg); }
.ov-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.ov-head .ov-re { margin-left: auto; width: 26px; height: 26px; }
.ov-body { padding: 0; } .ov-body.mut { padding: 12px 14px; }
.ov-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ov-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.ov-t th, .ov-t td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: top; }
.ov-t thead th { font-size: 11.5px; color: var(--mut); font-weight: 600; }
.ov-t tbody th a { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 650; }
.ov-t tbody th { position: sticky; left: 0; background: var(--bg); z-index: 1; }
.ov-c b { display: block; font-size: 14.5px; font-weight: 650; } .ov-c b small { font-size: 11.5px; font-weight: 500; color: var(--mut); }
.ov-c span { font-size: 11.5px; color: var(--mut); }
.ov-c.hot span { color: #16a34a; } .ov-c.warm span { color: #d97706; } .ov-c.off b { color: var(--mut); font-weight: 500; }
.ov-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.ov-dot.hot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); } .ov-dot.warm { background: #f59e0b; } .ov-dot.cold { background: #94a3b8; }
@media (max-width: 700px) { .ov-t th, .ov-t td { padding: 7px 9px; } .home > .dash { min-height: 0; } }

/* 내부 저장소: server folder picker */
.stg-pathrow { display: flex; gap: 6px; } .stg-pathrow input { flex: 1; min-width: 0; }
.stg-browse { border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 10px; overflow: hidden; background: var(--bg); }
.stg-browse .sb-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 13px; overflow-x: auto; white-space: nowrap; }
.stg-browse .sb-bar a { text-decoration: none; color: var(--fg); } .stg-browse .sb-crumbs { display: flex; gap: 4px; }
.stg-browse .sb-list { list-style: none; margin: 0; padding: 4px 0; max-height: 260px; overflow-y: auto; }
.stg-browse .sb-list li { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.stg-browse .sb-list li a { flex: 1; padding: 7px 0; color: var(--fg); text-decoration: none; font-size: 14px; }
.stg-browse .sb-list li:hover { background: var(--bg3); } .stg-browse .sb-list li.no a { color: var(--mut); } .stg-browse .sb-list li span { font-size: 11.5px; }
.stg-browse .sb-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg2); }
.stg-browse .sb-cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.stg-browse .sb-why { padding: 0 10px 8px; font-size: 12.5px; background: var(--bg2); }

/* 📷 screenshot */
.hc-shot { border: 0; background: none; font-size: 16px; padding: 0 6px; cursor: pointer; opacity: .8; } .hc-shot:hover { opacity: 1; }
.shot-menu { position: fixed; z-index: 95; display: flex; flex-direction: column; min-width: 230px; padding: 4px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); box-shadow: 0 10px 28px rgba(0,0,0,.2); animation: fadein .12s ease; }
.shot-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--fg); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.shot-menu button:hover { background: var(--bg3); } .shot-menu small { color: var(--mut); font-size: 11.5px; }
html.shooting * { animation: none !important; transition: none !important; }

/* attached images: thumbnails in the AI composer and messages, preview in the Buzz file chip */
.hc-thumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 2px; }
.hc-thumb { position: relative; display: block; width: 88px; height: 66px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg2); }
.hc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hc-thumb-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; line-height: 20px; padding: 0; cursor: pointer; }
.hm-bubble .hc-thumbs { padding: 8px 0 2px; } .hm-bubble .hc-thumb { width: 180px; height: 120px; }
.bz-filechip { align-items: center; gap: 8px; } .bz-chip-img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* exec-approval requests in channels / DMs: real buttons, the answered one marked */
.bz-apv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.bz-apv-b { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bz-apv-b img { width: 18px; height: 18px; } .bz-apv-b:hover:not(:disabled) { background: var(--bg3); border-color: var(--acc); }
.bz-apv-b.no:hover:not(:disabled) { border-color: #dc2626; } .bz-apv-b:disabled { opacity: .45; cursor: default; }
.bz-apv-b.on { opacity: 1; border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, var(--bg)); }
.bz-apv-done { font-size: 12px; color: var(--mut); }
.bz-msg.bz-flash { animation: bzflash 2.4s ease; } @keyframes bzflash { 0%, 60% { background: color-mix(in srgb, #f59e0b 28%, transparent); } 100% { background: transparent; } }

/* 프로젝트 관리 */
.prj { padding: 20px 24px 60px; max-width: 980px; font-size: 14px; }
.prj-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: var(--bg); }
.prj-item.def { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); background: color-mix(in srgb, var(--acc) 4%, var(--bg)); }
.prj-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prj-name { font: inherit; font-size: 16px; font-weight: 650; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; background: transparent; color: var(--fg); min-width: 0; }
.prj-name:hover, .prj-name:focus { border-color: var(--line); background: var(--bg2); }
.prj-key { font-family: ui-monospace, monospace; font-size: 12px; }
.prj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.prj-grid label, .prj-info { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--mut); }
.prj-grid select, .prj-grid input { font: inherit; font-size: 14px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); }
.prj-info a { color: var(--fg); font-size: 14px; } .prj-info .chip { display: inline-block; margin: 0 4px 4px 0; color: var(--fg); }
.prj-acts { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.prj-acts button { height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
.prj-acts button.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.prj-form { border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; }
@media (max-width: 700px) { .prj { padding: 12px; } .prj-grid { grid-template-columns: minmax(0, 1fr); } }

/* 프로젝트 현황: AI progress summary under each project row */
.ov-t tr.ov-sum td { padding: 0 12px 10px 33px; border-bottom: 1px solid var(--line); white-space: normal; position: static; }
.ov-t tbody tr:has(+ tr.ov-sum) > * { border-bottom: 0; }
.ov-sum-t { font-size: 13px; line-height: 1.55; color: var(--fg); max-width: 1100px; }
.ov-sum-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 2px; }
.ov-sum-re { border: 0; background: none; color: var(--mut); cursor: pointer; font-size: 12px; padding: 0 4px; } .ov-sum-re:hover { color: var(--acc); }
@media (max-width: 700px) { .ov-t tr.ov-sum td { padding-left: 9px; } }

.prj-folder { align-self: flex-start; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; }
.prj-folder:hover { border-color: var(--acc); }
.prj-folders { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.prj-folders button { text-align: left; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 13.5px; cursor: pointer; }
.prj-folders button:disabled { color: var(--mut); cursor: default; } .prj-folders button:hover:not(:disabled) { background: var(--bg3); }
.prj-team { margin-top: 12px; } .prj-team-h { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--mut); margin-bottom: 6px; }
.prj-tr { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.4fr) 30px; gap: 8px; align-items: center; margin-bottom: 6px; }
.prj-tr input[type=radio] { width: 17px; height: 17px; accent-color: var(--acc); }
.prj-tr input.prj-tn, .prj-tr select { font: inherit; font-size: 14px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); min-width: 0; }
.prj-x { height: 30px; border: 0; background: none; color: var(--mut); cursor: pointer; font-size: 14px; } .prj-x:hover { color: #dc2626; }
.prj-add { margin-top: 2px; border: 1px dashed var(--line); border-radius: 7px; background: none; color: var(--mut); padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; } .prj-add:hover { color: var(--acc); border-color: var(--acc); }
.ov-sum-t { display: flex; gap: 24px; flex-wrap: wrap; }
.ov-sum-col { flex: 1 1 320px; min-width: 0; } .ov-sum-col b { display: block; font-size: 11.5px; color: var(--mut); margin-bottom: 2px; letter-spacing: .02em; }
.ov-sum-col.td b { color: #d97706; } .ov-sum-col div { padding-left: 2px; }
@media (max-width: 700px) { .ov-sum-t { gap: 8px; } }
.kv a.doc-dm, .kv a.doc-ch { color: var(--fg); text-decoration: none; border-bottom: 1px dashed var(--line); }
.kv a.doc-dm small, .kv a.doc-ch small { color: var(--acc); font-size: 11px; margin-left: 2px; } .kv a.doc-dm:hover, .kv a.doc-ch:hover { border-bottom-color: var(--acc); }
.stg-browse .sb-list li.sb-file { color: var(--mut); font-size: 13px; padding: 4px 10px 4px 26px; cursor: default; }
.stg-browse .sb-list li.sb-file span:first-child { color: var(--fg); opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg-browse .sb-list li.sb-file:hover { background: none; }

/* search page: content hits */
.srch-h { margin: 18px 14px 6px; font-size: 13px; color: var(--mut); } .srch { list-style: none; margin: 0; padding: 0 14px 20px; }
.srch li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .srch li a { color: var(--fg); text-decoration: none; font-weight: 600; }
.srch .snip { font-size: 12.5px; color: var(--mut); margin-top: 3px; line-height: 1.45; }

/* 내부 저장소 folder picker: a modal with folders left, files right */
.sb-modal { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .12s ease; }
.sb-card { width: min(1000px, 100%); height: min(78vh, 760px); display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.3); overflow: hidden; }
.sb-card .sb-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 14px; overflow-x: auto; white-space: nowrap; }
.sb-card .sb-bar a { text-decoration: none; color: var(--fg); } .sb-card .sb-crumbs { display: flex; gap: 4px; } .sb-card .sb-x { margin-left: auto; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--mut); }
.sb-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.sb-col { min-height: 0; display: flex; flex-direction: column; } .sb-col + .sb-col { border-left: 1px solid var(--line); }
.sb-col h4 { margin: 0; padding: 8px 14px; font-size: 12px; color: var(--mut); border-bottom: 1px solid var(--line); background: var(--bg); }
.sb-card .sb-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.sb-card .sb-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; }
.sb-card .sb-list li a { flex: 1; padding: 8px 0; color: var(--fg); text-decoration: none; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-card .sb-list li:hover { background: var(--bg3); } .sb-card .sb-list li.no a { color: var(--mut); } .sb-card .sb-list li span { font-size: 12px; }
.sb-card .sb-list li.sb-file { padding: 6px 14px; cursor: default; } .sb-card .sb-list li.sb-file:hover { background: none; }
.sb-card .sb-list li.sb-file span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); opacity: .85; font-size: 14px; }
.sb-card .sb-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg2); }
.sb-card .sb-cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sb-card .sb-why { padding: 0 14px 10px; font-size: 12.5px; background: var(--bg2); }
.sb-card .sb-foot button.primary { height: 36px; padding: 0 16px; }
@media (max-width: 700px) { .sb-modal { padding: 0; } .sb-card { height: 100%; border-radius: 0; } .sb-cols { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); } .sb-col + .sb-col { border-left: 0; border-top: 1px solid var(--line); } }
.sb-card .sb-filter { flex: 1; min-width: 160px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; }
.sb-card .sb-filter:focus { border-color: var(--acc); outline: none; }
@media (max-width: 700px) { .sb-card .sb-bar { flex-wrap: wrap; } .sb-card .sb-filter { flex-basis: 100%; order: 9; } }

/* folder picker: views, column mode, preview, copy dialog */
.sb-card .sb-views { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.sb-card .sb-views button { border: 0; background: var(--bg); color: var(--mut); width: 32px; height: 30px; cursor: pointer; font-size: 14px; }
.sb-card .sb-views button.on { background: var(--acc); color: #fff; }
.sb-cols.with-prev { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.sb-cols.columns { display: flex; overflow-x: auto; overflow-y: hidden; }
.sb-colx { flex: 0 0 260px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.sb-colx h4 { margin: 0; padding: 8px 12px; font-size: 12px; color: var(--mut); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sb-colx h4 small { font-weight: 400; }
.sb-card .sb-list li.on { background: color-mix(in srgb, var(--acc) 14%, transparent); }
.sb-card .sb-list li .sb-arr { color: var(--mut); font-size: 13px; } .sb-colx .sb-list li a { font-size: 13.5px; padding: 6px 0; }
.sb-card .sb-list li.sb-file { cursor: pointer; } .sb-card .sb-list li.sb-file:hover { background: var(--bg3); }
.sb-card .sb-list li.sb-file .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); opacity: .9; font-size: 14px; }
.sb-colx .sb-list li.sb-file .nm { font-size: 13.5px; } .sb-colx .sb-list li.sb-file > span.mut { display: none; }
.sb-att { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 12px; padding: 2px 6px; cursor: pointer; flex: none; opacity: .75; }
.sb-att:hover { opacity: 1; border-color: var(--acc); }
.sb-prev { flex: 1 1 380px; min-width: 300px; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg2); }
.sb-pv-h { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 13px; }
.sb-pv-h b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-prev img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; display: block; padding: 10px; }
.sb-prev iframe { flex: 1; border: 0; width: 100%; } .sb-prev pre { flex: 1; margin: 0; padding: 12px; overflow: auto; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: var(--bg); }
.sb-copy { position: absolute; z-index: 5; width: 330px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: 0 12px 32px rgba(0,0,0,.25); font-size: 13.5px; }
.sb-copy label { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 12px; color: var(--mut); }
.sb-copy select, .sb-copy input { font: inherit; font-size: 14px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); }
.sb-copy-a { display: flex; align-items: center; gap: 8px; margin-top: 10px; } .sb-copy-a button { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
.sb-copy-a button.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.sb-card { position: relative; }
@media (max-width: 700px) { .sb-cols.with-prev { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; } .sb-prev { min-width: 0; min-height: 40vh; border-left: 0; border-top: 1px solid var(--line); } .sb-colx { flex-basis: 220px; } }
.sb-card .sb-title { font-weight: 650; white-space: nowrap; }
.sb-card .sb-foot { flex-wrap: wrap; } .sb-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mut); }
.sb-name-i { height: 32px; width: 220px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; }
.sb-ro { display: flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; } .sb-msg { font-size: 12.5px; }
@media (max-width: 700px) { .sb-card .sb-cur { flex-basis: 100%; } .sb-name-i { width: 150px; } }
