:root {
  color-scheme: light;
  --navy: #101a31;
  --navy-soft: #1a2743;
  --blue: #315be8;
  --blue-2: #5b7cfa;
  --green: #0ea88e;
  --ink: #10203d;
  --muted: #68758d;
  --line: #dce3ee;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --shadow: 0 12px 34px rgba(30, 49, 85, 0.08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-size: 16px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(49, 91, 232, .22); outline-offset: 2px; }

.auth-screen {
  min-height: 100vh;
  padding: 28px 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(49, 91, 232, .24), transparent 34%),
    radial-gradient(circle at 85% 85%, rgba(18, 165, 148, .18), transparent 32%),
    linear-gradient(145deg, #0d1730, #182746 58%, #10213d);
}
.auth-card { width: min(100%, 460px); padding: 32px; border: 1px solid rgba(255,255,255,.14); border-radius: 24px; background: rgba(255,255,255,.97); box-shadow: 0 30px 90px rgba(4, 13, 35, .36); }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 18px; }
.auth-brand span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.auth-heading { margin: 28px 0 22px; }
.auth-heading h1 { font-size: 28px; }
.auth-heading > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-tabs { margin-bottom: 20px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 12px; background: #edf1f8; }
.auth-tab { min-height: 40px; border: 0; border-radius: 9px; color: #66748c; background: transparent; font-weight: 750; }
.auth-tab.active { color: var(--blue); background: #fff; box-shadow: 0 5px 16px rgba(36, 55, 90, .10); }
.auth-form { display: grid; gap: 15px; }
.auth-form .field { font-size: 14px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-helper { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.auth-message { padding: 11px 13px; border: 1px solid #ffc3cc; border-radius: 10px; color: #a21d32; background: #fff0f2; font-size: 13px; line-height: 1.5; }
.account-chip { min-height: 44px; padding: 0 8px 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.account-chip span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 750; white-space: nowrap; }
.account-chip button { min-height: 30px; padding: 0 9px; border: 0; border-radius: 8px; color: #8f2e40; background: #fff0f3; font-size: 12px; font-weight: 750; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px 24px; display: flex; flex-direction: column; background: var(--navy); color: #d8e2f8; }
.brand { display: flex; align-items: center; gap: 14px; padding: 2px 10px 28px; }
.brand-mark { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-size: 25px; font-weight: 800; background: linear-gradient(145deg, #4d6ef4, #18b9b0); box-shadow: 0 12px 26px rgba(40, 103, 242, .3); }
.brand strong { display: block; color: #fff; font-size: 19px; }
.brand span { display: block; margin-top: 5px; font-size: 13px; color: #9fb0ce; }
.nav { display: grid; gap: 8px; }
.nav-item { width: 100%; min-height: 54px; padding: 0 17px; display: flex; align-items: center; gap: 14px; border: 0; border-radius: 13px; color: #bfd0ef; background: transparent; text-align: left; font-size: 17px; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, #4168ed, #3f55bb); box-shadow: 0 10px 22px rgba(29, 66, 190, .22); }
.nav-item > span:first-child { width: 22px; text-align: center; font-size: 19px; }
.privacy-note { margin-top: auto; padding: 16px; display: flex; gap: 11px; align-items: flex-start; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.035); }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { color: #fff; font-size: 14px; }
.privacy-note div span { margin-top: 4px; color: #9fb0ce; font-size: 12px; line-height: 1.5; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: #2bc9a3; box-shadow: 0 0 0 5px rgba(43,201,163,.12); }

.main-content { min-width: 0; padding: 28px 34px 44px; }
.topbar { min-height: 64px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-weight: 750; font-size: 13px; letter-spacing: .04em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.3; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.sync-state { display: flex; align-items: center; gap: 10px; margin-right: 4px; color: var(--muted); font-size: 14px; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; white-space: nowrap; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 9px 22px rgba(49, 91, 232, .2); }
.button.primary:hover { background: #274ed1; }
.button.secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.button.secondary:hover { border-color: #b8c5db; }
.button.danger { color: #b42338; border-color: #ffd5dc; background: #fff4f5; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.text-button, .link-button { padding: 0; border: 0; color: var(--blue); background: transparent; font-weight: 700; }

.global-message, .alert { margin-bottom: 16px; padding: 13px 16px; border-radius: 12px; color: #8a5300; background: #fff4d8; border: 1px solid #f7d47c; font-size: 14px; }
.global-message.error { color: #a21d32; background: #fff0f2; border-color: #ffc3cc; }
.global-message.success { color: #06765f; background: #e9fbf6; border-color: #a8eadb; }
.alerts:empty { display: none; }
.alert-summary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; text-align: left; }
.alert-summary strong, .alert-summary small { display: block; }
.alert-summary small { margin-top: 4px; color: #986307; font-size: 12px; font-weight: 500; }
.alert-summary > span:last-child { flex: 0 0 auto; font-weight: 750; }
.progress-shell { margin: -6px 0 20px; display: grid; grid-template-columns: minmax(160px, 280px) auto; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.progress-shell[hidden] { display: none; }
.progress-bar { height: 7px; overflow: hidden; border-radius: 999px; background: #dfe6f2; }
.progress-bar span { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #18b9b0); transition: width .25s ease; }

.view { display: none; }
.view.active { display: block; animation: view-in .18s ease; }
@keyframes view-in { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel, .reward-card, .wallet-card { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.metric-card { position: relative; min-height: 142px; padding: 22px 20px 18px; border-radius: 16px; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }
.accent-blue { --accent: #315be8; } .accent-indigo { --accent: #7658ed; } .accent-amber { --accent: #ef9b08; }
.accent-green { --accent: #0da980; } .accent-cyan { --accent: #009ec4; } .accent-purple { --accent: #a84ed3; }
.metric-label { display: block; min-height: 22px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.metric-value { display: block; min-height: 46px; margin: 8px 0 4px; color: #0d1b34; font-size: clamp(18px, 1.45vw, 25px); line-height: 1.16; overflow-wrap: anywhere; }
.metric-value small { display: block; margin-top: 2px; color: #586781; font-size: 12px; }
.metric-note { color: var(--muted); font-size: 12px; line-height: 1.45; }

.panel { border-radius: 18px; padding: 22px; }
.panel-header { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-header p, .section-intro p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(340px, .95fr); gap: 18px; margin-bottom: 18px; }
.chart-panel { min-height: 480px; }
.chart-wrap { width: 100%; min-height: 340px; display: grid; align-items: center; }
#daily-chart { width: 100%; height: 330px; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch, .wallet-color { width: 10px; height: 10px; border-radius: 50%; }
.wallet-list { display: grid; gap: 14px; align-content: start; }
.wallet-card { padding: 20px; border-radius: 18px; }
.wallet-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.wallet-name { display: flex; align-items: flex-start; gap: 10px; }
.wallet-name strong, .wallet-name span { display: block; }
.wallet-name strong { font-size: 17px; }
.wallet-name span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.wallet-color { margin-top: 6px; }
.wallet-address { max-width: 100%; margin: 12px 0 17px; overflow: hidden; text-overflow: ellipsis; color: var(--blue); font-family: Consolas, monospace; font-size: 12px; white-space: nowrap; }
.wallet-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wallet-stat, .reward-detail { padding: 11px; border-radius: 11px; background: #f6f8fc; }
.wallet-stat span, .wallet-stat strong, .reward-detail span, .reward-detail strong { display: block; }
.wallet-stat span, .reward-detail span { color: var(--muted); font-size: 11px; }
.wallet-stat strong, .reward-detail strong { margin-top: 5px; font-size: 14px; line-height: 1.3; }
.wallet-footer { margin-top: 15px; padding-top: 14px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.table-scroll { width: 100%; overflow-x: auto; }
.tall-table { max-height: 650px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; color: #5e6b82; background: #fff; font-size: 12px; font-weight: 750; }
.align-right { text-align: right; }
.amount-positive, .difference-ok { color: #008e72; font-weight: 750; }
.difference-warning { color: #c26b00; font-weight: 750; }
.empty-cell { padding: 38px; color: var(--muted); text-align: center; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; color: #29458e; background: #edf2ff; font-size: 11px; font-weight: 750; }
.badge.energy { color: #315be8; background: #eef2ff; }
.badge.bandwidth { color: #078873; background: #e9f8f4; }

.filter-row { display: flex; gap: 12px; }
.filter-row label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
select, input { min-height: 44px; padding: 0 12px; border: 1px solid #d6deeb; border-radius: 10px; color: var(--ink); background: #fff; }
select { min-width: 155px; }
.section-intro { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-intro h2 { font-size: 26px; }
.formula-note, .local-badge { padding: 12px 15px; border-radius: 12px; color: #31519d; background: #edf2ff; }
.formula-note strong, .formula-note span { display: block; }
.formula-note strong { font-size: 12px; }
.formula-note span { margin-top: 3px; font-size: 12px; }

.reward-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.reward-card { padding: 24px; border-radius: 18px; }
.reward-hero { margin: 24px 0 20px; }
.reward-hero span, .reward-hero strong { display: block; }
.reward-hero span { color: var(--muted); font-size: 13px; }
.reward-hero strong { margin-top: 8px; font-size: clamp(25px, 3vw, 38px); line-height: 1.2; overflow-wrap: anywhere; }
.reward-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.info-panel p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full-span { grid-column: 1 / -1; }
.local-badge { font-size: 12px; font-weight: 700; }
.wallet-settings-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr); gap: 22px; }
.managed-wallet-list { display: grid; gap: 10px; align-content: start; }
.managed-wallet { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: #f8faff; }
.managed-wallet-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.managed-wallet-main strong, .managed-wallet-main span { display: block; }
.managed-wallet-main span { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); white-space: nowrap; }
.managed-wallet-actions { display: flex; gap: 7px; }
.mini-button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 700; }
.mini-button.danger { color: #b42338; }
.wallet-form { padding: 17px; display: grid; grid-template-columns: 1fr 92px; gap: 14px; border-radius: 14px; background: #f6f8fc; }
.wallet-form .wide-field { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; color: #59677e; font-size: 12px; font-weight: 650; }
.field input:disabled { color: #8390a4; background: #edf0f5; }
.field input[type="color"] { width: 100%; padding: 5px; }
.form-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 9px; }
.wallet-form .form-actions, .wallet-form .form-status { grid-column: 1 / -1; }
.form-status { min-height: 20px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.order-settings { display: grid; gap: 12px; margin-bottom: 16px; }
.order-setting { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; border-radius: 13px; background: #f6f8fc; }
.order-setting > div strong, .order-setting > div span { display: block; }
.order-setting > div { grid-column: 1 / -1; }
.order-setting > div span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.order-setting select { width: 100%; min-width: 0; }
.toggle-field { min-height: 42px; display: flex; align-items: center; gap: 9px; color: #59677e; font-size: 12px; font-weight: 700; }
.toggle-field input { width: 18px; min-height: 18px; margin: 0; }
.compact input, .compact select { min-height: 40px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.override-list { display: flex; flex-wrap: wrap; gap: 10px; }
.override-item { min-height: 42px; padding: 0 10px 0 13px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: #f8faff; font-size: 13px; }
.override-item button { width: 25px; height: 25px; border: 0; border-radius: 7px; color: #b42338; background: #ffecee; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(420px, calc(100vw - 48px)); padding: 14px 17px; border-radius: 12px; color: #fff; background: #17243f; box-shadow: 0 18px 50px rgba(9, 22, 48, .26); font-size: 14px; }
.toast[hidden] { display: none; }

@media (max-width: 1450px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card { min-height: 132px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 86px minmax(0, 1fr); }
  .sidebar { padding: 24px 14px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item > span:last-child, .privacy-note div { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .privacy-note { justify-content: center; padding: 15px 0; }
  .main-content { padding: 25px 24px 40px; }
  .overview-grid { grid-template-columns: 1fr; }
  .wallet-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-settings-layout { grid-template-columns: 1fr; }
  .order-setting { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; padding-bottom: 76px; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 10; width: auto; height: 70px; padding: 8px 10px; border-top: 1px solid rgba(255,255,255,.13); }
  .brand, .privacy-note { display: none; }
  .nav { height: 100%; grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .nav-item { min-height: 54px; display: grid; place-content: center; gap: 2px; border-radius: 10px; font-size: 11px; text-align: center; }
  .nav-item > span:first-child { width: auto; font-size: 17px; }
  .nav-item > span:last-child { display: block; }
  .main-content { padding: 20px 16px 32px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { gap: 8px; }
  .sync-state { width: 100%; justify-content: flex-end; order: -1; }
  .button { min-height: 42px; padding-inline: 13px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 128px; padding: 18px 16px; }
  .wallet-list, .reward-grid, .settings-grid { grid-template-columns: 1fr; }
  .responsive-header, .section-intro { align-items: stretch; flex-direction: column; }
  .filter-row { width: 100%; }
  .filter-row label { flex: 1; }
  .filter-row select { width: 100%; min-width: 0; }
  .wallet-form { grid-template-columns: 1fr; }
  .wallet-form .wide-field, .wallet-form .form-actions, .wallet-form .form-status { grid-column: 1; }
  .order-setting { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .auth-screen { padding: 14px; }
  .auth-card { padding: 24px 20px; border-radius: 20px; }
  .auth-heading h1 { font-size: 24px; }
  .topbar { display: block; }
  h1 { font-size: 24px; }
  .topbar-actions { margin-top: 16px; justify-content: flex-start; }
  .sync-state { justify-content: flex-start; }
  #export-button { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 122px; }
  .metric-value { font-size: 19px; }
  .panel { padding: 18px 15px; }
  .chart-panel { min-height: 390px; }
  .chart-wrap { min-height: 270px; }
  #daily-chart { height: 270px; }
  .wallet-list { grid-template-columns: 1fr; }
  .wallet-stats, .reward-details { grid-template-columns: repeat(2, 1fr); }
  .wallet-footer { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-form { display: grid; grid-template-columns: 1fr; width: 100%; }
  .progress-shell { grid-template-columns: 1fr; }
}

/* V2 analysis and reconciliation */
.range-toolbar {
  margin: -8px 0 22px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 24px rgba(30, 49, 85, .05);
}
.range-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.range-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #53617a;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}
.range-button:hover { color: var(--blue); background: #f1f5ff; }
.range-button.active { color: #fff; background: var(--blue); box-shadow: 0 6px 16px rgba(49, 91, 232, .18); }
.custom-range { display: flex; align-items: flex-end; gap: 8px; color: var(--muted); font-size: 12px; }
.custom-range[hidden] { display: none; }
.custom-range label { display: grid; gap: 4px; }
.custom-range input { min-height: 36px; }
.compact-button { min-height: 36px; padding-inline: 13px; }
.range-current { margin-left: auto; display: grid; gap: 2px; text-align: right; }
.range-current span { color: var(--muted); font-size: 11px; }
.range-current strong { font-size: 13px; }

.comparison-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.comparison-card {
  min-height: 108px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(150deg, #fff, #f8faff);
  box-shadow: var(--shadow);
}
.comparison-card span, .comparison-card strong, .comparison-card small { display: block; }
.comparison-card span { color: var(--muted); font-size: 12px; }
.comparison-card strong { margin: 9px 0 4px; font-size: 23px; }
.comparison-card strong.up { color: #078873; }
.comparison-card strong.down { color: #c2475b; }
.comparison-card small { color: #7c889b; font-size: 11px; }

.category-strip { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category-strip article { padding: 14px 16px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.category-strip small, .category-strip strong { display: block; }
.category-strip small { color: var(--muted); font-size: 11px; }
.category-strip strong { margin-top: 4px; font-size: 16px; }
.category-dot { width: 11px; height: 34px; border-radius: 999px; }
.category-dot.energy { background: #315be8; }
.category-dot.bandwidth { background: #12a594; }
.category-dot.vote { background: #a84ed3; }
.category-dot.other { background: #94a0b4; }
.recent-panel { margin-top: 18px; }

.badge.vote { color: #8240aa; background: #f6ebfc; }
.badge.other { color: #5f6c80; background: #eef1f5; }
.category-select { min-width: 112px; min-height: 34px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.difference-problem { color: #c12945; font-weight: 800; }
.status-badge { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-badge.pending { color: #9b6200; background: #fff2cc; }
.status-badge.confirmed { color: #087760; background: #e4f8f1; }
.status-badge.problem { color: #b4233d; background: #ffe9ed; }
.status-badge::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.row-problem { background: #fffafb; }
.row-pending { background: #fffdf7; }

.intro-actions { display: flex; align-items: center; gap: 10px; }
.status-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.status-summary-item { min-height: 76px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: #fff; text-align: left; }
.status-summary-item strong { color: var(--ink); font-size: 24px; }
.status-summary-item.active { color: var(--blue); border-color: #b9c9fb; background: #f5f7ff; box-shadow: 0 8px 20px rgba(49, 91, 232, .09); }
.result-count, .analysis-caption { color: var(--muted); font-size: 13px; }
.action-group { display: flex; gap: 6px; }
.action-group .mini-button { padding-inline: 9px; }

.analytics-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.compact-chart { min-height: 430px; }
#income-trend-chart, #rate-trend-chart, #reward-history-chart { width: 100%; height: 320px; overflow: visible; }
.reward-history-wrap { min-height: 300px; }
.alert-center { display: grid; gap: 10px; }
.alert-item { padding: 14px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; }
.alert-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #a45f00; background: #fff0c6; font-weight: 900; }
.alert-item.problem .alert-icon { color: #b4233d; background: #ffe8ec; }
.alert-item strong, .alert-item span { display: block; }
.alert-item span { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.alert-item time { color: #8793a7; font-size: 11px; white-space: nowrap; }

.cloud-badge, .connection-badge { padding: 10px 13px; border-radius: 11px; color: #31519d; background: #edf2ff; font-size: 12px; font-weight: 750; }
.cloud-badge.success { color: #087760; background: #e6f8f2; }
.cloud-badge.error { color: #a73147; background: #ffecef; }
.sync-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.sync-detail-grid > div { min-height: 70px; padding: 13px; border-radius: 12px; background: #f6f8fc; }
.sync-detail-grid span, .sync-detail-grid strong { display: block; }
.sync-detail-grid span { color: var(--muted); font-size: 11px; }
.sync-detail-grid strong { margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
.notification-form { display: grid; gap: 12px; }
.channel-row { padding: 10px; display: grid; grid-template-columns: 20px 130px minmax(0, 1fr); align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #f8faff; }
.channel-row > input[type="checkbox"] { min-height: 18px; width: 18px; margin: 0; }
.channel-row span strong, .channel-row span small { display: block; }
.channel-row span strong { font-size: 13px; }
.channel-row span small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.channel-row > input:last-child { min-width: 0; width: 100%; }
.notification-note { padding: 11px 13px; border-radius: 10px; color: #8a5a04; background: #fff6dc; font-size: 12px; line-height: 1.5; }

@media (max-width: 1180px) {
  .comparison-grid, .category-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .sync-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .nav { grid-template-columns: repeat(6, 1fr); }
  .range-toolbar { align-items: stretch; flex-direction: column; }
  .range-current { margin-left: 0; text-align: left; }
  .custom-range { align-items: stretch; flex-wrap: wrap; }
  .custom-range label { flex: 1; min-width: 130px; }
  .status-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-actions { align-items: stretch; flex-direction: column; }
  .sync-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .range-toolbar { margin-top: -2px; padding: 10px; }
  .range-presets { display: grid; grid-template-columns: repeat(3, 1fr); }
  .range-button { padding-inline: 8px; }
  .comparison-grid, .category-strip { grid-template-columns: 1fr 1fr; gap: 9px; }
  .comparison-card { min-height: 100px; padding: 14px; }
  .comparison-card strong { font-size: 19px; }
  .category-strip article { padding: 12px; }
  .status-summary { gap: 8px; }
  .status-summary-item { min-height: 65px; padding: 11px; }
  .status-summary-item strong { font-size: 20px; }
  .channel-row { grid-template-columns: 20px minmax(0, 1fr); }
  .channel-row > input:last-child { grid-column: 1 / -1; }
  .alert-item { grid-template-columns: auto minmax(0, 1fr); }
  .alert-item time { grid-column: 2; }
  #income-trend-chart, #rate-trend-chart, #reward-history-chart { height: 270px; }
}
