:root {
  color-scheme: dark;
  --bg: #0e1318;
  --bg-raised: #121920;
  --surface: #161e26;
  --surface-2: #1b252e;
  --surface-3: #202c36;
  --line: #2a3641;
  --line-strong: #3a4854;
  --text: #edf3f6;
  --muted: #8c9aa7;
  --subtle: #64727f;
  --green: #39d69a;
  --green-dim: #173c32;
  --blue: #71a9ff;
  --blue-dim: #1b304d;
  --amber: #efb763;
  --amber-dim: #49391e;
  --coral: #f18172;
  --coral-dim: #4a2827;
  --red: #ff6f70;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --radius: 8px;
  --radius-small: 6px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 20px;
  background: #11171d;
  border-right: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; padding: 4px 7px; }
.brand-mark { width: 29px; height: 29px; display: inline-flex; align-items: end; gap: 3px; padding: 5px; border: 1px solid #34424e; border-radius: 7px; background: #151e26; }
.brand-mark span { display: block; width: 5px; border-radius: 2px; }
.brand-mark span:nth-child(1) { height: 10px; background: var(--green); }
.brand-mark span:nth-child(2) { height: 15px; background: var(--blue); }
.brand-mark span:nth-child(3) { height: 19px; background: var(--amber); }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.brand-copy small { margin-top: 4px; color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }

.primary-nav { display: grid; gap: 4px; margin-top: 52px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: var(--radius-small); padding: 11px 12px; background: transparent; color: var(--muted); text-align: left; transition: background .16s ease, color .16s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: #1c2d2c; color: var(--green); }
.nav-item [data-icon] { width: 17px; height: 17px; }

.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 5px 2px; border-top: 1px solid var(--line); }
.connection-mini { min-width: 0; display: flex; align-items: center; gap: 9px; flex: 1; }
.connection-mini > div { min-width: 0; display: grid; line-height: 1.18; }
.connection-mini small { color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.connection-mini strong { max-width: 137px; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--subtle); box-shadow: 0 0 0 3px rgba(100, 114, 127, .13); }
.status-dot.is-online { background: var(--green); box-shadow: 0 0 0 3px rgba(57, 214, 154, .12); }
.status-dot.is-warning { background: var(--amber); box-shadow: 0 0 0 3px rgba(239, 183, 99, .12); }
.status-dot.is-error { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 111, 112, .12); }

.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid transparent; border-radius: var(--radius-small); background: transparent; color: var(--muted); transition: border-color .16s ease, background .16s ease, color .16s ease; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
[data-icon] { width: 17px; height: 17px; display: inline-grid; place-items: center; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

.main-content { width: 100%; max-width: 1540px; padding: 46px clamp(24px, 5vw, 72px) 64px; }
.mobile-header { display: none; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.page-heading h1 { margin: 0; font-size: 31px; line-height: 1.12; font-weight: 650; letter-spacing: -.02em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 11px; }
.connection-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.secondary-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border-radius: var(--radius-small); padding: 0 13px; font-size: 13px; font-weight: 600; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.secondary-button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.secondary-button:hover { background: var(--surface-3); border-color: #526271; }
.secondary-button.is-loading [data-icon] { animation: spin .8s linear infinite; }
.primary-button { border: 1px solid #42dda4; background: var(--green); color: #092017; }
.primary-button:hover { background: #5be3ac; transform: translateY(-1px); }
.full-button { width: 100%; }

.notice { display: flex; align-items: center; gap: 10px; min-height: 46px; margin-bottom: 20px; padding: 9px 12px; border: 1px solid #65522e; border-radius: var(--radius-small); background: #29241a; color: #e8c780; }
.notice p { flex: 1; margin: 0; font-size: 13px; }
.notice-icon { width: 18px; height: 18px; }
.is-hidden { display: none !important; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 13px; font-weight: 600; padding: 5px 2px; }
.text-button:hover { color: #a8c9ff; }
.danger-text { color: var(--coral); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 42px; }
.metric { min-height: 137px; padding: 17px 18px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { width: 19px; height: 19px; }
.metric strong { display: block; margin-top: 16px; font-size: 28px; line-height: 1; font-weight: 650; letter-spacing: -.02em; }
.metric small { display: block; margin-top: 12px; color: var(--subtle); font-size: 11px; }
.metric-available strong { color: var(--green); }
.metric-capacity strong { color: var(--blue); }
.metric-warning strong { color: var(--amber); }
.metric-platform strong { color: var(--text); }

.pool-section { min-width: 0; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-header h2 { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 650; }
.section-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.view-toggle { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); }
.view-toggle button { display: grid; place-items: center; width: 30px; height: 27px; border: 0; border-radius: 4px; background: transparent; color: var(--subtle); }
.view-toggle button:hover, .view-toggle button.is-active { background: var(--surface-3); color: var(--text); }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(276px, 100%); min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); color: var(--subtle); }
.search-box:focus-within { border-color: var(--line-strong); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: var(--subtle); }
.filter-group { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); overflow-x: auto; }
.filter-button { min-height: 28px; border: 0; border-radius: 4px; padding: 0 9px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.filter-button:hover, .filter-button.is-active { background: var(--surface-3); color: var(--text); }
.select-wrap { position: relative; display: inline-flex; align-items: center; min-height: 36px; margin-left: auto; }
.select-wrap select, .field select { appearance: none; min-height: 36px; border: 1px solid var(--line); border-radius: var(--radius-small); padding: 0 32px 0 11px; outline: 0; background: var(--surface); color: var(--muted); font-size: 12px; }
.select-wrap select:focus, .field select:focus { border-color: var(--line-strong); }
.select-wrap [data-icon] { position: absolute; right: 10px; width: 14px; height: 14px; pointer-events: none; color: var(--subtle); }

.account-table { border-top: 1px solid var(--line); }
.table-head, .account-row { display: grid; grid-template-columns: minmax(210px, 1.3fr) 100px minmax(300px, 2fr) 105px 26px; gap: 18px; align-items: center; }
.table-head { min-height: 39px; padding: 0 15px; color: var(--subtle); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.account-rows { border-bottom: 1px solid var(--line); }
.account-row { width: 100%; min-height: 86px; border: 0; border-top: 1px solid var(--line); padding: 14px 15px; background: transparent; color: var(--text); text-align: left; transition: background .16s ease; }
.account-row:hover { background: #17212a; }
.account-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.account-copy { min-width: 0; display: grid; gap: 3px; }
.account-name { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-sub { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--subtle); font-size: 11px; }
.platform-label { overflow: hidden; max-width: 110px; text-overflow: ellipsis; white-space: nowrap; }
.platform-mark { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--subtle); }
.platform-mark.anthropic { background: var(--coral); }
.platform-mark.openai { background: var(--green); }
.platform-mark.gemini { background: var(--blue); }
.platform-mark.antigravity { background: var(--amber); }
.platform-mark.grok { background: #c6d0d8; }
.status-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-label.available { color: var(--green); }
.status-label.limited { color: var(--amber); }
.status-label.error { color: var(--red); }
.status-label.inactive { color: var(--subtle); }
.status-label .status-dot { width: 7px; height: 7px; flex-basis: 7px; box-shadow: none; }
.status-label.available .status-dot { background: var(--green); }
.status-label.limited .status-dot { background: var(--amber); }
.status-label.error .status-dot { background: var(--red); }
.status-label.inactive .status-dot { background: var(--subtle); }
.window-list { display: grid; gap: 7px; min-width: 0; }
.window-item { display: grid; grid-template-columns: minmax(82px, 120px) minmax(90px, 1fr) 45px; gap: 9px; align-items: center; min-width: 0; }
.window-label { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: #2a343c; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.progress-fill.low { background: var(--amber); }
.progress-fill.critical { background: var(--coral); }
.window-value { color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.window-more { color: var(--subtle); font-size: 11px; }
.remaining-value { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }
.remaining-value.good { color: var(--green); }
.remaining-value.warn { color: var(--amber); }
.remaining-value.bad { color: var(--coral); }
.row-chevron { color: var(--subtle); transition: color .16s ease, transform .16s ease; }
.account-row:hover .row-chevron { color: var(--text); transform: translateX(2px); }
.empty-state { display: grid; justify-items: center; gap: 10px; min-height: 270px; padding: 65px 20px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; }
.empty-state .empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--subtle); }
.empty-state strong { color: var(--text); font-size: 15px; }
.empty-state p { margin: 0; color: var(--subtle); font-size: 12px; }
.skeleton-row { height: 86px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent); background-size: 240px 100%; animation: shimmer 1.5s linear infinite; }

dialog { border: 0; padding: 0; color: var(--text); }
dialog::backdrop { background: rgba(3, 6, 9, .72); backdrop-filter: blur(4px); }
.settings-dialog { width: min(680px, calc(100vw - 28px)); max-height: min(770px, calc(100vh - 28px)); overflow: auto; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-raised); box-shadow: var(--shadow); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 19px; font-weight: 650; }
.dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.dialog-body { padding: 22px 24px 24px; }
.login-panel { display: grid; justify-items: center; width: min(330px, 100%); margin: 24px auto 14px; text-align: center; }
.lock-mark { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 15px; border: 1px solid #315042; border-radius: 12px; background: var(--green-dim); color: var(--green); }
.lock-mark [data-icon] { width: 21px; height: 21px; }
.login-panel h3, .form-section h3 { margin: 0; font-size: 14px; font-weight: 650; }
.login-panel h3 { margin-bottom: 18px; }
.field { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; text-align: left; }
.field > span { color: var(--muted); }
.field input, .field select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: var(--radius-small); padding: 0 11px; outline: 0; background: var(--surface); color: var(--text); font-size: 13px; }
.field input::placeholder { color: var(--subtle); }
.field input:focus, .field select:focus { border-color: var(--blue); }
.login-panel .field { width: 100%; margin-bottom: 14px; }
.config-form { display: grid; gap: 23px; }
.form-section { display: grid; gap: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.form-hint { margin: -7px 0 0; color: var(--subtle); font-size: 11px; line-height: 1.55; }
.form-error { min-height: 17px; margin: 7px 0 10px; color: var(--coral); font-size: 12px; text-align: left; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 3px; }
.detail-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-raised); box-shadow: var(--shadow); }
.detail-panel { display: grid; max-height: inherit; }
.detail-dialog .dialog-head p { margin-bottom: 4px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.detail-body { padding: 21px 24px 25px; overflow: auto; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.detail-meta strong { color: var(--text); font-weight: 600; }
.detail-windows { display: grid; gap: 14px; }
.detail-window { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-window:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-window-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.detail-window-top span:first-child { color: var(--muted); font-size: 12px; }
.detail-window-top strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.detail-reset { margin-top: 6px; color: var(--subtle); font-size: 11px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 10; display: grid; gap: 8px; width: min(340px, calc(100vw - 44px)); }
.toast { display: flex; align-items: start; gap: 9px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface-3); box-shadow: var(--shadow); color: var(--text); font-size: 12px; animation: toast-in .2s ease; }
.toast.success { border-color: #2e6850; }
.toast.error { border-color: #724141; }

body.is-compact .account-row { min-height: 69px; padding-top: 9px; padding-bottom: 9px; }
body.is-compact .window-list { gap: 4px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: 240px 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 204px minmax(0, 1fr); }
  .main-content { padding-left: 30px; padding-right: 30px; }
  .table-head, .account-row { grid-template-columns: minmax(180px, 1.2fr) 90px minmax(230px, 1.7fr) 90px 22px; gap: 12px; }
  .window-item { grid-template-columns: 90px minmax(70px, 1fr) 43px; gap: 6px; }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 0 18px 48px; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; min-height: 68px; border-bottom: 1px solid var(--line); }
  .brand-mobile { padding-left: 0; }
  .brand-mobile strong { font-size: 15px; }
  .page-heading { align-items: start; flex-direction: column; margin: 28px 0 24px; }
  .page-heading h1 { font-size: 28px; }
  .heading-actions { width: 100%; justify-content: space-between; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 32px; }
  .metric { min-height: 124px; padding: 14px; }
  .metric strong { margin-top: 14px; font-size: 24px; }
  .toolbar { align-items: stretch; }
  .search-box { flex: 1 1 100%; width: 100%; }
  .filter-group { max-width: 100%; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; }
  .filter-button { flex: 1 0 auto; }
  .select-wrap { margin-left: auto; }
  .table-head { display: none; }
  .account-row { display: grid; grid-template-columns: 1fr auto; gap: 11px 12px; min-height: auto; padding: 15px 11px; }
  .account-identity { grid-column: 1; }
  .account-row > .status-label { grid-column: 2; grid-row: 1; align-self: center; }
  .account-row > .window-list { grid-column: 1 / -1; grid-row: 2; }
  .account-row > .remaining-value { grid-column: 1; grid-row: 3; }
  .account-row > .row-chevron { grid-column: 2; grid-row: 3; align-self: center; }
  .window-item { grid-template-columns: 100px minmax(80px, 1fr) 45px; }
  .section-header { margin-bottom: 13px; }
  .settings-dialog, .detail-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
}

@media (max-width: 460px) {
  .main-content { padding-left: 13px; padding-right: 13px; }
  .page-heading h1 { font-size: 26px; }
  .connection-badge { padding: 0 8px; }
  .secondary-button { padding: 0 10px; }
  .metric { min-height: 116px; }
  .metric-top { font-size: 11px; }
  .metric strong { font-size: 22px; }
  .metric small { margin-top: 9px; font-size: 10px; }
  .select-wrap select { max-width: 122px; }
  .dialog-head, .dialog-body, .detail-body { padding-left: 17px; padding-right: 17px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
}

/* Compact public board and standalone admin page. */
.public-shell { width: min(1180px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; }
.public-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--line); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.connection-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.refresh-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface); color: var(--muted); }
.refresh-button:hover { background: var(--surface-3); color: var(--text); }
.refresh-button:disabled { opacity: .65; }
.refresh-button.is-loading [data-icon] { animation: spin .8s linear infinite; }
.public-main { padding: 42px 0 68px; }
.public-main .page-heading { display: block; margin: 0 0 35px; }
.public-main .page-heading h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 650; letter-spacing: -.02em; }
.public-main .page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.public-main .section-header { margin-bottom: 16px; }
.public-main .section-header h2 { font-size: 18px; }
.public-main .toolbar { margin-bottom: 15px; }
.public-main .account-table { border-top: 1px solid var(--line); }
.public-main .table-head { grid-template-columns: minmax(200px, 1.15fr) 90px minmax(330px, 2fr) 82px; padding: 0 14px; }
.public-main .account-row { display: grid; grid-template-columns: minmax(200px, 1.15fr) 90px minmax(330px, 2fr) 82px; gap: 18px; align-items: center; width: 100%; min-height: 108px; border: 0; border-top: 1px solid var(--line); padding: 16px 14px; background: transparent; color: var(--text); text-align: left; }
.public-main .account-row:hover { background: #151f27; }
.public-main .account-identity { min-width: 0; }
.public-main .account-name { font-size: 13px; }
.public-main .account-sub { font-size: 11px; }
.public-main .separator { color: var(--subtle); }
.quota-list { display: grid; gap: 10px; min-width: 0; }
.quota-window { min-width: 0; }
.quota-window-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.quota-window-head span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quota-window-head strong { color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600; }
.quota-track { width: 100%; height: 7px; overflow: hidden; border-radius: 4px; background: #2c3740; }
.quota-progress { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 4px; background: #2c3740; }
.quota-progress::-webkit-progress-bar { border-radius: inherit; background: #2c3740; }
.quota-progress::-webkit-progress-value { border-radius: inherit; background: var(--green); transition: width .25s ease; }
.quota-progress::-moz-progress-bar { border-radius: inherit; background: var(--green); }
.quota-progress.low::-webkit-progress-value { background: var(--amber); }
.quota-progress.low::-moz-progress-bar { background: var(--amber); }
.quota-progress.critical::-webkit-progress-value { background: var(--coral); }
.quota-progress.critical::-moz-progress-bar { background: var(--coral); }
.quota-window-head strong.good { color: var(--green); }
.quota-window-head strong.low { color: var(--amber); }
.quota-window-head strong.critical { color: var(--coral); }
.quota-window small { display: block; min-height: 15px; margin-top: 4px; overflow: hidden; color: var(--subtle); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quota-credit .quota-window-head { margin-bottom: 0; }
.window-more { color: var(--subtle); font-size: 11px; }
.public-main .remaining-value { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.public-main .remaining-value.good { color: var(--green); }
.public-main .remaining-value.warn, .public-main .remaining-value.low { color: var(--amber); }
.public-main .remaining-value.bad, .public-main .remaining-value.critical { color: var(--coral); }
.notice { display: flex; align-items: center; gap: 8px; min-height: 34px; margin: -14px 0 22px; padding: 7px 10px; border: 1px solid #5a482b; border-radius: var(--radius-small); background: #272117; color: #dfbf7c; font-size: 12px; }
.notice a { color: var(--blue); font-weight: 600; text-decoration: none; }
.notice a:hover { text-decoration: underline; }
.empty-state { min-height: 180px; }
.skeleton-row { height: 108px; }

.admin-page { min-height: 100vh; background: var(--bg); }
.admin-main { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 27px 0 60px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; min-height: 50px; margin-bottom: 34px; }
.admin-header .brand { padding-left: 0; }
.back-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--text); }
.admin-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 27px 29px 30px; background: var(--surface); }
.admin-title { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.admin-title h1 { margin: 0; font-size: 23px; line-height: 1.2; font-weight: 650; }
.admin-title p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.admin-form { display: grid; gap: 22px; padding-top: 25px; }
.admin-form h2 { margin: 0; font-size: 14px; font-weight: 650; }
.login-form { width: min(340px, 100%); margin: 0 auto; }
.admin-form .primary-button { min-height: 38px; }
.admin-form .field-grid { gap: 14px; }
.form-message { min-height: 17px; margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.form-message.success { color: var(--green); }
.form-message.error { color: var(--coral); }
.admin-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 1px; }

@media (max-width: 780px) {
  .public-shell { width: calc(100% - 26px); }
  .public-header { min-height: 66px; }
  .brand-copy small { display: none; }
  .public-main { padding-top: 29px; }
  .public-main .page-heading { margin-bottom: 25px; }
  .public-main .page-heading h1 { font-size: 26px; }
  .public-main .table-head { display: none; }
  .public-main .account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 0; padding: 15px 10px 17px; }
  .public-main .account-identity { grid-column: 1; grid-row: 1; }
  .public-main .account-row > .status-label { grid-column: 2; grid-row: 1; align-self: center; }
  .public-main .quota-list { grid-column: 1 / -1; grid-row: 2; }
  .public-main .remaining-value { grid-column: 1; grid-row: 3; text-align: left; }
  .public-main .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .public-main .search-box { grid-column: 1 / -1; width: 100%; }
  .public-main .filter-group { grid-column: 1 / -1; flex-wrap: wrap; overflow: visible; }
  .public-main .filter-button { flex: 1 0 auto; }
  .public-main .select-wrap { margin-left: auto; }
  .admin-main { width: calc(100% - 26px); padding-top: 16px; }
  .admin-header { margin-bottom: 21px; }
  .admin-card { padding: 21px 17px 24px; }
  .admin-form .field-grid { grid-template-columns: 1fr; }
  .admin-form .field-wide { grid-column: auto; }
}

@media (max-width: 460px) {
  .public-main .select-wrap select { max-width: 125px; }
  .admin-title h1 { font-size: 21px; }
}
