:root {
  color-scheme: light;
  --ink: #192b25;
  --sub: #52645c;
  --muted: #64736a;
  --forest: #19553e;
  --forest-hover: #103f30;
  --deep: #143b30;
  --acid: #cff09d;
  --rail-fg: #dbeadf;
  --rail-nav: #c5dace;
  --rail-hover: #204a3d;
  --rail-active-bg: #cfeeaa;
  --rail-active-fg: #163b2c;
  --rail-rule: #426354;
  --rail-muted: #9fb6a6;
  --brand-mark: #c9efa0;
  --brand-sub: #a8c3ac;
  --line: #dce3dc;
  --line-soft: #edf0eb;
  --paper: #ffffff;
  --bg: #f3f5f1;
  --topbar-bg: #fbfcf9;
  --surface-soft: #f6f8f4;
  --surface-tint: #edf4ed;
  --surface-hover: #f0f6ee;
  --input-bg: #fcfdfb;
  --input-border: #cdd8cd;
  --btn-bg: #ffffff;
  --btn-border: #cfd9d0;
  --btn-fg: #314c3e;
  --btn-hover-border: #97b09c;
  --focus-ring: #63a767;
  --format-g1: #173e32;
  --format-g2: #28513c;
  --format-glow: #456949;
  --format-sub: #d4e6d4;
  --folder-bg: #8eae74;
  --folder-front1: #cfe4a6;
  --folder-front2: #99c28d;
  --folder-border: #d1e5b1;
  --tag-bg: #eaf4e9;
  --tag-border: #c7e2cd;
  --tag-fg: #2c6140;
  --warn-bg: #fcf1df;
  --warn-border: #ecd8b7;
  --warn-fg: #86601f;
  --bad-bg: #fae9e4;
  --bad-border: #e7c7bd;
  --bad-fg: #963a29;
  --notice-bg: #fff1ea;
  --notice-border: #eccbbf;
  --notice-fg: #883c29;
  --caution-bg: #fff6e8;
  --caution-border: #ebdabe;
  --caution-fg: #785320;
  --panel-bg: #f0f5ed;
  --panel-border: #dce6d8;
  --panel-fg: #344e3a;
  --strip-bg: #e9f2e7;
  --strip-border: #d4e1cf;
  --danger: #9c3436;
  --danger-bg: #fff9f8;
  --danger-border: #e4c1be;
  --danger-hover: #fdece9;
  --meter-bg: #e7ede5;
  --toast-bg: #193d2e;
  --toast-fg: #ffffff;
  --backdrop: #0c251d72;
  --shadow: 0 2px 7px #1e423308;
  --metric-i-bg: #edf1e9;
  --metric-i-fg: #496349;
  --metric-mint-bg: #e3f2e6;
  --metric-mint-fg: #3c7653;
  --metric-sand-bg: #f6eedc;
  --metric-sand-fg: #886b2a;
  --metric-blue-bg: #e6f0f4;
  --metric-blue-fg: #527287;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Hiragino Kaku Gothic ProN", "Noto Sans CJK SC", "Noto Sans CJK JP", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
}

/* ===== Theme: Sky Blue (晴空天蓝) ===== */
:root[data-theme="sky"] {
  --ink: #102638;
  --sub: #476278;
  --muted: #607a8f;
  --forest: #0284c7;
  --forest-hover: #0369a1;
  --deep: #0c3b5e;
  --acid: #bae6fd;
  --rail-fg: #e0f2fe;
  --rail-nav: #bae6fd;
  --rail-hover: #14507a;
  --rail-active-bg: #bae6fd;
  --rail-active-fg: #082f49;
  --rail-rule: #25648f;
  --rail-muted: #93c5fd;
  --brand-mark: #7dd3fc;
  --brand-sub: #bae6fd;
  --line: #d4e5f2;
  --line-soft: #e8f1f8;
  --bg: #eff6fc;
  --topbar-bg: #f8fbfe;
  --surface-soft: #f2f8fd;
  --surface-tint: #e0f2fe;
  --surface-hover: #e8f5fe;
  --input-bg: #fbfdff;
  --input-border: #bed9ec;
  --btn-border: #bfd9eb;
  --btn-fg: #15496b;
  --btn-hover-border: #7cbce6;
  --focus-ring: #38bdf8;
  --format-g1: #0c4a6e;
  --format-g2: #0284c7;
  --format-glow: #38bdf8;
  --format-sub: #e0f2fe;
  --folder-bg: #38bdf8;
  --folder-front1: #bae6fd;
  --folder-front2: #7dd3fc;
  --folder-border: #e0f2fe;
  --panel-bg: #edf6fd;
  --panel-border: #cde4f5;
  --panel-fg: #1a4766;
  --strip-bg: #e5f3fc;
  --strip-border: #c4e1f5;
  --meter-bg: #ddecf7;
  --toast-bg: #0c4a6e;
  --backdrop: #07223678;
  --shadow: 0 2px 8px #0c4a6e0a;
  --metric-i-bg: #e0f2fe;
  --metric-i-fg: #0369a1;
}

/* ===== Theme: Indigo (暮色靛紫) ===== */
:root[data-theme="indigo"] {
  --ink: #1d1e33;
  --sub: #555875;
  --muted: #6c708e;
  --forest: #4f46e5;
  --forest-hover: #3730a3;
  --deep: #1e1b4b;
  --acid: #c7d2fe;
  --rail-fg: #e0e7ff;
  --rail-nav: #c7d2fe;
  --rail-hover: #2e2a6b;
  --rail-active-bg: #c7d2fe;
  --rail-active-fg: #1e1b4b;
  --rail-rule: #433f87;
  --rail-muted: #a5b4fc;
  --brand-mark: #a5b4fc;
  --brand-sub: #c7d2fe;
  --line: #dedef0;
  --line-soft: #eeeef8;
  --bg: #f4f4fa;
  --topbar-bg: #fafafe;
  --surface-soft: #f5f5fc;
  --surface-tint: #e8e9ff;
  --surface-hover: #eef0ff;
  --input-bg: #fcfcff;
  --input-border: #cfcfe8;
  --btn-border: #d0d0e8;
  --btn-fg: #343075;
  --btn-hover-border: #9a96db;
  --focus-ring: #818cf8;
  --format-g1: #241f66;
  --format-g2: #4338ca;
  --format-glow: #818cf8;
  --format-sub: #e0e7ff;
  --folder-bg: #818cf8;
  --folder-front1: #c7d2fe;
  --folder-front2: #a5b4fc;
  --folder-border: #e0e7ff;
  --panel-bg: #f1f2fc;
  --panel-border: #d8daf5;
  --panel-fg: #312e6b;
  --strip-bg: #ecedf9;
  --strip-border: #d4d6f2;
  --meter-bg: #e4e5f5;
  --toast-bg: #262266;
  --backdrop: #15123878;
  --metric-i-bg: #e8e9ff;
  --metric-i-fg: #4338ca;
}

/* ===== Theme: Warm Amber (暖阳琥珀) ===== */
:root[data-theme="amber"] {
  --ink: #2c1e14;
  --sub: #6b5342;
  --muted: #826957;
  --forest: #b45309;
  --forest-hover: #92400e;
  --deep: #3b2314;
  --acid: #fde68a;
  --rail-fg: #fef3c7;
  --rail-nav: #f3d7a8;
  --rail-hover: #54321c;
  --rail-active-bg: #fde68a;
  --rail-active-fg: #3b2314;
  --rail-rule: #6e452b;
  --rail-muted: #d6b085;
  --brand-mark: #fcd34d;
  --brand-sub: #e8c796;
  --line: #e8ddd0;
  --line-soft: #f3ece2;
  --bg: #faf6f0;
  --topbar-bg: #fdfbf8;
  --surface-soft: #f8f2ea;
  --surface-tint: #fef3c7;
  --surface-hover: #fdf5e6;
  --input-bg: #fffdf9;
  --input-border: #decbb5;
  --btn-border: #decbb5;
  --btn-fg: #663814;
  --btn-hover-border: #c99a65;
  --focus-ring: #f59e0b;
  --format-g1: #4a2810;
  --format-g2: #92400e;
  --format-glow: #f59e0b;
  --format-sub: #fef3c7;
  --folder-bg: #d97706;
  --folder-front1: #fde68a;
  --folder-front2: #fbbf24;
  --folder-border: #fef3c7;
  --panel-bg: #fbf4ea;
  --panel-border: #ead9c3;
  --panel-fg: #5c3718;
  --strip-bg: #f8efe1;
  --strip-border: #e7d4ba;
  --meter-bg: #eee3d5;
  --toast-bg: #45240e;
  --backdrop: #29160a78;
  --metric-i-bg: #fef3c7;
  --metric-i-fg: #92400e;
}

/* ===== Theme: Sakura Rose (樱花绯红) ===== */
:root[data-theme="rose"] {
  --ink: #2e1823;
  --sub: #6b4b5b;
  --muted: #826272;
  --forest: #be185d;
  --forest-hover: #9d174d;
  --deep: #43142a;
  --acid: #fbcfe8;
  --rail-fg: #fce7f3;
  --rail-nav: #f5c2dc;
  --rail-hover: #5e1d3b;
  --rail-active-bg: #fbcfe8;
  --rail-active-fg: #43142a;
  --rail-rule: #782b4f;
  --rail-muted: #e599be;
  --brand-mark: #f9a8d4;
  --brand-sub: #f0b6d4;
  --line: #ebd8e1;
  --line-soft: #f5e9ef;
  --bg: #faf4f7;
  --topbar-bg: #fdf9fb;
  --surface-soft: #f9f0f4;
  --surface-tint: #fce7f3;
  --surface-hover: #fceef5;
  --input-bg: #fffbfd;
  --input-border: #e0c1d1;
  --btn-border: #e0c1d1;
  --btn-fg: #6b1d42;
  --btn-hover-border: #d186ab;
  --focus-ring: #f472b6;
  --format-g1: #500724;
  --format-g2: #9d174d;
  --format-glow: #ec4899;
  --format-sub: #fce7f3;
  --folder-bg: #ec4899;
  --folder-front1: #fbcfe8;
  --folder-front2: #f472b6;
  --folder-border: #fce7f3;
  --panel-bg: #fbf0f5;
  --panel-border: #ebd1df;
  --panel-fg: #5e1e3b;
  --strip-bg: #f8e9f0;
  --strip-border: #e8cad9;
  --meter-bg: #f0dfe7;
  --toast-bg: #4c112d;
  --backdrop: #2e0a1b78;
  --metric-i-bg: #fce7f3;
  --metric-i-fg: #9d174d;
}

/* ===== Dark Mode (黑夜模式) ===== */
:root[data-mode="dark"] {
  color-scheme: dark;
  --ink: #e8f0ec;
  --sub: #a8bbb1;
  --muted: #849a8f;
  --bg: #0d1412;
  --paper: #141e1b;
  --topbar-bg: #111a17;
  --surface-soft: #1a2622;
  --surface-tint: #1d332a;
  --surface-hover: #1e2d28;
  --line: #263630;
  --line-soft: #1d2b26;
  --input-bg: #0f1715;
  --input-border: #2c4039;
  --btn-bg: #182420;
  --btn-border: #2e433b;
  --btn-fg: #d6e8df;
  --btn-hover-border: #4d7062;
  --forest: #2e8b64;
  --forest-hover: #247251;
  --deep: #0b1210;
  --rail-hover: #192923;
  --rail-active-bg: #264d3c;
  --rail-active-fg: #e2f9ea;
  --rail-rule: #21342c;
  --tag-bg: #183629;
  --tag-border: #275943;
  --tag-fg: #9de5be;
  --warn-bg: #362912;
  --warn-border: #664d1d;
  --warn-fg: #f8d27d;
  --bad-bg: #3b1c1c;
  --bad-border: #703232;
  --bad-fg: #fca5a5;
  --notice-bg: #381b1a;
  --notice-border: #703532;
  --notice-fg: #ffb8b3;
  --caution-bg: #332714;
  --caution-border: #634b20;
  --caution-fg: #f7d78c;
  --panel-bg: #182521;
  --panel-border: #293d36;
  --panel-fg: #cfe2d8;
  --strip-bg: #162620;
  --strip-border: #284238;
  --danger: #f87171;
  --danger-bg: #33191a;
  --danger-border: #693033;
  --danger-hover: #472022;
  --meter-bg: #22302b;
  --toast-bg: #255440;
  --toast-fg: #f1fbf5;
  --backdrop: #020806b8;
  --shadow: 0 3px 12px #00000045;
  --metric-i-bg: #1d2d27;
  --metric-i-fg: #9ec9b3;
  --metric-mint-bg: #183326;
  --metric-mint-fg: #7de0a8;
  --metric-sand-bg: #332917;
  --metric-sand-fg: #f1c66e;
  --metric-blue-bg: #182c38;
  --metric-blue-fg: #7ec8f2;
}

:root[data-mode="dark"][data-theme="sky"] {
  --ink: #e6f2fc;
  --sub: #9ebad1;
  --muted: #7898b3;
  --bg: #09121c;
  --paper: #0f1d2c;
  --topbar-bg: #0c1824;
  --surface-soft: #142638;
  --surface-tint: #13314d;
  --surface-hover: #183047;
  --line: #1f364d;
  --line-soft: #172a3d;
  --input-bg: #0b1622;
  --input-border: #26435e;
  --btn-bg: #132536;
  --btn-border: #274461;
  --btn-fg: #d6ecfc;
  --btn-hover-border: #38bdf8;
  --forest: #0ea5e9;
  --forest-hover: #0284c7;
  --deep: #071019;
  --rail-hover: #12283d;
  --rail-active-bg: #154569;
  --rail-active-fg: #e0f4ff;
  --rail-rule: #1a354d;
  --panel-bg: #122436;
  --panel-border: #22405c;
  --panel-fg: #cde7fa;
  --strip-bg: #11273b;
  --strip-border: #214666;
  --meter-bg: #1b3145;
  --toast-bg: #0369a1;
  --format-g1: #0b2c47;
  --format-g2: #0369a1;
  --metric-i-bg: #13314a;
  --metric-i-fg: #7dd3fc;
}

:root[data-mode="dark"][data-theme="indigo"] {
  --ink: #ebecfa;
  --sub: #a8abd1;
  --muted: #8286ad;
  --bg: #0d0e1a;
  --paper: #151629;
  --topbar-bg: #111222;
  --surface-soft: #1c1e36;
  --surface-tint: #23254a;
  --surface-hover: #242647;
  --line: #2b2e52;
  --line-soft: #202240;
  --input-bg: #0f1020;
  --input-border: #343866;
  --btn-bg: #1b1d36;
  --btn-border: #353966;
  --btn-fg: #e0e2ff;
  --btn-hover-border: #818cf8;
  --forest: #6366f1;
  --forest-hover: #4f46e5;
  --deep: #090a14;
  --rail-hover: #1b1d38;
  --rail-active-bg: #312e81;
  --rail-active-fg: #e8ebff;
  --rail-rule: #26284d;
  --panel-bg: #191b33;
  --panel-border: #2d3057;
  --panel-fg: #d6d9fa;
  --strip-bg: #191c38;
  --strip-border: #2f3361;
  --meter-bg: #242747;
  --toast-bg: #4338ca;
  --metric-i-bg: #23254a;
  --metric-i-fg: #a5b4fc;
}

:root[data-mode="dark"][data-theme="amber"] {
  --ink: #f7efe6;
  --sub: #c4b09d;
  --muted: #9c8673;
  --bg: #16100b;
  --paper: #211811;
  --topbar-bg: #1b130d;
  --surface-soft: #2b1f16;
  --surface-tint: #3b2814;
  --surface-hover: #332419;
  --line: #3d2d20;
  --line-soft: #2e2218;
  --input-bg: #17110c;
  --input-border: #4d3929;
  --btn-bg: #291e16;
  --btn-border: #4d3929;
  --btn-fg: #f5e2ce;
  --btn-hover-border: #f59e0b;
  --forest: #d97706;
  --forest-hover: #b45309;
  --deep: #110b07;
  --rail-hover: #2b1d13;
  --rail-active-bg: #6b3b12;
  --rail-active-fg: #fef3c7;
  --rail-rule: #3d2a1c;
  --panel-bg: #261c14;
  --panel-border: #423022;
  --panel-fg: #edd8c2;
  --strip-bg: #2b1f14;
  --strip-border: #4a3420;
  --meter-bg: #36281d;
  --toast-bg: #92400e;
  --metric-i-bg: #3b2814;
  --metric-i-fg: #fcd34d;
}

:root[data-mode="dark"][data-theme="rose"] {
  --ink: #f8ebf2;
  --sub: #c7a6b6;
  --muted: #9c7c8d;
  --bg: #170d12;
  --paper: #23141c;
  --topbar-bg: #1c1016;
  --surface-soft: #2e1a25;
  --surface-tint: #401a2e;
  --surface-hover: #361e2b;
  --line: #422534;
  --line-soft: #331c28;
  --input-bg: #180e13;
  --input-border: #522e41;
  --btn-bg: #2b1822;
  --btn-border: #522e41;
  --btn-fg: #f7dce9;
  --btn-hover-border: #f472b6;
  --forest: #db2777;
  --forest-hover: #be185d;
  --deep: #11080d;
  --rail-hover: #2e1623;
  --rail-active-bg: #6e1842;
  --rail-active-fg: #fce7f3;
  --rail-rule: #422031;
  --panel-bg: #291720;
  --panel-border: #472838;
  --panel-fg: #f0d3e2;
  --strip-bg: #2e1824;
  --strip-border: #4f283d;
  --meter-bg: #3b212f;
  --toast-bg: #9d174d;
  --metric-i-bg: #401a2e;
  --metric-i-fg: #f9a8d4;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  transition: background-color 0.18s ease, color 0.18s ease;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: var(--forest);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
}
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--deep);
  color: var(--rail-fg);
  padding: 33px 17px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px 43px;
}
.brand-symbol {
  display: flex;
  align-items: center;
  height: 36px;
  width: 36px;
  gap: 3px;
  transform: skewY(-24deg);
}
.brand-symbol i {
  width: 9px;
  height: 23px;
  background: var(--brand-mark);
  border-radius: 1.5px;
}
.brand-symbol i:nth-child(2) {
  height: 33px;
}
.wordmark {
  font-size: 1.47rem;
  font-weight: 750;
  line-height: 1.13;
  letter-spacing: 0.07em;
  color: #f4f8f0;
}
.wordmark b {
  display: block;
  letter-spacing: 0.26em;
  margin-top: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand-sub);
}
.nav {
  border: 0;
  color: var(--rail-nav);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  width: 100%;
  padding: 11px 14px;
  font-size: 0.93rem;
  font-weight: 540;
  border-radius: 8px;
  margin-bottom: 5px;
  min-height: 45px;
}
.nav:hover {
  background: var(--rail-hover);
  color: #fff;
}
.nav.active {
  background: var(--rail-active-bg);
  color: var(--rail-active-fg);
  font-weight: 700;
}
.rail-rule {
  margin: 18px 12px;
  border-top: 1px solid var(--rail-rule);
}
.rail-disk {
  padding: 6px 12px 0;
  font-size: 0.73rem;
  color: var(--rail-muted);
}
.rail-foot {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--rail-rule);
  padding: 18px 9px 2px;
  font-size: 0.78rem;
  color: var(--rail-fg);
}
.rail-version {
  margin-left: auto;
  color: var(--rail-muted);
}
.light {
  width: 8px;
  height: 8px;
  background: #bda984;
  border-radius: 50%;
  display: inline-block;
}
.light.online {
  background: var(--brand-mark);
  box-shadow: 0 0 0 3px #ffffff18;
}
.frame {
  min-width: 0;
}
.topbar {
  padding: 0 clamp(20px, 3vw, 55px);
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.83rem;
}
.crumb,
.slash {
  color: var(--muted);
}
.slash {
  margin: 0 10px;
}
.platform {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font:
    600 0.78rem Arial,
    "Noto Sans CJK JP",
    sans-serif;
  color: var(--sub);
}
.flag {
  width: 21px;
  height: 15px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at center, #ba3145 0 3.5px, transparent 3.8px), #fff;
}

/* Appearance controls (theme popover, day/night button, language select) */
.ui-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-picker {
  position: relative;
}
.theme-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--forest);
  border: 1.5px solid #ffffff90;
  box-shadow: 0 0 0 1px var(--line);
  display: inline-block;
  flex-shrink: 0;
}
.theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 156px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px #00000028;
  padding: 6px;
  z-index: 40;
  display: grid;
  gap: 3px;
}
.theme-opt {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 550;
  text-align: left;
}
.theme-opt:hover {
  background: var(--surface-hover);
}
.theme-opt.active {
  background: var(--surface-tint);
  color: var(--forest);
  font-weight: 700;
}
.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid #00000022;
}
.lang-select {
  width: auto !important;
  min-height: 34px;
  padding: 4px 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  background: var(--btn-bg) !important;
  border-color: var(--btn-border) !important;
  color: var(--btn-fg) !important;
  border-radius: 7px !important;
  cursor: pointer;
}
.mode-btn .icon {
  width: 16px;
  height: 16px;
}

main {
  margin: 0 auto;
  max-width: 1510px;
  padding: clamp(23px, 2.6vw, 39px) clamp(22px, 3.3vw, 55px) 55px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.7rem, 2.45vw, 2.35rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.045em;
}
.page-heading p {
  color: var(--sub);
  font-size: 0.94rem;
  margin-top: 9px;
}
.btn,
.icon-btn,
.guide-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.35;
  font-weight: 600;
  font-size: 0.87rem;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 7px;
  padding: 9px 14px;
  min-height: 38px;
  white-space: nowrap;
}
.btn:hover:not(:disabled),
.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--btn-hover-border);
}
.btn.primary {
  background: var(--forest);
  border-color: var(--forest);
  color: #ffffff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--forest-hover);
  border-color: var(--forest-hover);
}
.btn:disabled {
  opacity: 0.45;
}
.btn.plain {
  border: 0;
  background: transparent;
  padding-left: 0;
  color: var(--sub);
}
.btn.danger {
  color: var(--danger);
}
.btn.danger-outline {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}
.btn.danger-outline:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger);
}
.btn.compact {
  padding: 6px 11px;
  min-height: 34px;
  font-size: 0.81rem;
}
.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  min-height: 0;
}
.icon {
  width: 19px;
  height: 19px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 17px;
}
.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.metric span {
  font-size: 0.81rem;
  color: var(--sub);
}
.metric strong {
  font-family: Arial, sans-serif;
  font-size: clamp(1.55rem, 2.15vw, 2.05rem);
  font-weight: 600;
  display: block;
  line-height: 1;
  margin-top: 9px;
  font-variant-numeric: tabular-nums;
}
.metric i,
.section-icon {
  border-radius: 9px;
  background: var(--metric-i-bg);
  color: var(--metric-i-fg);
}
.metric i {
  height: 34px;
  width: 34px;
}
.metric .mint {
  background: var(--metric-mint-bg);
  color: var(--metric-mint-fg);
}
.metric .sand {
  background: var(--metric-sand-bg);
  color: var(--metric-sand-fg);
}
.metric .blue {
  background: var(--metric-blue-bg);
  color: var(--metric-blue-fg);
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.intake {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(200px, 1fr);
  gap: 16px;
  margin-bottom: 19px;
}
.import-card {
  padding: 21px 23px 17px;
}
.card-head,
.list-heading,
.form-foot,
.list-foot,
.filters {
  display: flex;
  align-items: center;
}
.card-head {
  gap: 10px;
}
.card-head h2,
.format-card h2,
.guide h2,
.history h2 {
  font-size: 1.12rem;
  font-weight: 720;
  letter-spacing: -0.025em;
}
.section-icon {
  width: 31px;
  height: 31px;
  background: var(--surface-tint);
  color: var(--forest);
}
.switcher {
  display: inline-flex;
  padding: 3px;
  margin: 15px 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.seg,
.filter {
  border: 0;
  background: transparent;
  color: var(--sub);
  font-weight: 600;
  font-size: 0.83rem;
}
.seg {
  padding: 5px 14px;
  border-radius: 4px;
}
.seg.on {
  background: var(--paper);
  color: var(--forest);
  box-shadow: 0 1px 4px #00000020;
}
label {
  font-size: 0.87rem;
  font-weight: 600;
  display: block;
  color: var(--ink);
}
label small {
  font-weight: 400;
  font-size: 0.77rem;
  color: var(--muted);
  margin-left: 8px;
}
input:not([type="checkbox"]),
textarea,
select {
  width: 100%;
  font-size: 0.91rem;
  line-height: 1.5;
  color: var(--ink);
  border: 1px solid var(--input-border);
  border-radius: 7px;
  background: var(--input-bg);
  padding: 8px 10px;
}
label input:not([type="checkbox"]),
label textarea,
label select {
  margin-top: 5px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}
textarea {
  resize: vertical;
  min-height: 55px;
}
#links {
  margin-top: 7px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.84rem;
  min-height: 70px;
  display: block;
}
.form-foot {
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}
.hint {
  color: var(--sub);
  font-size: 0.84rem;
  line-height: 1.65;
  margin: 8px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.format-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 18px 23px;
  background:
    radial-gradient(ellipse at 92% 12%, var(--format-glow) 0, transparent 56%),
    linear-gradient(130deg, var(--format-g1), var(--format-g2));
  color: #f4f9f6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}
.format-card:after {
  content: "";
  position: absolute;
  right: -30px;
  top: -56px;
  width: 230px;
  height: 160px;
  background: repeating-linear-gradient(
    140deg,
    transparent 0 13px,
    #ffffff14 14px,
    transparent 15px
  );
  transform: rotate(-5deg);
  pointer-events: none;
}
.format-card h2 {
  margin-top: 10px;
  font-size: 1.14rem;
}
.format-card p {
  color: var(--format-sub);
  font-size: 0.86rem;
  line-height: 1.6;
  margin: 6px 0 13px;
}
.guide-link {
  position: relative;
  background: #ffffff14;
  border-color: #ffffff44;
  color: #ffffff;
  font-size: 0.8rem;
  padding: 5px 10px;
  min-height: 30px;
}
.guide-link:hover {
  background: #ffffff28;
  border-color: #ffffff77;
}
.guide-link .icon {
  width: 15px;
  height: 15px;
}
.bundle-art {
  width: 110px;
  height: 72px;
  position: relative;
  flex: 0 0 72px;
  margin: 0 0 0 2px;
  transform: rotate(-5deg);
  isolation: isolate;
}
.folder-back,
.folder-front {
  position: absolute;
  left: 9px;
  bottom: 0;
  width: 91px;
  background: var(--folder-bg);
  border: 1px solid var(--folder-border);
  border-radius: 4px;
  height: 48px;
}
.folder-back:before {
  content: "";
  position: absolute;
  left: -1px;
  bottom: 40px;
  width: 36px;
  height: 13px;
  background: var(--folder-bg);
  border-radius: 4px 4px 0 0;
  border: 1px solid var(--folder-border);
  border-bottom: 0;
}
.sheet {
  position: absolute;
  top: 5px;
  background: #ffffffeb;
  border: 1px solid var(--folder-border);
  border-radius: 3px;
  width: 38px;
  height: 50px;
  color: #2f453b;
  font:
    700 9px/1.3 ui-monospace,
    monospace;
  letter-spacing: 0.07em;
  padding: 5px;
}
.sheet.one {
  left: 24px;
  transform: rotate(-12deg);
}
.sheet.two {
  left: 58px;
  top: 2px;
  transform: rotate(12deg);
  background: var(--folder-front1);
}
.sheet i {
  display: block;
  width: 18px;
  height: 1px;
  background: #6a8277;
  margin-top: 4px;
}
.folder-front {
  background: linear-gradient(110deg, var(--folder-front1), var(--folder-front2));
  height: 35px;
  left: 12px;
  width: 90px;
  transform: skewX(-9deg);
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 2px;
  padding: 6px;
}
.folder-front b {
  background: #00000044;
  width: 2px;
  height: 8px;
}
.folder-front b:nth-child(2) {
  width: 4px;
}
.catalog-card {
  overflow: hidden;
}
.list-heading {
  padding: 18px 21px 13px;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.export-tools,
.doc-links,
.actions,
.pager {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.filters {
  padding: 0 21px;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: flex;
  align-items: stretch;
  gap: 16px;
}
.filter {
  padding: 13px 1px 10px;
  border-bottom: 2px solid transparent;
}
.filter.active {
  border-bottom-color: var(--forest);
  color: var(--forest);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  max-width: 220px;
  font-weight: 400;
}
.search-field .icon {
  width: 16px;
  height: 16px;
}
.search-field input {
  margin: 0;
  background: transparent;
  border: 0;
  font-size: 0.84rem;
  padding: 5px 0;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: 10px 8px;
  font-size: 0.76rem;
  color: var(--sub);
  background: var(--surface-soft);
  font-weight: 600;
  white-space: nowrap;
}
td {
  padding: 12px 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  vertical-align: middle;
}
.check {
  width: 40px;
  text-align: center;
}
input[type="checkbox"] {
  accent-color: var(--forest);
  width: 16px;
  height: 16px;
  vertical-align: middle;
  cursor: pointer;
}
td:last-child {
  padding-right: 16px;
}
.item-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}
.thumb {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 0 0 40px;
  object-fit: cover;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.item-title {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.89rem;
  font-weight: 650;
  color: var(--ink);
  max-width: 410px;
}
.item-title:hover,
.text-button:hover {
  text-decoration: underline;
}
.sku {
  display: block;
  color: var(--muted);
  font:
    0.73rem/1.45 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  margin-top: 2px;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--tag-border);
  border-radius: 15px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 0.75rem;
  white-space: nowrap;
}
.tag.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-fg);
}
.tag.bad {
  background: var(--bad-bg);
  color: var(--bad-fg);
  border-color: var(--bad-border);
}
.tag.demo {
  font-weight: 500;
  color: var(--sub);
  background: var(--surface-soft);
  border-color: var(--line);
  margin: 0 4px 0 0;
  padding: 0 4px;
  font-size: 0.68rem;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 650;
  white-space: nowrap;
  font-size: 0.84rem;
}
.text-button.danger {
  color: var(--danger);
}
.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
.empty > [data-icon] {
  border-radius: 12px;
  background: var(--surface-tint);
  padding: 10px;
  color: var(--forest);
}
.empty .icon {
  width: 23px;
  height: 23px;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  margin: 8px 0 5px;
}
.empty p,
.list-foot,
.pager {
  font-size: 0.8rem;
}
.list-foot {
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  border-top: 1px solid var(--line);
  padding: 9px 20px;
  color: var(--muted);
}
.pager button {
  border: 1px solid var(--line);
  background: var(--btn-bg);
  border-radius: 5px;
  padding: 3px 8px;
  color: var(--ink);
  font-size: 0.8rem;
}
.pager button:disabled {
  opacity: 0.4;
}
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.notice,
.feedback,
.job-strip,
.source-panel,
.caution {
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.86rem;
  line-height: 1.6;
}
.notice {
  margin-bottom: 12px;
  border: 1px solid var(--notice-border);
  background: var(--notice-bg);
  color: var(--notice-fg);
  white-space: pre-line;
}
.notice button {
  float: right;
}
.job-strip {
  background: var(--strip-bg);
  border: 1px solid var(--strip-border);
  margin: 0 0 15px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.job-strip .text-button {
  margin-left: auto;
}
.history,
.guide {
  padding: 23px;
}
.job-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.job-row .job-name {
  flex: 1;
}
.job-row strong {
  font-size: 0.94rem;
}
.job-row p,
.muted {
  font-size: 0.84rem;
  color: var(--sub);
  margin-top: 4px;
}
.history .pager {
  justify-content: flex-end;
  padding-top: 12px;
}
.guide {
  max-width: 920px;
}
.guide ol {
  padding-left: 25px;
  margin: 18px 0 24px;
}
.guide li {
  padding: 0 0 14px 4px;
}
.guide li::marker {
  color: var(--forest);
  font-weight: 720;
}
.guide p,
.source-panel,
.feedback,
.caution,
.guide li {
  line-height: 1.7;
}
.guide p {
  font-size: 0.93rem;
  color: var(--sub);
  margin: 4px 0 9px;
}
.guide h3 {
  font-size: 1.03rem;
}
.doc-links {
  margin-top: 15px;
  font-size: 0.85rem;
  gap: 14px;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0;
  border-radius: 13px;
  width: min(770px, calc(100% - 26px));
  max-height: 89dvh;
  box-shadow: 0 22px 75px #00000055;
  background: var(--paper);
}
dialog::backdrop {
  background: var(--backdrop);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 21px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 2;
}
.dialog-header h2 {
  font-size: 1.13rem;
}
.dialog-header .icon-btn {
  border: 0;
}
.dialog-header + .notice {
  margin: 10px 18px;
}
#dialog-body {
  padding: 18px 21px 21px;
}
.source-panel,
.feedback {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--panel-fg);
  margin-bottom: 13px;
}
.source-panel a {
  font-weight: 600;
  float: right;
}
.caution {
  background: var(--caution-bg);
  border: 1px solid var(--caution-border);
  color: var(--caution-fg);
  margin: 10px 0;
  white-space: pre-line;
}
.editor label {
  display: block;
  margin-bottom: 11px;
}
.editor textarea {
  min-height: 72px;
}
.editor details {
  margin: 6px 0 13px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.editor details[open] summary {
  margin-bottom: 13px;
}
summary {
  cursor: pointer;
  font-size: 0.89rem;
  font-weight: 650;
}
.actions {
  justify-content: flex-end;
  margin-top: 16px;
}
.actions .left {
  margin-right: auto;
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 9px 0;
}
.gallery a,
.gallery .missing {
  width: 79px;
  color: var(--sub);
  font-size: 0.72rem;
  text-align: center;
  text-decoration: none;
}
.gallery img,
.gallery .missing span {
  display: block;
  width: 77px;
  height: 72px;
  object-fit: contain;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.gallery .missing span {
  display: grid;
  place-items: center;
  color: var(--warn-fg);
}
.job-detail,
.hit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.job-detail > div,
.hit > div {
  min-width: 0;
  flex: 1;
}
.job-detail p {
  word-break: break-all;
  font-size: 0.8rem;
  color: var(--sub);
}
.job-detail .tag {
  margin-top: 2px;
}
.hit label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
  line-height: 1.55;
}
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--toast-fg);
  background: var(--toast-bg);
  padding: 10px 17px;
  border-radius: 8px;
  box-shadow: 0 6px 20px #00000038;
  max-width: 90vw;
  z-index: 50;
  font-size: 0.9rem;
}
.skip,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus {
  z-index: 20;
  width: auto;
  height: auto;
  clip-path: none;
  background: var(--paper);
  color: var(--ink);
  padding: 8px;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: var(--bg);
}
.login-wrap {
  width: min(100%, 430px);
  display: grid;
  gap: 12px;
}
.login-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.login-card {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 50px #00000018;
}
.login-brand {
  padding: 23px 30px;
  background: var(--deep);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 23px;
  font-weight: 700;
}
.login-brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--brand-sub);
}
.login-body {
  padding: 28px 30px 32px;
}
.login-body h1 {
  font-size: 24px;
  margin: 0 0 6px;
}
.login-body > p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--sub);
  margin: 0 0 20px;
}
#sign-in {
  display: grid;
  gap: 8px;
}
#sign-in input {
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
}
#sign-in button {
  margin-top: 8px;
  justify-content: center;
}
#sign-in .notice {
  margin: 4px 0;
}
.account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.account-bar button {
  white-space: nowrap;
}
.heading-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.export-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stock-lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.editor .stock-line {
  display: grid;
  grid-template-columns: 1fr 84px;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow-wrap: anywhere;
}
.stock-line small {
  display: block;
  font-weight: 400;
  color: var(--sub);
}
.choice-line {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr auto auto;
  align-items: end;
  gap: 7px;
  margin: 8px 0;
}
.choice-line label {
  min-width: 0;
}
.choice-line input:not([type="checkbox"]) {
  min-width: 0;
  width: 100%;
}
.editor .choice-disabled {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 4px;
}
.choice-disabled input {
  width: auto;
}

/* v1.2 & v1.3 additions */
.cat-options {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.cat-both {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-weight: 500;
  font-size: 0.84rem;
  color: var(--sub);
  cursor: pointer;
}
.inline-check input {
  margin: 0;
}
.form-foot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.preview-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hit-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex: 0 0 44px;
  background: var(--surface-soft);
}
.bulk-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.bulk-section h3 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--forest);
}
.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.filter-select {
  width: auto !important;
  min-width: 120px;
  max-width: 190px;
  font-size: 0.81rem !important;
  padding: 5px 8px !important;
  background: var(--surface-soft) !important;
}
.selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.selection-bar .text-button {
  font-size: 0.78rem;
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sys-section {
  display: grid;
  gap: 16px;
}
.sys-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.sys-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sys-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--sub);
}
.sys-card strong {
  font-family: Arial, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.sys-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.meter {
  width: 100%;
  height: 7px;
  background: var(--meter-bg);
  border-radius: 99px;
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  background: var(--forest);
  border-radius: 99px;
  transition: width 0.25s ease;
}
.meter > i.warn {
  background: #d99429;
}
.meter > i.bad {
  background: #d14b3f;
}
.storage-card {
  padding: 21px 23px;
}
.storage-rows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 18px;
}
.storage-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
}
.storage-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--sub);
}
.storage-item strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.storage-item small {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--muted);
}
.maint-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 174px minmax(0, 1fr);
  }
  .rail {
    padding-left: 10px;
    padding-right: 10px;
  }
  .intake {
    grid-template-columns: minmax(0, 1.9fr) minmax(190px, 1fr);
  }
  main {
    padding-left: 22px;
    padding-right: 22px;
  }
  .metric {
    padding: 13px;
  }
  .store-col {
    display: none;
  }
  .format-card {
    padding: 19px;
  }
  .sys-grid,
  .storage-rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-bar .platform {
    display: none;
  }
}
@media (max-width: 780px) {
  .shell {
    display: block;
  }
  .rail {
    position: static;
    flex-direction: row;
    align-items: center;
    height: auto;
    padding: 8px 14px;
    gap: 12px;
    display: flex;
    overflow-x: auto;
  }
  .brand {
    padding: 0;
    gap: 5px;
  }
  .brand-symbol {
    width: 23px;
    gap: 2px;
    transform: scale(0.8) skewY(-24deg);
  }
  .wordmark {
    font-size: 1rem;
    white-space: nowrap;
  }
  .wordmark b {
    display: none;
  }
  .rail nav {
    display: flex;
    gap: 3px;
  }
  .rail-rule,
  .rail-disk,
  .rail-foot,
  .nav [data-icon] {
    display: none;
  }
  .nav {
    width: auto;
    white-space: nowrap;
    margin: 0;
    padding: 7px 9px;
    min-height: 34px;
    font-size: 0.81rem;
  }
  .topbar {
    min-height: 48px;
    padding: 6px 14px;
    flex-wrap: wrap;
  }
  main {
    padding: 20px 14px 42px;
  }
  .intake {
    grid-template-columns: minmax(0, 2fr) minmax(170px, 1fr);
    gap: 10px;
  }
  .import-card {
    padding: 16px;
  }
  .stats {
    gap: 7px;
  }
  .metric {
    padding: 12px;
    position: relative;
  }
  .metric i {
    width: 25px;
    height: 25px;
  }
  .metric i .icon {
    width: 15px;
    height: 15px;
  }
  .page-heading {
    margin-bottom: 16px;
  }
  .catalog-card .list-heading {
    padding: 14px;
  }
  .filters {
    padding: 0 14px;
  }
  .metric strong {
    font-size: 1.55rem;
  }
  .format-card {
    padding: 14px;
  }
  .stats {
    margin-bottom: 12px;
  }
  .tabs {
    gap: 9px;
  }
}
@media (max-width: 640px) {
  .choice-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }
  .heading-tools,
  .export-tools {
    justify-content: flex-start;
  }
  .account-bar {
    gap: 5px;
  }
  .stock-lines {
    grid-template-columns: 1fr;
  }
  .theme-label,
  .mode-label {
    display: none;
  }
}
@media (max-width: 590px) {
  .rail {
    gap: 7px;
    padding: 7px 8px;
  }
  .nav {
    font-size: 0.77rem;
    padding: 6px 7px;
  }
  .topbar {
    font-size: 0.75rem;
  }
  .page-heading {
    align-items: flex-start;
    gap: 6px;
  }
  .page-heading p {
    font-size: 0.84rem;
    line-height: 1.5;
  }
  .light-btn {
    font-size: 0.75rem;
    padding: 5px 9px;
    min-height: 32px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    padding: 10px 13px;
  }
  .metric strong {
    margin-top: 5px;
  }
  .metric i {
    width: 29px;
    height: 29px;
  }
  .intake {
    display: block;
  }
  .format-card {
    display: none;
  }
  .filters {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 0;
  }
  .search-field {
    width: 100%;
    max-width: none;
    background: var(--surface-soft);
    border-radius: 6px;
    padding: 2px 7px;
  }
  .check {
    width: 29px;
  }
  .thumb {
    display: none;
  }
  .item-cell {
    min-width: 128px;
  }
  .item-title {
    font-size: 0.8rem;
  }
  .table-wrap table {
    min-width: 480px;
  }
  td,
  th {
    padding: 9px 5px;
  }
  .list-heading {
    align-items: flex-start;
  }
  .export-tools .btn {
    padding: 5px 7px;
    min-height: 29px;
    font-size: 0.75rem;
  }
  .export-tools .icon {
    width: 14px;
    height: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .form-grid.tight {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  label small {
    display: block;
    margin: 1px 0;
  }
  .guide,
  .history,
  #dialog-body {
    padding: 15px;
  }
  .job-row {
    gap: 6px;
  }
  .bundle-art {
    display: none;
  }
  .job-strip {
    flex-wrap: wrap;
  }
  .source-panel a {
    float: none;
    margin-left: 6px;
  }
  .dialog-header {
    padding: 12px 15px;
  }
  .history .job-row {
    flex-wrap: wrap;
  }
  .editor .actions {
    flex-wrap: wrap;
  }
  .cat-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sys-grid,
  .storage-rows {
    grid-template-columns: 1fr;
  }
  .filter-controls {
    width: 100%;
  }
  .filter-select {
    flex: 1 1 45%;
    max-width: none;
  }
}
