:root {
  color-scheme: light;
  --ink: #1b241f;
  --muted: #758079;
  --muted-dark: #59645e;
  --canvas: #f3f5f2;
  --paper: #fff;
  --line: #e3e8e2;
  --sidebar: #222823;
  --lime: #d8fb67;
  --blue: #4f68ee;
  --blue-soft: #eef1ff;
  --orange: #f07b54;
  --orange-soft: #fff0e9;
  --green: #277a54;
  --green-soft: #e8f4eb;
  --red: #b3433a;
  --red-soft: #fff0ed;
  --lilac: #aa9ce5;
  --mono: 'DM Mono', 'Cascadia Code', Consolas, monospace;
  --sans: 'DM Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 244px; padding: 25px 16px 16px; color: #f5f8f4; background: var(--sidebar); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; }
.brand-lockup strong { display: block; font-size: 16px; font-weight: 700; }
.brand-lockup small { display: block; margin-top: 3px; color: #a3aea6; font-family: var(--mono); font-size: 10px; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 27px; height: 27px; padding: 4px; border-radius: 6px; background: var(--lime); }
.brand-mark i { display: block; width: 5px; border-radius: 2px 2px 1px 1px; background: var(--sidebar); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; }
.site-switch { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 11px; border: 1px solid #3b4941; border-radius: 6px; color: #f4f7f3; font-size: 13px; }
.site-dot, .status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #53c585; box-shadow: 0 0 0 3px #53c58522; }
.site-tag { margin-left: auto; color: #a4b0a7; font: 10px var(--mono); letter-spacing: 0; }
.nav-label { margin: 29px 10px 10px; color: #89968e; font: 10px var(--mono); text-transform: uppercase; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 0 11px; border: 0; border-radius: 6px; color: #bdc7c0; background: transparent; text-align: left; cursor: pointer; font-size: 13px; transition: background .18s ease, color .18s ease; }
.nav-item:hover { color: #fff; background: #25332b; }
.nav-item.active { color: var(--ink); background: var(--lime); font-weight: 700; }
.nav-mark { width: 8px; height: 8px; border-radius: 2px; background: #99a59d; }
.nav-item.active .nav-mark { background: var(--sidebar); }
.nav-mark-green { background: #6bc78c; }
.nav-mark-blue { background: #8093ff; }
.nav-mark-orange { background: #ff9a76; }
.nav-mark-lilac { background: #b7a8ff; }
.nav-mark-white { background: #f2f3ed; }
.sidebar-bottom { margin-top: auto; }
.sync-card { padding: 13px 12px; border: 1px solid #3a4840; border-radius: 6px; background: #202c25; }
.sync-card-top { display: flex; align-items: center; gap: 8px; color: #e9eee9; font-size: 12px; font-weight: 600; }
.sync-card p { min-height: 30px; margin: 8px 0 0; color: #a4b0a8; font-size: 11px; line-height: 1.5; }
.status-muted { background: #85938a; box-shadow: none; }
.status-error { background: #fa806d; box-shadow: 0 0 0 3px #fa806d20; }
.sync-link { margin-top: 8px; padding: 0; border: 0; color: var(--lime); background: transparent; cursor: pointer; font-size: 11px; font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 9px; padding: 17px 3px 3px; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; color: var(--sidebar); background: #f1f4ee; font-size: 13px; font-weight: 800; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; overflow: hidden; color: #f2f5f1; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #9eaaa2; font: 9px var(--mono); }
.logout-button { min-height: 34px; padding: 0 8px; border: 1px solid #405047; border-radius: 5px; color: #bdc7bf; background: transparent; cursor: pointer; font-size: 11px; }
.logout-button:hover { border-color: #718276; color: #fff; }

.main-area { min-height: 100dvh; margin-left: 244px; padding: 0 34px 42px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 65px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.breadcrumb b { color: #b5beb7; font-weight: 400; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-chip { color: var(--muted-dark); font-family: var(--mono); font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: wait; }
.button-quiet { border-color: var(--line); color: var(--ink); background: var(--paper); }
.button-quiet:hover { border-color: #b7c2b9; background: #fafbf9; }
.refresh-glyph { font-size: 17px; line-height: 1; }
.button-primary { color: var(--ink); background: var(--lime); }
.button-primary:hover { background: #c8ed4f; }
.button-secondary { border-color: var(--line); color: var(--ink); background: white; }
.button-danger { border-color: #f1d0ca; color: var(--red); background: #fff9f7; }
.button-danger:hover { border-color: #d99a90; background: #fff0ed; }
.notice { margin-top: 18px; padding: 11px 14px; border: 1px solid #d9e5c3; border-radius: 6px; color: #42521f; background: #f4fadf; font-size: 12px; line-height: 1.6; }
.notice.notice-warning { border-color: #f0cfbd; color: #7a412a; background: #fff4ed; }
.view-panel { max-width: 1500px; margin: 0 auto; padding-top: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font: 10px var(--mono); letter-spacing: 0; text-transform: uppercase; }
.page-head h1 { margin: 0; font-size: 25px; line-height: 1.3; font-weight: 700; }
.page-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.activation-box { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.activation-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 16px 18px; border-color: #f0d4ae; background: #fffaf3; }
.activation-panel h2 { margin: 0 0 5px; font-size: 14px; }
.activation-panel p { margin: 0; color: var(--muted-dark); font-size: 11px; line-height: 1.6; }
.activation-panel > div { min-width: 0; }
.activation-panel > button { flex: 0 0 auto; }
.restart-panel { border-color: #ecd9d5; background: #fffaf9; }
.restart-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid #e5d0cb; border-radius: 8px; box-shadow: 0 18px 60px #15201930; }
.restart-dialog::backdrop { background: #16201999; }
.restart-dialog-body { padding: 24px; background: var(--paper); }
.restart-dialog h2 { margin: 0 0 10px; font-size: 19px; }
.restart-dialog p:not(.eyebrow):not(.form-error) { margin: 0 0 18px; color: var(--muted-dark); font-size: 12px; line-height: 1.7; }
.restart-dialog label { display: block; font-size: 12px; font-weight: 600; }
.restart-dialog input { width: 100%; height: 42px; margin-top: 7px; padding: 0 11px; border: 1px solid #dce3dc; border-radius: 5px; outline: 0; font-size: 14px; }
.restart-dialog input:focus { border-color: var(--red); box-shadow: 0 0 0 3px #b3433a1c; }
.restart-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.period-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 12px 16px; border-left: 3px solid var(--blue); background: #e9eefc; }
.period-strip > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.period-strip span { color: #3f4e81; font-size: 11px; font-weight: 600; }
.period-strip strong { font: 500 21px var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.period-strip p { margin: 0; color: #59668a; font-size: 11px; line-height: 1.5; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 127px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.metric-card.emphasis { border-color: var(--lime); background: var(--lime); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted-dark); font-size: 12px; }
.metric-index { color: #87928b; font: 10px var(--mono); }
.metric-card.emphasis .metric-index { color: #53652a; }
.metric-value { display: block; margin-top: 17px; overflow-wrap: anywhere; font: 500 26px var(--mono); line-height: 1.15; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.metric-sub { margin-top: 8px; color: var(--muted-dark); font-size: 11px; }
.metric-card.emphasis .metric-sub { color: #4d5a30; }
.share-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.share-panel { display: flex; align-items: center; justify-content: space-between; min-height: 73px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.share-panel.own { border-left: 3px solid var(--blue); }
.share-panel.partner { border-left: 3px solid var(--orange); }
.share-title { color: var(--muted-dark); font-size: 11px; }
.share-title b { display: block; margin-top: 4px; color: var(--ink); font-size: 12px; }
.share-amount { font: 500 19px var(--mono); font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .9fr); gap: 13px; margin-top: 18px; }
.surface { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.surface-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.surface-head h2 { margin: 0; font-size: 13px; font-weight: 700; }
.surface-head p { margin: 4px 0 0; color: var(--muted-dark); font-size: 11px; }
.surface-label { color: var(--muted-dark); font: 11px var(--mono); }
.chart-wrap { padding: 18px 20px 15px; }
.chart-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.chart-summary strong { font: 500 20px var(--mono); font-variant-numeric: tabular-nums; }
.chart-summary span { color: var(--muted); font-size: 10px; }
.bar-chart { display: grid; grid-template-columns: repeat(8, minmax(16px, 1fr)); align-items: end; gap: 9px; height: 137px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.bar-slot { display: flex; height: 100%; min-width: 0; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-track { display: flex; align-items: flex-end; width: min(100%, 24px); height: 100%; }
.bar { width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: #c5d88c; transition: height .25s ease, background .2s ease; }
.bar.today { background: var(--blue); }
.bar-slot span { color: var(--muted); font: 9px var(--mono); }
.chart-legend { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.group-list { padding: 4px 17px 10px; }
.group-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid #edf0ec; }
.group-row:last-child { border-bottom: 0; }
.group-name { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.group-meta { margin-top: 3px; color: var(--muted-dark); font-size: 11px; }
.group-value { font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.accounting-note { display: flex; gap: 11px; margin-top: 13px; padding: 13px 16px; border: 1px solid #dce3fc; border-radius: 7px; background: var(--blue-soft); }
.note-marker { width: 4px; flex: 0 0 4px; border-radius: 3px; background: var(--blue); }
.accounting-note strong { display: block; margin-bottom: 4px; font-size: 11px; }
.accounting-note p { margin: 0; color: #4f5b88; font-size: 10px; line-height: 1.65; }
.empty-state { display: grid; min-height: 160px; place-items: center; padding: 22px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }

.table-surface { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.toolbar-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.field-control { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; outline: 0; color: var(--ink); background: #fff; font-size: 11px; }
.field-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #4f68ee18; }
.search-control { width: min(240px, 30vw); }
.table-scroll { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 40px; padding: 0 13px; color: var(--muted-dark); background: #f9faf8; font-size: 11px; font-weight: 600; white-space: nowrap; }
td { height: 48px; padding: 8px 13px; border-top: 1px solid #edf0ec; color: #39433d; font-size: 12px; white-space: nowrap; }
td.mono, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.truncate { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.table-empty { padding: 29px 16px; color: var(--muted); text-align: center; font-size: 11px; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 4px; color: #4d5b51; background: #eff2ee; font-size: 10px; font-weight: 600; }
.badge-success { color: #276b47; background: var(--green-soft); }
.badge-warn { color: #93502e; background: var(--orange-soft); }
.badge-error { color: #963e36; background: var(--red-soft); }
.badge-blue { color: #4055bb; background: var(--blue-soft); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.pagination-actions { display: flex; gap: 6px; }
.pagination button { min-height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: white; cursor: pointer; font-size: 10px; }
.pagination button:disabled { opacity: .4; cursor: default; }
.summary-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.summary-mini { padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.summary-mini span { color: var(--muted-dark); font-size: 11px; }
.summary-mini strong { display: block; margin-top: 8px; font: 500 17px var(--mono); font-variant-numeric: tabular-nums; }
.summary-mini strong.recharge-start { font-size: 12px; line-height: 1.5; }
.recharge-scope { width: 190px; flex: 0 0 190px; }
.summary-mini.positive { border-top: 2px solid #72bf8d; }
.summary-mini.cash { border-top: 2px solid var(--blue); }
.summary-mini.attention { border-top: 2px solid var(--orange); }
.detail-toggle { border: 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 10px; }
.detail-row td { padding: 11px 16px; white-space: normal; background: #f8f9f7; }
.breakdown { display: flex; flex-wrap: wrap; gap: 8px; }
.breakdown-chip { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 9px; line-height: 1.6; }
.breakdown-chip strong { display: block; font-size: 10px; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(285px, .7fr); gap: 13px; align-items: start; }
.form-surface { padding: 17px; }
.form-surface h2 { margin: 0; font-size: 13px; }
.form-surface > p { margin: 6px 0 16px; color: var(--muted-dark); font-size: 11px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(135px, .75fr); gap: 11px; }
.form-field label, .auth-form label { display: block; color: #4e5a53; font-size: 12px; font-weight: 600; }
.form-field input, .form-field select, .auth-form input { display: block; width: 100%; height: 40px; margin-top: 6px; padding: 0 10px; border: 1px solid #dce3dc; border-radius: 5px; outline: 0; color: var(--ink); background: white; font-size: 12px; }
.form-field input:focus, .form-field select:focus, .auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #4f68ee18; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #f4f6f3; }
.segment-option { min-height: 36px; border: 0; border-radius: 4px; color: var(--muted-dark); background: transparent; cursor: pointer; font-size: 12px; }
.segment-option.active { color: var(--ink); background: white; box-shadow: 0 1px 3px #14211a12; font-weight: 700; }
.rule-mode-wrap { margin: 14px 0; }
.rule-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; }
.form-error { min-height: 17px; margin: 8px 0 0; color: var(--red); font-size: 10px; }
.formula-box { padding: 16px; border-radius: 6px; color: #edf3ed; background: var(--sidebar); }
.formula-box .eyebrow { color: #9ba99f; }
.formula-box h2 { margin: 0 0 12px; color: white; font-size: 13px; }
.formula-line { padding: 10px 0; border-top: 1px solid #35443b; }
.formula-line span { display: block; margin-bottom: 6px; color: #a7b2aa; font-size: 9px; }
.formula-line code { color: var(--lime); font: 10px var(--mono); line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.formula-box p { margin: 12px 0 0; color: #b4beb7; font-size: 9px; line-height: 1.6; }
.readonly-flag { color: #b1a6e6; font: 9px var(--mono); }
.sync-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 13px; }
.sync-state { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.sync-state strong { display: block; font-size: 10px; }
.sync-state small { display: block; margin-top: 6px; color: var(--muted); font: 9px var(--mono); overflow-wrap: anywhere; }

.auth-screen { display: grid; min-height: 100dvh; grid-template-rows: auto 1fr auto; padding: 26px clamp(20px, 7vw, 96px) 22px; background: #eef1ed; }
.auth-brand { display: flex; align-items: center; gap: 11px; color: #526057; font: 10px var(--mono); }
.auth-brand .brand-mark { width: 32px; height: 32px; }
.auth-content { display: grid; width: min(920px, 100%); grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(30px, 7vw, 88px); margin: 0 auto; padding: 48px 0; }
.auth-copy { padding: 30px 0; }
.auth-copy .eyebrow { color: #607266; }
.auth-copy h1 { margin: 0; color: var(--ink); font-size: 42px; line-height: 1.28; }
.auth-copy > p:last-child { max-width: 310px; margin-top: 16px; color: #69756e; font-size: 13px; line-height: 1.7; }
.auth-form { padding: 24px; border: 1px solid #dce3dc; border-radius: 7px; background: white; }
.auth-form h2 { margin: 0 0 20px; font-size: 18px; }
.auth-form label { margin-top: 13px; }
.auth-form input { height: 44px; margin-top: 7px; font-size: 14px; }
.auth-submit { width: 100%; height: 44px; margin-top: 19px; }
.auth-submit span { margin-left: auto; font-size: 16px; }
.auth-hint { color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-foot { display: flex; justify-content: space-between; color: #87938b; font: 9px var(--mono); }
.mobile-nav { display: none; }
.loading-block { padding: 35px; color: var(--muted); text-align: center; font-size: 11px; }

@media (max-width: 1120px) {
  .main-area { padding-right: 22px; padding-left: 22px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, .85fr); }
}
@media (max-width: 840px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; padding: 0 20px 90px; }
  .mobile-nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); min-height: 60px; padding: 5px 8px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
  .mobile-nav button { min-width: 0; min-height: 46px; border: 0; border-radius: 5px; color: #68736c; background: transparent; cursor: pointer; font-size: 10px; }
  .mobile-nav button.active { color: var(--ink); background: #eff6dc; font-weight: 700; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .two-column { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .main-area { padding-right: 13px; padding-left: 13px; }
  .topbar { min-height: 57px; }
  .breadcrumb { gap: 7px; font-size: 10px; }
  .topbar-actions { gap: 7px; }
  .date-chip { font-size: 9px; }
  .button { min-height: 36px; padding: 0 9px; font-size: 10px; }
  .view-panel { padding-top: 22px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .page-head h1 { font-size: 21px; }
  .page-head p { font-size: 12px; }
  .page-actions { align-items: center; flex-direction: row; flex-wrap: wrap; }
  .activation-panel { align-items: flex-start; flex-direction: column; }
  .period-strip { align-items: flex-start; flex-direction: column; gap: 5px; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 106px; padding: 12px; }
  .metric-label { font-size: 11px; }
  .metric-value { margin-top: 14px; font-size: 18px; }
  .metric-sub { font-size: 10px; }
  .share-strip { gap: 8px; }
  .share-panel { min-height: 65px; padding: 10px; }
  .share-title { font-size: 9px; }
  .share-title b { font-size: 10px; }
  .share-amount { font-size: 14px; }
  .chart-wrap { padding-right: 12px; padding-left: 12px; }
  .bar-chart { gap: 5px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-group { flex-wrap: wrap; width: 100%; }
  .search-control { width: 100%; }
  .summary-cards { gap: 7px; }
  .summary-mini { padding: 10px; }
  .summary-mini span { font-size: 10px; }
  .summary-mini strong { font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .sync-status-grid { grid-template-columns: 1fr; }
  .auth-screen { padding: 17px 19px 14px; }
  .auth-content { grid-template-columns: 1fr; gap: 14px; padding: 25px 0; }
  .auth-copy { padding: 12px 0 0; }
  .auth-copy h1 { font-size: 34px; }
  .auth-copy > p:last-child { margin: 8px 0 0; font-size: 11px; }
  .auth-form { padding: 18px; }
  .auth-foot { font-size: 8px; }
}
/* Nebula: light finance workspace, adapted from the two user references. */
:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #8290a4;
  --muted-dark: #617087;
  --canvas: #f5f7fb;
  --paper: #ffffff;
  --line: #e6ebf3;
  --sidebar: #fbfcff;
  --lime: #665cf6;
  --blue: #665cf6;
  --blue-soft: #f0efff;
  --orange: #e87e4c;
  --orange-soft: #fff1e8;
  --green: #138865;
  --green-soft: #e7f7f0;
  --red: #cf5365;
  --red-soft: #fff0f2;
  --lilac: #8d7cff;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "DM Mono", "Cascadia Code", Consolas, monospace;
}
html { scroll-behavior: smooth; }
body { overflow-x: hidden; color: var(--ink); background: var(--canvas); }
button, input, select { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, .detail-toggle:focus-visible {
  outline: 3px solid #aaa4ff; outline-offset: 2px;
}
.app-shell { min-width: 0; }
.sidebar {
  width: 240px; padding: 26px 16px 16px; color: var(--ink);
  background: var(--sidebar); border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px #26366508;
}
.brand-lockup { gap: 12px; padding: 0 10px 26px; }
.brand-lockup strong { color: var(--ink); font-size: 17px; }
.brand-lockup small { color: var(--muted); font-family: var(--sans); font-size: 10px; }
.brand-mark {
  width: 34px; height: 34px; padding: 7px; border-radius: 8px;
  background: #6b61f5; box-shadow: 0 7px 18px #665cf62e;
}
.brand-mark i { background: white; }
.site-switch {
  min-height: 44px; height: auto; border-color: var(--line); border-radius: 8px;
  color: #39465d; background: white; font-weight: 600; line-height: 1.3;
}
.site-dot, .status-dot { background: #20b68b; box-shadow: 0 0 0 3px #20b68b1c; }
.status-dot.status-error { background: #e97161; box-shadow: 0 0 0 3px #e971611c; }
.status-dot.status-warning { background: #ddab4a; box-shadow: 0 0 0 3px #ddab4a1c; }
.status-dot.status-muted { background: #8b97aa; box-shadow: none; }
.sync-state details { margin-top: 8px; }
.sync-state summary { cursor: pointer; color: var(--muted); font-size: 11px; }
.site-tag { color: var(--green); font-weight: 700; }
.nav-label { margin: 27px 12px 9px; color: #98a3b5; font-family: var(--sans); font-weight: 700; }
.primary-nav { gap: 4px; }
.nav-item {
  position: relative; min-height: 45px; border-radius: 8px;
  color: #67758a; font-size: 13px; font-weight: 550;
}
.nav-item:hover { color: #3a345e; background: #f2f1ff; }
.nav-item.active { color: #5145d4; background: #efedff; font-weight: 700; }
.nav-item.active::before {
  position: absolute; inset: 10px auto 10px 0; width: 3px;
  border-radius: 0 3px 3px 0; background: #665cf6; content: "";
}
.nav-mark { width: 9px; height: 9px; border-radius: 3px; background: #acb3c3; }
.nav-mark-green { background: #40cfa4; }
.nav-mark-blue { background: #a7a0ff; }
.nav-mark-orange { background: #f1ae8d; }
.nav-mark-lilac { background: #af9af2; }
.nav-mark-white { background: #acb3c3; }
.nav-item.active .nav-mark { background: #665cf6; }
.sync-card {
  border-color: #e2e6f7; border-radius: 8px; background: #f5f5ff;
}
.sync-card-top { color: #364058; }
.sync-card p { color: #728099; }
.sync-link { color: #5b51dc; }
.user-box { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 15px; }
.avatar { color: #5a46ad; background: #eeeaff; border-radius: 8px; }
.user-meta strong { color: #2d3950; }
.user-meta small { color: var(--muted); }
.logout-button { border-color: var(--line); border-radius: 7px; color: #68768b; }
.logout-button:hover { color: #4e45c7; border-color: #beb9fb; background: #f7f6ff; }
.main-area { min-width: 0; margin-left: 240px; padding: 0 30px 48px; }
.topbar {
  position: sticky; top: 0; z-index: 5; min-height: 70px;
  border-bottom-color: var(--line); background: #f5f7fbe8;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: #39455c; }
.date-chip { color: #778398; font-family: var(--sans); font-size: 12px; }
.button {
  min-height: 42px; border-radius: 8px; font-size: 12px;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.button-quiet, .button-secondary {
  color: #4c5870; border-color: #dfe5ef; background: #fff;
  box-shadow: 0 3px 9px #26366508;
}
.button-quiet:hover, .button-secondary:hover { border-color: #bcb7f5; background: #f7f6ff; }
.button-primary { color: #fff; background: #665cf6; box-shadow: 0 7px 18px #665cf62b; }
.button-primary:hover { color: #fff; background: #574ae7; box-shadow: 0 10px 22px #665cf63e; }
.button-danger { border-color: #f0c9d0; color: #b84052; background: #fff7f8; }
.button-danger:hover { background: #fff0f2; }
.notice { border-color: #dcd8ff; border-radius: 8px; color: #4b4995; background: #f5f4ff; }
.notice.notice-warning { border-color: #f5dbc4; color: #945432; background: #fff7ef; }
.view-panel { max-width: 1480px; padding-top: 28px; }
.page-head { margin-bottom: 20px; }
.eyebrow { color: #8478df; font-family: var(--sans); font-weight: 700; }
.page-head h1 { color: #1a2539; font-size: 25px; }
.page-head p { color: #7d8aa0; font-size: 12px; }
.page-actions { flex-wrap: wrap; justify-content: flex-end; }
.period-strip {
  min-height: 91px; margin-bottom: 17px; padding: 17px 22px;
  border: 1px solid #d9daf8; border-left: 4px solid #7467f6;
  border-radius: 8px; background: #f0f0ff;
}
.period-strip span { color: #625ab9; }
.period-strip strong { color: #342d86; font-size: 25px; }
.period-strip p { color: #7974ae; }
.metric-grid { gap: 15px; }
.metric-card {
  position: relative; min-width: 0; min-height: 142px; padding: 19px 19px 17px;
  overflow: hidden; border-color: var(--line); border-radius: 8px;
  background: white; box-shadow: 0 8px 23px #283b680a;
  transition: transform .2s ease, box-shadow .2s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px #283b6816; }
.metric-card::before {
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: #9b91fd; content: "";
}
.metric-card:nth-child(2)::before { background: #8da3bb; }
.metric-card:nth-child(3)::before { background: #24bc8c; }
.metric-card:nth-child(4)::before { background: #f2a267; }
.metric-card.emphasis { border-color: #c9eddd; background: #f3fcf8; }
.metric-label, .metric-sub { color: #7b889b; }
.metric-index { color: #a0aabe; }
.metric-card.emphasis .metric-index, .metric-card.emphasis .metric-sub { color: #658976; }
.metric-value { color: #1d2a40; font-size: 26px; font-weight: 700; text-shadow: none; }
.metric-card.emphasis .metric-value { color: #137a5b; text-shadow: none; }
.share-strip { gap: 15px; margin-top: 15px; }
.share-panel {
  min-width: 0; min-height: 76px; padding: 15px 19px; border-color: var(--line);
  border-radius: 8px; background: white; box-shadow: 0 8px 23px #283b6808;
}
.share-panel.own { border-left-color: #7467f6; }
.share-panel.partner { border-left-color: #f2a267; }
.share-title { color: #7e8a9d; }
.share-title b { color: #2c3850; }
.share-amount { color: #243048; font-weight: 600; }
.dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(275px, .85fr); gap: 15px; margin-top: 19px; }
.surface {
  min-width: 0; border-color: var(--line); border-radius: 8px;
  background: white; box-shadow: 0 8px 25px #283b680a;
}
.surface-head { padding: 18px 20px; border-bottom-color: var(--line); }
.surface-head h2 { color: #253149; font-size: 14px; }
.surface-head p { color: #8b96a8; }
.surface-label { color: #929eb0; }
.chart-wrap { padding: 22px 22px 18px; }
.chart-summary strong { color: #2d246c; font-size: 23px; font-weight: 700; }
.chart-summary span { color: #8390a5; }
.bar-chart {
  height: 160px; border-bottom-color: #e6eaf4;
  background: repeating-linear-gradient(to top, #edf0f8 0, #edf0f8 1px, transparent 1px, transparent 25%);
}
.bar { border-radius: 4px 4px 0 0; background: #c4bfff; }
.bar.today { background: #6f62f5; box-shadow: 0 0 12px #7a69f43c; }
.bar-slot span, .chart-legend { color: #8b97aa; }
.legend-dot { background: #6f62f5; }
.group-row { border-bottom-color: #f0f2f7; }
.group-name { color: #2c3951; }
.group-meta { color: #8a96a9; }
.group-value { color: #138865; font-weight: 700; }
.accounting-note { border-color: #e7e4fa; border-radius: 8px; background: #f8f7ff; }
.note-marker { background: #8074f5; }
.accounting-note strong { color: #37325f; }
.accounting-note p { color: #6e6a8a; }
.table-surface { overflow: hidden; }
.table-toolbar { border-bottom-color: var(--line); background: white; }
.field-control {
  min-height: 40px; border-color: #dfe5ef; border-radius: 7px;
  color: #334057; background: #fbfcff; font-size: 12px;
}
.field-control:focus { border-color: #8e83f8; box-shadow: 0 0 0 3px #756bf620; }
.search-control input, .filter-control select { color: #334057; border-color: #dfe5ef; background: white; }
.table-scroll { max-width: 100%; overflow-x: auto; scrollbar-color: #c6c2ed transparent; }
table { min-width: max-content; }
th { color: #75839a; background: #f8f9fd; font-size: 11px; }
td { border-top-color: #eef1f6; color: #43516a; font-size: 12px; }
tr:hover td { background: #faf9ff; }
.pagination { border-top-color: var(--line); color: #78859b; }
.pagination button { min-height: 36px; color: #526078; border-color: #dfe5ef; background: white; }
.pagination button:not(:disabled):hover { color: #5549d8; border-color: #bcb7f5; }
.summary-cards { gap: 14px; }
.summary-mini { border-color: var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 23px #283b6808; }
.summary-mini span { color: #8793a5; }
.summary-mini strong { color: #29364d; }
.summary-mini.positive { border-top-color: #22b88a; }
.summary-mini.cash { border-top-color: #7569f6; }
.summary-mini.attention { border-top-color: #f0a264; }
.detail-toggle { min-height: 36px; padding: 0 6px; color: #5c50dd; font-size: 11px; }
.detail-row td { background: #fafaff; }
.two-column { gap: 15px; }
.form-surface { border-color: var(--line); border-radius: 8px; }
.form-field label, .auth-form label { color: #44516a; }
.form-field input, .form-field select, .auth-form input, .restart-dialog input {
  min-height: 44px; border-color: #dce3ee; border-radius: 7px;
  color: #27344c; background: #fff;
}
.form-field input:focus, .form-field select:focus, .auth-form input:focus, .restart-dialog input:focus {
  border-color: #8c80f7; box-shadow: 0 0 0 3px #756bf620;
}
.segmented { border-color: var(--line); background: #f3f4fa; }
.segment-option { min-height: 40px; color: #78849a; }
.segment-option.active { color: #574adc; background: white; }
.formula-box {
  border: 1px solid #e3e1fb; border-radius: 8px;
  color: #2f3158; background: #f4f3ff;
}
.formula-box .eyebrow { color: #8078c1; }
.formula-box h2 { color: #34365c; }
.formula-line { border-top-color: #e1dff8; }
.formula-line span, .formula-box p { color: #77799b; }
.formula-line code { color: #554ac6; }
.sync-status-grid { gap: 0; padding: 0 18px 10px; }
.sync-state { padding: 14px 5px; border: 0; border-radius: 0; border-bottom: 1px solid #edf0f7; background: white; }
.sync-state strong { color: #34415a; }
.sync-state small { color: #8b97aa; }
.empty-state, .loading-block { color: #8995a8; }
.auth-screen { background: #f5f7fb; }
.auth-brand { color: #6c7790; }
.auth-copy .eyebrow { color: #786cf0; }
.auth-copy h1 { color: #1b2840; }
.auth-copy > p:last-child { color: #7b879a; }
.auth-form {
  border-color: #e4e8f2; border-radius: 8px; background: #fff;
  box-shadow: 0 22px 60px #34437116;
}
.auth-form h2 { color: #253149; }
.auth-hint, .auth-foot { color: #909bad; }
.restart-dialog { border-color: #e4e8f2; border-radius: 8px; background: white; }
.restart-dialog::backdrop { background: #25314a66; }
.restart-dialog-body { background: white; }
.restart-dialog h2 { color: #23314b; }
.restart-dialog p:not(.eyebrow):not(.form-error) { color: #6e7c91; }
.mobile-menu-scrim, .mobile-nav { display: none; }

@media (max-width: 1120px) {
  .main-area { padding-right: 23px; padding-left: 23px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
  .sidebar {
    inset: 0 auto 0 0; z-index: 41; display: flex; width: min(292px, calc(100vw - 52px));
    transform: translateX(-110%); transition: transform .22s ease;
    box-shadow: 18px 0 45px #19254221;
    overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-scrim:not([hidden]) {
    position: fixed; inset: 0; z-index: 40; display: block;
    width: 100%; border: 0; background: #1e294863;
  }
  .main-area { margin-left: 0; padding: 0 18px calc(90px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 62px; }
  .dashboard-grid, .two-column { grid-template-columns: minmax(0, 1fr); }
  .mobile-nav {
    position: fixed; inset: auto 0 0; z-index: 30; display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 64px;
    padding: 7px 12px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid #e6eaf3; background: #fffffff5;
    box-shadow: 0 -7px 25px #25376516;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .mobile-nav button {
    min-width: 0; min-height: 48px; border: 0; border-radius: 8px;
    color: #7e89a0; background: transparent; font-size: 12px; font-weight: 600;
  }
  .mobile-nav button.active { color: #574bd8; background: #f0efff; }
}
@media (max-width: 560px) {
  .main-area { padding-right: 14px; padding-left: 14px; }
  .topbar { min-height: 58px; }
  .breadcrumb span, .breadcrumb b, .date-chip { display: none; }
  .breadcrumb strong { font-size: 13px; }
  .view-panel { padding-top: 22px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-head h1 { font-size: 22px; }
  .page-actions, .activation-box { width: 100%; justify-content: flex-start; }
  .activation-panel { align-items: flex-start; flex-direction: column; }
  .period-strip { align-items: flex-start; flex-direction: column; gap: 8px; }
  .period-strip strong { font-size: 22px; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 121px; padding: 13px; }
  .metric-label { display: block; font-size: 11px; }
  .metric-index { display: block; margin-top: 3px; font-size: 9px; }
  .metric-value { margin-top: 12px; font-size: 19px; }
  .metric-sub { font-size: 10px; line-height: 1.45; }
  .share-strip { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .share-panel { min-height: 66px; }
  .chart-wrap { padding: 18px 14px; }
  .surface-head { flex-wrap: wrap; }
  .bar-chart { gap: 5px; }
  .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .summary-mini { min-width: 0; }
  .summary-mini strong { overflow-wrap: anywhere; font-size: 16px; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { width: 100%; flex-wrap: wrap; }
  .field-control, .search-control, .recharge-scope { width: 100%; flex: 1 1 100%; }
  .pagination { gap: 10px; flex-wrap: wrap; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .rule-form-actions { align-items: stretch; flex-direction: column; }
  .sync-status-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-content { grid-template-columns: minmax(0, 1fr); }
  .auth-copy h1 { font-size: 32px; }
  .auth-form { padding: 20px; }
}
@media (max-width: 360px) {
  .metric-grid, .summary-cards { grid-template-columns: minmax(0, 1fr); }
  .topbar-actions .button { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.weekly-selector { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding: 13px 16px; border: 1px solid #e4e8f1; border-radius: 8px; background: #fff; }
.weekly-picker, .weekly-date-controls { display: flex; align-items: center; gap: 12px; min-width: 0; }
.weekly-picker { flex: 1; }
.weekly-range { min-width: 0; }
.weekly-range strong { display: block; color: #26334c; font-size: 15px; white-space: nowrap; }
.weekly-range strong span { padding: 0 3px; color: #8e98aa; font-weight: 400; }
.weekly-range > div { margin-top: 4px; font-size: 11px; }
.weekly-arrow { width: 38px; min-width: 38px; height: 38px; padding: 0; font-size: 18px; }
.weekly-arrow:disabled { opacity: .4; cursor: default; }
.weekly-date-controls .segmented { width: max-content; min-width: 178px; }
.weekly-date-controls .field-control { width: 152px; }
.weekly-metrics { margin: 16px 0 0; }
.weekly-metrics .metric-value { overflow-wrap: anywhere; }
.weekly-meta { display: flex; justify-content: space-between; gap: 8px 20px; margin: 11px 0 0; color: #78859b; font-size: 11px; }
.weekly-meta strong { color: #44516a; }
.weekly-note { margin-top: 16px; }
.weekly-section { margin-top: 16px; }
.weekly-future td { color: #a4adbc; background: #fbfcff; }
.weekly-selected td { background: #f7f6ff; }
.weekly-history-date { display: block; padding: 4px 0; text-align: left; }
.weekly-history-date .surface-label { display: block; margin-top: 3px; }

@media (max-width: 1120px) {
  .weekly-selector { align-items: stretch; flex-direction: column; }
  .weekly-date-controls { justify-content: space-between; }
}
@media (max-width: 560px) {
  .weekly-selector { padding: 12px; }
  .weekly-picker { justify-content: space-between; gap: 6px; }
  .weekly-range { text-align: center; }
  .weekly-range strong { font-size: 12px; }
  .weekly-range strong span { padding: 0; }
  .weekly-date-controls { flex-wrap: wrap; gap: 8px; }
  .weekly-date-controls .segmented, .weekly-date-controls .field-control { width: 100%; flex: 1 1 100%; }
  .weekly-meta { flex-direction: column; }
}

/* A shared destination, driven by the existing period profit. */
.model-y-goal {
  --car-width: 148px;
  position: relative; isolation: isolate; min-width: 0; margin-bottom: 20px; padding: 24px 28px 18px;
  overflow: hidden; border: 1px solid #e4e1f5; border-radius: 18px;
  background: radial-gradient(ellipse at 88% 12%, #e7e6ff8c 0, transparent 53%), linear-gradient(120deg, #ffffff 12%, #f8f9ff 68%, #f0f5ff);
  box-shadow: 0 5px 22px #433c7910;
}
.goal-heading, .goal-numbers, .goal-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.goal-plan { display: block; color: #766d9a; font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .18em; }
.goal-destination h2 { display: flex; align-items: baseline; gap: 14px; margin: 7px 0 0; color: #303650; font-size: 21px; font-weight: 650; letter-spacing: -.025em; }
.goal-destination h2 span { color: #78829a; font-size: 11px; font-weight: 400; letter-spacing: .02em; }
.goal-target { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #deddf0; border-radius: 8px; background: #ffffffa6; white-space: nowrap; }
.goal-target span { color: #78829a; font-size: 11px; }
.goal-target strong { color: #565179; font-family: var(--mono); font-size: 12px; font-weight: 500; }
.goal-numbers { align-items: flex-end; margin-top: 28px; }
.goal-profit > span { display: block; margin-bottom: 7px; color: #69758d; font-size: 12px; }
.goal-profit > strong { display: block; color: #303650; font-family: var(--mono); font-size: clamp(24px, 2.7vw, 34px); font-weight: 500; line-height: 1.2; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.goal-completion { flex-shrink: 0; text-align: right; }
.goal-completion > strong { display: block; color: #7361d8; font-family: var(--mono); font-size: 38px; font-weight: 500; line-height: 1.1; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.goal-completion > strong span { padding-left: 3px; font-size: 18px; }
.goal-completion > span { display: block; margin-top: 8px; color: #7c789a; font-size: 10px; }
.goal-road { position: relative; height: 94px; margin-top: 5px; }
.goal-road-surface { position: absolute; inset: auto 0 8px; height: 25px; overflow: hidden; border: 1px solid #e1e3f0; border-radius: 9px; background: #e9ecf6; box-shadow: inset 0 1px 2px #525a8010; }
.goal-road-fill { width: var(--goal-progress); height: 100%; background: linear-gradient(90deg, #e4dffb, #beb3ee); }
.goal-road-dashes { position: absolute; inset: 11px 0 auto; height: 2px; background: repeating-linear-gradient(90deg, #ffffffd9 0 16px, transparent 16px 32px); animation: goal-road-travel 1.6s linear infinite; }
.goal-car-path { position: absolute; right: calc(var(--car-width) / 2); bottom: 17px; left: calc(var(--car-width) / 2); height: 0; }
.goal-car { position: absolute; bottom: 0; left: var(--goal-progress); width: var(--car-width); transform: translateX(-50%); }
.goal-car img { position: relative; z-index: 1; display: block; width: 100%; height: auto; animation: goal-car-cruise 2.4s ease-in-out infinite; }
.goal-car-shadow { position: absolute; right: 12%; bottom: 4px; left: 12%; height: 4px; border-radius: 50%; background: #52617a21; filter: blur(3px); }
.goal-finish { position: absolute; top: 18px; right: 10px; width: 21px; height: 32px; color: #8677bb; }
.goal-finish svg { display: block; width: 100%; height: 100%; }
.goal-distance { display: grid; grid-template-columns: repeat(4, 1fr) auto; color: #7d879d; font-family: var(--mono); font-size: 9px; line-height: 1.5; }
.goal-distance > span:last-child { text-align: right; font-family: var(--sans); }
.goal-distance > span:first-child { font-family: var(--sans); }
.goal-footer { margin-top: 18px; padding-top: 13px; border-top: 1px solid #e8e8f3; color: #7c859c; font-size: 10px; line-height: 1.6; }
.goal-footer > span:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.goal-footer i { width: 3px; height: 3px; border-radius: 50%; background: #b4b9c9; }
.goal-footer b { color: #6756b5; font-family: var(--mono); font-weight: 500; }
.goal-reached .goal-completion > strong { color: #408b80; }
.goal-reached .goal-road-fill { width: 100%; background: linear-gradient(90deg, #d4eae5, #a9d7cc); }
@keyframes goal-road-travel { to { background-position: -32px 0; } }
@keyframes goal-car-cruise { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
@media (max-width: 1120px) and (min-width: 801px) {
  .goal-destination h2 { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 560px) {
  .model-y-goal { --car-width: 116px; padding: 18px 16px 14px; border-radius: 14px; }
  .goal-heading { align-items: flex-start; gap: 8px; }
  .goal-plan { font-size: 8px; letter-spacing: .12em; }
  .goal-destination h2 { align-items: flex-start; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 18px; }
  .goal-destination h2 span { font-size: 10px; }
  .goal-target { align-items: flex-end; flex-direction: column; gap: 4px; padding: 7px 8px; border-radius: 7px; }
  .goal-target span { font-size: 9px; }
  .goal-target strong { font-size: 10px; }
  .goal-numbers { gap: 10px; margin-top: 24px; }
  .goal-profit > span { font-size: 11px; }
  .goal-profit > strong { font-size: clamp(21px, 6.4vw, 29px); }
  .goal-completion > strong { font-size: 29px; }
  .goal-completion > strong span { font-size: 13px; }
  .goal-completion > span { margin-top: 7px; font-size: 9px; }
  .goal-road { height: 81px; margin-top: 5px; }
  .goal-finish { top: 10px; right: 7px; width: 18px; height: 28px; }
  .goal-distance { font-size: 8px; }
  .goal-footer { align-items: flex-start; flex-direction: column-reverse; gap: 6px; margin-top: 14px; padding-top: 11px; font-size: 9px; }
  .goal-footer > span:last-child { font-size: 11px; }
}
@media (max-width: 360px) {
  .goal-numbers { align-items: center; }
  .goal-profit > strong { font-size: 21px; }
  .goal-completion > strong { font-size: 25px; }
  .goal-completion > span { max-width: 74px; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-road-dashes, .goal-car img { animation: none; }
}
