/* voice-io 관리 콘솔 스타일. 바깥 글꼴·그림·스크립트 없음.
   색은 아래 변수만 쓴다. 밝은/어두운 화면: 시스템 설정을 따르되, 위쪽의 단추로 직접 고를 수 있다
   (<html data-theme="light|dark">). 상태는 색만으로 나타내지 않고 글자·기호도 함께 쓴다. */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --text: #1b2230;
  --muted: #5b6577;
  --line: #e0e4ec;
  --line-strong: #c9cfdb;
  --accent: #2a62d6;
  --accent-hover: #2150b3;
  --accent-text: #ffffff;
  --accent-soft: #e6eefc;
  --ok: #17803f;
  --ok-soft: #e3f4ea;
  --warn: #8f5b00;
  --warn-soft: #fff1d3;
  --bad: #be2f22;
  --bad-soft: #fde9e6;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 14px rgba(20, 30, 50, .05);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 232px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111419;
  --panel: #1a1e26;
  --panel-2: #1f242d;
  --text: #e7eaf0;
  --muted: #9aa4b5;
  --line: #2b313c;
  --line-strong: #3b4350;
  --accent: #7aa9f7;
  --accent-hover: #9bbffa;
  --accent-text: #0c1424;
  --accent-soft: #1d2a42;
  --ok: #5fd08e;
  --ok-soft: #16301f;
  --warn: #efbb55;
  --warn-soft: #35290e;
  --bad: #f3897c;
  --bad-soft: #3b1f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111419;
    --panel: #1a1e26;
    --panel-2: #1f242d;
    --text: #e7eaf0;
    --muted: #9aa4b5;
    --line: #2b313c;
    --line-strong: #3b4350;
    --accent: #7aa9f7;
    --accent-hover: #9bbffa;
    --accent-text: #0c1424;
    --accent-soft: #1d2a42;
    --ok: #5fd08e;
    --ok-soft: #16301f;
    --warn: #efbb55;
    --warn-soft: #35290e;
    --bad: #f3897c;
    --bad-soft: #3b1f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
h4 { font-size: .95rem; }
p { margin: .4rem 0; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: .92em; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-text); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- 처음 설정 / 로그인 ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.8rem; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.auth-card h1 { font-size: 1.3rem; margin-bottom: .3rem; }
.auth-card .stack { margin-top: 1rem; }
.auth-foot { display: flex; justify-content: flex-end; margin-top: 1rem; }
.auth-card.wide { max-width: 600px; }
.auth-card > .btn-row { margin-top: 1rem; }
.auth-card .stack .stack { margin-top: 0; }
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .35rem; color: var(--muted); }

/* ---- 전체 틀 ---- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .65rem; padding: .2rem .5rem 1.2rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text small { color: var(--muted); font-size: .78rem; }
.logo { width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--accent); position: relative; flex: none; display: inline-block; }
.logo::before { content: ""; position: absolute; left: calc(50% - 1.5px); top: 30%; width: 3px; height: 40%; border-radius: 2px; background: var(--accent-text); box-shadow: -7px 3px 0 0 var(--accent-text), 7px 3px 0 0 var(--accent-text), -14px 6px 0 -0px transparent; }
#nav { display: flex; flex-direction: column; gap: .15rem; }
#nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
#nav a:hover { background: var(--panel-2); color: var(--text); }
#nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
#nav svg { width: 1.2rem; height: 1.2rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-left, .top-right { display: flex; align-items: center; gap: .6rem; min-width: 0; flex-wrap: wrap; }
.top-name { display: none; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); text-decoration: none; font-size: .88rem; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); }
.offline { background: var(--bad-soft); color: var(--bad); padding: .55rem 1.5rem; font-weight: 600; border-bottom: 1px solid var(--line); }
#view { padding: 1.5rem; max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.2rem; outline: none; padding-bottom: 6rem; }

/* ---- 점·배지 (색 + 글자 + 모양) ---- */
.dot { width: .75rem; height: .75rem; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); border-radius: 2px; transform: rotate(45deg) scale(.9); }
.dot.bad { background: var(--bad); border-radius: 2px; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .08rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge .ico { font-weight: 800; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tags { display: inline-flex; gap: .3rem; flex-wrap: wrap; }

/* ---- 카드·틀 ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); min-width: 0; }
.card > h2, .card > h3 { margin-bottom: .6rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.row > .grow { flex: 1 1 200px; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.banner { border-radius: var(--radius-sm); padding: .75rem 1rem; display: flex; gap: .7rem; align-items: flex-start; border: 1px solid transparent; }
.banner .ico { font-weight: 800; flex: none; }
.banner p { margin: 0; }
.banner .body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.banner.ok { background: var(--ok-soft); border-color: var(--ok); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn); }
.banner.bad { background: var(--bad-soft); border-color: var(--bad); }
.banner.info { background: var(--accent-soft); }
.banner.ok .ico { color: var(--ok); } .banner.warn .ico { color: var(--warn); } .banner.bad .ico { color: var(--bad); } .banner.info .ico { color: var(--accent); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: .3rem; }
.loading { display: flex; align-items: center; gap: .7rem; color: var(--muted); padding: 2rem 0; justify-content: center; }
.spinner { width: 1.1rem; height: 1.1rem; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

ul.plain-list { list-style: none; margin: 0; padding: 0; }
ul.plain-list li { padding: .55rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
ul.plain-list li:first-child { border-top: 0; padding-top: 0; }
details summary { cursor: pointer; color: var(--accent); margin-bottom: .6rem; }

/* 숫자 타일 */
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.stat .n { font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .82rem; }

/* 이름-값 */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1.1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; min-width: 0; }

/* 엔진 */
.engine { display: flex; flex-direction: column; gap: .5rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.engine.first { border-top: 0; padding-top: .2rem; }
.engine-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.engine-head strong { font-size: 1.02rem; }
.bar { height: .5rem; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* ---- 입력 ---- */
label.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
label.field > span.lab { font-size: .85rem; font-weight: 600; }
.hint { color: var(--muted); font-size: .82rem; margin: 0; }
input, select, textarea, button, .button { font: inherit; color: inherit; }
input[type="text"], input[type="search"], input[type="date"], input:not([type]), input[type="password"], input[type="number"], select, textarea {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .55rem .7rem; width: 100%; min-width: 0; min-height: 2.5rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
textarea { resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="file"].sr-only { width: 1px; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 4.2rem; }
.pw-wrap button { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); min-height: 0; padding: .2rem .55rem; font-size: .8rem; border: 0; background: transparent; color: var(--accent); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: var(--radius-sm);
  padding: .5rem 1rem; border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; white-space: nowrap;
  min-height: 2.5rem; text-decoration: none; font-weight: 550;
}
button:hover, .button:hover { border-color: var(--accent); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.danger:hover { filter: brightness(.92); border-color: var(--bad); }
button.outline-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.ghost, .button.ghost { background: transparent; }
button.small, .button.small { padding: .25rem .7rem; min-height: 2rem; font-size: .85rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.busy { cursor: progress; }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); cursor: pointer; font-size: inherit; text-decoration: underline; font-weight: 500; }
.linkish:hover { border: 0; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; min-height: 2rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0; padding: .5rem .9rem .8rem; min-width: 0; }
legend { font-size: .85rem; font-weight: 600; padding: 0 .4rem; }
fieldset .check { margin-right: 1.2rem; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--panel); min-height: 2.2rem; padding: .35rem .9rem; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: .55rem 1rem; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { width: 2.7rem; height: 1.5rem; appearance: none; background: var(--line-strong); border-radius: 1rem; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: .17rem; left: .17rem; width: 1.16rem; height: 1.16rem; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 1.37rem; }
.switch input:disabled { opacity: .5; }

/* ---- 표 ---- */
.table-wrap { overflow-x: auto; margin: 0 -.3rem; padding: 0 .3rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { text-align: left; padding: .6rem .6rem; border-top: 1px solid var(--line); vertical-align: top; }
table.tbl thead th { color: var(--muted); font-weight: 600; border-top: 0; white-space: nowrap; font-size: .82rem; background: var(--panel-2); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl td.t { white-space: nowrap; color: var(--muted); }
table.tbl tbody tr:hover { background: var(--panel-2); }
table.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); }
table.tbl a.name { font-weight: 650; text-decoration: none; }
table.tbl a.name:hover { text-decoration: underline; }
tr.off td { opacity: .7; }

/* ---- 키 ---- */
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.key-row.first { border-top: 0; padding-top: 0; }
.key-row .k-main { flex: 1 1 260px; min-width: 0; }
.reveal { border: 2px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.secret-box { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.secret-box code, .secret-box pre { flex: 1 1 260px; margin: 0; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .7rem .9rem; font-family: var(--mono); font-size: 1rem; white-space: pre-wrap; word-break: break-all; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; margin: 0; padding: 0; list-style: none; }
.codes li { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .4rem .7rem; font-family: var(--mono); text-align: center; user-select: all; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius-sm); display: inline-block; line-height: 0; border: 1px solid var(--line); }
.qr svg { width: 200px; height: 200px; }
.totp-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.totp-grid > .stack { flex: 1 1 280px; min-width: 0; }

/* ---- 그래프 ---- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-line { stroke: var(--line-strong); stroke-width: 1; }
.chart .bar-rect { fill: var(--accent); }
.chart .bar-rect.today { fill: var(--accent-hover); }
.chart text.val { fill: var(--text); font-weight: 600; }
.chart .hit { fill: transparent; }
.chart g:hover .bar-rect { opacity: .75; }
.chart-empty { color: var(--muted); text-align: center; padding: 2.5rem 0; }

/* ---- 확인 창 ---- */
dialog.dlg { border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); color: var(--text); padding: 1.5rem; max-width: min(460px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog.dlg::backdrop { background: rgba(10, 14, 22, .55); }
dialog.dlg h2 { margin-bottom: .5rem; }
dialog.dlg .btn-row { justify-content: flex-end; margin-top: 1.2rem; }

/* ---- 알림 ---- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 500; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
:root[data-theme="dark"] .toast.ok { color: #0b2214; }
:root[data-theme="dark"] .toast.bad { color: #2a0d09; }

/* ---- 서버 설정 ---- */
.set { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: .3rem 1.2rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.set.first { border-top: 0; }
.set .lab { font-weight: 600; }
.set .lab .badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; font-weight: 400; }
.set .ctl { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.set .help { color: var(--muted); font-size: .85rem; margin: 0; }
.set .warnline { color: var(--warn); font-size: .85rem; margin: 0; font-weight: 600; }
.set.changed { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.error-text { color: var(--bad); font-weight: 500; }
.savebar { position: fixed; left: var(--side-w); right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line-strong); padding: .75rem 1.5rem; display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; z-index: 30; box-shadow: 0 -4px 16px rgba(0, 0, 0, .1); }

/* ---- 시험 ---- */
.result { margin-top: .8rem; display: flex; flex-direction: column; gap: .5rem; }
audio { width: 100%; max-width: 520px; }
.transcript { font-size: 1.15rem; margin: .2rem 0; padding: .7rem .9rem; background: var(--panel-2); border-radius: var(--radius-sm); min-height: 2.6rem; }
.words { display: flex; flex-wrap: wrap; gap: .3rem; }
.words span { padding: .1rem .45rem; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: .9rem; }
.words span.low { background: var(--warn-soft); border-color: var(--warn); }
.words span small { color: var(--muted); margin-left: .25rem; font-size: .75rem; }
.facts { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: 0; font-size: .9rem; }
.facts div { display: flex; gap: .4rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
button.rec-on { background: var(--bad); border-color: var(--bad); color: #fff; }
pre.out, pre.curl { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; font-family: var(--mono); font-size: .85rem; white-space: pre-wrap; word-break: break-all; max-height: 22rem; overflow: auto; margin: .3rem 0 0; }
pre.curl { color: var(--muted); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ---- 좁은 화면: 메뉴는 아래쪽 줄로 ---- */
@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; border-right: 0; border-top: 1px solid var(--line); padding: .3rem .4rem; z-index: 40; box-shadow: 0 -2px 12px rgba(0, 0, 0, .08); }
  .brand { display: none; }
  #nav { flex-direction: row; justify-content: space-around; gap: .1rem; }
  #nav a { flex-direction: column; gap: .1rem; padding: .35rem .2rem; font-size: .72rem; flex: 1 1 0; text-align: center; min-width: 0; }
  .main-col { padding-bottom: 4.2rem; }
  .top-name { display: inline; }
  .topbar { padding: .5rem .9rem; }
  #view { padding: 1rem .9rem 6rem; }
  .savebar { left: 0; bottom: 3.9rem; padding: .6rem .9rem; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .set { grid-template-columns: minmax(0, 1fr); }
  .toasts { bottom: 5rem; }
}
@media (max-width: 520px) {
  .card { padding: 1rem; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: .5rem; }
  h1 { font-size: 1.25rem; }
  .qr svg { width: 170px; height: 170px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
