:root {
  color: #111827;
  background: #f6f8fc;
  font-family: Inter, "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
  --page-bg:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(246, 248, 252, 0.98) 42%, #ffffff 100%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: rgba(255, 255, 255, 0.99);
  --surface-muted: rgba(241, 245, 249, 0.72);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.13);
  --text: #111827;
  --muted: #667085;
  --amber: #d97706;
  --red: #dc2626;
  --shadow-soft: 0 8px 32px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 10px 36px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; min-height: 100%; color-scheme: light; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background: var(--page-bg); background-size: auto, 48px 48px, 48px 48px; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .52; transform: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; min-height: 66px; align-items: center; gap: 20px;
  padding-right: max(16px, calc((100% - 1220px) / 2)); padding-left: max(16px, calc((100% - 1220px) / 2));
  background: rgba(255, 255, 255, .82); border-bottom: 1px solid var(--border); box-shadow: 0 4px 24px rgba(15, 23, 42, .05);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.brand-button { display: inline-flex; min-width: 0; align-items: center; gap: 10px; padding: 0; color: #18181b; background: transparent; border: 0; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; color: #fff; background: #18181b; border-radius: 8px; box-shadow: 0 8px 18px rgba(15, 23, 42, .15); font-size: 15px; font-weight: 850; }
.brand-button strong { font-size: 17px; font-weight: 850; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.service-state { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 12px; color: #27272a; background: rgba(24, 24, 27, .05); border: 1px solid rgba(24, 24, 27, .1); border-radius: 999px; font-size: 12px; font-weight: 720; white-space: nowrap; }
.service-state i { width: 7px; height: 7px; background: #f59e0b; border-radius: 50%; }
.service-state.ok i { background: #18181b; }
.service-state.error { color: #b91c1c; background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .2); }
.service-state.error i { background: #ef4444; }

.primary-button, .secondary-button, .danger-button, .icon-button {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 760;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.primary-button { padding: 0 16px; color: #fff; background: #18181b; box-shadow: 0 12px 26px rgba(15, 23, 42, .16); }
.primary-button:hover { background: #09090b; transform: translateY(-1px); }
.secondary-button { padding: 0 15px; color: var(--text); background: var(--surface-strong); border-color: var(--border); box-shadow: var(--shadow-soft); }
.secondary-button:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.secondary-button.light { color: var(--text); background: var(--surface-strong); }
.danger-button { padding: 0 15px; color: #b91c1c; background: #fff; border-color: rgba(239, 68, 68, .22); }
.icon-button { width: 40px; padding: 0; color: var(--muted); background: rgba(255, 255, 255, .72); border-color: var(--border); box-shadow: 0 6px 18px rgba(15, 23, 42, .05); font-size: 17px; }
.icon-button:hover { color: #09090b; border-color: rgba(24, 24, 27, .22); transform: translateY(-1px); }
.icon-button.light { color: var(--muted); background: #fff; }
.icon-button.small { width: 32px; min-height: 32px; font-size: 14px; }
.header-icon { width: 36px; min-height: 36px; color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; border-radius: 999px; }
.header-icon:hover { color: #09090b; background: rgba(24, 24, 27, .06); border-color: transparent; }
.header-command { min-height: 34px; padding: 0 11px; background: rgba(255, 255, 255, .72); box-shadow: none; font-size: 10px; }

main { width: min(1075px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 56px; }
.price-monitor-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.price-monitor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.price-monitor-heading h2 { margin: 0; color: #18181b; font-size: 15px; font-weight: 780; }
.price-monitor-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
.price-card {
  display: flex; min-width: 0; min-height: 244px; overflow: hidden; flex-direction: column; padding: 17px;
  color: var(--text); background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .86); border-radius: 8px;
  box-shadow: 0 7px 26px rgba(15, 23, 42, .045); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.price-card:hover { background: rgba(255, 255, 255, .7); border-color: rgba(255, 255, 255, .98); box-shadow: 0 12px 34px rgba(15, 23, 42, .07); transform: translateY(-2px); }
.price-card-header { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-bottom: 13px; }
.price-source-mark { display: grid; width: 32px; height: 32px; place-items: center; color: #fff; background: #18181b; border-radius: 7px; font-size: 11px; font-weight: 800; }
.price-source-copy { min-width: 0; }
.price-source-copy strong, .price-source-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-source-copy strong { color: #18181b; font-size: 12px; font-weight: 760; }
.price-source-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.price-product-list { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.price-product-row { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(15, 23, 42, .055); }
.price-product-row:last-child { border-bottom: 0; }
.price-product-row.is-unavailable { color: #a1a1aa; }
.price-product-row.is-unavailable .price-product-copy b,
.price-product-row.is-unavailable .price-product-value strong { color: #71717a; }
.price-product-copy, .price-product-value { min-width: 0; }
.price-product-copy b, .price-product-copy small, .price-product-value strong, .price-product-value small { display: block; }
.price-product-copy b { overflow: hidden; color: #3f3f46; font-size: 9px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.price-product-copy small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.price-product-value { flex: 0 0 auto; text-align: right; }
.price-product-value strong { color: #09090b; font-size: 12px; font-weight: 780; white-space: nowrap; }
.price-product-value small { min-height: 11px; margin-top: 2px; color: var(--muted); font-size: 8px; }
.price-card-empty { display: -webkit-box; min-height: 106px; overflow: hidden; flex: 1; place-content: center; align-items: center; padding: 14px; color: var(--muted); text-align: center; border: 1px dashed var(--border-strong); border-radius: 7px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; font-size: 9px; line-height: 1.55; }
.price-card-empty.is-error { color: #b91c1c; border-color: rgba(239, 68, 68, .18); }
.price-card-footer { display: grid; grid-template-columns: minmax(0, 1fr) 29px 29px 29px; align-items: center; gap: 5px; margin-top: 12px; }
.price-card-footer > span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.price-tool-button { display: grid; width: 29px; height: 29px; place-items: center; color: var(--muted); text-decoration: none; background: rgba(255, 255, 255, .76); border: 1px solid var(--border); border-radius: 7px; font-size: 12px; transition: color .18s ease, border-color .18s ease, transform .18s ease; }
.price-tool-button:hover { color: #09090b; border-color: rgba(24, 24, 27, .18); transform: translateY(-1px); }
.price-tool-button:disabled { opacity: .35; }
.add-price-card { align-items: center; justify-content: center; gap: 11px; color: #52525b; text-align: center; background: rgba(255, 255, 255, .28); border-color: rgba(15, 23, 42, .08); box-shadow: none; }
.add-price-card:hover { color: #09090b; background: rgba(255, 255, 255, .64); border-color: rgba(24, 24, 27, .15); }
.add-price-icon { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: #18181b; border-radius: 8px; box-shadow: 0 9px 20px rgba(15, 23, 42, .15); font-size: 22px; font-weight: 350; line-height: 1; transition: transform .18s ease; }
.add-price-card:hover .add-price-icon { transform: translateY(-2px); }
.add-price-card strong { font-size: 12px; font-weight: 720; }
.pool-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.pool-toolbar > p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 620; }
.pool-toolbar-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
.pool-view-mode { display: grid; min-width: 106px; grid-template-columns: 1fr 1fr; padding: 3px; background: rgba(24, 24, 27, .055); border: 1px solid rgba(24, 24, 27, .06); border-radius: 8px; }
.pool-view-mode button { min-height: 32px; padding: 0 9px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: 9px; font-weight: 720; }
.pool-view-mode button:hover { color: #18181b; }
.pool-view-mode button.active { color: #fff; background: #18181b; box-shadow: 0 6px 14px rgba(15, 23, 42, .14); }
.search-field { display: inline-flex; width: min(290px, 100%); min-height: 40px; align-items: center; gap: 8px; padding: 0 13px; color: #98a2b3; background: rgba(255, 255, 255, .7); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 6px 20px rgba(15, 23, 42, .04); backdrop-filter: blur(14px); }
.search-field:focus-within { color: #18181b; border-color: rgba(24, 24, 27, .28); box-shadow: 0 0 0 3px rgba(24, 24, 27, .07); }
.search-field input { width: 100%; min-width: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-field input::placeholder { color: #98a2b3; }

.pool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 24px; }
.pool-card {
  --pool-accent: #27272a; --pool-accent-strong: #09090b; --pool-accent-soft: rgba(24, 24, 27, .07);
  position: relative; display: flex; min-width: 0; min-height: 350px; overflow: hidden; flex-direction: column; padding: 22px;
  color: var(--text); text-align: left; background: rgba(255, 255, 255, .48); border: 1px solid rgba(255, 255, 255, .84); border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .04); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  transition: transform .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.pool-card--cliproxyapi { --pool-accent: #27272a; --pool-accent-strong: #09090b; --pool-accent-soft: rgba(24, 24, 27, .07); }
.pool-card:hover { background: rgba(255, 255, 255, .66); border-color: rgba(255, 255, 255, .96); box-shadow: 0 12px 40px rgba(0, 0, 0, .07); transform: translateY(-2px); }
.pool-platform-logo { position: absolute; top: 14px; left: 14px; z-index: 1; display: grid; width: 29px; height: 29px; place-items: center; color: var(--pool-accent-strong); background: rgba(255, 255, 255, .92); border: 1px solid rgba(255, 255, 255, .82); border-radius: 999px; box-shadow: 0 7px 16px rgba(15, 23, 42, .07); font-size: 10px; font-weight: 850; }
.pool-status { position: absolute; top: 0; right: 0; z-index: 1; }
.pool-status .badge { border-radius: 0 0 0 8px; }
.pool-card-body { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.pool-card-header { margin-bottom: 14px; }
.pool-card-header h2 { margin: 0 0 6px; padding-left: 34px; overflow: hidden; color: var(--text); font-size: 16px; font-weight: 760; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.pool-card-header p { margin: 0; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.pool-primary-stat { display: flex; min-height: 45px; align-items: baseline; gap: 7px; margin-bottom: 14px; white-space: nowrap; }
.pool-primary-stat strong { color: #09090b; font-size: 36px; font-weight: 760; line-height: 1.08; }
.pool-primary-stat > span { color: var(--muted); font-size: 12px; }
.pool-primary-stat em { margin-left: auto; padding: 4px 8px; color: #27272a; background: rgba(24, 24, 27, .05); border: 1px solid rgba(24, 24, 27, .1); border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 760; }
.pool-breakdown { min-width: 0; margin-bottom: 10px; }
.pool-breakdown-head { display: flex; min-height: 18px; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); font-size: 10px; font-weight: 740; }
.pool-breakdown-head em { color: var(--muted); font-size: 8px; font-style: normal; font-weight: 500; }
.pool-breakdown-list { display: flex; max-height: 76px; min-height: 34px; overflow-y: auto; flex-direction: column; gap: 5px; padding: 2px 2px 3px 1px; scrollbar-width: thin; }
.pool-platform-group { --platform-color: #52525b; --platform-soft: rgba(82, 82, 91, .08); display: grid; width: 100%; min-width: 0; min-height: 33px; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 7px; padding: 4px 6px 4px 4px; background: var(--platform-soft); border: 1px solid color-mix(in srgb, var(--platform-color) 18%, transparent); border-radius: 7px; }
.pool-platform-group.platform-openai { --platform-color: #10a37f; --platform-soft: rgba(16, 163, 127, .08); }
.pool-platform-group.platform-codex { --platform-color: #18181b; --platform-soft: rgba(24, 24, 27, .06); }
.pool-platform-group.platform-grok { --platform-color: #111827; --platform-soft: rgba(17, 24, 39, .07); }
.pool-platform-group.platform-claude { --platform-color: #d97757; --platform-soft: rgba(217, 119, 87, .09); }
.pool-platform-group.platform-gemini { --platform-color: #4285f4; --platform-soft: rgba(66, 133, 244, .09); }
.pool-platform-group.platform-antigravity { --platform-color: #7c3aed; --platform-soft: rgba(124, 58, 237, .08); }
.pool-platform-name { display: inline-flex; min-width: 0; align-items: center; gap: 4px; color: var(--platform-color); }
.pool-platform-name > i { display: grid; width: 22px; height: 22px; place-items: center; color: #fff; background: var(--platform-color); border-radius: 6px; font-size: 8px; font-style: normal; font-weight: 800; }
.pool-platform-name > b { overflow: hidden; font-size: 8px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.pool-plan-list { display: flex; min-width: 0; align-items: center; gap: 5px; overflow-x: auto; padding-bottom: 1px; scrollbar-width: thin; }
.pool-plan-item { display: inline-grid; min-height: 24px; grid-template-columns: auto auto auto; align-items: center; gap: 4px; padding: 0 6px; color: #3f3f46; background: rgba(255, 255, 255, .72); border: 1px solid rgba(15, 23, 42, .07); border-radius: 5px; }
.pool-plan-item > strong { font-size: 8px; font-weight: 720; }
.plan-health { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 8px; font-style: normal; font-weight: 700; }
.plan-health > i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.plan-health.is-normal { color: #16a34a; }
.plan-health.is-abnormal { color: #dc2626; }
.pool-platform-summary { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; padding-right: 3px; }
.pool-platform-total { display: inline-flex; align-items: baseline; gap: 3px; margin-right: auto; color: #18181b; }
.pool-platform-total strong { font-size: 11px; font-weight: 780; }
.pool-platform-total i { color: var(--muted); font-size: 8px; font-style: normal; }
.pool-breakdown.is-compact .pool-breakdown-list { max-height: 76px; }
.pool-breakdown-empty { color: var(--muted); font-size: 9px; }
.pool-features { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.pool-features-head { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--text); font-size: 11px; font-weight: 760; }
.pool-features-head em { color: var(--muted); font-size: 9px; font-style: normal; font-weight: 500; }
.pool-features-list { display: flex; max-height: 68px; overflow-y: auto; flex-direction: column; gap: 5px; padding-right: 4px; scrollbar-width: thin; }
.pool-feature { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 28px; color: var(--text); font-size: 11px; }
.pool-feature-icon { display: grid; width: 18px; height: 18px; place-items: center; flex: 0 0 auto; color: #27272a; background: rgba(24, 24, 27, .06); border-radius: 999px; font-size: 9px; font-weight: 800; }
.pool-feature-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-feature-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.pool-feature strong { color: #18181b; font-size: 12px; }
.pool-feature.is-warning .pool-feature-icon, .pool-feature.is-warning strong { color: var(--amber); }
.pool-feature.is-warning .pool-feature-icon { background: rgba(245, 158, 11, .1); }
.pool-feature.is-danger .pool-feature-icon, .pool-feature.is-danger strong { color: var(--red); }
.pool-feature.is-danger .pool-feature-icon { background: rgba(239, 68, 68, .1); }
.pool-features-empty { display: grid; min-height: 48px; place-items: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 10px; }
.pool-replenishment-bar { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 5px 6px 5px 10px; background: rgba(24, 24, 27, .035); border: 1px solid rgba(24, 24, 27, .08); border-radius: 7px; }
.pool-replenishment-bar > span { display: inline-flex; min-width: 0; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 720; white-space: nowrap; }
.pool-replenishment-bar > span i { width: 6px; height: 6px; flex: 0 0 auto; background: #a1a1aa; border-radius: 50%; }
.pool-replenishment-bar.is-enabled > span { color: #16794f; }
.pool-replenishment-bar.is-enabled > span i { background: #16a34a; }
.pool-replenishment-bar > button { min-height: 24px; padding: 0 9px; color: #27272a; background: rgba(255, 255, 255, .9); border: 1px solid var(--border); border-radius: 6px; font-size: 9px; font-weight: 720; }
.pool-replenishment-bar > button:hover { color: #fff; background: #27272a; }
.pool-card-actions { display: grid; grid-template-columns: minmax(0, 1fr) 38px 38px 38px; gap: 7px; margin-top: 14px; }
.pool-card-actions.no-replenishment { grid-template-columns: minmax(0, 1fr) 38px 38px; }
.pool-open-button { min-height: 40px; color: #fff; background: #1c1c1e; border: 1px solid rgba(28, 28, 30, .12); border-radius: 8px; box-shadow: 0 12px 26px rgba(15, 23, 42, .13); font-size: 11px; font-weight: 720; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.pool-open-button:hover { background: #111113; box-shadow: 0 17px 34px rgba(15, 23, 42, .2); transform: scale(1.015); }
.pool-tool-button { display: grid; min-height: 38px; place-items: center; color: var(--muted); background: rgba(255, 255, 255, .82); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: color .18s ease, border-color .18s ease, transform .18s ease; }
.pool-tool-button:hover { color: #09090b; border-color: rgba(24, 24, 27, .18); transform: translateY(-1px); }
.add-pool-card {
  align-items: center; justify-content: center; gap: 14px; color: #3f3f46; text-align: center;
  background: rgba(255, 255, 255, .42); border: 1px solid rgba(15, 23, 42, .09); box-shadow: 0 8px 28px rgba(15, 23, 42, .035);
}
.add-pool-card:hover { color: #09090b; background: rgba(255, 255, 255, .72); border-color: rgba(24, 24, 27, .16); box-shadow: 0 14px 38px rgba(15, 23, 42, .07); }
.add-pool-card:active { transform: translateY(0) scale(.99); }
.add-pool-card:focus-visible { outline: 0; border-color: rgba(24, 24, 27, .3); box-shadow: 0 0 0 4px rgba(24, 24, 27, .07), 0 14px 38px rgba(15, 23, 42, .07); }
.add-pool-icon {
  display: grid; width: 42px; height: 42px; place-items: center; color: #fff; background: #18181b; border: 1px solid #18181b; border-radius: 8px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .16); font-size: 24px; font-weight: 350; line-height: 1; transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.add-pool-card:hover .add-pool-icon { background: #09090b; box-shadow: 0 13px 26px rgba(15, 23, 42, .22); transform: translateY(-2px); }
.add-pool-card strong { color: inherit; font-size: 13px; font-weight: 720; }

.badge { display: inline-flex; min-height: 28px; align-items: center; padding: 0 11px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge.success { color: #fff; background: #18181b; }
.badge.danger { color: #fff; background: #ef4444; }
.badge.warning { color: #92400e; background: #fef3c7; }
.badge.info { color: #1d4ed8; background: #dbeafe; }
.badge.neutral { color: #475569; background: rgba(148, 163, 184, .18); }

.detail-toolbar { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 4px 0 24px; }
.detail-title { min-width: 0; }
.detail-title h1 { margin: 0; color: var(--text); font-size: 26px; font-weight: 760; }
.detail-title p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { display: flex; align-items: center; gap: 8px; }
.detail-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; background: rgba(255, 255, 255, .54); border: 1px solid rgba(255, 255, 255, .82); border-radius: 8px; box-shadow: var(--shadow-soft); backdrop-filter: blur(18px); }
.detail-metrics div { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--border); }
.detail-metrics div:last-child { border-right: 0; }
.detail-metrics span, .detail-metrics strong { display: block; }
.detail-metrics span { color: var(--muted); font-size: 10px; }
.detail-metrics strong { margin-top: 6px; overflow-wrap: anywhere; color: var(--text); font-size: 20px; }
.detail-metrics div:last-child strong { font-size: 11px; line-height: 1.5; }
.error-banner { margin-top: 15px; padding: 11px 14px; color: #b91c1c; background: rgba(254, 226, 226, .82); border: 1px solid rgba(239, 68, 68, .18); border-radius: 8px; overflow-wrap: anywhere; font-size: 11px; }
.section-heading { display: flex; min-height: 45px; align-items: center; justify-content: space-between; gap: 20px; margin: 30px 0 14px; }
.section-heading h2 { margin: 0; color: var(--text); font-size: 18px; font-weight: 760; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.table-shell { overflow-x: auto; background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .86); border-radius: 8px; box-shadow: var(--shadow-soft); backdrop-filter: blur(18px); }
table { width: 100%; min-width: 1120px; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; font-size: 11px; }
th { color: var(--muted); background: rgba(241, 245, 249, .74); font-size: 10px; font-weight: 760; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(241, 245, 249, .58); }
.account-name { display: block; max-width: 250px; overflow-wrap: anywhere; color: var(--text); }
.muted { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.quota-list { display: grid; min-width: 275px; gap: 5px; }
.quota-row { display: grid; grid-template-columns: minmax(82px, 1fr) 92px 68px; align-items: center; gap: 7px; }
.quota-row > span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.quota-row > i { height: 5px; overflow: hidden; background: #e2e8f0; border-radius: 999px; }
.quota-row b { display: block; height: 100%; background: #22a06b; }
.quota-row em { color: var(--muted); font-size: 9px; font-style: normal; text-align: right; }
.account-cycle-estimate { display: grid; min-width: 138px; gap: 3px; font-variant-numeric: tabular-nums; }
.account-cycle-estimate strong { color: #16794f; font-size: 14px; }
.account-cycle-estimate small { max-width: 170px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.account-cycle-estimate.is-excluded strong { color: #667085; }
.request-stats { display: flex; min-width: 255px; align-items: center; gap: 12px; }
.request-stat { display: grid; min-width: 48px; gap: 2px; font-variant-numeric: tabular-nums; }
.request-stat b { color: #27272a; font-size: 10px; white-space: nowrap; }
.request-stat small { color: var(--muted); font-size: 8px; }
.request-stat.last-used { min-width: 80px; }
.table-empty { display: none; min-height: 180px; place-items: center; color: var(--muted); font-size: 11px; }
.table-empty.show { display: grid; }

dialog { width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 0; color: var(--text); background: rgba(255, 255, 255, .97); border: 1px solid rgba(255, 255, 255, .88); border-radius: 8px; box-shadow: 0 24px 64px rgba(15, 23, 42, .18); backdrop-filter: blur(20px); }
#priceSourceDialog { width: min(590px, calc(100% - 32px)); }
#replenishmentDialog { width: min(680px, calc(100% - 32px)); }
#manualReplenishmentDialog { width: min(680px, calc(100% - 32px)); }
#replenishmentHistoryDialog { width: min(980px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(2, 6, 23, .46); backdrop-filter: blur(5px); }
dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; font-size: 18px; font-weight: 760; }
.dialog-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
fieldset { margin: 0 0 16px; padding: 0; border: 0; }
legend, .form-field { color: #475467; font-size: 11px; font-weight: 680; }
legend { margin-bottom: 8px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--surface-muted); border-radius: 8px; }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: grid; min-height: 36px; place-items: center; color: var(--muted); border-radius: 6px; font-size: 11px; font-weight: 720; }
.segmented-control input:checked + span { color: var(--text); background: #fff; box-shadow: var(--shadow-soft); }
.form-field { display: grid; gap: 7px; margin-top: 14px; }
.form-field input, .form-field select { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--text); background: var(--surface-strong); border: 1px solid var(--border); border-radius: 8px; outline: 0; font-size: 12px; }
.form-field select[multiple] { min-height: 88px; }
.form-field input:focus, .form-field select:focus { border-color: #27272a; box-shadow: 0 0 0 3px rgba(24, 24, 27, .08); }
.model-config-heading { display: flex; min-height: 26px; align-items: center; justify-content: space-between; gap: 8px; }
.inline-tool-button { min-height: 26px; padding: 0 8px; color: #16794f; background: rgba(22, 121, 79, .06); border: 1px solid rgba(22, 121, 79, .18); border-radius: 6px; font-size: 9px; font-weight: 720; }
.inline-tool-button:hover { color: #fff; background: #16794f; }
.inline-tool-button:disabled { cursor: wait; opacity: .55; }
.selector-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.segmented-control.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-control input:disabled + span { cursor: not-allowed; opacity: .55; }
.check-field { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: #475467; font-size: 11px; }
.check-field input { width: 15px; height: 15px; accent-color: #18181b; }
.dialog-footer { display: flex; align-items: center; gap: 9px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.small-command { min-height: 30px; padding: 0 10px; font-size: 10px; }
.replenishment-policy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(120px, .8fr) auto; align-items: end; gap: 10px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.replenishment-policy .form-field { margin-top: 0; }
.replenishment-policy-status { display: grid; min-height: 42px; align-content: center; gap: 2px; font-variant-numeric: tabular-nums; }
.replenishment-policy-status span, .replenishment-policy-status small { color: var(--muted); font-size: 8px; }
.replenishment-policy-status strong { color: var(--text); font-size: 15px; }
.replenishment-policy-status b { font-weight: 760; }
.manual-replenishment-quote { margin-top: 14px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.manual-quote-heading, .manual-quote-price, .manual-quote-meta, .manual-replenishment-budget { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.manual-quote-heading > span { color: var(--muted); font-size: 9px; font-weight: 720; text-transform: uppercase; }
.manual-quote-inventory { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; color: #52525b; background: #f4f4f5; border-radius: 6px; font-size: 9px; }
.manual-quote-inventory.is-available { color: #087443; background: #eaf8f0; }
.manual-quote-inventory.is-unavailable { color: #b42318; background: #fff1f0; }
.manual-quote-price { min-height: 56px; }
.manual-quote-price span { display: grid; min-width: 0; gap: 3px; }
.manual-quote-price b { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.manual-quote-price small { color: var(--muted); font-size: 9px; }
.manual-quote-price > strong { color: #087443; font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.manual-quote-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 16px; color: var(--muted); font-size: 9px; }
.manual-quote-meta strong { color: #52525b; text-align: right; font-size: 9px; }
.manual-purchase-fields { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr); }
.manual-replenishment-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.manual-replenishment-budget { margin-top: 12px; padding: 11px 12px; background: #f7f7f8; border-radius: 7px; }
.manual-replenishment-budget span { display: grid; gap: 3px; color: var(--muted); font-size: 9px; }
.manual-replenishment-budget span:last-child { text-align: right; }
.manual-replenishment-budget strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.manual-price-status { min-height: 34px; margin: 10px 0 0; padding: 9px 10px; color: #52525b; background: #f4f4f5; border-left: 3px solid #a1a1aa; border-radius: 6px; font-size: 10px; line-height: 1.5; }
.manual-price-status.is-ready { color: #087443; background: #effaf4; border-left-color: #16a36a; }
.manual-price-status.is-warning { color: #9a6700; background: #fff8e6; border-left-color: #eaaa08; }
.manual-price-status.is-blocked { color: #b42318; background: #fff5f4; border-left-color: #d92d20; }
.manual-import-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.manual-import-heading strong { color: var(--text); font-size: 11px; }
.manual-import-heading span { color: var(--muted); font-size: 9px; }
.manual-replenishment-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin-top: 12px; padding: 10px 0 0; border-top: 1px solid var(--border); font-size: 10px; }
.manual-replenishment-meta span { color: var(--muted); }
.manual-replenishment-meta strong { max-width: 230px; overflow-wrap: anywhere; text-align: right; }
.history-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 40px; align-items: end; gap: 10px; margin-bottom: 14px; }
.history-filters .form-field { margin-top: 0; }
.history-table-shell { max-height: min(520px, calc(100dvh - 230px)); overflow: auto; }
.history-table { min-width: 850px; }
.history-table th { position: sticky; top: 0; z-index: 1; }
.history-table td { min-width: 105px; }
.history-table td:nth-child(5) { min-width: 175px; }
.history-account-list { display: grid; max-width: 240px; gap: 3px; }
.history-account-list strong { font-size: 10px; }
.history-account-list small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.history-message { display: -webkit-box; max-width: 180px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.4; }
.history-spend { display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.history-spend strong { color: #16794f; font-size: 12px; }
.history-spend small { color: var(--muted); font-size: 8px; }
.replenishment-rule-list { display: grid; max-height: 190px; overflow-y: auto; gap: 7px; margin-bottom: 16px; }
.replenishment-rule-empty { display: grid; min-height: 56px; place-items: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 10px; }
.replenishment-rule-row { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr) auto auto auto; align-items: center; gap: 7px; padding: 8px 9px; background: rgba(244, 244, 245, .74); border: 1px solid rgba(24, 24, 27, .07); border-radius: 7px; }
.replenishment-rule-order { color: #71717a; font-size: 9px; font-weight: 760; text-align: center; font-variant-numeric: tabular-nums; }
.replenishment-rule-row > i { display: grid; width: 26px; height: 26px; place-items: center; color: #fff; background: #27272a; border-radius: 6px; font-size: 9px; font-style: normal; font-weight: 800; }
.replenishment-rule-copy { min-width: 0; }
.replenishment-rule-copy strong, .replenishment-rule-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replenishment-rule-copy strong { display: flex; align-items: center; gap: 7px; color: #27272a; font-size: 10px; }
.replenishment-rule-copy strong em { color: #b42318; font-size: 8px; font-style: normal; font-weight: 700; }
.replenishment-rule-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.replenishment-rule-row .price-tool-button { width: 28px; height: 28px; }
.replenishment-rule-row .manual-replenishment-button { width: auto; min-width: 64px; padding: 0 8px; font-size: 9px; font-weight: 720; }
.replenishment-rule-actions, .replenishment-order-actions { display: inline-flex; gap: 4px; }
.replenishment-order-actions { padding-right: 6px; border-right: 1px solid var(--border); }
.replenishment-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid var(--border); }
.replenishment-editor-heading strong { font-size: 12px; }
.footer-spacer { flex: 1; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(420px, calc(100vw - 44px)); padding: 12px 15px; color: var(--text); background: rgba(255, 255, 255, .96); border: 1px solid var(--border); border-left: 3px solid #18181b; border-radius: 8px; box-shadow: var(--shadow-card); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .16s ease, transform .16s ease; font-size: 11px; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-metrics div:nth-child(3) { border-right: 0; }
  .detail-metrics div:nth-child(-n + 3) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 700px) {
  .topbar { position: static; gap: 8px; padding-right: 12px; padding-left: 12px; }
  .topbar-actions { gap: 4px; }
  .header-command { width: 36px; min-height: 36px; padding: 0; font-size: 14px; }
  .header-command-label { display: none; }
  .service-state { max-width: 116px; margin-left: auto; overflow: hidden; padding: 0 8px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  main { width: calc(100% - 24px); padding-top: 28px; }
  .price-grid { grid-template-columns: minmax(0, 1fr); }
  .price-card { min-height: 228px; }
  .pool-toolbar { align-items: stretch; flex-direction: column; }
  .pool-toolbar-actions { width: 100%; justify-content: stretch; }
  .pool-toolbar-actions .search-field { min-width: 0; flex: 1; }
  .search-field { width: 100%; }
  .pool-grid { grid-template-columns: minmax(0, 1fr); }
  .manual-replenishment-inputs { grid-template-columns: minmax(0, 1fr); }
  .pool-card { min-height: 340px; align-items: center; text-align: center; }
  .pool-card-body, .pool-card-header { width: 100%; }
  .pool-card-header h2 { padding-left: 0; }
  .pool-primary-stat { justify-content: center; }
  .pool-primary-stat em { margin-left: 8px; }
  .pool-breakdown { width: 100%; text-align: left; }
  .pool-feature { text-align: left; }
  .detail-toolbar { grid-template-columns: 40px minmax(0, 1fr); }
  .detail-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .selector-fields { grid-template-columns: minmax(0, 1fr); }
  .replenishment-policy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .replenishment-policy-status { min-height: 36px; }
  .history-filters { grid-template-columns: repeat(3, minmax(0, 1fr)) 40px; }
}

@media (max-width: 480px) {
  .brand-button strong { font-size: 15px; }
  .service-state { max-width: 88px; }
  .pool-card { min-height: 330px; padding: 20px; }
  .pool-card-actions { grid-template-columns: minmax(0, 1fr) 40px 40px 40px; }
  .segmented-control.three { grid-template-columns: minmax(0, 1fr); }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-metrics div, .detail-metrics div:nth-child(3) { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .detail-metrics div:nth-child(even) { border-right: 0; }
  .detail-metrics div:last-child { border-right: 0; border-bottom: 0; }
  .replenishment-rule-row { grid-template-columns: 16px 26px minmax(0, 1fr) auto; }
  .replenishment-rule-row .badge { display: none; }
  .replenishment-order-actions { grid-column: 3; justify-self: end; padding-right: 0; border-right: 0; }
  .replenishment-rule-actions { grid-column: 4; }
  .replenishment-policy { grid-template-columns: minmax(0, 1fr); }
  .history-filters { grid-template-columns: minmax(0, 1fr) 40px; }
  .history-filters .form-field { grid-column: 1; }
  .history-filters .icon-button { grid-column: 2; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
