:root {
  color-scheme: light;
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --card-fg: oklch(0.141 0.005 285.823);
  --primary: oklch(0.21 0.006 285.885);
  --primary-fg: oklch(0.985 0 0);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-fg: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-fg: #62626c;
  --accent: oklch(0.967 0.001 286.375);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.705 0.015 286.067);
  --destructive: oklch(0.577 0.245 27.325);
  --ok: #047857;
  --ok-strong: #10b981;
  --warn: #b45309;
  --info: #2563eb;
  --dock-bg: oklch(1 0 0 / 70%);
  --dock-icon: oklch(0.922 0 0);
  --dock-shadow: 0 10px 15px -3px oklch(0 0 0 / 10%), 0 4px 6px -4px oklch(0 0 0 / 10%);
  --shadow-pop: 0 16px 48px oklch(0 0 0 / 18%);
  --r-card: 16px;
  --fast: 120ms;
  --ease-out: cubic-bezier(.165, .84, .44, 1);
  --canvas: #f8f9fb;
  --surface-shadow: 0 1px 3px rgb(20 24 35 / 3%);
}
html.dark {
  --canvas: #131416;
  --surface-shadow: 0 1px 3px rgb(0 0 0 / 12%);
  color-scheme: dark;
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.21 0.006 285.885);
  --card-fg: oklch(0.985 0 0);
  --primary: oklch(0.92 0.004 286.32);
  --primary-fg: oklch(0.21 0.006 285.885);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-fg: oklch(0.985 0 0);
  --muted: oklch(0.274 0.006 286.033);
  --muted-fg: oklch(0.705 0.015 286.067);
  --accent: oklch(0.274 0.006 286.033);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.552 0.016 285.938 / 55%);
  --destructive: oklch(0.704 0.191 22.216);
  --ok: #34d399;
  --ok-strong: #34d399;
  --warn: #fbbf24;
  --info: #60a5fa;
  --dock-bg: #171717;
  --dock-icon: #262626;
  --dock-shadow: 0 10px 15px -3px oklch(1 0 0 / 5%), 0 4px 6px -4px oklch(1 0 0 / 5%);
  --shadow-pop: 0 16px 48px oklch(0 0 0 / 55%);
}
* { box-sizing: border-box; scrollbar-width: none; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--foreground);
  font: 13px/1.6 "Segoe UI Variable Text", -apple-system, "SF Pro Text", Inter, "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::-webkit-scrollbar { display: none; width: 0; height: 0; }
.tablecard, .modal-body, .select-list { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.tablecard::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .select-list::-webkit-scrollbar { display: block; width: 6px; height: 6px; }
.tablecard::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb, .select-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.muted { color: var(--muted-fg); }
.error { color: var(--destructive); }
.warn-text { color: var(--warn); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
svg.lucide { flex: none; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; background: var(--muted); padding: 1px 5px; border-radius: 6px; }

#app-view { min-height: 100vh; display: flex; }
.shell {
  --page-inset: 16px;
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 16px 24px;
  flex: 1; min-width: 0;
}
@media (min-width: 640px) { .shell { --page-inset: 20px; padding: 20px 20px 24px; } }
@media (min-width: 768px) { .shell { --page-inset: 28px; padding: 24px 28px 24px; gap: 16px; } }
@media (min-width: 1024px) { .shell { --page-inset: 40px; padding: 24px 40px 24px; } }
.container-7xl {
  width: 100%; max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 20px;
  padding-bottom: 92px;
}
@media (min-width: 768px) { .container-7xl { gap: 24px; } }
section { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
section > h2 {
  margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 7px;
}
section > h2 .lucide { color: var(--muted-fg); }

@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fade-up .28s var(--ease-out) both; }

.utilrow {
  width: 100%; max-width: 1200px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid oklch(0.92 0.004 286.32 / 60%);
  background: oklch(0.967 0.001 286.375 / 60%);
  color: var(--muted-fg);
  font-size: 11px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out);
  white-space: nowrap;
}
html.dark .pill { border-color: oklch(1 0 0 / 10%); background: oklch(1 0 0 / 4%); }
.pill:hover { background: var(--muted); color: var(--foreground); }
.pill .lucide { opacity: .7; }

.dock-wrap {
  position: fixed; z-index: 40;
  bottom: 14px; left: 50%; transform: translateX(-50%);
  user-select: none;
}
.dock {
  display: flex; align-items: flex-end; gap: 8px;
  height: 60px; padding: 0 14px 10px;
  border-radius: 14px;
  background: var(--dock-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid oklch(0.92 0.004 286.32 / 40%);
  box-shadow: var(--dock-shadow);
}
html.dark .dock { border-color: oklch(1 0 0 / 10%); }
.dock-item {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; cursor: pointer; padding: 0;
  border-radius: 999px; background: transparent;
  transition: transform 180ms var(--ease-out);
}
.dock-item .di {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--dock-icon); color: var(--foreground);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.dock-item:hover { transform: translateY(-4px) scale(1.1); }
.dock-item.active .di { box-shadow: inset 0 0 0 2px oklch(0 0 0 / 10%); }
html.dark .dock-item.active .di { box-shadow: inset 0 0 0 2px oklch(1 0 0 / 14%); }
.dock-item .tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--primary); color: var(--primary-fg);
  font-size: 11px; font-weight: 500; line-height: 1;
  padding: 6px 9px; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
  box-shadow: var(--shadow-pop); z-index: 5;
}
.dock-item:hover .tip, .dock-item:focus-visible .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.dock-item.active .di { background: var(--primary); color: var(--primary-fg); }
.dock-sep {
  align-self: stretch; margin-top: 12px;
  width: 1px; margin-inline: 3px; background: var(--border);
}

.pagehead {
  display: flex; flex-direction: column; gap: 6px;
}
@media (min-width: 640px) { .pagehead { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.pagehead .tt { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.035em; line-height: 1.3; }
.page-title { display: flex; align-items: center; gap: 10px; }
.info-tip { position: relative; display: inline-flex; vertical-align: middle; flex: none; }
.info-trigger { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted-fg); cursor: help; }
.info-trigger:hover, .info-trigger:focus-visible { background: var(--accent); color: var(--foreground); }
.help-tooltip { display: none; position: absolute; z-index: 80; top: calc(100% + 8px); left: 0; width: max-content; max-width: min(300px, calc(100vw - 32px)); margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--foreground); box-shadow: var(--shadow-pop); font-size: 12px; font-weight: 400; line-height: 1.65; text-align: left; white-space: normal; visibility: hidden; opacity: 0; transform: translateY(-3px); transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out), visibility 140ms; }
.settings-panel :is(label, .field-group).f small.help-tooltip { font-size: 12px; color: var(--foreground); }
.info-tip:hover > .help-tooltip:not([popover]), .info-tip:focus-within > .help-tooltip:not([popover]), .help-tooltip:popover-open { display: block; visibility: visible; opacity: 1; transform: none; }
.help-tooltip:popover-open { position: fixed; inset: auto; }
.field-label { display: flex; align-items: center; gap: 4px; min-height: 24px; }
.pagehead .desc { margin: 3px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted-fg); }
.pagehead .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.section-tabs {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px;
  width: fit-content; max-width: 100%; overflow-x: auto;
  padding: 4px; border-radius: 10px;
  background: var(--muted); color: var(--muted-fg);
}
.section-tabs .tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px;
  white-space: nowrap; border: 0; cursor: pointer; background: none;
  border-radius: 7px; padding: 4px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--muted-fg);
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out);
}
.section-tabs .tab:hover { color: var(--foreground); }
.section-tabs .tab.active {
  background: oklch(1 0 0); color: var(--foreground);
  box-shadow: 0 1px 2px oklch(0 0 0 / 8%);
}
html.dark .section-tabs .tab.active { background: oklch(1 0 0 / 8%); }
.section-tabs .tab .cnt {
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 2.5px 6px; border-radius: 999px;
  background: oklch(0 0 0 / 5%); color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out);
}
html.dark .section-tabs .tab .cnt { background: oklch(1 0 0 / 8%); }
.section-tabs .tab.active .cnt { background: oklch(0 0 0 / 7%); color: var(--foreground); }
html.dark .section-tabs .tab.active .cnt { background: oklch(1 0 0 / 12%); }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px 16px; border-radius: var(--r-card); background: var(--muted);
  color: var(--muted-fg); font-size: 12px; text-align: center;
}
.empty .lucide { opacity: .4; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; border-radius: 9px;
  height: 34px; padding: 0 14px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  border: 1px solid var(--border); background: var(--card); color: var(--card-fg);
  box-shadow: var(--surface-shadow);
  cursor: pointer; user-select: none;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out), border-color var(--fast) var(--ease-out), opacity var(--fast) var(--ease-out), transform 220ms cubic-bezier(.2, 1.45, .4, 1);
}
.btn:hover { background: var(--accent); }
html.dark .btn { background: oklch(1 0 0 / 5%); }
html.dark .btn:hover { background: oklch(1 0 0 / 10%); }
.btn.primary {
  background: var(--primary); color: var(--primary-fg); border-color: transparent;
  box-shadow: 0 1px 2px oklch(0 0 0 / 8%);
}
html.dark .btn.primary { background: var(--primary); color: var(--primary-fg); }
.btn.primary:hover { filter: brightness(1.2); }
.btn.danger { color: var(--destructive); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.loading::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid oklch(1 0 0 / 40%); border-top-color: var(--primary);
  animation: spin .6s linear infinite;
}
.btn.primary.loading::after { border-color: oklch(1 0 0 / 40%); border-top-color: var(--primary-fg); }
@keyframes spin { to { transform: rotate(360deg); } }

.ibtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted-fg); cursor: pointer;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out);
}
.ibtn:hover { background: var(--accent); color: var(--foreground); }
.ibtn.danger:hover { background: oklch(0.577 0.245 27.325 / 12%); color: var(--destructive); }
.ibtn:disabled { opacity: .4; pointer-events: none; }
.ibtn .tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: var(--primary); color: var(--primary-fg);
  font-size: 11px; font-weight: 500; line-height: 1; padding: 5px 8px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none; z-index: 6;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.ibtn:hover .tip, .ibtn:focus-visible .tip { opacity: 1; transform: translateX(-50%) translateY(0); }

input, select, textarea {
  font: inherit; color: var(--foreground);
  height: 36px; padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--input);
  background: var(--card);
  transition: border-color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out);
}
html.dark input, html.dark select, html.dark textarea { background: oklch(1 0 0 / 5%); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: transparent;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--muted-fg); }
textarea { height: auto; width: 100%; max-width: 100%; min-width: 0; resize: vertical; padding: 8px 10px; min-height: 48px; line-height: 1.55; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); }

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox .lucide { position: absolute; left: 11px; width: 14px; height: 14px; color: var(--muted-fg); pointer-events: none; }
.searchbox input { border-radius: 9px; height: 36px; padding-left: 33px; background: var(--card); border-color: var(--input); }
html.dark .searchbox input { background: oklch(1 0 0 / 4%); border-color: oklch(1 0 0 / 9%); }
.searchbox input:focus { background: var(--card); border-color: transparent; }

select.round { border-radius: 9px; height: 36px; padding: 0 28px 0 12px; background: var(--card); border-color: var(--input); cursor: pointer; }
html.dark select.round { background: oklch(1 0 0 / 4%); border-color: oklch(1 0 0 / 9%); }
select.round:hover { background: var(--muted); }
td, th { transition: background var(--fast) var(--ease-out); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border-radius: var(--r-card); background: var(--muted);
  padding: 8px 12px;
}
.status-pills { display: inline-flex; align-items: center; gap: 2px; border-radius: 10px; background: var(--muted); border: 1px solid transparent; padding: 3px; }
html.dark .status-pills { background: oklch(1 0 0 / 5%); }
.status-pills button {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; cursor: pointer;
  border-radius: 7px; padding: 5px 11px;
  font-size: 12px; font-weight: 500; color: var(--muted-fg);
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out);
}
.status-pills button:hover { color: var(--foreground); }
.status-pills button.active {
  background: oklch(1 0 0); color: var(--foreground);
  box-shadow: 0 1px 2px oklch(0 0 0 / 8%);
}
html.dark .status-pills button.active { background: oklch(1 0 0 / 10%); }
.status-pills .cnt {
  font-size: 11px; font-weight: 600; min-width: 16px; text-align: center;
  border-radius: 999px; padding: 1px 5px;
  background: oklch(0 0 0 / 6%); color: var(--muted-fg);
}
html.dark .status-pills .cnt { background: oklch(1 0 0 / 8%); }
.status-pills button.active .cnt { background: oklch(0 0 0 / 8%); }

.statcard, .card, .formcard, .toolbar, .management-empty, .empty, .usage-panel { border: 1px solid var(--border); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.cards.multicol { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) { .cards.multicol { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.statcard {
  border-radius: var(--r-card); background: var(--card);
  padding: 18px 20px; box-shadow: var(--surface-shadow);
  display: flex; flex-direction: column;
}
.statcard .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.statcard .t { font-size: 12px; font-weight: 500; color: var(--muted-fg); line-height: 1.4; word-break: keep-all; }
.statcard .t:has(.info-tip) { display: inline-flex; align-items: center; gap: 3px; }
.statcard .ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  color: var(--muted-fg);
}
html.dark .statcard .ico { background: oklch(1 0 0 / 8%); box-shadow: none; }
.statcard .stat { margin-top: 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.statcard .stat small { font-size: 12px; font-weight: 500; color: var(--muted-fg); }
.statcard .d { margin-top: 6px; font-size: 12px; color: var(--muted-fg); line-height: 1.5; }
.tone-success { color: var(--ok); }
.tone-warning { color: var(--warn); }
.tone-danger { color: var(--destructive); }
html.dark .ico.tone-success { background: oklch(0.596 0.145 163 / 18%); }
html.dark .ico.tone-warning { background: oklch(0.666 0.179 58 / 18%); }

.tablecard {
  border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); box-shadow: var(--surface-shadow);
  max-width: 100%; overflow: visible;
}
.tablecard th:first-child { border-top-left-radius: 13px; }
.tablecard th:last-child { border-top-right-radius: 13px; }
.tablecard tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.tablecard tr:last-child td:last-child { border-bottom-right-radius: 13px; }
.tablecard table, section > table { width: 100%; border-collapse: separate; border-spacing: 0; }
table { font-size: 13px; }
th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted-fg);
  letter-spacing: .01em;
  padding: 11px 16px; white-space: nowrap;
  border-bottom: 1px solid oklch(0.92 0.004 286.32 / 40%);
  background: var(--muted);
}
html.dark th { border-bottom-color: oklch(1 0 0 / 8%); }
td {
  padding: 12px 16px; vertical-align: middle;
  border-bottom: 1px solid oklch(0.92 0.004 286.32 / 40%);
}
html.dark td { border-bottom-color: oklch(1 0 0 / 6%); }
tr:last-child td { border-bottom: 0; }
tbody tr, section > table tr { transition: background var(--fast) var(--ease-out); }
tbody tr:hover, section > table tr:hover { background: var(--accent); }
html.dark tbody tr:hover, html.dark section > table tr:hover { background: oklch(1 0 0 / 4%); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11.5px; color: var(--muted-fg); }
.quota-meta { display: block; font-size: 11px; line-height: 1.5; color: var(--muted-fg); }
.reward-link { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 11px; font-weight: 600;
}
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-name .nm { min-width: 0; }
.cell-name .nm b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 8px;
  font-size: 11px; font-weight: 500; line-height: 1.4;
  background: var(--secondary); color: var(--secondary-fg);
  white-space: nowrap;
}
.badge.sm { border-radius: 6px; padding: 0 6px; font-size: 11px; }
.badge.active { background: var(--secondary); color: var(--ok); }
.badge.cooldown { background: oklch(0.666 0.179 58 / 14%); color: var(--warn); }
.badge.needs_relogin, .badge.expired, .badge.error { background: oklch(0.577 0.245 27.325 / 12%); color: var(--destructive); }
.badge.web_only { background: oklch(0.623 0.214 259 / 12%); color: var(--info); }
.badge.live { background: oklch(0.696 0.17 162.48 / 15%); color: var(--ok); font-size: 11px; padding: 1px 6px; }
.badge.plain { background: oklch(1 0 0 / 60%); color: var(--muted-fg); font-size: 11px; padding: 1px 6px; }
html.dark .badge.plain { background: oklch(1 0 0 / 6%); }
.badge.ok { background: oklch(0.696 0.17 162.48 / 14%); color: var(--ok); }
.badge.busy { background: oklch(0.666 0.179 58 / 14%); color: var(--warn); }
.badge.err { background: oklch(0.577 0.245 27.325 / 12%); color: var(--destructive); }
html:not(.dark) .badge:is(.needs_relogin, .expired, .error, .err) { color: #b42318; }
html:not(.dark) .badge.web_only { color: #1d4ed8; }

.bar {
  height: 6px; border-radius: 999px; background: var(--border); overflow: hidden;
  min-width: 90px;
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--ok-strong);
  transition: width .6s var(--ease-out);
}
.bar.warn > i { background: var(--warn); }
.bar.danger > i { background: var(--destructive); }

.card {
  border-radius: var(--r-card); background: var(--muted);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
:is(label, .field-group).f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted-fg); }
:is(label, .field-group).f input, :is(label, .field-group).f select { height: 32px; }
:is(label, .field-group).f.check { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--foreground); }
:is(label, .field-group).f.check input { flex: none; }
.kv { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 8px; }
.kv b, .kv > label { font-size: 12px; font-weight: 500; color: var(--muted-fg); }

.formcard { border-radius: var(--r-card); background: var(--muted); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.formcard > h3 { margin: 0; font-size: 14px; font-weight: 600; }
.settings-ports { margin: 0; font-size: 12px; line-height: 1.6; }
textarea.invalid { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--destructive); }
.json-hint { margin: -6px 0 0; min-height: 0; font-size: 11px; line-height: 1.5; color: var(--muted-fg); }
.json-hint:empty { display: none; }
.json-hint.error { color: var(--destructive); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.pager button {
  min-width: 26px; height: 26px; padding: 0 7px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted-fg); font-size: 12px; cursor: pointer;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out);
}
.pager button:hover:not(:disabled) { background: var(--accent); color: var(--foreground); }
.pager button.cur { background: var(--primary); color: var(--primary-fg); font-weight: 600; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .pinfo { font-size: 11px; color: var(--muted-fg); margin-left: 6px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--background); }
.login-card {
  width: 100%; max-width: 360px;
  border-radius: var(--r-card); background: var(--muted);
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 14px;
  animation: fade-up .45s var(--ease-out) both;
}
.login-logo {
  display: block; width: 40px; height: 40px; margin: 0 auto;
}
.login-card h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; text-align: center; }
.login-card .sub { margin: 0 0 4px; font-size: 12px; color: var(--muted-fg); text-align: center; line-height: 1.5; }
.login-card input { height: 36px; background: var(--card); border-color: transparent; }
.login-card .btn { width: 100%; height: 36px; }
.login-card .error { font-size: 12px; min-height: 16px; margin: 0; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--muted-fg); cursor: pointer;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out);
}
.pw-toggle:hover { background: var(--accent); color: var(--foreground); }
.login-card.shake { animation: shake .4s var(--ease-out); }
@keyframes shake {
  20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

.modal-bg {
  position: fixed; inset: 0; z-index: 50;
  background: oklch(0.17 0.015 255 / 56%);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: bg-in .2s var(--ease-out);
}
@keyframes bg-in { from { opacity: 0; } }
.modal {
  width: min(100%, 560px); max-height: min(780px, calc(100dvh - 48px)); overflow: hidden;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--card); color: var(--card-fg);
  box-shadow: 0 28px 80px oklch(0.17 0.015 255 / 25%), 0 4px 16px oklch(0.17 0.015 255 / 8%);
  display: flex; flex-direction: column;
  animation: modal-in .25s var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-eyebrow { display: block; margin-bottom: 4px; color: var(--muted-fg); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.modal-header h2 { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.modal-close { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 9px; background: var(--muted); color: var(--muted-fg); font-family: inherit; font-size: 22px; line-height: 1; cursor: pointer; transition: background 180ms var(--ease-out), color 180ms var(--ease-out), transform 180ms var(--ease-out); }
.modal-close:hover { color: var(--foreground); background: var(--accent); }
.modal-close:active { transform: scale(.96); }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 18px; }
.modal-body > div, .dialog-form { display: flex; flex-direction: column; gap: 12px; }
.modal-body section > h2 { font-size: 14px; line-height: 1.5; }
.modal-body .kv { grid-template-columns: minmax(90px, 115px) minmax(0, 1fr); margin-bottom: 10px; }
.modal-body .kv input:not([type="checkbox"]), .modal-body .kv select { width: 100%; min-width: 0; }
.modal-body input:not([type="checkbox"]), .modal-body select { min-width: 0; max-width: 100%; height: 32px; }
.modal-body .btn { min-height: 30px; padding-inline: 14px; }
.dialog-intro, .confirm-content p { margin: 0; color: var(--muted-fg); font-size: 13px; line-height: 1.7; }
.dialog-field { display: flex; flex-direction: column; gap: 7px; color: var(--foreground); font-size: 13px; font-weight: 600; }
.dialog-field input, .dialog-field select { width: 100%; font-weight: 400; }
.dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dialog-error { margin: 0; font-size: 13px; }
.dialog-error:empty { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.btn.danger-solid { background: var(--destructive); color: #fff; border-color: transparent; }
html.dark .btn.danger-solid { background: var(--destructive); color: #1b1212; }
.btn.danger-solid:hover { filter: brightness(.9); }
.import-option { gap: 12px; }
.import-option p, .import-option label { font-size: 12.5px; line-height: 1.6; }
.import-option input { width: 100%; }
.secret-result .log { user-select: all; }
.modal-bg.closing { opacity: 0; transition: opacity .2s var(--ease-out); }
.modal-bg.closing .modal { opacity: 0; transform: translateY(8px); transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); }
@media (max-width: 640px) {
  .modal-bg { padding: 12px; align-items: flex-end; }
  .modal { width: 100%; max-height: calc(100dvh - 24px); border-radius: 20px; }
  .modal-header { padding: 20px 20px 16px; }
  .modal-body { padding: 20px; }
  .modal-body .kv { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .dialog-grid { grid-template-columns: minmax(0, 1fr); }
}
pre.log {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--muted); font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-all;
}

.toast {
  position: fixed; right: 20px; bottom: 24px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: var(--primary-fg);
  border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  box-shadow: var(--shadow-pop);
  animation: toast-in .3s var(--ease-out);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.spinner {
  width: 12px; height: 12px; flex: none;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.oauth-result {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-top: 2px;
  background: oklch(1 0 0 / 50%);
}
html.dark .oauth-result { background: oklch(1 0 0 / 3%); }
.oauth-result.ok { border-color: oklch(0.696 0.17 162.48 / 45%); }
.oauth-result.warn { border-color: oklch(0.666 0.179 58 / 45%); }
tr.hl > td { animation: row-hl 1.1s ease-in-out 3; }
@keyframes row-hl { 0%, 100% { background: transparent; } 50% { background: oklch(0.696 0.17 162.48 / 16%); } }

@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@keyframes theme-fade { from { opacity: .6; } }
html.theme-swap, html.theme-swap body { animation: theme-fade .25s var(--ease-out); }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

#main.no-anim *, #main.no-anim { animation: none !important; }
#main.no-anim .bar > i { transition: none !important; }

.btn, .pill, .ibtn, .tab { transition-duration: 180ms; }
.ibtn:focus-visible .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) {
  .shell { padding-top: 16px; }
  .dock-wrap { max-width: calc(100vw - 16px); bottom: 8px; overflow-x: auto; }
  .dock { width: max-content; padding: 0 10px 10px; gap: 5px; }
  .dock-item, .dock-item .di { width: 36px; height: 36px; }
  .dock-sep { margin-inline: 1px; }
  .tablecard { overflow-x: auto; }
  .tablecard table { min-width: 680px; }
  .toast { right: 12px; bottom: 64px; max-width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (min-width: 1024px) { .cards.usage-summary { grid-template-columns: repeat(4, 1fr); } }
.usage-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.usage-heading .muted { font-size: 12px; }
.usage-panel { border-radius: var(--r-card); background: var(--muted); padding: 10px 12px; }
.usage-panel { min-width: 0; }
.usage-panel h3 { margin: 0 0 10px; font-size: 14px; }
.usage-panel .tablecard { background: transparent; border: 0; }
.usage-empty { color: var(--muted-fg); font-size: 13px; padding: 20px 14px; margin: 0; }
@media (max-width: 640px) { .usage-panel .tablecard table { min-width: 0; } }

button, input, select, textarea, table { font-variant-numeric: tabular-nums; }
p, .desc, .dialog-intro { text-wrap: pretty; }
.btn > svg, h2 > svg, .toast > svg { position: relative; top: .125em; }
html.dark :is(.pagehead .tt, .modal-header h2) { font-weight: 550; }
html.dark :is(.statcard .stat, .formcard > h3, .dialog-field, .pager button.cur) { font-weight: 500; }
html.dark :is(.statcard .t, .btn, .section-tabs .tab, .cell-name .nm b, :is(label, .field-group).f, .kv b, .badge, .toast) { font-weight: 400; }
html.dark .modal-eyebrow { font-weight: 600; }

.select-control { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
.select-control:not(.select-control-round) { width: 100%; }
.row > .select-control { width: auto; }
.select-native { display: none !important; }
.select-trigger {
  width: 100%; min-width: 0; height: 32px; padding: 0 10px; display: inline-flex;
  align-items: center; justify-content: space-between; gap: 16px; text-align: left;
  border: 0; border-radius: 8px; background: var(--secondary); color: var(--foreground);
  font: inherit; cursor: pointer; transition: background 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
html.dark .select-trigger { background: oklch(1 0 0 / 5%); }
.select-trigger:hover, .select-trigger[aria-expanded="true"] { background: var(--accent); }
.select-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ring); }
.select-trigger:disabled { opacity: .5; cursor: not-allowed; }
.select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-chevron { flex: none; color: var(--muted-fg); transition: transform 160ms var(--ease-out); }
.select-trigger[aria-expanded="true"] .select-chevron { transform: rotate(180deg); }
.select-control-round .select-trigger { height: 36px; border-radius: 9px; font-size: 13px; }
.modal-body .select-trigger { height: 32px; }
.select-list {
  position: absolute; z-index: 20; left: 0; right: auto; top: calc(100% + 6px); bottom: auto;
  margin: 0; width: max(100%, 180px); max-width: calc(100vw - 16px); max-height: 260px;
  overflow-y: auto; padding: 5px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-pop);
  animation: fade-up 140ms var(--ease-out);
}
.select-open-up .select-list { top: auto; bottom: calc(100% + 6px); }
.select-list:popover-open { position: fixed; bottom: auto; }
.select-list[hidden] { display: none; }
.select-option { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 5px 9px; border-radius: 7px; font-size: 13px; line-height: 1.4; cursor: pointer; }
.select-option:hover, .select-option.is-active { background: var(--muted); }
.select-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.select-option[aria-selected="true"] { font-weight: 600; }
.select-check { color: var(--info); flex: none; }
html.dark .select-option[aria-selected="true"] { font-weight: 500; }

.usage-tabs { margin-bottom: 10px; }
.usage-pager { justify-content: flex-end; }
.usage-pager .pinfo { margin: 0 6px; }
main[data-page="logs"] { gap: 18px; }
.log-tabs { padding: 3px; }
.log-live { color: var(--muted-fg); }
.log-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.log-live[aria-pressed="true"]::before { background: var(--ok); opacity: 1; }
.log-live.is-reconnecting::before { background: var(--warn); }
.log-tabs .tab { min-height: 28px; padding: 3px 9px; }
.log-filter-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.log-filter-grid { display: grid; gap: 8px; }
.log-primary-filters { grid-column: 1 / -1; grid-template-columns: minmax(220px, 1.6fr) minmax(105px, .65fr) minmax(105px, .65fr) minmax(180px, 1.1fr); }
.log-filter { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 11px; color: var(--muted-fg); }
.log-filter :is(input, select) { width: 100%; min-width: 0; height: 30px; padding: 4px 8px; font-size: 12px; }
.log-filter .select-trigger { height: 30px; padding: 0 8px; gap: 8px; font-size: 12px; }
.log-filter-actions { grid-column: 2; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin: 0; }
.log-filter-actions .btn { height: 28px; min-height: 28px; padding: 3px 12px; font-size: 12px; }
.log-advanced { align-self: center; min-width: 0; margin: 0; font-size: 11px; color: var(--muted-fg); }
.log-advanced > summary { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: var(--muted-fg); cursor: pointer; width: fit-content; list-style: none; transition: background var(--fast), color var(--fast); }
.log-advanced > summary::-webkit-details-marker { display: none; }
.log-advanced > summary:hover, .log-advanced[open] > summary { background: var(--accent); color: var(--foreground); }
.log-advanced > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.log-filter-chevron { transition: transform var(--fast); }
.log-advanced[open] .log-filter-chevron { transform: rotate(180deg); }
.log-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; border-radius: 5px; padding: 0 4px; background: var(--primary); color: var(--primary-fg); font-size: 10px; font-weight: 600; }
.log-advanced[open] { grid-column: 1 / -1; }
.log-advanced[open] > summary { margin-bottom: 8px; }
.log-advanced .log-filter-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding-top: 10px; border-top: 1px solid var(--border); }
#lf-error { color: var(--destructive); font-size: 12px; }
#lf-error:empty { display: none; }
#log-page-jump { display: flex; align-items: center; gap: 8px; margin-left: 10px; font-size: 12px; color: var(--muted-fg); }
#log-page-jump input { width: 72px; padding: 6px; }
.log-desktop { overflow-x: auto; }
.log-desktop table { table-layout: fixed; min-width: 1180px; }
.log-desktop .log-col-time { width: 152px; }
.log-desktop .log-col-key { width: 100px; }
.log-desktop .log-col-account { width: 240px; }
.log-desktop .log-col-model { width: 90px; }
.log-desktop .log-col-status { width: 58px; }
.log-desktop .log-col-attempts { width: 44px; }
.log-desktop .log-col-ttft { width: 92px; }
.log-desktop .log-col-tokens { width: 80px; }
.log-desktop .log-col-error { width: 220px; }
.log-desktop th, .log-desktop td { padding: 6px; font-size: 12px; }
#log-panel tbody td { padding-top: 12px; padding-bottom: 12px; }
.log-desktop td:first-child { white-space: nowrap; }
.log-desktop th:nth-child(5), .log-desktop td:nth-child(5), .log-desktop th:nth-child(6), .log-desktop td:nth-child(6) { text-align: center; }
.log-desktop th:nth-child(7), .log-desktop td:nth-child(7), .log-desktop th:nth-child(8), .log-desktop td:nth-child(8) { text-align: right; }
.log-desktop th:last-child, .log-desktop td:last-child { padding-left: 12px; }
.log-desktop th small { font-size: 10px; font-weight: 400; }
.log-cell-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-error-message { display: block; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.log-detail-trigger { flex: none; padding: 3px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-fg); font: inherit; font-size: 11px; cursor: pointer; }
.log-detail-trigger:hover, .log-detail-trigger[aria-expanded="true"] { background: var(--accent); color: var(--foreground); }
.log-detail-trigger:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.log-detail-card { position: fixed; inset: auto; z-index: 100; margin: 0; padding: 12px; box-sizing: border-box; max-width: calc(100vw - 24px); max-height: min(300px, calc(100vh - 24px)); overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); box-shadow: 0 8px 28px oklch(0 0 0 / 14%); font-size: 12px; }
.log-detail-card[hidden] { display: none; }
.log-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.log-detail-heading strong { font-size: 12px; font-weight: 600; }
.log-detail-close { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted-fg); font-size: 18px; line-height: 1; cursor: pointer; }
.log-detail-close:hover { background: var(--accent); color: var(--foreground); }
.log-detail-card dl { display: grid; gap: 7px; margin: 0; }
.log-detail-card dl > div { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: baseline; gap: 10px; }
.log-detail-card dt { color: var(--muted-fg); font-size: 11px; }
.log-detail-card dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11.5px; line-height: 1.5; }
.log-candidate-trigger { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); }
.log-candidate-trigger > span { font-variant-numeric: tabular-nums; }
.log-candidate-list { display: grid; gap: 7px; }
.log-candidate-item { padding: 8px 9px; border-radius: 8px; background: var(--muted); }
.log-candidate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.log-candidate-head strong { min-width: 0; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.log-candidate-head .badge { flex: none; max-width: 60%; white-space: normal; overflow-wrap: anywhere; }
.log-candidate-id { margin-top: 3px; color: var(--muted-fg); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 10.5px; overflow-wrap: anywhere; }
.log-candidate-empty { margin: 0; font-size: 12px; color: var(--muted-fg); line-height: 1.6; }
.mobile-log-error { display: block; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--destructive); font-size: 12px; line-height: 1.5; }
.log-audit-detail { max-width: 480px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1000px) { .log-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .log-filter-grid, .log-advanced .log-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .log-filter-search, .log-filter-date, .log-filter-wide { grid-column: 1 / -1; } .usage-pager .pinfo { width: 100%; } #log-page-jump { margin-left: 0; } }

.overview-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--card); box-shadow: var(--surface-shadow); overflow: hidden; }
.overview-strip > div { min-width: 0; padding: 18px 20px; }
.overview-strip > div + div { border-left: 1px solid var(--border); }
.overview-strip > div > span { font-size: 12px; color: var(--muted-fg); }
.overview-strip strong { display: block; margin-top: 2px; font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; }
.overview-strip strong small { font-size: 12px; font-weight: 400; color: var(--muted-fg); letter-spacing: 0; }
.overview-strip p { margin: 2px 0 0; color: var(--muted-fg); font-size: 11.5px; line-height: 1.5; }
.overview-strip .overview-unavailable { grid-column: 1 / -1; }
.logs-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; }
.logs-strip strong { font-variant-numeric: tabular-nums; }
.management-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.management-toolbar .searchbox { flex: 1; max-width: 440px; min-width: 200px; }
.management-toolbar .searchbox input { width: 100%; }
.management-toolbar > .result-count { margin-left: auto; }
.result-count, .table-hint { font-size: 12px; font-weight: 400; color: var(--muted-fg); }
.account-filters { width: fit-content; max-width: 100%; }
.management-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 16px; text-align: center; background: var(--muted); border-radius: var(--r-card); }
.management-empty > svg { color: var(--muted-fg); margin-bottom: 4px; }
.management-empty h3 { margin: 0; font-size: 15px; font-weight: 600; }
.management-empty p, .quiet-message { margin: 0; font-size: 12px; color: var(--muted-fg); line-height: 1.6; }
.management-empty.compact { padding: 16px 12px; }
.quiet-message.error { color: var(--destructive); }
.text-action { display: inline-flex; align-items: center; justify-content: center; flex: none; border: 0; border-radius: 6px; background: transparent; padding: 6px; font: inherit; font-size: 12px; color: var(--muted-fg); cursor: pointer; }
.text-action:hover { background: var(--accent); color: var(--foreground); }
.text-action:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.quota-ledger { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.quota-entry { min-width: 0; flex: 0 1 auto; }
.quota-entry + .quota-entry { padding-top: 0; border-top: 0; }
.quota-entry-top, .quota-entry-meta { display: flex; align-items: baseline; justify-content: flex-start; gap: 7px; }
.quota-entry-top { font-size: 12px; line-height: 1.4; white-space: nowrap; }
.quota-entry-top strong { flex: none; font-size: 14px; font-weight: 600; }
.quota-entry-meta { color: var(--muted-fg); font-size: 12px; line-height: 1.5; margin-top: 0; flex-wrap: wrap; }
.quota-entry-meta > span { white-space: nowrap; }
.quota-entry-pending { color: var(--muted-fg); }
.quota-entry-pending strong { font-size: 13px; font-weight: 500; }
.quota-entry em { display: inline-block; font: inherit; font-size: 11px; border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; margin-left: 3px; }
.account-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }

.inline-notice { border-radius: 10px; padding: 8px 12px; background: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.inline-notice.error { color: var(--destructive); border-left: 3px solid var(--destructive); }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.section-heading > span { color: var(--muted-fg); font-size: 11px; }
.section-heading h3 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.section-heading h3 svg { vertical-align: -.15em; margin-right: 3px; }
.ok-text { color: var(--ok); }

.daily-claim-card { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--card); box-shadow: var(--surface-shadow); }
.daily-claim-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px; }
.daily-claim-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.daily-claim-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 1px solid var(--border); border-radius: 14px; background: var(--muted); color: var(--foreground); }
.daily-claim-title h2 { margin: 0 0 3px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.daily-claim-title div > span { font-size: 12px; color: var(--muted-fg); }
.daily-claim-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.daily-claim-schedule { display: flex; align-items: center; gap: 6px; }
.daily-claim-schedule label { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-size: 12px; color: var(--muted-fg); cursor: pointer; white-space: nowrap; }
.daily-claim-schedule input[type="checkbox"] { appearance: none; display: inline-block; flex: none; width: 34px; height: 20px; margin: 0; padding: 3px; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: background var(--fast) var(--ease-out), opacity var(--fast) var(--ease-out); }
.time-field { position: relative; display: inline-flex; align-items: center; flex: none; }
.time-field input { width: 84px; height: 30px; padding: 0 28px 0 10px; font-size: 12px; text-align: left; }
.time-field-trigger { position: absolute; right: 4px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted-fg); font: inherit; cursor: pointer; transition: color 120ms var(--ease-out), background 120ms var(--ease-out); }
.time-field-trigger:hover:not(:disabled), .time-field-trigger[aria-expanded="true"] { color: var(--foreground); background: var(--accent); }
.time-field-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ring); }
.time-field-trigger:disabled { opacity: .5; cursor: not-allowed; }
.time-field-pop { position: absolute; z-index: 80; top: calc(100% + 6px); left: 0; right: 0; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); box-shadow: var(--shadow-pop); animation: fade-up 140ms var(--ease-out); visibility: hidden; }
.time-field-pop.open { visibility: visible; }
.time-field-col { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-width: 0; max-height: 174px; overflow-y: auto; overscroll-behavior: contain; }
.time-option { flex: none; min-height: 26px; padding: 3px 0; border: 0; border-radius: 7px; background: transparent; color: var(--foreground); font: inherit; font-size: 12px; text-align: center; cursor: pointer; transition: background 120ms var(--ease-out); }
.time-option:hover { background: var(--muted); }
.time-option.selected { background: var(--primary); color: var(--primary-fg); font-weight: 600; }
.time-option:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--ring); }
.daily-claim-schedule input[type="checkbox"]::before { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / .16); transition: transform var(--fast) var(--ease-out); }
.daily-claim-schedule input[type="checkbox"]:checked { background: var(--primary); }
.daily-claim-schedule input[type="checkbox"]:checked::before { transform: translateX(14px); background: var(--primary-fg); }
.daily-claim-schedule input:disabled { opacity: .5; cursor: default; }
.daily-claim-schedule input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.daily-claim-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; min-height: 52px; padding: 8px 24px; border-top: 1px solid var(--border); transition: background var(--fast) var(--ease-out); }
.daily-claim-row:hover { background: var(--accent); }
.daily-claim-row .account-name-button { width: fit-content; min-width: 0; max-width: 100%; }
.daily-claim-row .account-identity { flex-direction: row; align-items: center; gap: 14px; min-width: 0; }
.daily-claim-row .account-row-family { margin-left: 4px; }
.daily-claim-row .account-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-claim-row > .btn { min-width: 64px; min-height: 30px; height: 30px; padding: 0 12px; font-size: 12px; }
.daily-claim-grants { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; text-align: right; }
.daily-claim-grants > div { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.daily-claim-grants strong { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.025em; white-space: nowrap; }
.daily-claim-grants small { font-size: 11px; color: var(--muted-fg); font-weight: 400; letter-spacing: 0; }
.daily-claim-grants span { display: block; font-size: 11px; color: var(--muted-fg); }
.daily-claim-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 200px; padding: 32px 24px; border-top: 1px solid var(--border); color: var(--muted-fg); }
.daily-claim-empty p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.daily-claim-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; min-height: 48px; padding: 10px 24px; border-top: 1px solid var(--border); }
.daily-claim-footer #claims-notice { display: flex; align-items: center; gap: 5px; margin-left: auto; color: var(--muted-fg); font-size: 12px; }
.daily-claim-footer .pager { margin: 0 0 0 auto; }
.daily-claim-footer .pager[hidden] { display: none; }
.skeleton-block { min-height: 72px; background: var(--muted); animation: pulse-soft 1.6s ease-in-out infinite; }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 70; background: var(--primary); color: var(--primary-fg); border-radius: 8px; padding: 8px 14px; }
.skip-link:focus { top: 12px; }
.section-heading h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 15px; font-weight: 600; }
.updated-at { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-fg); }
.page-skeleton { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.page-skeleton .skeleton-block { border-radius: var(--r-card); min-height: 150px; }
.page-skeleton .skeleton-block:last-child { grid-column: 1 / -1; min-height: 80px; }
.page-error { flex-direction: row; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-left: 3px solid var(--destructive); border-radius: 12px; background: var(--card); }
.page-error > svg { color: var(--destructive); }
.page-error > div { min-width: 0; flex: 1; }
.page-error h2 { margin: 0; font-size: 14px; }
.page-error p { margin: 4px 0 0; color: var(--muted-fg); overflow-wrap: anywhere; }
.dashboard-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.quota-hero, .pool-health { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--card); }
.quota-hero { background: var(--card); box-shadow: var(--surface-shadow); }
.dashboard-usage-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-usage-heading .eyebrow { display: inline-flex; align-items: center; gap: 3px; }
.dashboard-usage-heading .select-control { width: auto; min-width: 120px; }
.dashboard-usage-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.dashboard-usage-breakdown > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.dashboard-usage-breakdown span { color: var(--muted-fg); font-size: 12px; }
.dashboard-usage-breakdown strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.eyebrow { color: var(--muted-fg); font-size: 13px; font-weight: 500; }
.hero-number { margin: 6px 0 18px; font-size: clamp(30px, 3vw, 44px); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.hero-number small { margin-left: 10px; font-size: 14px; font-weight: 400; color: var(--muted-fg); letter-spacing: 0; }
.hero-quota-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted-fg); margin-bottom: 8px; }
.quota-hero > .quiet-message { margin-top: 10px; }
.pool-health { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pool-health > .section-heading { width: 100%; }
.health-number { font-size: 36px; line-height: 1.25; font-weight: 600; letter-spacing: -.03em; }
.health-number small { font-size: 13px; color: var(--muted-fg); font-weight: 400; margin-left: 8px; letter-spacing: 0; }
.pool-health > .text-action { margin-top: auto; padding-left: 0; gap: 10px; }
.dashboard-secondary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dashboard-secondary .statcard { background: var(--card); padding: 18px 20px; }
.dashboard-chart-card { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--card); box-shadow: var(--surface-shadow); }
.dashboard-chart-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 66px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.dashboard-chart-heading h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.dashboard-chart-heading .select-control { margin-left: auto; width: auto; }
.dashboard-chart { position: relative; min-width: 0; padding-top: 12px; }
.dashboard-chart-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.dashboard-chart-svg { display: block; width: 100%; min-width: 880px; overflow: visible; font-family: inherit; animation: fade-up .3s var(--ease-out) both; }
.dashboard-chart-grid { stroke: var(--border); stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.dashboard-chart-grid.baseline { stroke-dasharray: none; }
.dashboard-chart-tick { fill: var(--muted-fg); font-size: 11px; }
.dashboard-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dashboard-chart-line.cache { stroke: #1680ff; }
.dashboard-chart-line.tokens { stroke: #eb8b00; }
.dashboard-chart-point.cache, .dashboard-chart-value.cache { fill: #1680ff; }
.dashboard-chart-point.tokens, .dashboard-chart-value.tokens { fill: #d88000; }
.dashboard-chart-value { fill: var(--foreground); font-size: 11px; font-weight: 500; }
.dashboard-chart-hit { outline: none; }
.dashboard-chart-hit-area { fill: transparent; cursor: crosshair; }
.dashboard-chart-crosshair { stroke: var(--muted-fg); stroke-dasharray: 3 4; opacity: 0; pointer-events: none; vector-effect: non-scaling-stroke; transition: opacity 140ms var(--ease-out); }
.dashboard-chart-hit.is-active .dashboard-chart-crosshair { opacity: .45; }
.dashboard-chart-hit:focus-visible .dashboard-chart-crosshair { stroke: var(--foreground); stroke-dasharray: none; opacity: .6; }
.dashboard-chart-bar { rx: 2px; }
.dashboard-chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--muted); border-radius: 0 0 var(--r-card) var(--r-card); }
.dashboard-chart-legend > span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-fg); }
:is(.dashboard-chart-legend, .dashboard-chart-tooltip) i { display: inline-block; flex: none; width: 12px; height: 4px; border-radius: 2px; background: var(--series-color); }
.dashboard-chart-tooltip { position: absolute; z-index: 5; width: max-content; max-width: min(340px, calc(100% - 16px)); padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); box-shadow: var(--shadow-pop); font-size: 12px; pointer-events: none; }
.dashboard-chart-tooltip[hidden] { display: none; }
.dashboard-chart-tooltip > strong { display: block; margin-bottom: 10px; font-size: 12px; }
.dashboard-chart-tooltip > div { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-top: 7px; }
.dashboard-chart-tooltip span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; color: var(--muted-fg); }
.dashboard-chart-tooltip b { white-space: nowrap; font-weight: 600; }
.dashboard-chart-tooltip b.cache { color: #1680ff; }
.dashboard-chart-tooltip p { margin: 6px 0 12px; color: var(--muted-fg); font-size: 11px; }
.dashboard-chart-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); color: var(--muted-fg); font-size: 12px; pointer-events: none; }
.quota-details > summary { cursor: pointer; width: fit-content; }
.quota-summary { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.quota-summary > strong { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.quota-summary > span:not(.badge) { color: var(--muted-fg); font-size: 12px; }
.quota-details { margin-top: 4px; font-size: 12px; color: var(--muted-fg); }
.quota-details[open] { min-width: min(250px, 100%); }
.quota-details .quota-ledger { margin-top: 10px; display: grid; gap: 10px; }
.quota-details .quota-entry { color: var(--foreground); }
.quota-details .quota-entry-meta { gap: 4px 12px; }
.settings-form { display: flex; flex-direction: column; gap: 12px; }
.pagehead:has(.settings-save) { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.settings-save { min-width: 100px; min-height: 36px; }
.settings-panel { display: block; padding: 24px; background: var(--card); }
.settings-panel h2 { font-size: 16px; margin: 0; font-weight: 600; }
.settings-panel > div > p { margin: 2px 0 0; color: var(--muted-fg); font-size: 13px; line-height: 1.5; }
.settings-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.settings-panel :is(label, .field-group).f { color: var(--foreground); font-size: 13px; gap: 4px; min-width: 0; line-height: 1.5; }
.settings-panel :is(label, .field-group).f small, .settings-check small { font-size: 12px; color: var(--muted-fg); font-weight: 400; }
.settings-panel :is(label, .field-group).f input, .settings-panel .select-trigger { height: 36px; border: 1px solid var(--input); background: var(--background); }
.settings-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; cursor: pointer; padding-block: 2px; }
.settings-check input { margin: 3px 0 0; flex: none; }
.settings-check small { display: block; margin-top: 2px; }
.network-settings-fields { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.network-settings-fields[hidden] { display: none; }
.network-settings-fields .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.network-settings-fields .inline-notice { margin: 0; }
.settings-panel .inline-notice { padding: 6px 10px; line-height: 1.5; }
.settings-panel .code-input { padding: 8px; }
.settings-subsection { border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.settings-subsection h3 { margin: 0; font-size: 13px; font-weight: 500; }
.proxy-test-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.proxy-test-actions small { color: var(--muted-fg); }
.settings-section.formcard { display: block; padding: 0; background: var(--card); }
.settings-section-summary { display: flex; align-items: center; gap: 12px; padding: 20px 24px; cursor: pointer; list-style: none; transition: background 160ms var(--ease-out); border-radius: inherit; }
.settings-section-summary:hover { background: var(--accent); }
.settings-section-summary::-webkit-details-marker { display: none; }
.settings-section-summary::before { content: '›'; font-size: 20px; color: var(--muted-fg); transition: transform 150ms; }
.settings-section[open] > summary::before { transform: rotate(90deg); }
.settings-section-summary > span:first-of-type { flex: 1; min-width: 0; }
.settings-section-summary strong { display: block; font-size: 14px; font-weight: 600; }
.settings-section-summary small { display: block; color: var(--muted-fg); font-size: 12px; }
.settings-section-summary .pill { pointer-events: none; }
.settings-section[open] > summary { border-bottom: 1px solid var(--border); }
.settings-section-body { border-radius: 0 0 var(--r-card) var(--r-card); }
@supports (interpolate-size: allow-keywords) {
  :is(.settings-section, .import-advanced)::details-content { interpolate-size: allow-keywords; block-size: 0; overflow: clip; transition: block-size 240ms var(--ease-out), content-visibility 240ms allow-discrete; }
  :is(.settings-section, .import-advanced)[open]::details-content { block-size: auto; }
}
.settings-panel.settings-section-content { display: block; }
.update-panel-body { display: flex; flex-direction: column; gap: 18px; }
.update-panel-body [hidden] { display: none !important; }
#update-summary { display: block; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.update-versions > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.update-versions span { color: var(--muted-fg); font-size: 12px; }
.update-versions strong { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.update-toolbar, .update-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.update-toolbar { justify-content: space-between; gap: 12px; }
.update-repository { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.update-message { margin: 0; color: var(--muted-fg); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.update-message:empty { display: none; }
.update-message.error { color: var(--destructive); }
.update-panel-body progress { width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; accent-color: var(--primary); }
.update-panel-body progress::-webkit-progress-bar { background: var(--muted); border-radius: inherit; }
.update-panel-body progress::-webkit-progress-value { background: var(--primary); border-radius: inherit; transition: width 240ms var(--ease-out); }
.update-panel-body progress::-moz-progress-bar { background: var(--primary); border-radius: inherit; }
.update-notes { border-top: 1px solid var(--border); padding-top: 14px; }
.update-notes summary { cursor: pointer; color: var(--muted-fg); font-size: 12px; }
.update-notes pre { margin: 14px 0; max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }
@media (max-width: 600px) { .update-toolbar { align-items: flex-start; flex-direction: column; } .update-actions { width: 100%; } .update-actions .btn { flex: 1; } .update-versions { gap: 14px; } }
.proxy-small-button.btn { height: 24px; padding: 0 9px; font-size: 11px; flex: none; }
.mihomo-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.mihomo-field-heading, .proxy-field-heading { display: flex; align-items: center; gap: 8px; min-height: 24px; line-height: 1.5; }
.mihomo-field-heading { justify-content: space-between; }
.mihomo-field-actions { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.mihomo-field-actions .text-action { height: 24px; padding: 0 6px; font-size: 11px; white-space: nowrap; }
.mihomo-field input { height: 32px; min-width: 0; background: var(--background); border: 1px solid var(--input); }
.mihomo-field small { color: var(--muted-fg); font-size: 12px; overflow-wrap: anywhere; }
.settings-panel .runtime-status.ok-text { color: var(--ok); }
.settings-panel .runtime-status.warn-text { color: var(--warn); }
.proxy-node-box { border: 1px solid var(--border); border-radius: 10px; min-width: 0; gap: 0; }
.proxy-node-heading { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.proxy-node-heading h3 { margin: 0; font-size: 13px; font-weight: 500; }
.proxy-node-heading > span { margin-left: auto; color: var(--muted-fg); font-size: 12px; }
.proxy-node-content { display: grid; gap: 10px; padding: 0 12px 12px; }
.proxy-node-content .proxy-test-actions { justify-content: space-between; }
.proxy-node-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.proxy-node-option { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; min-width: 0; }
.proxy-node-option:first-child { grid-column: 1 / -1; }
.proxy-node-option:has(input:checked) { border-color: var(--foreground); background: var(--muted); }
.proxy-node-option input { margin: 0; width: 15px; height: 15px; accent-color: var(--primary); }
.proxy-node-option strong, .proxy-node-option small { display: block; overflow-wrap: anywhere; }
.proxy-node-option strong { font-size: 12px; font-weight: 500; }
.proxy-node-option small { font-size: 11px; color: var(--muted-fg); }
.proxy-node-option.unavailable { opacity: .6; cursor: default; }
.proxy-node-badge { font-size: 10px; white-space: nowrap; color: var(--muted-fg); }
.proxy-node-badge.current { color: var(--ok); }
.proxy-test-results { border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 12px; overflow-wrap: anywhere; }
.proxy-test-results p { margin: 0 0 8px; color: var(--muted-fg); }
.proxy-test-details > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; cursor: pointer; list-style: none; }
.proxy-test-details > summary::-webkit-details-marker { display: none; }
.proxy-test-details > summary::before { content: '›'; font-size: 18px; color: var(--muted-fg); transition: transform 150ms; }
.proxy-test-details[open] > summary::before { transform: rotate(90deg); }
.proxy-test-details > summary > span { color: var(--muted-fg); }
.proxy-test-body { max-height: 320px; overflow-y: auto; scrollbar-width: thin; margin-top: 10px; padding-right: 8px; }
.proxy-test-results ul { display: grid; gap: 10px; margin: 0; padding-left: 18px; }
.proxy-test-results li > span { display: block; margin-top: 3px; }
.advanced-fields { display: flex; flex-direction: column; gap: 20px; }
.settings-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.code-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.code-field-wide { grid-column: 1 / -1; }
.code-field .json-hint:empty { display: none; }
.advanced-fields > label:not(:first-child) { margin-top: 4px; }
.advanced-fields > label:first-child { max-width: 360px; }
.code-input { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.55; background: var(--muted); border: 1px solid var(--input); padding: 10px; tab-size: 2; }
.advanced-fields .json-hint { margin: 0; font-size: 12px; }
.usage-chart { padding: 20px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--card); }
.usage-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.usage-chart-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.usage-chart-head p { margin: 3px 0 0; color: var(--muted-fg); font-size: 12px; }
.chart-metric { display: flex; gap: 8px; align-items: center; color: var(--muted-fg); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.chart-frame { display: flex; gap: 12px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; flex: none; min-width: 28px; color: var(--muted-fg); font-size: 11px; text-align: right; }
.chart-plot { display: grid; grid-template-columns: repeat(var(--chart-count), minmax(0, 1fr)); gap: 5px; height: 180px; flex: 1; min-width: 0; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0, transparent calc(50% - 1px), var(--border) 50%); }
.chart-column { position: relative; display: flex; align-items: flex-end; justify-content: center; min-width: 0; height: 100%; padding: 0 3px; border: 0; border-radius: 4px 4px 0 0; background: transparent; cursor: pointer; }
.chart-bar { display: block; width: 100%; background: var(--info); opacity: .7; border-radius: 3px 3px 0 0; transition: opacity 180ms var(--ease-out); }
.chart-dot { position: absolute; bottom: -2px; height: 3px; width: 100%; max-width: 24px; background: var(--muted-fg); border-radius: 3px; }
.chart-column.failed .chart-bar { background: var(--destructive); }
.chart-column:hover .chart-bar, .chart-column.selected .chart-bar, .chart-column:focus-visible .chart-bar { opacity: 1; }
.chart-column.selected { background: var(--muted); }
.chart-axis { display: flex; justify-content: space-between; gap: 8px; margin: 10px 0 0 40px; font-size: 11px; color: var(--muted-fg); }
.chart-selection { margin: 18px 0 8px; min-height: 22px; font-size: 13px; }
.usage-panel th:not(:first-child), .usage-panel td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.usage-panel .mono { font-size: 12px; }
.log-mobile { display: none; }
.example-line { overflow-wrap: anywhere; }
.example-line code { box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.integration-note { color: var(--muted-fg); font-size: 12px; }
.integration-note { margin-top: -10px; }
.integration-note .example-line { line-height: 2; }
.import-option .section-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.import-option:has(+ .import-option) { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.import-option:has(#i-local) { flex-direction: row; align-items: center; justify-content: space-between; }
.import-option #oauth-box:empty, .import-option #oauth-pending:empty { display: none; }
.import-advanced { border-top: 1px solid var(--border); padding-top: 16px; }
.import-advanced > summary { width: fit-content; padding-block: 4px; color: var(--muted-fg); font-size: 12px; cursor: pointer; }
.import-credentials { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.import-credentials > .inline-notice { margin: 0; }

.dashboard-accounts { display: block; min-width: 0; }
.compact-account-table { width: 100%; max-width: 100%; overflow: auto; border-radius: 12px; background: var(--card); }
.compact-account-table table { width: 100%; min-width: 980px; table-layout: fixed; }
.dashboard-account-table table { min-width: 810px; }
.compact-account-table .account-name-col { width: 28%; }
.compact-account-table th, .compact-account-table td { height: 52px; padding: 10px 16px; white-space: nowrap; vertical-align: middle; font-size: 13px; overflow-wrap: normal; }
.compact-account-table th { height: 40px; font-size: 12px; }
.compact-account-table th:first-child, .compact-account-table td:first-child { padding-left: 12px; }
.compact-account-table .align-right { text-align: right; font-variant-numeric: tabular-nums; }
.compact-account-table .badge { white-space: nowrap; font-size: 12px; }
.account-name-button { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; border: 0; padding: 0; color: var(--foreground); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.account-name-button .avatar { width: 25px; height: 25px; flex: none; font-size: 11px; }
.account-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.account-identity { display: flex; flex-direction: column; min-width: 0; gap: 2px; text-align: left; }
.account-identity .account-row-name { white-space: pre; }
.account-row-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-fg); font-size: 10.5px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
.account-row-family { margin-left: auto; color: var(--muted-fg); font-size: 11px; flex: none; }
.account-row-number, .account-row-quota strong { font-size: 14px; font-weight: 600; }
.account-row-quota { display: inline-flex; justify-content: flex-end; align-items: center; gap: 6px; }
.account-row-quota .text-action { font-size: 12px; padding: 2px; }
.account-pending-dot { display: inline-block; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
.account-row-expiry { font-size: 12px; }
.account-row-group { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--muted-fg); }
.compact-account-table .account-action-row { flex-wrap: nowrap; gap: 2px; }
.compact-account-table .account-action-row .ibtn { width: 26px; height: 28px; flex: none; }
.account-delete { color: var(--destructive); }
.account-scroll-hint { display: none; margin: 0 0 6px; font-size: 12px; color: var(--muted-fg); }
.account-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 18px; padding: 12px 0 0; font-size: 12px; color: var(--muted-fg); }
.account-page-range { margin-right: auto; }
.account-page-size { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.account-page-size .select-control { width: 80px; }
.account-page-controls { display: flex; align-items: center; gap: 6px; }
.account-page-controls .btn { min-width: 30px; height: 30px; padding: 0 8px; }
.account-page-controls > span { min-width: 50px; text-align: center; }
.account-detail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.account-detail dt { color: var(--muted-fg); font-size: 12px; }
.account-detail dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.account-detail-quota { border-top: 1px solid var(--border); padding-top: 16px; gap: 12px; }
.account-detail-quota h3 { margin: 0; font-size: 14px; }
.account-detail .quota-details { color: var(--foreground); }
.management-empty h2 { margin: 0; font-size: 15px; font-weight: 600; }
.client-version-note { margin: 4px 0 0; color: var(--muted-fg); font-size: 12px; }

@media (max-width: 1000px) {
  .account-scroll-hint { display: block; }
  .compact-account-table .account-name-col { width: 190px; }
  .compact-account-table th:first-child, .compact-account-table td:first-child { position: sticky; left: 0; z-index: 3; background: var(--card); border-right: 1px solid var(--border); }
  .compact-account-table th:first-child { z-index: 4; background: var(--muted); }
}
@media (max-width: 640px) {
  .compact-account-table .account-name-col { width: 155px; }
  .compact-account-table .account-row-family { display: none; }
  .account-pagination { justify-content: space-between; gap: 10px; }
  .account-page-range { flex: 1 1 100%; }
  .account-detail dl { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .dashboard-overview { grid-template-columns: 1fr; }
  .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-panel { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pagehead .tt { font-size: 21px; }
  .pagehead .desc { font-size: 13px; }
  .page-error { flex-wrap: wrap; }
  .page-error .btn { margin-left: 34px; }
  .quota-hero, .pool-health { padding: 18px; }
  .hero-number { font-size: 36px; }
  .dashboard-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dashboard-secondary > :last-child { grid-column: 1 / -1; }
  .dashboard-secondary .statcard { padding: 12px; }
  .settings-panel { padding: 12px 14px; }
  .settings-fields, .settings-code-grid { grid-template-columns: 1fr; gap: 16px; }
  .network-settings-fields .settings-fields { grid-template-columns: 1fr; }
  .settings-panel :is(label, .field-group).f input, .settings-panel .select-trigger { height: 40px; }
  .mihomo-field input { height: 40px; }
  .settings-section-summary { padding: 12px 14px; }
  .proxy-node-list { grid-template-columns: 1fr; }
  .settings-save { min-height: 40px; }
  .account-filters button, #claims-filters button { white-space: nowrap; }
  #claims-filters { flex-wrap: wrap; border-radius: 12px; }
  .quota-details .quota-entry-top { white-space: normal; }
  .quota-details .quota-entry-meta > span { white-space: normal; }
  .usage-chart { padding: 16px 12px; }
  .usage-chart-head { align-items: flex-start; flex-wrap: wrap; }
  .chart-metric { max-width: 100%; }
  .chart-plot { height: 160px; gap: 2px; }
  .chart-column { padding-inline: 1px; }
  .chart-axis { font-size: 10px; }
  .chart-axis span:nth-child(2) { display: none; }
  .chart-selection { font-size: 12px; }
  .log-desktop { display: none; }
  .log-mobile { display: grid; gap: 10px; }
  .mobile-log { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
  .mobile-log > summary { padding: 14px; list-style: none; cursor: pointer; }
  .mobile-log > summary::-webkit-details-marker { display: none; }
  .mobile-log-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .mobile-log-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
  .mobile-log-heading .badge { flex: none; }
  .mobile-log-time { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted-fg); font-size: 12px; }
  .mobile-log[open] > summary { border-bottom: 1px solid var(--border); }
  .mobile-log dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 14px; }
  .mobile-log dt { color: var(--muted-fg); font-size: 12px; }
  .mobile-log dd { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }
  .responsive-table { background: transparent; border: 0; overflow: visible; }
  .responsive-table table, .responsive-table tbody { display: block; width: 100%; min-width: 0; }
  .responsive-table colgroup, .responsive-table thead, .responsive-table tr:has(th) { display: none; }
  .responsive-table tbody { display: grid; gap: 12px; }
  .responsive-table tr:has(td) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
  .responsive-table td { display: block; min-width: 0; padding: 0; border: 0; text-align: left !important; overflow-wrap: anywhere; }
  .responsive-table td::before { content: attr(data-label); display: block; color: var(--muted-fg); font: 12px/1.5 'Segoe UI Variable Text', 'Microsoft YaHei UI', sans-serif; margin-bottom: 4px; }
  .responsive-table td:first-child, .responsive-table td:last-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .overview-strip:not(.logs-strip) { margin-bottom: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-strip > div, .overview-strip > div:first-child { padding: 8px 12px; }
  .overview-strip > div + div { padding-left: 12px; }
  .overview-strip:not(.logs-strip) strong { font-size: 17px; margin-top: 2px; }
  .overview-strip strong small { display: block; margin-top: 2px; font-size: 11px; }
  .overview-strip:not(.logs-strip) > div:last-child { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); padding: 10px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
  .overview-strip:not(.logs-strip) > div:last-child strong { margin: 0; font-size: 15px; }
  .overview-strip:not(.logs-strip) > div:last-child strong small { display: inline; }
  .overview-strip:not(.logs-strip) > div:last-child p { margin: 0 0 0 auto; font-size: 11px; }
  .logs-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logs-strip > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .logs-strip strong { font-size: 15px; }
  .management-toolbar { gap: 8px; }
  .management-toolbar .searchbox { max-width: none; flex-basis: 100%; }
  .management-toolbar .status-pills { flex-basis: 100%; }
  .account-filters { flex-wrap: wrap; }
  .daily-claim-header { padding: 18px 16px; gap: 12px; }
  .daily-claim-title { gap: 10px; }
  .daily-claim-icon { width: 38px; height: 38px; border-radius: 11px; }
  .daily-claim-title h2 { font-size: 15px; }
  .daily-claim-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .daily-claim-row { gap: 10px; padding: 8px 16px; }
  .daily-claim-row .account-identity { flex-direction: column; align-items: flex-start; gap: 0; }
  .daily-claim-row .account-row-family { display: none; }
  .daily-claim-row > .btn { min-width: 52px; padding-inline: 10px; }
  .daily-claim-grants { max-width: 115px; }
  .daily-claim-grants > div { flex-direction: column; gap: 0; align-items: flex-end; }
  .daily-claim-grants span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .daily-claim-footer { padding: 10px 16px; }
}
