:root {

  --c-0:  #ffffff;
  --c-25: #fcfcfc;
  --c-50: #f7f7f8;
  --c-100:#f1f1f2;
  --c-150:#e9e9eb;
  --c-200:#e0e0e2;
  --c-300:#c9c9cd;
  --c-400:#a1a1a6;
  --c-500:#76767c;
  --c-600:#55555a;
  --c-700:#3a3a3e;
  --c-900:#18181b;

  --bg:         var(--c-50);
  --surface:    var(--c-0);
  --line:       var(--c-150);
  --line-soft:  var(--c-100);
  --text:       var(--c-900);
  --text-2:     var(--c-600);
  --text-3:     var(--c-400);
  --hover:      rgba(24,24,27,.04);
  --active:     rgba(24,24,27,.07);

  --shadow-sm: 0 1px 2px rgba(24,24,27,.04);
  --shadow-md: 0 4px 16px rgba(24,24,27,.06);
  --shadow-lg: 0 10px 34px rgba(24,24,27,.10);

  --surface-blur: rgba(255,255,255,.72);
  --on-accent-dim: rgba(255,255,255,.7);
  --scrim: rgba(24,24,27,.22);
  --ring: rgba(24,24,27,.07);

  --accent-from:  var(--c-900);
  --accent-to:    var(--c-900);
  --accent-hover-from: var(--c-700);
  --accent-hover-to:   var(--c-700);
  --accent-ink:   var(--c-0);
  --accent-solid: var(--c-900);
  --accent-grad:       linear-gradient(135deg, var(--accent-from), var(--accent-to));
  --accent-grad-hover: linear-gradient(135deg, var(--accent-hover-from), var(--accent-hover-to));

  --bg-layer: none;
  --bg-size: auto;

  --sidebar-w: 236px;
  --topbar-h:  58px;

  --r-sm: 8px;
  --r:    10px;
  --r-lg: 14px;

  --ios:    cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.42, .48, 1);
  --snap:   cubic-bezier(.4, 0, .2, 1);
  --decel:  cubic-bezier(.16, 1, .3, 1);

  --t-fast: .16s;
  --t-med:  .28s;
  --t-slow: .46s;
  --t-page: .52s;
}

:root[data-theme="dark"] {
  --c-0:  #141417;
  --c-25: #1a1a1e;
  --c-50: #0e0e10;
  --c-100:#202026;
  --c-150:#2b2b32;
  --c-200:#35353d;
  --c-300:#474751;
  --c-400:#7d7d88;
  --c-500:#9b9ba5;
  --c-600:#b6b6bf;
  --c-700:#d6d6dc;
  --c-900:#f3f3f5;

  --hover:  rgba(255,255,255,.055);
  --active: rgba(255,255,255,.09);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 10px 34px rgba(0,0,0,.55);

  --surface-blur: rgba(20,20,23,.72);
  --on-accent-dim: rgba(0,0,0,.6);
  --scrim: rgba(0,0,0,.5);
  --ring: rgba(255,255,255,.09);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --c-0:  #141417;
    --c-25: #1a1a1e;
    --c-50: #0e0e10;
    --c-100:#202026;
    --c-150:#2b2b32;
    --c-200:#35353d;
    --c-300:#474751;
    --c-400:#7d7d88;
    --c-500:#9b9ba5;
    --c-600:#b6b6bf;
    --c-700:#d6d6dc;
    --c-900:#f3f3f5;

    --hover:  rgba(255,255,255,.055);
    --active: rgba(255,255,255,.09);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.45);
    --shadow-lg: 0 10px 34px rgba(0,0,0,.55);

    --surface-blur: rgba(20,20,23,.72);
    --on-accent-dim: rgba(0,0,0,.6);
    --scrim: rgba(0,0,0,.5);
    --ring: rgba(255,255,255,.09);

    color-scheme: dark;
  }
}

:root[data-density="compact"] {
  --topbar-h: 50px;
  --pad-page: 14px;
  --pad-card: 13px;
  --pad-row: 9px;
}
:root { --pad-page: 24px; --pad-card: 18px; --pad-row: 13px; }

:root[data-radius="sharp"] { --r-sm: 3px; --r: 4px; --r-lg: 5px; }
:root[data-radius="soft"] { --r-sm: 12px; --r: 16px; --r-lg: 22px; }

:root[data-scale="sm"] { font-size: 14px; }
:root[data-scale="lg"] { font-size: 16px; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: Inter, "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.011em;
  background: var(--bg);
  background-image: var(--bg-layer);
  background-size: var(--bg-size);
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
::selection { background: var(--c-900); color: var(--c-0); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-200); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--c-300); background-clip: padding-box; }

.pressable {
  transition: transform var(--t-slow) var(--spring);
  -webkit-tap-highlight-color: transparent;
}
.pressable:active { transform: scale(.965); transition: transform .09s var(--snap); }
.pressable-sm:active { transform: scale(.94); }
.pressable-lg:active { transform: scale(.985); }
.ico {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-lg { width: 20px; height: 20px; }

.app { display: flex; height: 100vh; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  transition:
    border-color var(--t-med) var(--ios),
    box-shadow   var(--t-slow) var(--ios),
    transform    var(--t-slow) var(--ios);
}
.card-head {
  padding: calc(var(--pad-card) - 3px) var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h3 { font-size: .875rem; font-weight: 600; letter-spacing: -.015em; }
.card-head p { font-size: .76rem; color: var(--text-3); margin-top: 2px; }
.card-body { padding: var(--pad-card); }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.logo { display: flex; align-items: center; gap: 9px; min-width: 0; }
.logo-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.logo-mark .ico { width: 15px; height: 15px; stroke-width: 1.8; }

.logo-mark .logo-ico { width: 19px; height: 19px; stroke-width: 3.6; }
.logo-text {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
  overflow-y: auto;
}
.nav-indicator {
  position: absolute;
  left: 10px; right: 10px;
  top: 0;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--active);
  z-index: 0;
  transition:
    transform var(--t-slow) var(--ios),
    opacity   var(--t-med)  var(--ios);
  will-change: transform;
}
.nav-indicator.idle { opacity: 0; }
.nav-label {
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: 10px 10px 6px;
  position: relative;
  z-index: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: .865rem;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition:
    color var(--t-med) var(--ios),
    background var(--t-med) var(--ios),
    transform var(--t-slow) var(--spring);
}
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.active { color: var(--text); font-weight: 550; background: transparent; }
.nav-item.active:hover { background: transparent; }
.nav-item:active { transform: scale(.97); transition: transform .09s var(--snap); }
.nav-item .ico { transition: transform var(--t-slow) var(--spring); }
.nav-item.active .ico { transform: scale(1.08); }
.nav-count {
  margin-left: auto;
  font-size: .7rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sidebar-footer { padding: 10px; border-top: 1px solid var(--line-soft); }
.bot-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t-med) var(--ios);
}
.bot-status:hover { background: var(--hover); }
.bot-status-name { font-size: .8rem; font-weight: 500; }
.bot-status-sub { font-size: .7rem; color: var(--text-3); }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-solid);
  flex-shrink: 0;
  position: relative;
}
.dot.off { background: var(--c-300); }
.dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--c-900);
  opacity: 0;
  animation: ring 2.4s var(--decel) infinite;
}
.dot.off::after { animation: none; }
@keyframes ring {
  0%   { opacity: .4; transform: scale(.6); }
  70%  { opacity: 0;  transform: scale(1.5); }
  100% { opacity: 0;  transform: scale(1.5); }
}

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top-bar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-blur);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  z-index: 50;
  transition:
    border-color var(--t-med) var(--ios),
    box-shadow   var(--t-med) var(--ios);
}
.top-bar.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 10px var(--ring);
}
.menu-toggle {
  display: none;
  width: 32px; height: 32px;
  border: none; background: none;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  place-items: center;
  transition: background var(--t-fast) var(--ios);
}
.menu-toggle:hover { background: var(--hover); }
.top-bar-title { flex: 1; min-width: 0; }
.top-bar-title h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
  will-change: transform, opacity;
  transition: opacity var(--t-med) var(--ios);
}
.top-bar-title h1.out-up { animation: title-out-up   .2s var(--snap) both; }
.top-bar-title h1.out-down { animation: title-out-down .2s var(--snap) both; }
.top-bar-title h1.in-up { animation: title-in-up    .42s var(--ios) both; }
.top-bar-title h1.in-down { animation: title-in-down  .42s var(--ios) both; }
@keyframes title-out-up { to { opacity: 0; transform: translateY(-9px); } }
@keyframes title-out-down { to { opacity: 0; transform: translateY(9px); } }
@keyframes title-in-up { from { opacity: 0; transform: translateY(9px); } }
@keyframes title-in-down { from { opacity: 0; transform: translateY(-9px); } }
.top-bar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px;
  border: none; background: none;
  border-radius: var(--r-sm);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition:
    background var(--t-fast) var(--ios),
    color var(--t-fast) var(--ios),
    transform var(--t-slow) var(--spring);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.role-chip {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--c-100);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 11px;
  white-space: nowrap;
}
.role-chip.dev { background: var(--c-900); color: var(--c-0); border-color: var(--c-900); }

.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  touch-action: pan-y;
}
.page-track { position: relative; min-height: 100%; }
.page { display: none; padding: 20px var(--pad-page) 32px; max-width: 1320px; }
.page.active { display: block; }
.page.peek {
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
}
body.swiping { user-select: none; -webkit-user-select: none; }
body.swiping .page { pointer-events: none; }
.page.enter-fwd  > * { animation: sec-in-fwd  var(--t-page) var(--ios) both; }
.page.enter-back > * { animation: sec-in-back var(--t-page) var(--ios) both; }
@keyframes sec-in-fwd {
  from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes sec-in-back {
  from { opacity: 0; transform: translate3d(0, -18px, 0) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.page > *:nth-child(1) { animation-delay: .02s; }
.page > *:nth-child(2) { animation-delay: .07s; }
.page > *:nth-child(3) { animation-delay: .12s; }
.page > *:nth-child(4) { animation-delay: .17s; }
.page.leaving {
  animation: sec-out .2s var(--snap) both;
  pointer-events: none;
}
@keyframes sec-out {
  to { opacity: 0; transform: translate3d(0, -10px, 0) scale(.99); }
}
.page.entering .stat-card { animation: tile-in .5s var(--ios) both; }
.stat-card:nth-child(1) { animation-delay: .06s; }
.stat-card:nth-child(2) { animation-delay: .10s; }
.stat-card:nth-child(3) { animation-delay: .14s; }
.stat-card:nth-child(4) { animation-delay: .18s; }
@keyframes tile-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.97); }
}
.page-intro {
  font-size: .78rem;
  color: var(--text-3);
  margin: -4px 0 14px;
  line-height: 1.5;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.stat-card { padding: 16px 18px; margin-bottom: 0; }
.stat-card:hover {
  border-color: var(--c-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-3);
  margin-bottom: 12px;
}
.stat-head .ico { transition: transform var(--t-slow) var(--spring); }
.stat-card:hover .stat-head .ico { transform: scale(1.12) rotate(-4deg); }
.stat-label { font-size: .76rem; font-weight: 500; color: var(--text-2); }
.stat-num {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-num .unit { font-size: .9rem; font-weight: 500; color: var(--text-3); margin-right: 2px; }
.stat-delta { font-size: .72rem; color: var(--text-3); margin-top: 6px; }
.stat-delta b { color: var(--text-2); font-weight: 550; }

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
  flex-wrap: wrap;
}
.filter-row h2 { font-size: .82rem; font-weight: 600; }
.filter-row .filter-controls { display: flex; align-items: center; gap: 8px; }
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
}
.chart-card { padding: 18px; }
.chart-card .chart-title { font-size: .82rem; font-weight: 600; }
.chart-card .chart-sub {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.chart-plot {
  position: relative;
  margin-top: 14px;
  height: 200px;
}
.chart-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }

.ch-line {
  fill: none;
  stroke: var(--accent-solid);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ch-area { fill: var(--accent-solid); opacity: .10; }

.ch-dot { fill: var(--accent-solid); stroke: var(--surface); stroke-width: 2; }

.ch-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ch-axis-text {
  font-size: 10px;
  fill: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ch-end-label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text);

  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.ch-crosshair { stroke: var(--c-300); stroke-width: 1; shape-rendering: crispEdges; }
.ch-hit { fill: transparent; cursor: pointer; outline: none; }

.chart-plot.animate .ch-line {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: draw .9s var(--ios) forwards;
}
.chart-plot.animate .ch-area, .chart-plot.animate .ch-dot, .chart-plot.animate .ch-end-label { animation: fade-in .5s var(--ios) .45s both; }
.chart-plot.animate .ch-bar {
  transform-origin: center bottom;
  animation: grow .6s var(--ios) both;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes grow { from { transform: scaleY(0); } }
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--c-900);
  color: var(--c-0);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: .75rem;
  line-height: 1.45;
  white-space: nowrap;
  left: 0;
  top: 0;
  opacity: 0;
  transition:
    transform .2s var(--ios),
    opacity .16s var(--ios);
  will-change: transform;
  box-shadow: var(--shadow-lg);
}
.chart-tip.show { opacity: 1; }

.chart-tip .tip-value { font-weight: 600; font-size: .85rem; }
.chart-tip .tip-label { color: var(--on-accent-dim); font-size: .7rem; }

.table-view[hidden] { display: none; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.field { min-width: 0; }
.field label {
  display: block;
  font-size: .735rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}
.field small {
  display: block;
  font-size: .7rem;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.4;
}
.field.wide { grid-column: 1 / -1; }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  font-size: .83rem;
  color: var(--text);
  outline: none;
  transition:
    border-color var(--t-med) var(--ios),
    box-shadow   var(--t-med) var(--ios);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-200); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-400);
  box-shadow: 0 0 0 3.5px var(--c-100);
}
.select { cursor: pointer; }
.textarea { resize: vertical; min-height: 78px; line-height: 1.5; font-family: inherit; }
.input.mono, .textarea.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--c-25);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.add-row {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--c-25);
}

.btn {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    background var(--t-med) var(--ios),
    border-color var(--t-med) var(--ios),
    color var(--t-med) var(--ios),
    transform var(--t-slow) var(--spring);
}
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: var(--c-50); border-color: var(--c-200); color: var(--text); }
.btn-primary { background: var(--accent-grad); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-grad-hover); }
.btn-sm { height: 28px; padding: 0 11px; font-size: .765rem; }
.btn-danger { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn-danger:hover { background: var(--c-900); border-color: var(--c-900); color: var(--c-0); }
.btn-label { display: inline-block; transition: transform var(--t-med) var(--ios), opacity var(--t-med) var(--ios); }
@keyframes label-in { from { transform: translateY(120%); opacity: 0; } }
.inline-form { display: inline; margin: 0; }

.table-wrap { overflow-x: auto; }
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
table.table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--c-25);
}
table.table td {
  padding: var(--pad-row) var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.table tbody tr { transition: background var(--t-fast) var(--ios); }
table.table tbody tr:hover { background: var(--c-25); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.table td.id, table.table td.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78rem;
  color: var(--text-2);
  white-space: nowrap;
}
table.table td.actions { text-align: right; white-space: nowrap; }
table.table td.strong { font-weight: 550; }
.page.entering table.table tbody tr { animation: row-in .46s var(--ios) both; }
table.table tbody tr:nth-child(1) { animation-delay: .10s; }
table.table tbody tr:nth-child(2) { animation-delay: .13s; }
table.table tbody tr:nth-child(3) { animation-delay: .16s; }
table.table tbody tr:nth-child(4) { animation-delay: .19s; }
table.table tbody tr:nth-child(5) { animation-delay: .22s; }
table.table tbody tr:nth-child(6) { animation-delay: .25s; }
table.table tbody tr:nth-child(n+7) { animation-delay: .28s; }
@keyframes row-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
.empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--text-3);
  font-size: .82rem;
}

tr.filtering {
  transition: opacity .22s var(--snap), transform .22s var(--snap);
}
tr.hidden { display: none; }

.badge {
  display: inline-block;
  font-size: .71rem;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.solid { background: var(--accent-grad); color: var(--accent-ink); }
.badge.soft { background: var(--c-100); color: var(--text-2); border-color: var(--line); }
.badge.outline { background: transparent;  color: var(--text-3); border-color: var(--line); }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78em;
  background: var(--c-100);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--text-2);
}
.link {
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--c-300);
  padding-bottom: 1px;
  transition: border-color var(--t-fast) var(--ios);
}
.link:hover { border-color: var(--c-900); }

.seg {
  display: flex;
  gap: 2px;
  background: var(--c-100);
  padding: 2px;
  border-radius: var(--r-sm);
  position: relative;
  flex-shrink: 0;
}
.seg-thumb {
  position: absolute;
  top: 2px; left: 0;
  height: calc(100% - 4px);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 1px 3px var(--ring);
  z-index: 0;
  transition:
    transform var(--t-slow) var(--ios),
    width     var(--t-slow) var(--ios),
    opacity   var(--t-fast) var(--ios);
  will-change: transform, width;
}
.seg-thumb.idle { opacity: 0; }
.seg.pressing .seg-thumb { transform: scale(.94); transition: transform .12s var(--snap); }
.seg button {
  padding: 4px 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: .74rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--t-med) var(--ios);
}
.seg button:hover { color: var(--text); }
.seg button.active { color: var(--text); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 120%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--c-900);
  color: var(--c-0);
  font-size: .82rem;
  padding: 11px 18px;
  border-radius: 99px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition:
    transform var(--t-slow) var(--spring),
    opacity   var(--t-med)  var(--ios);
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .ico { width: 15px; height: 15px; }

body.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}

body.login-page::before {
  content: '';
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(42% 38% at 22% 18%, var(--accent-from) 0%, transparent 62%),
    radial-gradient(38% 34% at 78% 82%, var(--accent-to) 0%, transparent 60%);
  opacity: .1;
  animation: login-drift 26s ease-in-out infinite alternate;
}
@keyframes login-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
.login-page-inner {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-lg);
  animation: login-in .62s var(--ios) both;
  transition:
    opacity .34s var(--ios),
    transform .34s var(--ios),
    filter .34s var(--ios);
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
}

.login-card.leaving {
  opacity: 0;
  transform: translateY(-10px) scale(.985);
  filter: blur(2px);
}

.login-head, .login-card .field, .login-remember, .login-submit, .login-note, .login-foot {
  animation: login-rise .5s var(--ios) both;
}
.login-head { animation-delay: .06s; }
.login-card .field:nth-of-type(1) { animation-delay: .14s; }
.login-card .field:nth-of-type(2) { animation-delay: .20s; }
.login-remember { animation-delay: .26s; }
.login-submit { animation-delay: .32s; }
.login-note { animation-delay: .40s; }
.login-foot { animation-delay: .46s; }
@keyframes login-rise {
  from { opacity: 0; transform: translateY(9px); }
}

.login-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.login-logo {
  flex-shrink: 0;
  width: 44px; height: 44px;
  color: var(--text);
  overflow: visible;
}
.login-logo path, .login-logo circle {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: logo-draw .52s var(--decel) both;
}

.login-logo > g > :nth-child(1) { animation-delay: .18s; }
.login-logo > g > :nth-child(2) { animation-delay: .30s; }
.login-logo > g > :nth-child(3) { animation-delay: .46s; }
.login-logo > g > :nth-child(4) { animation-delay: .53s; }
.login-logo > g > :nth-child(5) { animation-delay: .60s; }
.login-logo > g > :nth-child(6) { animation-delay: .66s; }
.login-logo > g > :nth-child(7) { animation-delay: .74s; }
.login-logo > g > :nth-child(8) { animation-delay: .80s; }
.login-logo > g > :nth-child(9) { animation-delay: .86s; }
.login-logo > g > :nth-child(10) { animation-delay: .94s; }
.login-logo > g > :nth-child(11) { animation-delay: 1s; }
@keyframes logo-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
.login-title h1 {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.login-title .sub {
  font-size: .76rem;
  color: var(--text-3);
  margin-top: 2px;
}
.login-card .field { margin-bottom: 14px; }

.input-icon { position: relative; }
.input-icon > .ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
  transition: color var(--t-med) var(--ios);
}
.input-icon .input { padding-left: 34px; }
.input-icon:focus-within > .ico { color: var(--text); }
.peek {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ios), color var(--t-fast) var(--ios);
}
.peek:hover { background: var(--hover); color: var(--text); }
.peek:active { transform: translateY(-50%) scale(.9); }
.peek .ico { width: 16px; height: 16px; }
.input-icon:has(.peek) .input { padding-right: 38px; }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
  font-size: .78rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  width: 15px; height: 15px;
  accent-color: var(--accent-solid);
  cursor: pointer;
}

.login-submit {
  position: relative;
  width: 100%;
  margin-top: 14px;
  overflow: hidden;
}
.login-submit-text, .login-submit-arrow {
  transition: transform var(--t-slow) var(--ios), opacity var(--t-med) var(--ios);
}
.login-submit-arrow {
  width: 15px; height: 15px;
  margin-left: -4px;
  opacity: 0;
  transform: translateX(-6px);
}
.login-submit:hover .login-submit-text { transform: translateX(-5px); }
.login-submit:hover .login-submit-arrow { opacity: 1; transform: translateX(0); }

.login-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 38%, rgba(255,255,255,.22) 50%, transparent 62%);
  transform: translateX(-100%);
  pointer-events: none;
}
.login-submit:hover::after { animation: login-sheen .75s var(--ios); }
@keyframes login-sheen {
  to { transform: translateX(100%); }
}
.login-spinner {
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0;
  animation: login-spin .62s linear infinite;
}
.login-submit.loading { pointer-events: none; }
.login-submit.loading .login-submit-text, .login-submit.loading .login-submit-arrow { opacity: 0; transform: translateY(-8px); }
.login-submit.loading .login-spinner { opacity: 1; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--c-50);
  font-size: .72rem;
  line-height: 1.5;
  color: var(--text-3);
}
.login-note .ico {
  flex-shrink: 0;
  width: 14px; height: 14px;
  margin-top: 1px;
}
.login-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: .72rem;
  color: var(--text-3);
}
@media (max-width: 420px) {
  .login-card { padding: 24px 20px 20px; }
  .login-head { gap: 12px; }
  .login-logo { width: 38px; height: 38px; }
}
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--c-50);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c-900);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: .78rem;
  color: var(--text-2);
  margin-bottom: 16px;
  animation: alert-in .42s var(--spring) both;
}
.alert .ico { width: 15px; height: 15px; margin-top: 1px; flex-shrink: 0; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-6px); } }

.overlay.active { opacity: 1; pointer-events: auto; }
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translate3d(-100%, 0, 0);
    box-shadow: var(--shadow-lg);
    transition: transform var(--t-slow) var(--ios);
    will-change: transform;
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .top-bar { padding: 0 14px; }
  .page { padding: 16px 14px 28px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-num { font-size: 1.35rem; }
  .field-grid { grid-template-columns: 1fr; }
  .add-row { grid-template-columns: 1fr !important; }
  .role-chip { display: none; }
  .stat-card:hover { transform: none; box-shadow: none; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
  .page-container { scroll-behavior: auto; }
}

.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px 0;
}
.tool-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  font-size: .83rem;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition:
    background var(--t-med) var(--ios),
    color var(--t-med) var(--ios),
    transform var(--t-slow) var(--spring);
}
.tool-btn:hover { background: var(--hover); color: var(--text); }
.tool-btn:active { transform: scale(.97); transition: transform .09s var(--snap); }
.tool-btn .ico { width: 17px; height: 17px; }
.tool-btn kbd {
  margin-left: auto;
  font-family: inherit;
  font-size: .68rem;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.5;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
.drawer.open { pointer-events: auto; }
.drawer-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ios);
}
.drawer.open .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(380px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translate3d(100%, 0, 0);
  transition: transform var(--t-slow) var(--ios);
  will-change: transform;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 0 18px;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--line-soft);
}
.drawer-head h2 { font-size: .9rem; font-weight: 600; letter-spacing: -.02em; }
.drawer-head p { font-size: .7rem; color: var(--text-3); margin-top: 1px; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 18px 18px;
}
.drawer-foot {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--c-25);
}
.drawer-foot .btn { flex: 1; }

.set-group { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.set-group:last-child { border-bottom: none; }
.set-group > h3 {
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
}
.set-row.stack { flex-direction: column; align-items: stretch; gap: 9px; }
.set-row .set-label { font-size: .825rem; font-weight: 500; }
.set-row .set-hint { font-size: .71rem; color: var(--text-3); margin-top: 2px; line-height: 1.45; }

.choices { display: flex; flex-wrap: wrap; gap: 5px; }
.choices button {
  flex: 1 1 auto;
  min-width: 58px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    background var(--t-med) var(--ios),
    border-color var(--t-med) var(--ios),
    color var(--t-med) var(--ios),
    transform var(--t-slow) var(--spring);
}
.choices button .ico { width: 14px; height: 14px; }
.choices button:hover { border-color: var(--c-300); color: var(--text); }
.choices button:active { transform: scale(.95); transition: transform .09s var(--snap); }
.choices button.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 7px;
}
.swatch {
  position: relative;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--t-slow) var(--spring), box-shadow var(--t-med) var(--ios);
}
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.swatch:active { transform: scale(.94); transition: transform .09s var(--snap); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c-400); }
.swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sw);
}
.color-pair { display: flex; align-items: center; gap: 8px; }
.color-pair input[type="color"] {
  width: 38px; height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
}
.color-pair span { font-size: .72rem; color: var(--text-3); }

.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--c-200);
  border-radius: 99px;
  pointer-events: none;
  transition: background var(--t-med) var(--ios);
}
.switch-track::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  top: 2px; left: 2px;
  background: #fff;
  border-radius: 99px;
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform var(--t-slow) var(--spring), width var(--t-med) var(--ios);
}
.switch input:checked + .switch-track { background: var(--accent-grad); }
.switch input:checked + .switch-track::before { transform: translateX(16px); }
.switch input:active + .switch-track::before { width: 23px; }
.switch input:checked:active + .switch-track::before { transform: translateX(11px); }

.set-row .input, .set-row select.input { max-width: 190px; }
.set-row.stack .input, .set-row.stack select.input { max-width: none; width: 100%; }

:root[data-bg="glow"] {
  --bg-layer:
    radial-gradient(55% 45% at 12% 0%, var(--accent-from) 0%, transparent 62%),
    radial-gradient(45% 40% at 100% 18%, var(--accent-to) 0%, transparent 58%);
  --bg-size: cover;
}
:root[data-bg="glow"] body { background-blend-mode: normal; }

:root[data-bg="image"] {
  --bg-layer: var(--bg-image, none);
  --bg-size: cover;
}
:root[data-bg="image"] .page-container::before {
  content: '';
  position: fixed;
  inset: var(--topbar-h) 0 0 var(--sidebar-w);
  background: var(--bg);
  opacity: var(--bg-veil, .84);
  pointer-events: none;
  z-index: 0;
}
:root[data-bg="image"] .page, :root[data-bg="image"] .filter-row { position: relative; z-index: 1; }

:root[data-sidebar="collapsed"] { --sidebar-w: 62px; }
:root[data-sidebar="collapsed"] .logo-text, :root[data-sidebar="collapsed"] .nav-item span, :root[data-sidebar="collapsed"] .nav-count, :root[data-sidebar="collapsed"] .bot-status > div, :root[data-sidebar="collapsed"] .tool-btn span, :root[data-sidebar="collapsed"] .tool-btn kbd { display: none; }
:root[data-sidebar="collapsed"] .nav-item, :root[data-sidebar="collapsed"] .tool-btn, :root[data-sidebar="collapsed"] .bot-status, :root[data-sidebar="collapsed"] .sidebar-header { justify-content: center; padding: 0; }
:root[data-sidebar="collapsed"] .nav-label {
  font-size: 0;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}
@media (max-width: 768px) {
  :root[data-sidebar="collapsed"] { --sidebar-w: 236px; }
  .drawer-panel { width: 100%; }
}

:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: .01ms !important;
  animation-delay: 0ms !important;
  transition-duration: .01ms !important;
}

[hidden] { display: none !important; }

:root { accent-color: var(--accent-solid); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 190px;
  height: 4px;
  border-radius: 99px;
  background: var(--c-200);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-solid);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm), 0 1px 3px var(--ring);
  transition: transform var(--t-slow) var(--spring);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-solid);
  border: 2px solid var(--surface);
  cursor: pointer;
}

.ch-cursor {
  opacity: 0;
  transition:
    transform .2s var(--ios),
    opacity .16s var(--ios);
  will-change: transform;
}
.ch-cursor.on { opacity: 1; }
.ch-hover-wrap {
  transition: transform .2s var(--ios);
  will-change: transform;
}
.ch-hover-dot {
  fill: var(--accent-solid);
  stroke: var(--surface);
  stroke-width: 2;
}

.ch-bar {
  fill: var(--accent-solid);
  transition: opacity var(--t-med) var(--ios);
}
.ch-bar.dim { opacity: .3; }

.rating { font-size: 1.6rem; font-weight: 600; letter-spacing: -.035em; }
.rating-max { font-size: .8rem; color: var(--text-3); margin-left: 5px; font-weight: 500; }

.overview-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.3fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
.overview-row > .card { margin-bottom: 0; }

.shop-card {
  padding: var(--pad-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-thumb {
  width: 52px; height: 52px;
  flex-shrink: 0;
  border-radius: var(--r);
  background: var(--accent-grad);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.shop-thumb .ico { width: 24px; height: 24px; stroke-width: 1.5; }

.shop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-desc {
  font-size: .81rem;
  line-height: 1.6;
  color: var(--text-2);
  flex: 1;
}

.member-card { display: flex; flex-direction: column; }
.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.chart-headline { text-align: right; line-height: 1.15; }

.chart-big {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.035em;
}
.chart-delta {
  display: block;
  font-size: .73rem;
  color: var(--text-3);
  margin-top: 3px;
}
.chart-delta.up::before { content: '↑ '; }
.chart-delta.down::before { content: '↓ '; }
.member-card .chart-plot { flex: 1; min-height: 150px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}

.info-tile {
  background: var(--surface);
  padding: 13px var(--pad-card);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background var(--t-fast) var(--ios);
}
.info-tile:hover { background: var(--c-25); }
.info-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--text-3);
}
.info-label .ico { width: 13px; height: 13px; }
.info-value {
  font-size: .9rem;
  font-weight: 550;
  letter-spacing: -.015em;
}
.info-value.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

@media (max-width: 860px) {
  .overview-row { grid-template-columns: 1fr; }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}
.modal.open { pointer-events: auto; }
#ticketTable tr.tk-row { cursor: pointer; }
#ticketTable tr.tk-row:hover td { background: var(--hover); }
.tk-card { max-width: 620px; }
.tk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.tk-cell { min-width: 0; font-size: .84rem; color: var(--text-1); overflow-wrap: anywhere; }
.tk-label { display: block; font-size: .7rem; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.tk-section { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--c-100); font-size: .84rem; }
.tk-section p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-kv { margin-bottom: 8px; }
.tk-kv span { font-weight: 600; font-size: .78rem; }
@media (max-width: 560px) { .tk-grid { grid-template-columns: 1fr; } }
.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ios);
}
.modal.open .modal-scrim { opacity: 1; }
.modal-card {
  position: relative;
  width: min(470px, 100%);
  max-height: min(86vh, 760px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transition:
    transform var(--t-slow) var(--spring),
    opacity var(--t-med) var(--ios);
  will-change: transform;
}
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 14px 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: .9rem; font-weight: 600; letter-spacing: -.02em; }
.modal-head p { font-size: .72rem; color: var(--text-3); margin-top: 2px; }
.modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 18px 16px;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--c-25);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-foot-main { display: flex; gap: 8px; }

.pick-row { display: flex; gap: 12px; align-items: flex-start; }
.pick-preview {
  width: 58px; height: 58px;
  flex-shrink: 0;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--accent-grad);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pick-preview .ico { width: 24px; height: 24px; stroke-width: 1.5; }
.pick-preview img { width: 100%; height: 100%; object-fit: cover; }
.pick-actions { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.module-head .card-head { align-items: center; }
.module-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.module-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: var(--r);
  background: var(--c-100);
  color: var(--text-2);
  display: grid;
  place-items: center;
}
.module-icon .ico { width: 19px; height: 19px; }

.module-head:has(input:not(:checked)) .module-icon { opacity: .5; }

form > .set-row {
  padding: 12px var(--pad-card);
  border-top: 1px solid var(--line-soft);
}
@media (max-width: 560px) {
  .module-title { gap: 10px; }
  .module-icon { width: 32px; height: 32px; }
}

.pick-preview.wide {
  width: 96px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--accent-grad);
  background-size: cover;
  background-position: center;
}
@media (max-width: 560px) {
  .pick-row { flex-wrap: wrap; }
}

.sub-head {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin: 20px 0 10px;
}
.card-body > .sub-head:first-child { margin-top: 0; }

.xselect { position: relative; width: 100%; }
.xselect-native {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}
.xselect-btn {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: .83rem;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--t-med) var(--ios),
    box-shadow var(--t-med) var(--ios);
}
.xselect-btn:hover { border-color: var(--c-200); }
.xselect.open .xselect-btn, .xselect-btn:focus-visible {
  border-color: var(--c-400);
  box-shadow: 0 0 0 3.5px var(--c-100);
  outline: none;
}
.xselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xselect-caret {
  width: 15px; height: 15px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--t-slow) var(--spring);
}
.xselect.open .xselect-caret { transform: rotate(180deg); }

.xselect-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  left: auto;
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(340px, calc(100vw - 32px));
  max-height: 248px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top center;
  pointer-events: none;
  transition:
    opacity var(--t-fast) var(--ios),
    transform var(--t-slow) var(--spring);
}
.xselect.up .xselect-menu {
  top: auto;
  bottom: calc(100% + 5px);
  transform-origin: bottom center;
  transform: translateY(6px) scale(.98);
}
.xselect.open .xselect-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.xselect-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast) var(--ios), color var(--t-fast) var(--ios);
}

.xselect-opt:hover { background: var(--hover); color: var(--text); }
.xselect-opt:focus-visible { background: var(--hover); color: var(--text); outline: none; }
.xselect-opt.on { color: var(--text); font-weight: 550; }
.xselect-opt-label { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.xselect-tick {
  width: 15px; height: 15px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(.7);
  transition: opacity var(--t-fast) var(--ios), transform var(--t-slow) var(--spring);
}
.xselect-opt.on .xselect-tick { opacity: 1; transform: none; }

.set-row .xselect { width: auto; min-width: 190px; max-width: min(300px, 62%); flex-shrink: 0; }
.set-row.stack .xselect { width: 100%; min-width: 0; max-width: none; }

.hours-hint { font-size: .72rem; color: var(--text-3); }

.shop-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.shop-banner {
  height: 96px;
  background-color: var(--c-100);
  background-size: cover;
  background-position: center;
  transition: background-image var(--t-slow) var(--ios);
}

.shop-thumb {
  width: 64px; height: 64px;
  border: 4px solid var(--surface);
  border-radius: 16px;
}
.shop-thumb .ico { width: 26px; height: 26px; }
.shop-desc {
  padding: 12px var(--pad-card) 0;
  flex: 1;
}
@media (max-width: 560px) {
  .shop-banner { height: 76px; }
  .shop-thumb { width: 52px; height: 52px; }
}

.dc-panel {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dc-embed {
  border-left: 4px solid var(--accent-solid);
  border-radius: 4px;
  background: var(--c-50);
  padding: 12px 14px;
}
.dc-embed-title { font-size: .86rem; font-weight: 600; margin-bottom: 4px; }
.dc-embed-desc { font-size: .78rem; color: var(--text-2); line-height: 1.55; }
.dc-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .82rem;
  color: var(--text-3);
}
.dc-select .ico { width: 15px; height: 15px; }
.dc-options {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.dc-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.dc-option:last-child { border-bottom: none; }
.dc-option:hover { background: var(--c-25); }
.dc-emoji { font-size: 1rem; line-height: 1.3; flex-shrink: 0; }
.dc-option-name { font-size: .82rem; font-weight: 550; }
.dc-option-desc { font-size: .74rem; color: var(--text-3); margin-top: 1px; }
.dc-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: .8rem; }

.tt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--t-fast) var(--ios);
}
.tt-row:last-child { border-bottom: none; }
.tt-row:hover { background: var(--c-25); }
.tt-emoji {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--c-100);
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.tt-info { flex: 1; min-width: 0; }
.tt-name { font-size: .855rem; font-weight: 550; }
.tt-desc {
  font-size: .74rem;
  color: var(--text-3);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.tt-meta .badge { font-size: .69rem; }

.tt-fields {
  display: flex;
  flex-direction: column;

  flex: none;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);

  overflow: visible;
}

.tt-fields > :first-child { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tt-fields > :last-child { border-radius: 0 0 var(--r-sm) var(--r-sm); }
.tt-fields > :only-child { border-radius: var(--r-sm); }
.tt-fields:empty { display: none; }
.tt-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
}
.tt-field .input { flex: 1; min-width: 0; }
.tt-field .xselect { width: 94px; flex-shrink: 0; }

.tt-req {
  flex-shrink: 0;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-3);
  font-size: .72rem;
  cursor: pointer;
  transition:
    background var(--t-med) var(--ios),
    color var(--t-med) var(--ios),
    border-color var(--t-med) var(--ios);
}
.tt-req.on { background: var(--accent-grad); border-color: transparent; color: var(--accent-ink); }
.tt-del {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ios), color var(--t-fast) var(--ios);
}
.tt-del:hover { background: var(--hover); color: var(--text); }
.tt-del .ico { width: 15px; height: 15px; }
.emoji-row { display: flex; gap: 8px; }

.set-row.stack .emoji-row .input { flex: 1; min-width: 0; }

.set-row.stack .emoji-row .emoji-input {
  flex: 0 0 56px;
  width: 56px;
  text-align: center;
  font-size: 1rem;
}
.modal-foot .btn-danger { margin-right: auto; }
@media (max-width: 560px) {
  .tt-field { flex-wrap: wrap; }
  .tt-field .input { flex: 1 1 100%; }
}

.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-buttons[hidden] { display: none; }
.dc-btn {
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: .8rem;
  font-weight: 500;
}

.tt-handle {
  flex-shrink: 0;
  width: 26px; height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--c-300);
  cursor: grab;
  touch-action: none;
  transition: color var(--t-fast) var(--ios), background var(--t-fast) var(--ios);
}
.tt-handle:hover { color: var(--text-2); background: var(--hover); }
.tt-handle:focus-visible { outline: none; color: var(--text); background: var(--hover); }
.tt-handle:active { cursor: grabbing; }
.tt-handle .ico { width: 16px; height: 16px; }

.tt-row.dragging {
  position: relative;
  z-index: 5;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-sm);
  cursor: grabbing;
}
.tt-row.dragging .tt-handle { color: var(--text); }

.reordering .tt-row:hover { background: var(--surface); }
.reordering .tt-row.dragging:hover { background: var(--surface); }

.tt-field-wrap { background: var(--surface); }
.tt-more {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ios), color var(--t-fast) var(--ios);
}
.tt-more:hover { background: var(--hover); color: var(--text); }
.tt-more .ico {
  width: 15px; height: 15px;
  transition: transform var(--t-slow) var(--spring);
}
.tt-more.open .ico { transform: rotate(180deg); }
.tt-field-adv {
  display: grid;
  grid-template-columns: 1fr 86px 86px;
  gap: 8px;
  padding: 0 10px 10px 10px;
}
.tt-field-adv[hidden] { display: none; }
.tt-field-adv .input { font-size: .78rem; }

.var-hints {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 8px;
}
.var-hints code { margin-left: 4px; }
.msg-preview {
  display: flex;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--c-50);
  overflow: hidden;
}
.msg-preview-bar {
  width: 4px;
  flex-shrink: 0;
  background: var(--accent-solid);
}
.msg-preview-body {
  padding: 10px 12px;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--text-2);
}

.msg-ping {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--c-150);
  color: var(--text);
  font-weight: 500;
  margin-right: 4px;
}
.msg-ping[hidden] { display: none; }

.btn-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-toggle { cursor: pointer; }
.btn-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.btn-toggle span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-3);
  font-size: .76rem;
  font-weight: 500;
  transition:
    background var(--t-med) var(--ios),
    border-color var(--t-med) var(--ios),
    color var(--t-med) var(--ios),
    transform var(--t-slow) var(--spring);
}
.btn-toggle:hover span { border-color: var(--c-300); color: var(--text-2); }
.btn-toggle:active span { transform: scale(.95); }
.btn-toggle input:checked + span {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
}
.btn-toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--c-100); }

.reply-empty {
  padding: 28px var(--pad-card);
  text-align: center;
  color: var(--text-3);
  font-size: .8rem;
}
@media (max-width: 560px) {
  .tt-field-adv { grid-template-columns: 1fr; }
}

.msg-preview-body { white-space: pre-wrap; word-break: break-word; }
.msg-preview-body.is-empty { color: var(--text-3); }

.msg-ping.inline { margin-right: 0; }

.tt-row.is-off { opacity: .55; }
.tt-row.is-off .tt-name { text-decoration: line-through; }

.fee-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fee-row .input { width: 80px; }
.fee-row span {
  font-size: .78rem;
  color: var(--text-3);
}

.pm-kind[hidden] { display: none; }
#pmPreview { margin-top: 0; width: 100%; }
#pmPreviewText { white-space: pre-wrap; }
@media (max-width: 560px) {
  .fee-row { flex-wrap: wrap; }
  .fee-row .input { width: 72px; }
}

.pick-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.rule-list {
  border-top: 1px solid var(--line-soft);
}
.rule-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 142px;
  align-items: center;
  gap: 14px;
  padding: 11px var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t-fast) var(--ios);
}
.rule-row:last-child { border-bottom: none; }
.rule-row:hover { background: var(--hover); }

.rule-row:has(.switch input:not(:checked)) { opacity: .5; }
.rule-name {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
}
.rule-hint {
  margin-top: 1px;
  font-size: .72rem;
  color: var(--text-3);
}
.rule-limit {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.rule-limit .input {
  width: 58px;
  padding-left: 8px;
  padding-right: 4px;
  text-align: center;
}
.rule-limit span {
  font-size: .74rem;
  color: var(--text-3);
}
.rule-action { width: 100%; }
@media (max-width: 900px) {
  .rule-row {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 10px;
  }
  .rule-limit, .rule-action { grid-column: 2; }
  .rule-action { width: 142px; }
}

@media (max-width: 560px) {
  .tt-row { flex-wrap: wrap; row-gap: 8px; }
  .tt-info { flex: 1 1 100%; order: 3; }
  .tt-meta { flex-wrap: wrap; justify-content: flex-end; }
}

.login-ripple {
  position: absolute;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .28;
  transform: scale(0);
  pointer-events: none;
  animation: login-ripple .62s var(--decel) forwards;
}
@keyframes login-ripple {
  to { transform: scale(26); opacity: 0; }
}

.login-submit {
  transition:
    width .44s var(--spring),
    border-radius .44s var(--spring),
    background .3s var(--ios),
    transform .2s var(--ios);
}
.login-submit.morph { border-radius: 999px; }

.login-check {
  position: absolute;
  left: 50%; top: 50%;
  width: 19px; height: 19px;
  margin: -9.5px 0 0 -9.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.login-check path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.login-submit.done .login-spinner { opacity: 0; }
.login-submit.done .login-check { opacity: 1; }
.login-submit.done .login-check path {
  animation: logo-draw .34s var(--decel) forwards;
}

.login-card.leaving .login-foot { animation: login-fall .26s var(--ios) both; }
.login-card.leaving .login-note { animation: login-fall .26s var(--ios) .04s both; }
.login-card.leaving .login-remember { animation: login-fall .26s var(--ios) .08s both; }
.login-card.leaving .field:nth-of-type(2) { animation: login-fall .26s var(--ios) .12s both; }
.login-card.leaving .field:nth-of-type(1) { animation: login-fall .26s var(--ios) .16s both; }
@keyframes login-fall {
  to { opacity: 0; transform: translateY(10px); }
}

.login-card.leaving {
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  filter: blur(3px);
  transition:
    opacity .3s var(--ios) .18s,
    transform .42s var(--ios) .12s,
    filter .3s var(--ios) .18s;
}
.login-card.leaving .login-logo {
  transform: scale(1.14);
  transition: transform .5s var(--spring);
}

.login-veil, .boot-veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  color: var(--accent-ink);
  pointer-events: none;
}
.login-veil {
  clip-path: circle(0 at var(--vx, 50%) var(--vy, 50%));
  transition: clip-path .66s cubic-bezier(.76, 0, .24, 1);
}
.login-veil.open { clip-path: circle(150% at var(--vx, 50%) var(--vy, 50%)); }
.veil-logo {
  width: 86px; height: 86px;
  opacity: 0;
  overflow: visible;
}
.login-veil.open .veil-logo {
  opacity: 1;
  transition: opacity .3s var(--ios) .26s;
}
.login-veil.open .veil-logo path, .login-veil.open .veil-logo circle {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: logo-draw .34s var(--decel) forwards;
}
.login-veil.open .veil-logo > g > :nth-child(1) { animation-delay: .28s; }
.login-veil.open .veil-logo > g > :nth-child(2) { animation-delay: .34s; }
.login-veil.open .veil-logo > g > :nth-child(3) { animation-delay: .42s; }
.login-veil.open .veil-logo > g > :nth-child(4) { animation-delay: .46s; }
.login-veil.open .veil-logo > g > :nth-child(5) { animation-delay: .5s; }
.login-veil.open .veil-logo > g > :nth-child(6) { animation-delay: .56s; }
.login-veil.open .veil-logo > g > :nth-child(7) { animation-delay: .6s; }

.boot-veil {
  opacity: 0;
  visibility: hidden;
}
body.booting .boot-veil {
  opacity: 1;
  visibility: visible;
}
body.booting .boot-veil .veil-logo { opacity: 1; }
body.booted .boot-veil {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px) scale(1.04);
  transition:
    opacity .46s var(--ios),
    transform .62s var(--ios),
    visibility 0s linear .62s;
}
body.booted .boot-veil .veil-logo {
  opacity: 0;
  transform: scale(.92);
  transition: opacity .3s var(--ios), transform .46s var(--ios);
}

body.booting .sidebar-nav .nav-item, body.booted .sidebar-nav .nav-item {
  animation: login-rise .42s var(--ios) both;
}
body.booted .sidebar-nav .nav-item:nth-child(-n+4) { animation-delay: .38s; }
body.booted .sidebar-nav .nav-item:nth-child(n+5) { animation-delay: .44s; }
body.booted .sidebar-nav .nav-item:nth-child(n+9) { animation-delay: .5s; }
body.booted .sidebar-nav .nav-item:nth-child(n+13) { animation-delay: .56s; }
body.booting .main-content { opacity: 0; }
body.booted .main-content {
  animation: boot-main .55s var(--ios) .3s both;
}
@keyframes boot-main {
  from { opacity: 0; transform: translateY(12px) scale(.995); }
}

.login-error {
  margin: 2px 0 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--c-100);
  border-left: 3px solid var(--c-900);
  font-size: .76rem;
  color: var(--text);
  animation: login-shake .34s var(--ios);
}
.login-error[hidden] { display: none; }
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.card-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .card-head-actions { flex-wrap: wrap; justify-content: flex-end; }
}

.nav-dyn { display: flex; flex-direction: column; gap: 1px; }
.nav-mod {
  overflow: hidden;
  transition:
    color var(--t-med) var(--ios), background var(--t-med) var(--ios),
    transform var(--t-slow) var(--spring), opacity .32s var(--ios),
    height .38s var(--ios), margin .38s var(--ios);
}
.nav-mod.nav-enter { opacity: 0; transform: translateX(-12px) scale(.96); }
.nav-mod.nav-leave { opacity: 0; transform: translateX(-10px); pointer-events: none; }
.nav-dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px var(--surface);
}
.nav-dot[hidden] { display: none; }
#navModuleCount:empty { display: none; }

.page-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  background: var(--c-100);
  border-radius: calc(var(--r) + 2px);
}
.page-tab {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: .8rem;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-med) var(--ios), color var(--t-med) var(--ios), transform .09s var(--snap);
}
.page-tab:hover { color: var(--text); }
.page-tab:active { transform: scale(.96); }
.page-tab.active { background: var(--surface); color: var(--text); font-weight: 550; box-shadow: var(--shadow-sm); }

.mod-off-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  border-radius: var(--r-lg);
  background: var(--c-100);
  font-size: .8rem;
  color: var(--text-2);
  transition: max-height .42s var(--ios), opacity .3s var(--ios), padding .42s var(--ios), margin .42s var(--ios);
}
.mod-off-bar.show { max-height: 90px; opacity: 1; padding: 12px 16px; margin-bottom: 12px; }
.mod-off-bar b { color: var(--text); font-weight: 600; margin-right: 4px; }
.mod-off-bar .ico { width: 16px; height: 16px; color: var(--text-3); }

.mod-hero { padding: 22px 22px 18px; overflow: hidden; }
.mod-hero-main { display: flex; align-items: center; gap: 22px; }
.mod-hero-count {
  font-size: 2.7rem;
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mod-hero-of { font-size: 1.05rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.mod-hero-copy h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.015em; }
.mod-hero-copy p { font-size: .78rem; color: var(--text-2); margin-top: 4px; line-height: 1.6; max-width: 62ch; }
.mod-meter { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; margin-top: 18px; }
.mod-meter i {
  height: 6px;
  border-radius: 3px;
  background: var(--c-150);
  transform-origin: bottom;
  transition: background .3s var(--ios), transform .5s var(--spring);
}
.mod-meter i.on { background: var(--accent-grad); transform: scaleY(1.35); }

.sys-card { overflow: hidden; }
.sys-pressure {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px;
  border-radius: 13px;
  border: 1px solid var(--line);
  font-size: .74rem;
  color: var(--text-2);
}
.sys-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); position: relative; }
.sys-pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid currentColor; opacity: 0;
}
.sys-pressure[data-level="normal"] .sys-pulse { background: var(--text); }
.sys-pressure[data-level="warn"] { color: var(--text); border-color: var(--c-300); }
.sys-pressure[data-level="warn"] .sys-pulse { background: var(--text); animation: sysBlink 1.4s var(--ios) infinite; }
.sys-pressure[data-level="critical"] { background: var(--accent-solid); color: var(--accent-ink); border-color: transparent; }
.sys-pressure[data-level="critical"] .sys-pulse { background: var(--accent-ink); }
.sys-pressure[data-level="critical"] .sys-pulse::after { animation: sysRing 1.1s var(--decel) infinite; color: var(--accent-ink); }
@keyframes sysBlink { 50% { opacity: .25; } }
@keyframes sysRing { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.6); } }
.sys-banner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 0 var(--pad-card, 18px) 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--accent-solid);
  color: var(--accent-ink);
}
.sys-banner small { display: block; font-size: .74rem; color: var(--on-accent-dim); margin-top: 2px; }
.sys-banner .btn { background: var(--accent-ink); color: var(--accent-solid); border-color: transparent; }
.sys-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}
.sys-tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 18px 16px;
  min-width: 0;
  border-right: 1px solid var(--line-soft);
}
.sys-tile:last-child { border-right: 0; }
.sys-val b { font-size: 1.5rem; font-weight: 640; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sys-val small { font-size: .74rem; color: var(--text-3); margin-left: 4px; }
.sys-foot { font-size: .7rem; color: var(--text-3); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-spark { position: relative; height: 40px; cursor: crosshair; touch-action: pan-y; }
.sys-spark svg { display: block; overflow: visible; }
.spark-cross { stroke: var(--line); stroke-width: 1; }
.spark-dot { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.spark-tip {
  position: absolute; bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent-solid); color: var(--accent-ink);
  font-size: .68rem; white-space: nowrap; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.sys-events { border-top: 1px solid var(--line-soft); padding: 8px 18px 12px; }
.sys-event {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px;
  padding: 5px 0;
  font-size: .76rem; color: var(--text-2);
}
.sys-event time { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: .7rem; }
.sys-event-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-300); }
.sys-event[data-level="warn"] .sys-event-dot { background: var(--text-2); }
.sys-event[data-level="error"] .sys-event-dot { background: var(--text); box-shadow: 0 0 0 3px var(--c-150); }
.sys-event.empty { display: block; color: var(--text-3); }
.btn.spinning .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mod-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 12px;
}
.mod-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-chip {
  height: 30px; padding: 0 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit; font-size: .76rem; color: var(--text-2);
  cursor: pointer;
  transition: background var(--t-med) var(--ios), color var(--t-med) var(--ios), border-color var(--t-med) var(--ios), transform .09s var(--snap);
}
.mod-chip:hover { color: var(--text); border-color: var(--c-300); }
.mod-chip:active { transform: scale(.95); }
.mod-chip.active { background: var(--accent-grad); color: var(--accent-ink); border-color: transparent; }
.mod-search { position: relative; margin-left: auto; flex: 0 1 220px; }
.mod-search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.mod-search .input { padding-left: 32px; height: 32px; width: 100%; }

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.mod-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
  transition:
    border-color .45s var(--ios),
    box-shadow .6s var(--ios),
    background .45s var(--ios);
}
.mod-card[hidden] { display: none; }
.mod-card:hover { border-color: var(--c-200); }
.mod-card-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.mod-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--c-100);
  color: var(--text-3);
  transition: background .5s var(--ios), color .5s var(--ios), transform .55s var(--spring), box-shadow .6s var(--ios);
}
.mod-icon .ico { width: 19px; height: 19px; }
.mod-card-id { min-width: 0; }
.mod-card-id h4 { font-size: .92rem; font-weight: 600; letter-spacing: -.01em; }
.mod-group { font-size: .7rem; color: var(--text-3); }
.mod-desc { font-size: .78rem; color: var(--text-3); line-height: 1.55; transition: color .45s var(--ios); }
.mod-req {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; color: var(--text-2);
}
.mod-req .ico { width: 13px; height: 13px; color: var(--text-3); }
.mod-issue {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 9px 11px;
  border-radius: var(--r);
  background: var(--c-50);
  border: 1px dashed var(--c-300);
  font-size: .74rem; color: var(--text-2);
  line-height: 1.5;
}
.mod-issue[hidden] { display: none; }
.mod-issue b { color: var(--text); font-weight: 600; }
.mod-cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: copy;
}
.mod-issue .btn { margin-left: auto; }
.mod-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.mod-status { display: flex; align-items: center; gap: 7px; font-size: .72rem; color: var(--text-3); min-width: 0; }
.mod-status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--c-300); }
.mod-link {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: none; padding: 4px 2px 4px 6px;
  font: inherit; font-size: .76rem; color: var(--text-2);
  cursor: pointer; border-radius: 6px;
  transition: color var(--t-med) var(--ios);
}
.mod-link .ico { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform var(--t-slow) var(--spring); }
.mod-link:hover { color: var(--text); }
.mod-link:hover .ico { transform: rotate(-90deg) translateY(2px); }

.mod-card.is-on {
  border-color: color-mix(in srgb, var(--text) 22%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent),
    0 10px 30px -14px color-mix(in srgb, var(--text) 38%, transparent);
}
.mod-card.is-on .mod-icon {
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--text) 55%, transparent);
}
.mod-card.is-on .mod-desc { color: var(--text-2); }
.mod-card.is-on .mod-status { color: var(--text-2); }
.mod-card.is-on .mod-dot { background: var(--text); animation: modBreath 2.8s var(--ios) infinite; }
@keyframes modBreath {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}
.mod-card[data-state="error"] .mod-dot, .mod-card[data-state="quarantined"] .mod-dot { background: var(--text); animation: sysBlink 1.2s var(--ios) infinite; }
.mod-card[data-state="shed"] .mod-dot { background: var(--text-3); animation: none; }
.mod-card[data-state="quarantined"], .mod-card[data-state="error"] { border-style: dashed; }

.mod-shine {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, color-mix(in srgb, var(--text) 10%, transparent) 50%, transparent 70%);
  transform: translateX(-110%);
}
.mod-card.just-on .mod-shine { animation: modSweep 1.05s var(--decel) forwards; }
.mod-card.just-on .mod-icon { animation: modPop .7s var(--spring); }
@keyframes modSweep { to { transform: translateX(110%); } }
@keyframes modPop { 0% { transform: scale(.82); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
.mod-empty { text-align: center; font-size: .8rem; color: var(--text-3); padding: 34px 0; }

.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line-soft); }
.cmd-item { display: flex; align-items: baseline; gap: 10px; padding: 11px 18px; background: var(--surface); font-size: .76rem; color: var(--text-3); }
.cmd-item code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; color: var(--text); font-weight: 550; }

.req-list { border-top: 1px solid var(--line-soft); }
.req-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); }
.req-row:last-child { border-bottom: 0; }
.req-row b { font-size: .8rem; font-weight: 600; }
.req-row small { display: block; font-size: .72rem; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.req-dot { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px dashed var(--c-300); position: relative; }
.req-row[data-level="ok"] .req-dot { border: 0; background: var(--accent-grad); }
.req-row[data-level="ok"] .req-dot::after {
  content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.req-row[data-level="bad"] .req-dot { border: 1.5px solid var(--text); }
.req-row[data-level="bad"] .req-dot::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 1.5px; height: 7px; background: var(--text);
  box-shadow: 0 9px 0 0 var(--text);
}
.req-row[data-level="bad"] small::before { content: "未就緒 · "; color: var(--text); font-weight: 600; }

.row-editor { border-top: 1px solid var(--line-soft); }
.ed-row { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.ed-row .ed-grow { flex: 1; min-width: 0; }
.ed-row .xselect, .ed-row > select { width: 118px; flex-shrink: 0; }
.ar-row { flex-direction: column; align-items: stretch; }
.ar-row .textarea { min-height: 56px; }
.ar-hints { padding: 10px 18px 0; }
.save-hint { font-size: .74rem; color: var(--text-3); margin-right: auto; }
.save-hint[data-ok="0"] { color: var(--text); font-weight: 550; }
.form-editor { border-top: 1px solid var(--line-soft); }
.fe-card { border-bottom: 1px solid var(--line-soft); }
.fe-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; }
.fe-title {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 6px 0;
  font: inherit; text-align: left; color: var(--text); cursor: pointer;
}
.fe-title b { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-title span { font-size: .72rem; color: var(--text-3); }
.fe-chev { width: 15px; height: 15px; color: var(--text-3); transform: rotate(-90deg); transition: transform var(--t-slow) var(--spring); }
.fe-card.open .fe-chev { transform: rotate(0); }
.fe-body { display: none; padding: 4px 18px 16px; }
.fe-card.open .fe-body { display: block; animation: feOpen .4s var(--decel); }
@keyframes feOpen { from { opacity: 0; transform: translateY(-4px); } }
.fe-questions { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.fe-q { padding: 8px 10px; }
.fe-qn {
  width: 22px; height: 22px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--c-100);
  font-size: .7rem; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.fe-addq { margin: 8px 10px; }
.fe-publish { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .78rem; color: var(--text-2); }
.fe-publish .xselect, .fe-publish > select { width: 220px; }

.say-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 4px 18px 0; }
.say-edit { display: flex; flex-direction: column; gap: 12px; }
.say-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-2); cursor: pointer; }
.say-embed { display: flex; flex-direction: column; gap: 12px; padding-left: 12px; border-left: 2px solid var(--line); }
.say-embed[hidden] { display: none; }
.say-two { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.say-preview { position: relative; padding: 26px 16px 16px; border-radius: var(--r-lg); background: var(--c-50); border: 1px solid var(--line-soft); align-self: start; }
.say-preview-label { position: absolute; top: 9px; left: 16px; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.dc-msg { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-grad); color: var(--accent-ink); display: grid; place-items: center; }
.dc-avatar .ico { width: 18px; height: 18px; }
.dc-name { display: flex; align-items: center; gap: 6px; font-size: .84rem; }
.dc-tag { font-size: .6rem; font-weight: 600; padding: 1px 4px; border-radius: 3px; background: var(--accent-solid); color: var(--accent-ink); }
.dc-text { font-size: .84rem; color: var(--text); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.dc-text[hidden], .dc-embed[hidden], .dc-embed img[hidden] { display: none; }
.dc-embed { margin-top: 6px; padding: 10px 12px; border-left: 4px solid var(--text); border-radius: 4px; background: var(--surface); max-width: 420px; }
.dc-embed b { font-size: .84rem; display: block; }
.dc-embed p { font-size: .8rem; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.dc-embed img { display: block; max-width: 100%; border-radius: 4px; margin-top: 8px; }
.say-actions { grid-column: 1 / -1; padding: 0 0 14px; }

@media (max-width: 860px) {
  .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-tile:nth-child(2) { border-right: 0; }
  .sys-tile:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .say-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mod-hero-main { flex-direction: column; align-items: flex-start; gap: 10px; }
  .mod-search { flex-basis: 100%; margin-left: 0; }
  .mod-grid { grid-template-columns: 1fr; }
  .ed-row { flex-wrap: wrap; }
  .ed-row .ed-grow { flex-basis: calc(100% - 60px); }
  .fe-publish { flex-wrap: wrap; }
  .fe-publish .xselect, .fe-publish > select { width: 100%; }
  .mod-off-bar { grid-template-columns: auto 1fr; }
  .mod-off-bar .btn { grid-column: 1 / -1; justify-self: start; }
  .mod-off-bar.show { max-height: 140px; }
  .sys-banner { grid-template-columns: auto 1fr; }
  .sys-banner .btn { grid-column: 1 / -1; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .mod-card.is-on .mod-dot, .sys-pressure .sys-pulse, .sys-pressure .sys-pulse::after { animation: none !important; }
  .mod-meter i.on { transform: none; }
}

.sidebar-nav > *, .nav-dyn > * { flex-shrink: 0; }

.panel-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 var(--pad-card) 4px; }
.panel-tab {
  height: 28px; padding: 0 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  font: inherit; font-size: .76rem; color: var(--text-2); cursor: pointer;
  transition: background var(--t-med) var(--ios), color var(--t-med) var(--ios), transform .09s var(--snap);
}
.panel-tab:active { transform: scale(.95); }
.panel-tab.active { background: var(--accent-grad); color: var(--accent-ink); border-color: transparent; }
.panel-tab.off { text-decoration: line-through; opacity: .6; }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-bar-info { font-size: .76rem; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tu-pv-fields:empty { display: none; }
.tu-pv-fields { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.tu-pv-fields small { font-size: .7rem; color: var(--text-3); margin-bottom: 2px; }
.tu-pv-fields b { font-size: .78rem; margin-top: 4px; }
.tu-pv-fields p { margin: 0; font-size: .78rem; color: var(--text-2); }
.tu-pv-footer { display: block; margin-top: 8px; font-size: .66rem; color: var(--text-3); }
.tu-pv-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tu-pv-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 12px; border-radius: 4px;
  font-size: .78rem; font-weight: 550; color: #fff; background: #4e5058;
}
.tu-pv-btn[data-style="primary"] { background: #5865f2; }
.tu-pv-btn[data-style="success"] { background: #248046; }
.tu-pv-btn[data-style="danger"] { background: #da373c; }
.tu-pv-none { font-size: .72rem; color: var(--text-3); }
.tu-btn-row { display: grid; grid-template-columns: auto 72px 64px minmax(0, 1fr) 96px; align-items: center; gap: 8px; padding: 6px 0; }
.tu-btn-name { font-size: .78rem; color: var(--text-2); }
.tu-btn-emoji { text-align: center; }
@media (max-width: 600px) {
  .tu-btn-row { grid-template-columns: auto 1fr 56px; }
  .tu-btn-row .tu-btn-label, .tu-btn-row .xselect, .tu-btn-row > select { grid-column: 1 / -1; }
}

.tcfg-bar { padding: 14px 16px; }
.tcfg-bar-row { display: flex; gap: 8px; align-items: stretch; }
.tcfg-bar-row .xselect, .tcfg-bar-row > select { flex: 1; min-width: 0; }
.tcfg-bar-row .xselect-btn { height: 42px; font-size: .9rem; font-weight: 550; }
.tcfg-add { width: 42px; height: 42px; padding: 0; justify-content: center; flex-shrink: 0; }
.tcfg-bar-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tcfg-summary { font-size: .74rem; color: var(--text-3); min-width: 0; }
.tcfg-bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tcfg-bar-actions .save-hint { margin-right: 0; }
.tcfg-group { padding: 14px 16px 16px; }
.tcfg-group-title { font-size: .8rem; font-weight: 600; margin-bottom: 10px; }
.tcfg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tcfg-tile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface);
  font: inherit; text-align: left; color: var(--text); cursor: pointer;
  transition: border-color var(--t-med) var(--ios), box-shadow var(--t-slow) var(--ios), transform .09s var(--snap);
}
.tcfg-tile:hover { border-color: var(--c-300); box-shadow: var(--shadow-md); }
.tcfg-tile:active { transform: scale(.98); }
.tcfg-tile-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c-100); color: var(--text-2); }
.tcfg-tile-ico .ico { width: 17px; height: 17px; }
.tcfg-tile-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tcfg-tile-text b { font-size: .86rem; font-weight: 600; }
.tcfg-tile-text small { font-size: .72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcfg-tile-chev { width: 16px; height: 16px; color: var(--text-3); transform: rotate(-90deg); transition: transform var(--t-slow) var(--spring); }
.tcfg-tile:hover .tcfg-tile-chev { transform: rotate(-90deg) translateY(2px); }
.tcfg-modal-card.wide { max-width: 980px; }
.tcfg-modal-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.tcfg-modal-card.wide .tcfg-modal-body { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.tcfg-preview {
  position: sticky; top: 0; align-self: start;
  display: flex; flex-direction: column; gap: 14px;
  padding: 26px 14px 14px; border-radius: var(--r-lg); background: var(--c-50); border: 1px solid var(--line-soft);
  position: relative;
}
.tcfg-preview[hidden] { display: none; }
.tcfg-short { max-width: 140px; }
.tcfg-ff { display: flex; flex-direction: column; gap: 6px; }
.tcfg-ff .ed-row { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.tcfg-ff .ed-row .xselect, .tcfg-ff .ed-row > select { width: 92px; }
.tcfg-ff .btn { align-self: flex-start; margin-top: 4px; }
@media (max-width: 960px) {
  .tcfg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tcfg-modal-card.wide .tcfg-modal-body { grid-template-columns: 1fr; }
  .tcfg-preview { position: static; }
}
@media (max-width: 600px) {
  .tcfg-grid { grid-template-columns: 1fr; }
  .tcfg-bar-actions { margin-left: 0; flex-wrap: wrap; }
  .tcfg-ff .ed-row { flex-wrap: wrap; }
}
.tcfg-modal-card { width: min(620px, 100%); }
.tcfg-modal-card.wide { width: min(1000px, 100%); max-width: none; }

.wel-state { font-style: normal; font-size: .7rem; color: var(--text); font-weight: 550; margin-top: 3px; }
.wel-state.off { color: var(--text-3); font-weight: 400; }
.wel-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line-soft); }
.wel-var { display: flex; align-items: baseline; gap: 10px; padding: 11px 16px; border: 0; background: var(--surface); font: inherit; text-align: left; cursor: copy; color: var(--text-3); font-size: .74rem; }
.wel-var:hover { background: var(--c-50); }
.wel-var code { font-size: .76rem; color: var(--text); font-weight: 550; }
.wel-pv-embed { position: relative; }
.wel-pv-thumb { float: right; width: 44px; height: 44px; margin: 0 0 6px 10px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-grad); color: var(--accent-ink); font-size: .8rem; }
.wel-pv-embed img { display: block; max-width: 100%; border-radius: 4px; margin-top: 8px; clear: both; }
.wel-pv-embed p { white-space: pre-wrap; }

.wel-pre { white-space: pre-wrap; }
.rv-dist { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.rv-dist-row { display: grid; grid-template-columns: 10px 1fr 28px; align-items: center; gap: 6px; font-size: .66rem; color: var(--text-3); }
.rv-dist-row i { height: 5px; border-radius: 3px; background: var(--c-100); overflow: hidden; }
.rv-dist-row b { display: block; height: 100%; border-radius: 3px; background: var(--accent-grad); }
.rv-dist-row em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.rv-stars { letter-spacing: 1px; white-space: nowrap; }
.rv-comment { max-width: 320px; }
.rv-pv-form { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.rv-pv-form b { font-size: .84rem; }
.rv-pv-form small { font-size: .7rem; color: var(--text-2); }
.rv-pv-form span { min-height: 54px; padding: 8px 10px; border-radius: 6px; background: var(--c-50); font-size: .76rem; color: var(--text-3); }
.rv-quote { display: block; margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--line); white-space: pre-wrap; }

.lot-create { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.lot-create .field.wide { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .lot-create { grid-template-columns: 1fr; }
}
#lotTable td.actions { white-space: nowrap; text-align: right; }
#lotTable .lot-win { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-create .lot-span2 { grid-column: span 2; }
.lot-create-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 900px) {
  .lot-create .lot-span2 { grid-column: auto; }
}

.an-level { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-bottom: 1px solid var(--line); }
.an-level .choices { margin: 0; }
.an-level .hours-hint { margin: 0; flex-basis: 100%; }
.an-level-label { font-size: .8rem; color: var(--text-2); font-weight: 500; }

.fc-list { display: flex; flex-direction: column; }
.fc-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.fc-row:first-child { border-top: 0; }
.fc-row.off .fc-main { opacity: .5; }
.fc-main b { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.fc-main small { display: block; color: var(--text-3); margin-top: 2px; }
.fc-empty { padding: 28px 20px; text-align: center; color: var(--text-3); font-size: .85rem; }
.fc-field { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; display: grid; gap: 8px; }
.fc-field-top { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.fc-field-sub { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.fc-pv-modal { background: var(--c-100); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.fc-pv-modal > b { font-size: .95rem; }
.fc-pv-q small { display: block; font-size: .72rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; text-transform: uppercase; }
.fc-pv-q small i { color: #e74c3c; font-style: normal; }
.fc-pv-q span { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: .8rem; color: var(--text-3); min-height: 34px; }
.fc-pv-q span.long { min-height: 70px; }
.fc-pv-foot { display: flex; justify-content: flex-end; gap: 8px; }
.fc-pv-cmd { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; background: var(--c-100); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.fc-pv-cmd em { color: var(--text-3); font-style: normal; margin-left: 8px; font-family: inherit; }
#fcTable .fc-ans { max-width: 340px; font-size: .8rem; color: var(--text-2); }
#fcTable .fc-ans b { color: var(--text-1); font-weight: 500; }

.lv-rewards { display: flex; flex-direction: column; }
.lv-reward { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.lv-reward:first-child { border-top: 0; }
.lv-reward .lv-lv { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-2); }
.lv-reward .lv-lv input { width: 80px; }
.lv-adjust { display: grid; grid-template-columns: 1.4fr 1fr .8fr auto; gap: 10px; padding: 0 20px 16px; }
.lv-prog { display: inline-block; width: 110px; height: 6px; border-radius: 99px; background: var(--c-100); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.lv-prog b { display: block; height: 100%; background: var(--accent-grad, var(--text-1)); }
.cmd-mini { display: grid; gap: 8px; font-size: .85rem; color: var(--text-2); }
.cmd-mini code { margin-right: 8px; }
@media (max-width: 900px) {
  .lv-adjust { grid-template-columns: 1fr 1fr; }
  .lv-reward { grid-template-columns: 1fr; }
}

.dcp, .dcg { padding: 0; overflow: hidden; }
.dcp-banner, .dcg-banner { height: 120px; background: #5865f2 center / cover no-repeat; }
.dcg-banner { height: 132px; position: relative; overflow: hidden; }
.dcg-haze { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(24px) saturate(1.2); transform: scale(1.2); }
.dcp-activity { align-self: flex-start; margin: 8px 0 0 10px; max-width: 260px; padding: 6px 12px; border-radius: 14px; background: var(--c-100); border: 1px solid var(--line); font-size: .8rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.dcp-activity::before { content: ""; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--c-100); border: 1px solid var(--line); }
.dcp-head, .dcg-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px; height: 52px; }
.dcg-actions { display: flex; gap: 4px; padding-top: 10px; margin-left: auto; }
.dcp-avatar-wrap { position: relative; margin-top: -52px; }
.dcp-avatar { width: 92px; height: 92px; border-radius: 50%; border: 6px solid var(--card, var(--bg)); background: #5865f2; display: grid; place-items: center; overflow: hidden; color: #fff; }
.dcp-avatar img, .dcg-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcp-avatar .ico { width: 40px; height: 40px; }
.dcp-status { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: #23a55a; border: 5px solid var(--card, var(--bg)); }
.dcp-body { padding: 4px 16px 16px; }
.dcp-names h3 { font-size: 1.25rem; font-weight: 700; margin: 0; line-height: 1.3; }
.dcp-user { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--text-2); margin-top: 2px; }
.dcp-app { display: inline-flex; align-items: center; gap: 2px; background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: .02em; }
.dcp-app .ico { width: 10px; height: 10px; }
.dcp-box { margin-top: 12px; background: var(--c-100); border-radius: 10px; padding: 12px 14px; display: grid; gap: 12px; }
.dcp-label { font-size: .7rem; font-weight: 700; color: var(--text-1); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 6px; }
.dcp-sec p { margin: 0; font-size: .86rem; color: var(--text-1); white-space: pre-wrap; line-height: 1.45; }
.dcp-since { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--text-2); }
.dcp-since span { display: inline-flex; align-items: center; gap: 6px; }
.dcp-since .ico { width: 15px; height: 15px; }
.dcp-since i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }
.dcp-since b { font-weight: 500; color: var(--text-1); }
.dcp-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.dcp-role { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; padding: 2px 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--text-1); }
.dcp-role i { width: 10px; height: 10px; border-radius: 50%; background: #99aab5; }
.dcg-icon { width: 76px; height: 76px; margin-top: -38px; border-radius: 22px; border: 5px solid var(--card, var(--bg)); background: #2b2d31; color: #fff; display: grid; place-items: center; overflow: hidden; }
.dcg-icon .ico { width: 30px; height: 30px; }
.dcg-body { padding: 2px 18px 18px; }
.dcg-title { display: flex; align-items: center; gap: 6px; font-size: 1.15rem; font-weight: 700; margin: 0; }
.dcg-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: #23a55a; color: #fff; font-size: .7rem; }
.dcg-badge.partner { background: #5865f2; }
.dcg-counts { display: flex; gap: 16px; font-size: .82rem; color: var(--text-2); margin-top: 4px; }
.dcg-counts span { display: inline-flex; align-items: center; gap: 6px; }
.dcg-counts b { color: var(--text-1); font-weight: 600; }
.dcg-dot { width: 8px; height: 8px; border-radius: 50%; background: #80848e; display: inline-block; }
.dcg-dot.on { background: #23a55a; }
.dcg .shop-desc { margin: 12px 0 0; font-size: .86rem; color: var(--text-2); line-height: 1.5; }
.dcg-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--text-3); }
.dcg-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dcg-meta .ico { width: 14px; height: 14px; }
.dcg-meta b { color: var(--text-2); font-weight: 500; }
[data-refresh-profile].spin .ico { animation: dcspin .8s linear infinite; }
@keyframes dcspin { to { transform: rotate(360deg); } }
.dcg .shop-desc { padding: 0; }
.sh-guild-bar { margin-top: 8px; }
.sh-guild-bar .tcfg-summary b { color: var(--text-1); }
.hours-grid { display: grid; gap: 8px; width: 100%; }
.hours-grid-row { display: grid; grid-template-columns: 70px auto 1fr auto 1fr; gap: 10px; align-items: center; font-size: .85rem; }
.hours-grid-row.off input[type="time"] { opacity: .35; }
.hours-grid-row span.to { color: var(--text-3); font-size: .8rem; }

.ai-top { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 4px 20px 16px; align-items: center; }
.ai-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ai-fact { background: var(--c-100); border-radius: 10px; padding: 10px 12px; }
.ai-fact span { display: block; font-size: .72rem; color: var(--text-3); }
.ai-fact b { font-size: .95rem; font-weight: 600; }
.ai-fact small { display: block; font-size: .72rem; color: var(--text-3); margin-top: 2px; }
.ai-findings { padding: 0 20px; display: grid; gap: 8px; }
.ai-finding { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-left: 3px solid #f0b232; border-radius: 8px; padding: 10px 12px; font-size: .85rem; }
.ai-finding.critical { border-left-color: #e74c3c; }
.ai-finding .grow { flex: 1; }
.ai-finding small { display: block; color: var(--text-3); margin-top: 2px; }
.ai-ok { padding: 10px 12px; border-radius: 8px; background: var(--c-100); font-size: .85rem; color: var(--text-2); }
.ai-log-head { padding: 16px 20px 6px; font-size: .74rem; font-weight: 700; color: var(--text-2); }
.ai-log { padding: 0 20px 18px; display: grid; gap: 0; max-height: 320px; overflow: auto; }
.ai-log-row { display: grid; grid-template-columns: 92px 70px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .8rem; }
.ai-log-row:first-child { border-top: 0; }
.ai-log-row time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.ai-log-row .who { font-weight: 600; }
.ai-log-row small { display: block; color: var(--text-3); margin-top: 2px; }
.ai-log-row.critical .who { color: #e74c3c; }
@media (max-width: 760px) {
  .ai-top { grid-template-columns: 1fr; justify-items: center; }
}
.ai-top { grid-template-columns: 200px 1fr; }
.ai-health { --p: 0; --c: #23a55a; background: var(--c-100); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; height: 100%; align-content: center; }
.ai-health-state { font-size: .74rem; color: var(--c); font-weight: 600; }
.ai-ok { display: flex; align-items: center; gap: 8px; }
.ai-ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #23a55a; flex: none; }
.ai-ok.muted-dot::before { background: var(--text-3); }
.ai-log-row .count { display: inline-block; margin-left: 6px; font-size: .7rem; color: var(--text-3); background: var(--c-100); border-radius: 99px; padding: 0 6px; }
@media (max-width: 760px) {
  .ai-top { grid-template-columns: 1fr; }
}

.ai-top { grid-template-columns: 170px 1fr; }
.ai-health { background: none; padding: 0; justify-items: center; gap: 8px; }
.ai-dial { position: relative; width: 132px; height: 132px; }
.ai-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ai-track { fill: none; stroke: var(--c-100); stroke-width: 9; }
.ai-arc { fill: none; stroke: url(#aiDialGrad); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: calc(var(--p) * 1) 100; transition: stroke-dasharray .6s ease;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 45%, transparent)); }
.ai-g1 { stop-color: var(--c); stop-opacity: .55; }
.ai-g2 { stop-color: var(--c); }
.ai-ticks line { stroke: var(--line); stroke-width: 1.5; stroke-linecap: round; }
.ai-ticks line.on { stroke: color-mix(in srgb, var(--c) 60%, transparent); }
.ai-dial-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ai-dial-text b { font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.ai-dial-text small { font-size: .7rem; color: var(--text-3); margin-top: 4px; }
.ai-health-state { font-size: .74rem; font-weight: 600; color: var(--c); padding: 3px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 12%, transparent); display: inline-flex; align-items: center; gap: 6px; }
.ai-health-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
@media (max-width: 640px) {
  .tcfg-bar-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .tcfg-bar-actions { justify-content: flex-end; flex-wrap: wrap; margin-left: 0; }
}

.crm-adjust { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; padding: 0 20px 16px; }
@media (max-width: 760px) { .crm-adjust { grid-template-columns: 1fr 1fr; } }

.order-tools { display: flex; align-items: center; gap: 10px; padding: 14px 20px 6px; }
.order-tools .input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .order-tools { flex-direction: column; align-items: stretch; } }

:where(button, a, [tabindex], summary):focus-visible {
  outline: 2px solid var(--c-400);
  outline-offset: 2px;
}
.input:focus-visible, .textarea:focus-visible, .xselect-btn:focus-visible { outline: none; }
.switch input:focus-visible + .switch-track,
.check input:focus-visible + .check-box {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c-400);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.code-block {
  position: relative;
  background: var(--c-50);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--c-25);
  font-size: .74rem;
  color: var(--text-3);
}
.code-pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--text-2);
  max-height: 360px;
}

.alert-icon { width: 17px; height: 17px; color: var(--text); align-self: flex-start; margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; color: var(--text); }
.alert-text { color: var(--text-2); }
.alert-close {
  width: 26px; height: 26px;
  flex-shrink: 0;
  align-self: flex-start;
  display: grid; place-items: center;
  border: none; background: none;
  border-radius: var(--r-sm);
  color: inherit;
  opacity: .7;
  cursor: pointer;
  transition: background var(--t-fast) var(--ios), opacity var(--t-fast) var(--ios);
}
.alert-close:hover { background: var(--hover); opacity: 1; }
.alert-close .ico { width: 15px; height: 15px; }

.alert-success { background: var(--surface); border-left: 3px solid var(--accent-solid); }
.alert-warning { background: var(--c-25); border-style: dashed; border-color: var(--c-400); }
.alert-danger { background: var(--c-900); border-color: var(--c-900); color: var(--c-0); }
.alert-danger .alert-icon,
.alert-danger .alert-title,
.alert-danger .alert-text { color: var(--c-0); }
.alert-danger .alert-close:hover { background: rgba(127,127,127,.25); }
.spinner {
  display: inline-block;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: .8;
  animation: login-spin .62s linear infinite;
}

.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .74rem;
  color: var(--text-2);
}
.progress-val { font-variant-numeric: tabular-nums; color: var(--text-3); }
.progress-track {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--c-100);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-grad);
  transition: width var(--t-slow) var(--ios);
}
.progress-track.indeterminate .progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  animation: progress-slide 1.15s var(--ios) infinite;
}
@keyframes progress-slide {
  from { transform: translateX(-105%); }
  to   { transform: translateX(270%); }
}

.skeleton {
  display: block;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent, var(--hover), transparent) 0 0 / 50% 100% no-repeat,
    var(--c-100);
  animation: skeleton-sheen 1.3s var(--ios) infinite;
}
.skeleton-lines { display: flex; flex-direction: column; gap: 8px; }
@keyframes skeleton-sheen {
  from { background-position: -100% 0, 0 0; }
  to   { background-position: 200% 0, 0 0; }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 32px 18px;
}
.empty-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-100);
  border: 1px solid var(--line);
  color: var(--text-3);
  margin-bottom: 6px;
}
.empty-title { font-size: .86rem; font-weight: 600; }
.empty-desc { font-size: .76rem; color: var(--text-3); max-width: 340px; line-height: 1.55; }
.empty-action { margin-top: 10px; }

.tip-wrap { position: relative; display: inline-flex; }
.tip {
  position: absolute;
  left: 50%;
  z-index: 70;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--c-900);
  color: var(--c-0);
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--shadow-md);
  transition: opacity var(--t-fast) var(--ios), transform var(--t-med) var(--spring);
}
.tip-top    { bottom: calc(100% + 7px); transform: translate(-50%, 4px); }
.tip-bottom { top: calc(100% + 7px);    transform: translate(-50%, -4px); }
.tip-wrap:hover > .tip,
.tip-wrap:focus-within > .tip { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }

.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--t-fast) var(--ios), border-color var(--t-fast) var(--ios), color var(--t-fast) var(--ios), transform var(--t-slow) var(--spring);
}
.pager-btn .ico { width: 15px; height: 15px; }
.pager-btn:hover:not(:disabled) { border-color: var(--c-300); color: var(--text); }
.pager-btn:active:not(:disabled) { transform: scale(.94); transition: transform .09s var(--snap); }
.pager-btn.active { background: var(--accent-grad); color: var(--accent-ink); border-color: transparent; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-gap { min-width: 20px; text-align: center; color: var(--text-3); font-size: .78rem; }

.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .82rem;
}
.check.disabled { opacity: .5; cursor: not-allowed; }
.check input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: inherit; }
.check-box {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid; place-items: center;
  border: 1.5px solid var(--c-300);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent-ink);
  transition: background var(--t-med) var(--ios), border-color var(--t-med) var(--ios), transform var(--t-slow) var(--spring);
}
.check:hover .check-box { border-color: var(--c-400); }
.check:active .check-box { transform: scale(.9); transition: transform .09s var(--snap); }
.check-box svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.check-tick { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--t-med) var(--ios); }
.check-dash { opacity: 0; }
.check input:checked + .check-box,
.check input:indeterminate + .check-box { background: var(--accent-grad); border-color: transparent; }
.check input:checked + .check-box .check-tick { stroke-dashoffset: 0; }
.check input:indeterminate + .check-box .check-tick { opacity: 0; }
.check input:indeterminate + .check-box .check-dash { opacity: 1; }
.check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.check-label { color: var(--text); font-weight: 500; line-height: 1.45; }
.check-desc { font-size: .72rem; color: var(--text-3); line-height: 1.45; }

.radio .check-box { border-radius: 50%; }
.radio .check-box::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-ink);
  transform: scale(0);
  transition: transform var(--t-slow) var(--spring);
}
.radio input:checked + .check-box::after { transform: scale(1); }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-group.row { flex-direction: row; flex-wrap: wrap; gap: 10px 18px; }

.kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-family: inherit;
  font-size: .72rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-2);
}

table.table td.empty-cell { padding: 0; }
.empty-cell .empty-state { padding: 30px 18px; }
.empty-state .empty-icon .ico { width: 19px; height: 19px; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn .spinner { width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px; }
.btn-sm .spinner { width: 11px; height: 11px; margin-right: 5px; }
.backup-files { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.backup-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--c-25); font-size: .78rem; }
.backup-file .num { color: var(--text-3); }
.modal-body.menu-open { overflow: visible; }
.xselect:not(.open) .xselect-menu {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  transition:
    opacity var(--t-fast) var(--ios),
    transform var(--t-slow) var(--spring),
    max-height 0s linear var(--t-fast),
    padding 0s linear var(--t-fast),
    border-width 0s linear var(--t-fast);
}
@media (max-width: 560px) {
  .card-head { flex-wrap: wrap; }
  .card-head > div:first-child { flex: 1 1 220px; min-width: 0; }
}
