:root {
  color-scheme: light;
  --surface: #fffdfa;
  --canvas: #faf4ec;
  --ink: #5b392a;
  --muted: #765e53;
  --line: #ebddd1;
  --accent: #ba492a;
  --accent-hover: #9f3b23;
  --soft: #fff0e5;
  --rail: #f9f0e7;
  --rail-muted: #70574e;
  --control-line: #e4d0c1;
  --selection-line: #d19c85;
  --focus: #ba492a;
  --panel-shadow: 0 1px 2px #9b674308, 0 4px 14px #9b674305;
  --radius: 12px;
  font-family: "Inter", "PingFang SC", "Microsoft Yahei", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { accent-color: var(--accent); }
input, textarea { caret-color: var(--accent); }
option { color: var(--ink); background: var(--surface); }
::selection { color: var(--ink); background: #f8dfcb; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
svg { width: 20px; height: 20px; display: block; flex: none; }
.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; }

/* Keep the workspace and account screens lighter than the public site. */
.layout,
.account-auth,
.auth-loading {
  --surface: #fff;
  --canvas: #fdfdfc;
  --ink: #494441;
  --muted: #696460;
  --line: #e9e8e4;
  --rail: #f6f6f4;
  --rail-muted: #625f5c;
  --control-line: #deddd9;
  --selection-line: #d7aaa0;
  --soft: #fff4ef;
  --subtle: #f2f2f0;
  --hover-line: #cbc8c3;
  --panel-shadow: 0 1px 2px #6b665f0a, 0 4px 14px #6b665f05;
  color: var(--ink);
  background: var(--canvas);
}

.layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: var(--ink); border-right: 1px solid var(--line); padding: 19px 13px 17px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 9px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; align-content: center; gap: 3px; width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--accent); box-shadow: 0 1px 3px #c3764c2a; }
.brand-mark i { display: block; height: 2.6px; border-radius: 5px; background: #fffdfa; }
.brand-mark i:nth-child(2) { width: 73%; }
.brand-mark i:nth-child(3) { width: 43%; }
.brand-text { display: flex; align-items: baseline; gap: 8px; font-size: 20px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.brand-text span { font-size: 10px; font-weight: 650; color: var(--muted); letter-spacing: .09em; }
.rail-search { display: flex; align-items: center; gap: 7px; flex: none; width: 100%; min-height: 38px; margin-top: 18px; padding: 6px 8px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); color: var(--rail-muted); text-align: left; font-size: 13px; }
.rail-search:hover { border-color: var(--hover-line); color: var(--ink); }
.rail-search:focus-visible { outline-offset: -2px; }
.rail-search > span { flex: 1; min-width: 0; }
.rail-search svg, .workbench-search svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.rail-search svg { width: 17px; height: 17px; }
.rail-search kbd, .workbench-search kbd { display: inline-block; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--subtle); color: var(--muted); font-size: 11px; line-height: 1.4; white-space: nowrap; }
.rail-nav { display: grid; gap: 4px; margin-top: 13px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 7px; text-decoration: none; color: var(--rail-muted); font-size: 14px; font-weight: 550; white-space: nowrap; }
.nav-link svg { fill: none; stroke: currentColor; stroke-width: 1.65; width: 18px; height: 18px; }
.nav-link:hover { background: var(--subtle); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--accent-hover); }
.nav-link[aria-current="page"] svg { color: var(--accent); }
.rail-body { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.rail-mobile, .rail-drawer-top, .rail-backdrop { display: none; }
.rail-menu-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--control-line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.rail-menu-button:hover { border-color: var(--hover-line); background: var(--subtle); }
.rail-menu-button svg { width: 19px; height: 19px; }
.rail-footer { display: grid; gap: 10px; margin-top: auto; padding-top: 20px; }
.environment { padding: 0 7px 2px; display: flex; align-items: flex-start; gap: 8px; }
.environment strong, .environment span:not(.environment-dot) { display: block; }
.environment strong { font-weight: 600; color: var(--ink); font-size: 14px; }
.environment span:not(.environment-dot) { margin-top: 4px; color: var(--rail-muted); font-size: 12px; }
.environment-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; background: #9d9993; flex: none; }
.environment-dot.connected { background: var(--accent); }

body:has(.workbench-search[open]) { overflow: hidden; }
.workbench-search { width: min(580px, calc(100% - 32px)); max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--control-line); border-radius: 15px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 64px #30282430; }
.workbench-search::backdrop { background: #372f2b51; }
.workbench-search-content { display: flex; flex-direction: column; max-height: min(625px, calc(100dvh - 32px)); }
.workbench-search-header { display: flex; align-items: center; gap: 12px; padding: 10px 13px 10px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.workbench-search-header input { width: 100%; min-width: 0; min-height: 37px; padding: 4px 0; border: 0; border-radius: 3px; background: transparent; color: var(--ink); font-size: 16px; }
.workbench-search-header input::placeholder { color: var(--muted); opacity: 1; }
.workbench-search-header input:focus { outline: 0; }
.workbench-search-close { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 7px; background: var(--subtle); color: var(--muted); }
.workbench-search-close:hover { color: var(--ink); }
.workbench-search-close svg { width: 17px; height: 17px; }
.workbench-search-results { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 9px; }
.workbench-search-group { margin: 4px 0 9px; }
.workbench-search-group-label { padding: 7px 8px 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.workbench-search-option { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 4px 7px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.workbench-search-option:hover { background: var(--subtle); }
.workbench-search-option[aria-selected="true"] { border-color: var(--selection-line); background: var(--soft); }
.workbench-search-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 6px; background: var(--subtle); color: var(--muted); }
.workbench-search-icon .platform-icon { width: 28px; height: 28px; border-radius: 6px; }
.workbench-search-icon svg, .workbench-search-icon .platform-icon svg { width: 16px; height: 16px; }
.workbench-search-option-text { display: flex; align-items: baseline; gap: 9px; flex: 1; min-width: 0; }
.workbench-search-option strong { flex: none; font-size: 14px; font-weight: 650; }
.workbench-search-option small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workbench-search-detail { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.workbench-search-empty { padding: 25px 18px 29px; color: var(--muted); font-size: 14px; text-align: center; }
.workbench-search-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 12px; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.workbench-search-footer > div { display: flex; gap: 12px; }
.rail-credits { display: grid; gap: 8px; padding: 10px; }
.rail-credits-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.rail-credits-heading h2 { color: var(--muted); font-size: 13px; font-weight: 600; }
.rail-credits-heading > span { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rail-credits p { color: var(--muted); font-size: 12px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.rail-credits progress { width: 100%; height: 5px; display: block; overflow: hidden; border: 0; border-radius: 100px; background: var(--subtle); }
.rail-credits progress::-webkit-progress-bar { background: var(--subtle); border-radius: 100px; }
.rail-credits progress::-webkit-progress-value { background: var(--accent); border-radius: 100px; }
.rail-credits progress::-moz-progress-bar { background: var(--accent); border-radius: 100px; }
.rail-footer .rail-footer-button { min-height: 34px; padding: 5px 7px; font-size: 13px; }
.rail-account { display: grid; gap: 3px; }
.rail-account-link { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 4px 6px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13px; }
.rail-account-link:hover { background: var(--subtle); }
.rail-account-link > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-account .rail-footer-button { justify-content: flex-start; border-color: transparent; background: transparent; color: var(--muted); }
.rail-account .rail-footer-button:hover:not(:disabled) { border-color: transparent; color: var(--ink); }
.rail-account .rail-account-error { margin: 0 6px; font-size: 12px; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 57px; padding: 7px clamp(20px, 3.5vw, 46px); border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-title { font-size: 14px; font-weight: 650; color: var(--muted); }
.mode-control { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--subtle); }
.mode-control button { color: var(--muted); border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 5px 13px; min-height: 33px; font-size: 14px; font-weight: 650; }
.mode-control button { position: relative; isolation: isolate; }
.mode-control button > span:not(.mode-active-tab) { position: relative; }
.mode-control button[aria-pressed="true"] { color: var(--accent-hover); }
.mode-active-tab { position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: var(--surface); border: 1px solid var(--control-line); box-shadow: var(--panel-shadow); }
.mode-control button:disabled { color: var(--muted); }

.content { max-width: 1450px; margin: 0 auto; padding: 33px clamp(20px, 3.5vw, 46px) 56px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(27px, 3.1vw, 35px); line-height: 1.23; letter-spacing: -.041em; font-weight: 750; }
.page-heading p { margin-top: 6px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.platform { display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; min-width: 0; min-height: 66px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); transition: background .16s, border-color .16s; }
.platform:hover { border-color: var(--hover-line); }
.platform[aria-selected="true"] { background: var(--soft); border-color: var(--selection-line); }
.platform-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; flex: none; }
.platform-icon svg { width: 23px; height: 23px; }
.rednote-icon { background: var(--soft); color: var(--accent-hover); font-size: 10px; font-weight: 750; letter-spacing: -.08em; }
.douyin-icon { background: var(--soft); color: var(--accent-hover); }
.channels-icon { background: var(--soft); color: var(--accent-hover); }
.platform strong, .platform small { display: block; }
.platform strong { font-size: 15px; font-weight: 680; }
.platform small { font-size: 12px; margin-top: 3px; color: var(--muted); line-height: 1.35; }

.console-grid { display: grid; grid-template-columns: minmax(286px, .72fr) minmax(0, 1.6fr); gap: 15px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; box-shadow: var(--panel-shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 19px 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .guide-panel h2 { font-size: 18px; line-height: 1.36; font-weight: 700; letter-spacing: -.025em; }
.panel-heading p { margin-top: 4px; color: var(--muted); line-height: 1.5; font-size: 14px; }
.task-form { padding: 16px 19px 19px; }
.task-fields { min-width: 0; display: grid; gap: 15px; margin: 0; border: 0; padding: 0; }
.field { display: grid; min-width: 0; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 620; }
.field input, .field select, .field textarea { appearance: none; min-width: 0; max-width: 100%; width: 100%; min-height: 41px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--control-line); border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 480; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field textarea { resize: vertical; min-height: 72px; }
.field select { padding-right: 29px; background: linear-gradient(45deg,transparent 50%,var(--muted) 50%) calc(100% - 14px) 50% / 5px 5px no-repeat, linear-gradient(135deg,var(--muted) 50%,transparent 50%) calc(100% - 9px) 50% / 5px 5px no-repeat, var(--surface); }
.field input[type="date"] { color-scheme: light; padding-inline: 8px; }
.field input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; }
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="number"]::-webkit-inner-spin-button,
.result-filter input::-webkit-search-cancel-button {
  filter: invert(39%) sepia(25%) saturate(724%) hue-rotate(335deg) brightness(91%);
}
.fields-pair { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
.field-hint { font-weight: 470; font-size: 12px; color: var(--muted); line-height: 1.35; }
.mode-note { margin-top: 15px; border-radius: 8px; padding: 9px 10px; background: var(--subtle); color: var(--muted); font-size: 13px; line-height: 1.45; }
.mode-note.live { background: var(--soft); color: var(--accent-hover); }
.mode-note.unavailable { background: var(--subtle); color: var(--muted); }
.form-error { margin-top: 12px; color: #922e33; font-size: 14px; line-height: 1.5; }
.form-actions { margin-top: 17px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.secondary { border-color: var(--control-line); color: var(--ink); background: var(--surface); }
.button.secondary:hover:not(:disabled) { border-color: var(--hover-line, #d5a38d); background: var(--subtle, #fff6ed); }
.button.ghost { background: transparent; color: var(--accent); }
.button.ghost:hover:not(:disabled) { background: var(--soft); }
.button:disabled { opacity: .55; }
.form-actions .primary { flex: 1 1 115px; }

.result-panel { min-height: 412px; overflow: hidden; display: flex; flex-direction: column; }
.result-heading { align-items: center; }
.result-heading p { color: var(--muted); }
.result-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 19px; min-height: 51px; }
.result-tools > span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.result-filter { display: flex; align-items: center; gap: 8px; max-width: 210px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; color: var(--muted); min-width: 0; }
.result-filter svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; }
.result-filter input { min-width: 0; width: 100%; border: none; background: transparent; min-height: 32px; color: var(--ink); font-size: 13px; }
.result-filter:focus-within { border-color: var(--selection-line); outline: 2px solid var(--focus); outline-offset: 2px; }
.result-filter .aceternity-field-control { width: 100%; min-width: 0; }
.result-filter input:focus-visible { outline: none; }
.result-body { flex: 1; min-width: 0; }
.empty-state { min-height: 290px; padding: 30px 20px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; }
.empty-state strong { font-weight: 680; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.empty-art { display: grid; width: 51px; height: 51px; align-content: center; gap: 4px; padding: 11px; border: 1px solid var(--line); background: var(--soft); border-radius: 13px; color: var(--accent); }
.empty-art i { display: block; height: 2px; border-radius: 5px; background: #cf8e69; }
.empty-art i:first-child { width: 85%; }
.empty-art i:nth-child(2) { width: 70%; }
.empty-art i:last-child { width: 45%; }
.result-warnings { margin: 0; padding: 13px 22px 13px 41px; border-top: 1px solid var(--line); background: var(--rail); color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.result-warnings li + li { margin-top: 4px; }
.table-wrap { overflow: auto; max-height: 475px; width: 100%; }
.result-pager { display: flex; justify-content: flex-end; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 8px 14px; }
.result-pager span { color: var(--muted); font-size: 13px; }
.result-pager .button { min-height: 31px; padding: 4px 9px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { min-width: 88px; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.48; }
th:first-child, td:first-child { padding-left: 21px; }
th:last-child, td:last-child { padding-right: 21px; }
th { position: sticky; top: 0; background: var(--subtle, #f8eee5); color: var(--muted); font-weight: 650; white-space: nowrap; z-index: 1; }
td { max-width: 350px; overflow-wrap: anywhere; color: var(--ink); }
td a { text-underline-offset: 2px; }
td.data-text { min-width: 156px; white-space: pre-wrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-panel [data-column="title"] { min-width: 164px; }
.result-panel [data-column="snippet"], .result-panel [data-column="commentText"] { min-width: 185px; }
.result-panel [data-column="date"], .result-panel [data-column="publishedAt"],
.result-panel [data-column="commentPublishedAt"] { min-width: 116px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-panel [data-column="likes"], .result-panel [data-column="comments"],
.result-panel [data-column="commentCount"] { min-width: 62px; }
tbody tr:nth-child(even) { background: var(--canvas); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--subtle, #fff2e6); }
.result-panel td.empty-row { text-align: center; color: var(--muted); padding: 27px 13px; }
.history-panel { overflow: hidden; }
.history-empty-icon { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 12px; color: var(--accent); background: var(--soft); font-size: 28px; }
.history-panel .empty-state { min-height: 220px; }
.history-panel .empty-state .button { margin-top: 4px; }
.history-query { max-width: 300px; }
.mode-tag { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--soft); color: var(--accent); white-space: nowrap; font-size: 12px; font-weight: 650; }
.mode-tag.live { background: var(--soft); color: var(--accent-hover); }
.guide-grid { display: grid; grid-template-columns: repeat(3,minmax(0, 1fr)); gap: 15px; }
.guide-panel { padding: 21px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.guide-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--accent); background: var(--soft); font-weight: 700; }
.guide-panel p { color: var(--muted); line-height: 1.6; margin-bottom: 3px; }
.guide-panel .button { margin-top: auto; }

@media (max-width: 1070px) {
  .layout { grid-template-columns: 180px minmax(0, 1fr); }
  .rail { padding-inline: 13px; }
  .content { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .console-grid { grid-template-columns: minmax(268px, .8fr) minmax(0, 1.35fr); gap: 13px; }
  .panel-heading, .task-form { padding-inline: 15px; }
  .result-tools { padding-inline: 15px; }
  th:first-child,td:first-child { padding-left: 15px; }
}
@media (max-width: 865px) {
  .console-grid { grid-template-columns: minmax(0, 1fr); }
  .result-panel { min-height: 320px; }
  .result-panel .empty-state { min-height: 225px; }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .layout { display: block; }
  .rail { position: static; height: auto; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-mobile { display: flex; align-items: center; justify-content: space-between; }
  .rail-desktop-brand { display: none; }
  .rail-drawer-top { display: flex; align-items: center; justify-content: space-between; }
  .rail-body { position: fixed; inset: 0 auto 0 0; width: min(82vw, 280px); z-index: 101; background: var(--rail); border-right: 1px solid var(--line); padding: 16px; overflow: auto; transform: translateX(-100%); }
  .rail-backdrop { display: block; position: fixed; inset: 0; z-index: 100; background: #726b5c42; }
  .brand { padding: 3px 5px; gap: 7px; }
  .brand-mark { width: 29px; height: 29px; padding: 6px; border-radius: 7px; }
  .brand-text { font-size: 17px; }
  .brand-text span { display: none; }
  .rail-nav { margin: 13px 0 0; }
  .workbench-search-option-text { display: grid; gap: 2px; }
  .topbar { min-height: 54px; padding: 6px 14px; }
  .content { padding: 23px 14px 44px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading p { margin-top: 6px; font-size: 14px; }
  .platforms { gap: 5px; margin-bottom: 12px; }
  .platform { padding: 8px 6px; min-height: 64px; border-radius: 9px; gap: 5px; }
  .platform-icon { width: 23px; height: 23px; border-radius: 6px; }
  .platform-icon svg { width: 17px; height: 17px; }
  .rednote-icon { font-size: 8px; }
  .platform strong { font-size: 12px; }
  .platform small { font-size: 10px; }
  .panel-heading { padding-top: 17px; padding-bottom: 14px; }
  .panel-heading p { font-size: 13px; }
}
@media (max-width: 340px) {
  .platform strong { font-size: 11px; }
  .platform small { font-size: 9px; }
  .platform { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

.aceternity-platforms .platform { position: relative; isolation: isolate; }
.aceternity-platforms .platform[aria-selected="true"] { background: var(--surface); }
.aceternity-platforms .platform-icon, .platform-label { position: relative; z-index: 1; }
.aceternity-active-tab { position: absolute; inset: 0; border-radius: inherit; background: var(--soft); pointer-events: none; }
.aceternity-run-button .loader, .aceternity-run-button .check { flex: none; }
.aceternity-run-button:disabled[aria-busy="true"] { opacity: .8; }

.aceternity-surface-spotlight { background: var(--soft); opacity: 0; transition: opacity .2s; }
.aceternity-surface:hover > .aceternity-surface-spotlight { opacity: .35; }
.aceternity-field-control { --aceternity-input-glow: #e3ac91; }
.aceternity-field-control .aceternity-input { display: block; }
.aceternity-action { --aceternity-action-glow: #e1a58a; }
.aceternity-action:disabled .aceternity-action-gradient { visibility: hidden; }

.topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-chip { min-height: 36px; max-width: min(210px, 42vw); }
.account-chip .aceternity-action-content { min-width: 0; }
.account-chip .aceternity-action-content > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.account-avatar { display: grid; place-items: center; width: 21px; height: 21px; flex: none; border-radius: 50%; background: var(--soft); color: var(--accent); font-size: 11px; font-weight: 700; }
#run-budget { margin-top: 14px; }
.auth-loading { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); }

.settings-view { max-width: 960px; }
.settings-view .page-heading { margin-bottom: 17px; }
.settings-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; gap: 4px; padding: 3px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.settings-tab { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; min-height: 33px; padding: 5px 14px; border-radius: 6px; font-size: 14px; font-weight: 650; white-space: nowrap; color: var(--muted); text-decoration: none; }
.settings-tab[aria-selected="true"] { color: var(--accent-hover); }
.settings-tab[aria-selected="false"]:hover { color: var(--ink); background: var(--rail); }
.settings-tab-active { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--soft); }
.settings-content { display: grid; gap: 14px; }
.settings-webhooks-view { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: start; }
.settings-webhooks-view > .settings-message, .settings-webhook-endpoints { grid-column: 1 / -1; }
.settings-card-heading { padding: 15px 18px 13px; }
.settings-card-heading h2 { font-size: 16px; }
.settings-card-body { padding-inline: 18px; }
.settings-card-body > :first-child:not(.settings-row) { margin-top: 16px; }
.settings-card-body > :last-child { margin-bottom: 13px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.settings-card-body > .settings-row:last-child { border: 0; margin-bottom: 2px; }
.settings-row-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.settings-row-copy > strong, .settings-row-copy > p { display: block; }
.settings-row-copy > strong, .webhook-event strong { font-size: 14px; font-weight: 700; }
.settings-row-copy > p, .settings-inset p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-row-copy > p { margin-top: 4px; }
.settings-input { width: min(100%, 420px); }
.settings-inline-form { align-items: end; justify-content: flex-start; gap: 12px; }
.settings-inline-form .settings-input { flex: 0 1 310px; }
.settings-inline-form > .button { margin-bottom: 1px; }
.settings-inline-form:has(.field-hint) > .button { margin-bottom: 20px; }
.settings-actions, .settings-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.settings-tags { margin-top: 8px; }
.settings-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; color: var(--muted); background: var(--rail); font-size: 12px; font-weight: 650; white-space: nowrap; }
.settings-status.good { background: var(--soft); color: var(--accent); }
.settings-feedback, .settings-empty { font-size: 14px; line-height: 1.55; color: var(--muted); }
.settings-feedback:not(.settings-message) { padding: 9px 0; }
.settings-message { margin: 0 0 10px; }
.settings-inset { display: grid; justify-items: start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); margin: 10px 0; }
.settings-danger { border-color: #efe3e0; }
.settings-danger h2, .danger-text, .button.ghost.danger-text { color: #903c35; }
.button.danger { color: #903c35; background: #fff7f5; border-color: #e8d1cb; }
.button.danger:hover:not(:disabled) { background: #f9eae5; }
.settings-metric { display: grid; gap: 3px; color: var(--muted); font-size: 14px; padding-bottom: 9px; }
.settings-metric strong { font-size: 27px; color: var(--ink); margin-right: 9px; font-variant-numeric: tabular-nums; }
.settings-metric progress { width: min(100%, 420px); height: 7px; margin-top: 6px; accent-color: var(--accent); }
.settings-metric progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.settings-metric progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.settings-switch { position: relative; flex: none; width: 40px; height: 23px; }
.settings-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.settings-switch span { display: block; width: 100%; height: 100%; border-radius: 30px; background: #e3e1dd; transition: background .18s; pointer-events: none; }
.settings-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px #6b665f20; transition: transform .18s; }
.settings-switch input:checked + span { background: var(--accent); }
.settings-switch input:checked + span::after { transform: translateX(17px); }
.settings-switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.settings-switch input:disabled + span { opacity: .58; }
.settings-threshold { display: flex; align-items: end; gap: 7px; margin-top: 9px; }
.settings-threshold .settings-input { max-width: 105px; }
.webhook-form { justify-items: stretch; }
.webhook-event-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.webhook-event-fields legend { font-size: 14px; font-weight: 650; margin-bottom: 7px; }
.webhook-select-all.button { min-height: 30px; padding-inline: 5px; margin-bottom: 7px; font-size: 13px; }
.webhook-events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.webhook-event { display: flex; gap: 7px; align-items: flex-start; min-width: 0; border: 1px solid var(--line); background: var(--surface); padding: 8px; border-radius: 8px; }
.webhook-event input { margin: 3px 0 0; accent-color: var(--accent); }
.webhook-event small, .webhook-endpoint small { display: block; overflow-wrap: anywhere; color: var(--muted); margin-top: 3px; font-size: 11px; }
.webhook-endpoint { padding-bottom: 12px; }
.webhook-endpoint + .webhook-endpoint { border-top: 1px solid var(--line); }
.webhook-endpoint .settings-row { border: 0; padding-bottom: 8px; }
.endpoint-url { overflow-wrap: anywhere; }
.webhook-secret code { overflow-wrap: anywhere; font-size: 13px; max-width: 100%; }
.settings-code { overflow: auto; padding: 12px; margin: 9px 0; border: 1px solid var(--line); background: var(--canvas); color: var(--ink); border-radius: 8px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.settings-actions [aria-pressed="true"] { background: var(--soft); border-color: var(--selection-line); color: var(--accent-hover); }
.delivery-filter { margin-block: 8px 14px; }
.settings-empty { padding-block: 11px; }

.billing-settings { container: billing / inline-size; display: grid; gap: 14px; min-width: 0; }
.billing-overview { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.billing-metric { display: flex; flex-direction: column; padding: 17px 18px 15px; }
.billing-metric-primary { background: var(--soft); border-color: var(--control-line); }
.billing-metric dt { font-size: 14px; font-weight: 650; line-height: 1.45; }
.billing-metric dd { margin-inline-start: 0; }
.billing-metric-value { margin-block: 6px 10px; font-size: clamp(1.125rem, 3.6cqi, 2.125rem); font-weight: 700; line-height: 1.22; letter-spacing: -.02em; overflow-wrap: anywhere; }
.billing-metric-value progress { display: block; width: 100%; height: 5px; margin-top: 9px; accent-color: var(--accent); }
.billing-metric-value progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.billing-metric-value progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.billing-metric-note { margin-top: auto; color: var(--muted); font-size: 13px; line-height: 1.5; }
.billing-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-hover); font-weight: 650; text-decoration: none; }
.billing-link:hover { text-decoration: underline; }
.billing-payment-note { color: var(--muted); font-size: 14px; line-height: 1.6; }
.billing-load-error { display: flex; align-items: center; gap: 12px; }
.billing-load-error p { margin: 0; }
.billing-packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.billing-packages button { display: grid; gap: 5px; min-width: 0; padding: 11px 13px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); text-align: start; }
.billing-packages button:hover { border-color: var(--selection-line); }
.billing-packages button[aria-pressed="true"] { border-color: var(--selection-line); color: var(--accent-hover); background: var(--soft); }
.billing-packages strong { font-size: 20px; font-weight: 700; line-height: 1.25; }
.billing-package-credits { color: var(--muted); font-size: 13px; line-height: 1.4; white-space: nowrap; }
.billing-metric-value, .billing-packages button, .billing-estimate input, .billing-estimate-result output { font-variant-numeric: tabular-nums; }
.billing-estimate { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) auto; align-items: start; gap: 12px 18px; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line); }
.billing-estimate .settings-input { width: 100%; }
.billing-estimate .settings-input label, .billing-estimate-result > span { font-size: 14px; font-weight: 620; line-height: 20px; }
.billing-estimate input[aria-invalid="true"] { border-color: #a64c4f; }
.billing-estimate-result { display: grid; gap: 7px; min-width: 0; }
.billing-estimate-result output { display: flex; align-items: baseline; flex-wrap: wrap; align-content: center; gap: 2px 6px; min-height: 43px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.billing-estimate-result small { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: normal; }
.billing-estimate > .button { justify-self: start; margin-top: 30px; }

@container billing (max-width: 34rem) {
  .billing-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .billing-metric { padding-inline: 14px; }
  .billing-metric-primary { grid-column: 1 / -1; }
  .billing-metric-value { font-size: clamp(1.125rem, 5cqi, 1.75rem); }
  .billing-estimate { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-estimate > .button { grid-column: 1 / -1; margin-top: 0; }
}

@container billing (max-width: 24rem) {
  .billing-packages { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .billing-packages button { grid-template-columns: auto auto; align-items: baseline; justify-content: space-between; gap: 8px; }
  .billing-packages strong { font-size: 17px; }
  .billing-estimate-result output { font-size: 21px; }
}

@container billing (max-width: 20rem) {
  .billing-estimate { grid-template-columns: minmax(0, 1fr); }
}

.usage-dashboard { display: grid; gap: 14px; min-width: 0; }
.usage-dashboard-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.usage-dashboard-heading h2 { margin: 0; font-size: 23px; line-height: 1.25; }
.usage-dashboard-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.usage-controls { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 12px 20px; padding: 14px 17px; }
.usage-controls > .settings-actions { padding-bottom: 1px; }
.usage-controls > .form-error { grid-column: 1 / -1; margin: 0; }
.usage-controls .button, .usage-dashboard-heading .button { min-height: 34px; padding-inline: 10px; font-size: 13px; }
.usage-date-form { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto; align-items: end; gap: 8px; justify-self: end; }
.usage-date-form .button { margin-bottom: 1px; }
.usage-date-form input { min-height: 34px; padding-block: 5px; width: 100%; }
.usage-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.usage-totals > div { padding: 14px 18px 13px; }
.usage-totals > div + div { border-left: 1px solid var(--line); }
.usage-totals dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.usage-totals dd { margin: 5px 0 0; color: var(--ink); font-size: clamp(21px, 4vw, 32px); line-height: 1.12; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.usage-overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.usage-chart { margin: 0; padding: 0 0 5px; }
.usage-chart figcaption { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 9px; min-height: 18px; }
.usage-chart-main { display: flex; gap: 8px; height: 96px; }
.usage-chart-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: end; color: var(--muted); font-size: 11px; line-height: 1; }
.usage-chart-bars { display: flex; flex: 1; min-width: 0; border-block: 1px solid var(--line); background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; }
.usage-chart-day { position: relative; display: grid; align-items: end; justify-items: center; flex: 1 1 0; min-width: 0; padding: 0; border: 0; background: transparent; border-radius: 3px; }
.usage-chart-day span { display: block; width: 76%; max-width: 24px; height: var(--bar-height); min-height: 1px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: .72; }
.usage-chart-day:is(:hover, :focus-visible) { background: var(--soft); z-index: 1; }
.usage-chart-day:is(:hover, :focus-visible) span { opacity: 1; }
.usage-chart-dates { display: flex; justify-content: space-between; gap: 4px; color: var(--muted); padding: 7px 0 0 14px; font-size: 11px; }
.usage-platform-list { display: grid; gap: 14px; list-style: none; padding: 0 0 7px; }
.usage-platform-list li { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 5px; font-size: 13px; }
.usage-platform-list li > span { font-variant-numeric: tabular-nums; }
.usage-platform-list progress { width: 100%; height: 6px; grid-column: 1 / -1; border: 0; background: var(--soft); border-radius: 100px; }
.usage-platform-list progress::-webkit-progress-bar { background: var(--soft); border-radius: 100px; }
.usage-platform-list progress::-webkit-progress-value { background: var(--accent); border-radius: 100px; }
.usage-platform-list progress::-moz-progress-bar { background: var(--accent); border-radius: 100px; }
.usage-history-card .settings-card-body { min-width: 0; }
.usage-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.usage-filters .settings-input { width: min(100%, 158px); min-width: 0; }
.usage-id-filter { display: flex; align-items: end; gap: 8px; width: min(100%, 300px); }
.usage-id-filter .settings-input { flex: 1; }
.usage-id-filter .button { margin-bottom: 1px; }
.usage-coverage { margin: 11px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.usage-table-scroll { overflow-x: auto; margin-top: 13px; border: 1px solid var(--line); border-radius: 8px; }
.usage-table { font-size: 13px; }
.usage-table :is(th, td) { padding: 9px 10px; min-width: 0; }
.usage-table td:first-child { min-width: 99px; font-variant-numeric: tabular-nums; }
.usage-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.usage-table code { font-size: .92em; overflow-wrap: anywhere; }
.usage-request-status { display: inline-block; white-space: nowrap; border-radius: 999px; background: var(--rail); color: var(--muted); padding: 2px 7px; font-weight: 650; font-size: 11px; }
.usage-request-status.succeeded { color: #386147; background: #edf4e9; }
.usage-request-status.failed { color: #903c35; background: #fbece8; }
.usage-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 13px; }
.usage-pagination .button { min-height: 32px; padding: 4px 8px; font-size: 13px; }

@media (max-width: 1090px) {
  .usage-controls { grid-template-columns: minmax(0, 1fr); }
  .usage-date-form { justify-self: start; }
}

@media (max-width: 1130px) {
  .settings-webhooks-view { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .topbar-actions { gap: 7px; }
  .settings-tab { padding-inline: 7px; font-size: 12px; }
  .settings-card-heading { padding-inline: 15px; }
  .settings-card-body { padding-inline: 15px; }
  .webhook-events { grid-template-columns: 1fr; }
  .account-chip { max-width: 120px; padding-inline: 8px; font-size: 13px; }
  .usage-overview { grid-template-columns: minmax(0, 1fr); }
  .usage-date-form { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-self: stretch; }
  .usage-date-form .button { justify-self: start; }
  .usage-totals > div { padding-inline: 11px; }
  .usage-filters > .settings-input { width: calc(50% - 5px); }
}

.fallback-dashboard { display: grid; gap: 14px; min-width: 0; }
.fallback-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.fallback-heading h2 { font-size: 23px; line-height: 1.25; }
.fallback-dashboard > .form-error { margin: 0; }
.settings-card-body > :is(.fallback-providers, .fallback-events):first-child { margin: 0; padding: 0; list-style: none; }
.fallback-providers { counter-reset: fallback-priority; }
.fallback-providers > li { counter-increment: fallback-priority; }
.fallback-providers > li::before { content: counter(fallback-priority); display: grid; place-items: center; flex: none; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-weight: 650; color: var(--muted); }
:is(.fallback-providers, .fallback-events) > li:last-child { border-bottom: 0; }
.fallback-health.healthy { color: #386147; background: #edf4e9; }
.fallback-health.cooldown { color: #903c35; background: #fbece8; }
.fallback-events time { flex: none; color: var(--muted); font-size: 12px; }

@media (max-width: 440px) {
  .fallback-events > li { flex-wrap: wrap; gap: 6px 12px; }
  .fallback-events .settings-row-copy { flex-basis: 100%; }
}
