:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #67676f;
  --accent: #27272a;
  --accent-soft: #ededee;
  --on-accent: #ffffff;
  --chart: #52525b;
  --code-bg: #f4f4f5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .05);
  --c-md: #4b6584; --c-html: #9a5b34; --c-text: #6b6b73; --c-file: #75669a; --c-image: #3f7a70;
  --radius: 10px;
  --topbar-h: 56px;
  --sidebar-w: 248px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: "JetBrains Mono", "D2Coding", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f10; --surface: #18181b; --surface-2: #222225; --border: #2e2e33;
    --text: #ececee; --muted: #a1a1aa; --accent: #e4e4e7; --accent-soft: #2a2a2e; --on-accent: #18181b; --chart: #a1a1aa;
    --code-bg: #141416; --shadow: none;
    --c-md: #9db0c8; --c-html: #d4a27e; --c-text: #a1a1aa; --c-file: #b6aad2; --c-image: #8fc0b6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f10; --surface: #18181b; --surface-2: #222225; --border: #2e2e33;
  --text: #ececee; --muted: #a1a1aa; --accent: #e4e4e7; --accent-soft: #2a2a2e; --on-accent: #18181b; --chart: #a1a1aa;
  --code-bg: #141416; --shadow: none;
  --c-md: #9db0c8; --c-html: #d4a27e; --c-text: #a1a1aa; --c-file: #b6aad2; --c-image: #8fc0b6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* Page scrollbar: thin and shown only while the pointer is at the right edge (html.sb-hover, set in app.js);
   none at all while the "On this page" list scrolls on its own (html.sb-none). */
html { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html.sb-hover { scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; }
html.sb-none { scrollbar-width: none; }
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
html.sb-hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); }
html.sb-none::-webkit-scrollbar { display: none; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }
kbd { font: 11px var(--mono); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--surface); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); width: calc(var(--sidebar-w) - 36px); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font: 700 13px var(--mono); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark circle { fill: currentColor; stroke: none; }
.brand-mark path { fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.search { position: relative; flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.search-pop { position: absolute; top: 42px; left: 0; right: 0; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; }
.search-pop a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.search-pop a.sel, .search-pop a:hover { background: var(--accent-soft); text-decoration: none; }
.search-pop .sp-path { color: var(--muted); font-size: 12px; font-family: var(--mono); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.search-pop .empty { padding: 12px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.pill { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.pill:hover { color: var(--text); border-color: var(--muted); }
.only-mobile { display: none; }
.top-admin { display: contents; }
.top-admin .icon-btn:hover { text-decoration: none; }
.top-write { height: 32px; margin-right: 4px; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: flex-start;
  width: var(--sidebar-w); height: calc(100vh - var(--topbar-h)); overflow: auto;
  padding: 16px 12px; border-right: 1px solid var(--border); background: var(--surface); flex: none;
  /* Thin scrollbar, shown only while the pointer is over the sidebar (its space stays reserved). */
  scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.sidebar:hover { scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.side-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text); font-size: 14px; }
.side-link:hover { background: var(--surface-2); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.side-link svg { color: var(--muted); }
.side-link.active svg { color: var(--text); }
.side-link .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: 18px; padding: 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.side-foot a { display: flex; width: fit-content; align-items: center; gap: 5px; margin-bottom: 8px; color: var(--muted); text-decoration: none; }
.side-foot a:hover { color: var(--accent); }
.side-foot a.side-visits { display: grid; width: auto; grid-template-columns: 1fr 1fr; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: inherit; }
.side-visits > div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; white-space: nowrap; }
.side-visits > div + div { padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--border); }
.side-foot a.side-visits:hover .v { color: var(--accent); }
.side-visits .k { font-size: 12px; color: var(--muted); }
.side-visits .v { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.side-visits .n { font-size: 11px; color: var(--muted); }
.side-visits .c { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-foot a svg { width: 13px; height: 13px; }
.side-foot a.side-contact { max-width: 100%; margin-bottom: 12px; }
.side-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-feedback { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.doc-feedback > svg { width: 15px; height: 15px; }
main { flex: 1; min-width: 0; padding: 28px 36px 64px; outline: none; }
.scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 9; }

/* ---------- common ---------- */
.page-h { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-h h1 { margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -.01em; }
.page-h p { margin: 4px 0 0; color: var(--muted); }
.page-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); }
.section-h { display: flex; align-items: baseline; gap: 10px; margin: 32px 0 12px; }
.section-h h2 { margin: 0; font-size: 16px; }
.section-h .sub { color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* .badge.md must beat the .md (rendered markdown) rule below. min-width fits the longest type name ("image"). */
.badge, .badge.md { display: inline-block; min-width: 5.5ch; text-align: center; font: 600 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: .03em; color: var(--bc, var(--muted)); background: color-mix(in srgb, var(--bc, var(--muted)) 13%, transparent); }
.badge.md { --bc: var(--c-md); } .badge.html { --bc: var(--c-html); } .badge.text { --bc: var(--c-text); }
.badge.file { --bc: var(--c-file); } .badge.image { --bc: var(--c-image); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.muted { color: var(--muted); }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }
.empty-state code { font-family: var(--mono); background: var(--code-bg); padding: 2px 6px; border-radius: 4px; }

/* ---------- home ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v.small { font-size: 16px; padding-top: 8px; }
.home-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.home-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 4px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cat-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; color: var(--text); transition: border-color .15s, transform .15s; }
.cat-card:hover { text-decoration: none; border-color: var(--muted); transform: translateY(-1px); }
.cat-card .top { display: flex; align-items: center; gap: 10px; }
.cat-card .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.cat-card .name { font-weight: 700; }
.cat-card .n { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-card .desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.cat-card .latest { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 8px; margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.links { padding: 6px; }
.links a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 7px; color: var(--text); }
.links a:hover { background: var(--surface-2); text-decoration: none; }
.links a .u { margin-left: auto; color: var(--muted); font-size: 12px; font-family: var(--mono); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- doc list ---------- */
.doc-list { overflow: hidden; }
.doc-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; color: var(--text); border-top: 1px solid var(--border); }
.doc-row:first-child { border-top: 0; }
.doc-row:hover { background: var(--surface-2); text-decoration: none; }
.doc-row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row .meta { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-row .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.group-h { font: 600 12px var(--mono); color: var(--muted); padding: 8px 16px; background: var(--surface-2); border-top: 1px solid var(--border); }
.group-h:first-child { border-top: 0; }
.side-link.sub { padding-left: 28px; font-size: 13px; }
.side-link.sub svg { width: 14px; height: 14px; }
.sel-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; border-top: 1px solid var(--border); }
.sel-row:first-child { border-top: 0; }
.sel-row .doc-row { border-top: 0; padding-left: 4px; }
.sel-row input.sel { justify-self: end; width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.sub-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sub-chip { display: inline-flex; align-items: center; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 13px; }
.sub-chip a { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; color: var(--text); }
.sub-chip a:hover { text-decoration: none; }
.sub-chip svg { width: 14px; height: 14px; color: var(--muted); }
.sub-chip .count { font-size: 12px; color: var(--muted); }
.sub-chip button { height: 100%; padding: 0 8px; border: 0; border-left: 1px solid var(--border); border-radius: 0 7px 7px 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.sub-chip button { border-radius: 0; }
.sub-chip button:last-child { border-radius: 0 7px 7px 0; }
.sub-chip button:hover { color: var(--text); }
.sub-chip button[data-delsub]:hover { color: #dc2626; }
.move-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 12px 8px 16px; margin-bottom: 12px; font-size: 13px; }
.move-bar .mv-all { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.move-bar input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.move-bar .mv-to { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.move-bar select { height: 30px; max-width: 220px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 8px; font: inherit; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.toolbar select, .toolbar input { height: 32px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: 13px; }

/* ---------- doc view ---------- */
.doc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; max-width: 1180px; }
.doc-wrap.wide { grid-template-columns: minmax(0, 1fr); max-width: none; }
.doc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.doc-head .info { font-size: 13px; color: var(--muted); }
.views { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.views svg { width: 13px; height: 13px; opacity: .8; }
.doc-head .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.doc-head .acts .views { font-size: 13px; color: var(--muted); margin-right: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.btn[hidden] { display: none; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.toc { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; max-height: calc(100vh - var(--topbar-h) - 48px); overflow: auto; font-size: 13px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc .h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.toc a { display: block; padding: 3px 0 3px 10px; color: var(--muted); border-left: 2px solid var(--border); line-height: 1.4; }
.toc a.l3 { padding-left: 22px; }
.toc a:hover, .toc a.on { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.frame { width: 100%; height: calc(100vh - var(--topbar-h) - 150px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.raw-text { white-space: pre-wrap; font: 13px/1.6 var(--mono); padding: 18px; background: var(--code-bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: auto; }
.img-view { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }

/* ---------- markdown ---------- */
.md { font-size: 15.5px; line-height: 1.75; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.3; margin: 1.8em 0 .6em; letter-spacing: -.01em; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.md h1 { font-size: 28px; } .md h2 { font-size: 21px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md h3 { font-size: 17px; } .md h4 { font-size: 15px; }
.md .anchor { opacity: 0; margin-left: 6px; color: var(--muted); font-weight: 400; }
.md h1:hover .anchor, .md h2:hover .anchor, .md h3:hover .anchor { opacity: 1; }
.md p, .md ul, .md ol, .md blockquote, .md table, .md pre { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.5em; }
.md li + li { margin-top: .25em; }
.md li > input[type=checkbox] { margin-right: 6px; }
.md code { font: .88em var(--mono); background: var(--code-bg); border: 1px solid var(--border); padding: .1em .4em; border-radius: 5px; }
.md pre { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow: auto; }
.md pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.6; }
.md pre .hljs { background: transparent; padding: 0; }
.md pre .copy { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; height: 26px; font-size: 12px; }
.md pre:hover .copy { opacity: 1; }
.md pre .lang { position: absolute; top: 6px; right: 12px; font: 11px var(--mono); color: var(--muted); }
.md pre:hover .lang { display: none; }
.md blockquote { border-left: 4px solid var(--muted); background: var(--surface-2); margin-left: 0; padding: 10px 16px; border-radius: 0 8px 8px 0; }
.md blockquote > :last-child { margin-bottom: 0; }
.md table { border-collapse: collapse; display: block; overflow: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md img { max-width: 100%; border-radius: 6px; }
.md a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: currentColor; }
.md a.anchor { text-decoration: none; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.md .mermaid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.md .pdf-view { margin: 16px 0; color: var(--muted); font-size: 13px; }
.md .pdf-page { background: #fff; border: 1px solid var(--border); border-radius: 4px; margin: 0 auto 12px; overflow: hidden; }
.md .pdf-page canvas { display: block; width: 100%; height: auto; }
.md details > summary { cursor: pointer; color: var(--muted); }

/* ---------- editor ---------- */
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--surface)); border-color: var(--accent); }
.btn.primary kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--on-accent) 45%, transparent); opacity: .85; }
.btn.danger { color: #dc2626; }
.btn.danger:hover { border-color: #dc2626; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.plain-text { white-space: pre-wrap; font-size: 16px; line-height: 1.85; }

body.editing main { padding-bottom: 24px; }
.ed { display: flex; flex-direction: column; gap: 12px; max-width: 1400px; }
.ed input, .ed select, .ed textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.ed input:focus, .ed select:focus, .ed textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.ed-title { font-size: 26px !important; font-weight: 700; padding: 10px 14px; border-radius: var(--radius) !important; }
.ed-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.ed-meta label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.ed-meta .grow { flex: 1 1 220px; } .ed-meta .grow2 { flex: 2 1 280px; }
.ed-meta select, .ed-meta input { height: 34px; padding: 0 10px; font-size: 14px; font-weight: 400; }
.ed .fn { display: flex; align-items: center; height: 34px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); font: 13px var(--mono); color: var(--muted); overflow: hidden; }
.ed .fn span { padding: 0 8px; white-space: nowrap; }
.ed .fn input { flex: 1; min-width: 60px; border: 0; border-radius: 0; height: 100%; font: 13px var(--mono); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--surface); height: 34px; }
.seg button { border: 0; background: transparent; padding: 0 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.ed-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ed-tools .tools { display: flex; gap: 2px; flex-wrap: wrap; }
.ed-tools .tb { height: 30px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font: 600 12.5px var(--mono); color: var(--text); }
.ed-tools .tb:hover { background: var(--surface-2); }
.ed-tools .view { margin-left: auto; height: 30px; }
.ed.fmt-txt .no-txt { display: none !important; }
.ed:not(.fmt-md) .md-only { display: none !important; }
.ed-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; height: calc(100vh - var(--topbar-h) - 330px); min-height: 380px; }
.ed-panes.v-edit { grid-template-columns: minmax(0, 1fr); } .ed-panes.v-edit .ed-preview { display: none; }
.ed-panes.v-preview { grid-template-columns: minmax(0, 1fr); } .ed-panes.v-preview textarea { display: none; }
.ed textarea { resize: none; padding: 16px 18px; font: 14.5px/1.7 var(--mono); tab-size: 2; height: 100%; }
.ed.fmt-txt textarea { font: 16px/1.85 var(--font); }
.ed textarea.drop { border-color: var(--accent); background: var(--accent-soft); }
.ed-preview { overflow: auto; padding: 18px 22px; height: 100%; }
.ed-preview.html { padding: 0; overflow: hidden; background: #fff; }
.ed-preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.ed-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.ed-foot #ed-status { margin-right: auto; font-size: 13px; }
.ed-foot .btn { height: 36px; padding: 0 14px; font-size: 14px; }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 360px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.modal h3 { margin: 0; font-size: 18px; } .modal p { margin: 0; font-size: 13px; }
.modal input { min-width: 0; height: 38px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.modal .err { color: #dc2626; font-size: 13px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
.modal .btn { height: 34px; padding: 0 14px; }
.modal.wide { max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; }
.modal .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.modal select { height: 38px; padding: 0 10px; font: inherit; font-size: 14px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.modal input:disabled { color: var(--muted); background: var(--surface-2); }
.modal label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.modal label.chk input { height: 16px; width: 16px; accent-color: var(--accent); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.login .icon-pick label { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; color: var(--muted); }
.icon-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick svg { display: block; width: 17px; height: 17px; }
.cat-grid.editing .cat-card:hover { transform: none; border-color: var(--border); }
.cat-card .name svg { width: 13px; height: 13px; color: var(--muted); vertical-align: -1px; }
.cat-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }
.cat-add { justify-content: center; align-items: center; min-height: 110px; border-style: dashed; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.cat-add:hover { color: var(--text); }

/* ---------- admin: login + posts ---------- */
.login-wrap { display: grid; place-items: center; min-height: calc(100vh - var(--topbar-h) - 140px); }
.login { width: 100%; max-width: 380px; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.login-h { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.login h3 { margin: 0; font-size: 18px; color: var(--text); }
.login p { margin: 0; font-size: 13px; }
.login label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.login input { height: 38px; padding: 0 12px; font: inherit; font-size: 15px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.login input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.login .err { color: #dc2626; font-size: 13px; }
.login .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.login .btn { height: 36px; padding: 0 16px; }
.login:not(.modal) .btn.primary { flex: 1; justify-content: center; }
.btn:disabled { opacity: .6; cursor: default; }
.pp-wrap { overflow-x: auto; }
.pp { width: 100%; border-collapse: collapse; font-size: 14px; }
.pp th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.pp td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.pp tbody tr:first-child td { border-top: 0; }
.pp tbody tr:hover { background: var(--surface-2); }
.pp .r { text-align: right; }
.pp-t { min-width: 200px; }
.pp-t a { font-weight: 600; color: var(--text); }
.pp-path { font: 12px var(--mono); color: var(--muted); }
.pp-c { white-space: nowrap; color: var(--muted); }
.pp-c svg { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.pp-m { white-space: nowrap; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-a { white-space: nowrap; }
.pp-a .btn + .btn { margin-left: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .only-mobile { display: grid; }
  .brand { width: auto; }
  .brand span:last-child { display: none; }
  .search kbd { display: none; }
  .sidebar { position: fixed; z-index: 10; left: 0; top: var(--topbar-h); transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  main { padding: 20px 16px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-row { grid-template-columns: 48px minmax(0, 1fr); }
  .doc-row .meta { display: none; }
  .topbar { padding: 0 10px; gap: 8px; }
  .ed-panes, .ed-panes.v-split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ed-panes.v-split > * { height: 55vh; }
  .ed-panes.v-edit textarea, .ed-panes.v-preview .ed-preview { height: 65vh; }
  .ed-title { font-size: 20px !important; }
  .ed-meta label, .ed-meta .grow, .ed-meta .grow2 { flex: 1 1 100%; }
  .ed-meta .seg { width: 100%; } .ed-meta .seg button { flex: 1; }
  .ed-tools .view { margin-left: 0; }
  .top-write span, .top-posts { display: none !important; }
  .top-write { padding: 0 8px; margin-right: 0; }
  .top-actions { gap: 2px; }
  .pp th:nth-child(3), .pp td:nth-child(3), .pp th:nth-child(5), .pp td:nth-child(5) { display: none; }
  .pp-a .btn span { display: none; }
  .page-h .right.toolbar { flex-wrap: wrap; margin-left: 0; }
}

/* ---------- visitor stats ---------- */
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.vz-card { padding: 16px 18px; margin-top: 16px; min-width: 0; }
.vz-card h3 { margin: 0 0 14px; font-size: 14px; }
.vz-card h3 .sub { color: var(--muted); font-weight: 400; margin-left: 6px; }
.vz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.vz-chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 160px 18px; column-gap: 8px; }
.vz-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.vz-plot { display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--border); background: linear-gradient(var(--border), var(--border)) top / 100% 1px no-repeat; }
.vz-col { flex: 1; display: flex; align-items: flex-end; min-width: 0; cursor: default; }
.vz-bar { width: 100%; background: var(--chart); border-radius: 4px 4px 0 0; }
.vz-col:hover .vz-bar { filter: brightness(1.15); }
.vz-col:hover { background: var(--surface-2); }
.vz-x { grid-column: 2; position: relative; font-size: 11px; color: var(--muted); }
.vz-x span { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; }
.vz-x span:first-child { transform: none; left: 0 !important; }
.vz-x span:last-child { transform: translateX(-100%); left: 100% !important; }
.vz-rank { display: flex; flex-direction: column; gap: 6px; }
.vz-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.vz-row:hover { background: var(--surface-2); }
.vz-row .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-row .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.vz-row .fill { display: block; height: 100%; background: var(--chart); border-radius: 4px; }
.vz-row .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
.vz-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.vz-table { margin-top: 12px; font-size: 13px; }
.vz-table summary { cursor: pointer; color: var(--muted); }
.vz-table table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.vz-table th, .vz-table td { border-bottom: 1px solid var(--border); padding: 4px 14px 4px 0; text-align: left; }
#vz-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow); }
#vz-tip[hidden] { display: none; }
@media (max-width: 640px) { .vz-chart { grid-template-rows: 120px 18px; } }

/* ---------- memo board (sticky notes) ---------- */
:root {
  --m-gray: #ececee; --m-yellow: #fff3b0; --m-pink: #ffd9e3; --m-green: #d6f5d1; --m-blue: #d6e9ff; --m-purple: #e7ddff; --m-orange: #ffe1c4;
  --m-text: #26231c; --m-muted: rgba(38, 35, 28, .55); --m-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 16px -6px rgba(0, 0, 0, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --m-gray: #2a2a2e; --m-yellow: #4a4322; --m-pink: #4d2a36; --m-green: #23402b; --m-blue: #1f3552; --m-purple: #352c54; --m-orange: #4d3522;
    --m-text: #ecebe6; --m-muted: rgba(236, 235, 230, .55); --m-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px -8px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --m-gray: #2a2a2e; --m-yellow: #4a4322; --m-pink: #4d2a36; --m-green: #23402b; --m-blue: #1f3552; --m-purple: #352c54; --m-orange: #4d3522;
  --m-text: #ecebe6; --m-muted: rgba(236, 235, 230, .55); --m-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px -8px rgba(0, 0, 0, .6);
}
.c-gray { --m: var(--m-gray); } .c-yellow { --m: var(--m-yellow); } .c-pink { --m: var(--m-pink); } .c-green { --m: var(--m-green); }
.c-blue { --m: var(--m-blue); } .c-purple { --m: var(--m-purple); } .c-orange { --m: var(--m-orange); }
.page-h p svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.memo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; align-items: start; }
.memo-empty { grid-column: 1 / -1; border: 1px dashed var(--border); border-radius: var(--radius); }
.memo { position: relative; display: flex; flex-direction: column; min-height: 170px; padding: 16px 16px 10px;
  background: var(--m, var(--m-gray)); color: var(--m-text); border-radius: 4px 4px 4px 4px; box-shadow: var(--m-shadow);
  transform: rotate(var(--tilt, 0deg)); transition: transform .15s ease, box-shadow .15s ease; }
.memo:nth-child(4n+1) { --tilt: -.6deg; } .memo:nth-child(4n+2) { --tilt: .5deg; }
.memo:nth-child(4n+3) { --tilt: -.3deg; } .memo:nth-child(4n) { --tilt: .7deg; }
.memo:not(.editing):hover { transform: rotate(0deg) translateY(-2px); box-shadow: var(--m-shadow), 0 12px 24px -10px rgba(0, 0, 0, .25); }
.memo::after { content: ""; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; border-radius: 0 0 4px 0;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, .08) 50%); }
.memo[draggable=true] { cursor: grab; }
.memo.dragging { opacity: .35; }
.memo.pinned { box-shadow: var(--m-shadow), inset 0 3px 0 rgba(0, 0, 0, .12); }
.memo-body { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; max-height: 360px; overflow: auto; }
.memo-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.memo footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 28px; font-size: 12px; color: var(--m-muted); }
.memo-acts { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.memo:hover .memo-acts, .memo:focus-within .memo-acts { opacity: 1; }
.memo-acts button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--m-muted); cursor: pointer; }
.memo-acts button:hover { background: rgba(0, 0, 0, .08); color: var(--m-text); }
.memo-acts button[data-act=del]:hover { color: #dc2626; }
.memo-acts svg { width: 15px; height: 15px; }
.memo-acts button.on { color: var(--m-text); }
.memo.pinned .memo-acts { opacity: 1; } .memo.pinned .memo-acts button:not(.on) { opacity: 0; }
.memo.pinned:hover .memo-acts button:not(.on) { opacity: 1; }
.memo.pinned .memo-acts button.on svg { fill: currentColor; }
.memo.editing { transform: none; z-index: 1; box-shadow: var(--m-shadow), 0 0 0 2px var(--accent); }
.memo-ta { width: 100%; min-height: 120px; resize: none; border: 0; outline: 0; padding: 0; background: transparent; color: var(--m-text);
  font: 14px/1.6 var(--font); }
.memo-ta::placeholder { color: var(--m-muted); }
.memo-colors { display: flex; gap: 5px; }
.memo-colors .dot { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); background: var(--m); cursor: pointer; }
.memo-colors .dot.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--m-text); }
.memo.editing footer { flex-wrap: wrap; row-gap: 8px; }
.memo-btns { margin-left: auto; display: flex; gap: 6px; }
.memo-btns .btn { height: 28px; white-space: nowrap; }
.memo-hint { margin: 14px 0 0; font-size: 12px; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-pick label { position: relative; cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; }
.kind-pick span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.kind-pick span svg { width: 18px; height: 18px; color: var(--muted); }
.kind-pick small { color: var(--muted); font-size: 12px; font-weight: 400; }
.kind-pick input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kind-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) { .memo-acts { opacity: 1; } .memo.pinned .memo-acts button:not(.on) { opacity: 1; } }
@media (max-width: 560px) { .memo-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .memo { min-height: 130px; padding: 12px 12px 8px; } }

/* ---------- Windows apps (download page) ---------- */
.app-req { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.app-req svg { width: 15px; height: 15px; }
.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.app-card { display: flex; flex-direction: column; overflow: hidden; }
.app-shot-wrap { position: relative; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.app-shot { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.app-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .2s; }
a.app-shot:hover img { transform: scale(1.015); }
.app-shot.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, color-mix(in srgb, var(--surface-2) 70%, var(--border)) 12px 13px); }
.app-shot .ph-win { display: flex; gap: 5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px 6px 0 0; border-bottom: 0; background: var(--surface); width: 46%; }
.app-shot .ph-win span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.app-shot .ph-name { font: 700 22px/1.2 var(--font); color: var(--text); letter-spacing: -.01em; }
.app-shot .ph-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.app-shot .ph-note svg { width: 15px; height: 15px; }
.app-shot-btn { position: absolute; right: 10px; bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.app-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.app-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.app-title h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.app-tag { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.app-desc { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.65; flex: 1; }
.app-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; line-height: 1.5; color: var(--muted); font-size: 12.5px; padding-top: 10px; border-top: 1px solid var(--border); }
.app-meta .ver { font: 600 12.5px/1.5 var(--mono); color: var(--text); }
.app-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.app-dl { height: 38px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.app-dl .sz { font-weight: 400; opacity: .72; font-size: 12.5px; }
.app-dl:hover { text-decoration: none; }
.app-none { color: var(--muted); font-size: 13.5px; }
.app-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 16px 18px; color: var(--muted); font-size: 13.5px; }
.app-note > svg { margin-top: 2px; color: var(--text); }
.app-note b { color: var(--text); }
.app-note p { margin: 4px 0 0; }
@media (max-width: 900px) {
  .app-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .app-body { padding: 16px; }
  .app-dl { flex: 1 1 100%; justify-content: center; }
}
.app-hash { border-top: 1px solid var(--border); padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.app-stats { border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.app-stats .dl-h { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 8px; }
.app-stats .dl-h svg { width: 14px; height: 14px; }
.app-stats .dl-last { margin-left: auto; font-weight: 400; }
.app-stats .dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px 12px; }
.app-stats .dl-n { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-stats .dl-n b { font-size: 18px; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.app-stats .dl-n em { font-style: normal; font-size: 11.5px; opacity: .85; overflow-wrap: anywhere; }
.app-stats .dl-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; }
.app-hash summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; list-style: none; }
.app-hash summary::-webkit-details-marker { display: none; }
.app-hash summary svg { width: 14px; height: 14px; }
.app-hash summary:hover { color: var(--text); }
.app-hash[open] summary { color: var(--text); margin-bottom: 8px; }
.app-hash p { margin: 10px 0 6px; }
.hash-row { margin-top: 8px; }
.hash-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hash-h > span { font-weight: 600; color: var(--text); }
.hash-file { font: 11.5px var(--mono); }
.hash-v { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.hash-v code, .hash-cmd { flex: 1; min-width: 0; font: 11.5px/1.5 var(--mono); color: var(--text); background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; word-break: break-all; }
.hash-cmd { display: block; }
.hash-v .btn { height: 28px; padding: 0 7px; flex: none; }
.hash-pending { margin-top: 3px; font-style: italic; }

/* idle-logout warning */
.idle-warn { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: 14px; }
.idle-warn span { font-variant-numeric: tabular-nums; }

/* apps: admin box for a newer build than the published one */
.app-upd { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); padding: 10px 12px; font-size: 12.5px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.app-upd-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; }
.app-upd-h svg { width: 14px; height: 14px; }
.app-upd-h b { font: 600 12.5px/1.5 var(--mono); }
.app-upd-cur { margin-left: auto; color: var(--muted); }
.app-upd-notes { margin: 0; width: 100%; max-height: 7.5em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 var(--font); color: var(--muted); }

/* apps: share / embed dialog */
.app-btns .app-share { margin-left: auto; }
.sh-modal { max-width: 560px; }
.sh-f { display: flex; flex-direction: column; gap: 5px; }
.sh-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.sh-l .btn { height: 28px; padding: 0 9px; }
.sh-f input, .sh-f textarea { width: 100%; font: 12px/1.5 var(--mono); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.sh-f input { height: 34px; padding: 0 10px; }
.sh-f textarea { padding: 8px 10px; resize: vertical; white-space: pre; overflow: auto; }
.sh-f p { margin: 0; font-size: 12px; }
.sh-f p:empty { display: none; }
.app-card.flash { animation: app-flash 2s ease-out; }
@keyframes app-flash { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); } to { box-shadow: 0 0 0 3px transparent; } }
@media (max-width: 520px) { .app-btns .app-share { margin-left: 0; } }
