:root {
  color-scheme: light;
  --ink: #13233c;
  --muted: #60708a;
  --faint: #8f9bb0;
  --line: #dce5f0;
  --panel: rgba(255, 255, 255, .93);
  --surface: #f5f8fc;
  --surface-2: #edf3f9;
  --blue: #1267ed;
  --blue-deep: #0a3e95;
  --blue-pale: #eaf3ff;
  --green: #0b9468;
  --green-pale: #e9faf3;
  --purple: #7532bd;
  --purple-pale: #f5ecff;
  --orange: #e87817;
  --orange-pale: #fff4e7;
  --cyan: #0a8aaf;
  --shadow: 0 18px 48px rgba(35, 67, 109, .09);
  --radius: 18px;
  --control-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eff5ff;
    --muted: #acbad0;
    --faint: #8292aa;
    --line: #2b3a51;
    --panel: rgba(20, 31, 49, .96);
    --surface: #0f1a2b;
    --surface-2: #18263b;
    --blue-pale: #152f59;
    --green-pale: #123a35;
    --purple-pale: #302143;
    --orange-pale: #3d2a1a;
    --shadow: 0 18px 48px rgba(0, 0, 0, .22);
  }
}

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eff5ff;
  --muted: #acbad0;
  --faint: #8292aa;
  --line: #2b3a51;
  --panel: rgba(20, 31, 49, .96);
  --surface: #0f1a2b;
  --surface-2: #18263b;
  --blue-pale: #152f59;
  --green-pale: #123a35;
  --purple-pale: #302143;
  --orange-pale: #3d2a1a;
  --shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

html[data-theme="light"] {
  --ink: #13233c;
  --muted: #60708a;
  --faint: #8f9bb0;
  --line: #dce5f0;
  --panel: rgba(255, 255, 255, .93);
  --surface: #f5f8fc;
  --surface-2: #edf3f9;
  --blue-pale: #eaf3ff;
  --green-pale: #e9faf3;
  --purple-pale: #f5ecff;
  --orange-pale: #fff4e7;
  --shadow: 0 18px 48px rgba(35, 67, 109, .09);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 15% 0%, rgba(31, 129, 255, .08), transparent 34rem), var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(18, 103, 237, .3); outline-offset: 2px; }

.site-header {
  min-height: 116px;
  padding: 24px clamp(18px, 4vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: linear-gradient(117deg, #0f438f, #123d76 55%, #1c2d52);
  box-shadow: 0 10px 30px rgba(13, 49, 103, .18);
}
.brand-wrap { display: flex; gap: 18px; align-items: center; min-width: 0; }
.brand-mark { width: 70px; flex: 0 0 70px; display: grid; gap: 5px; }
.brand-mark span { display: block; height: 15px; border-radius: 9px; background: linear-gradient(90deg, #fff, #a7d8ff); position: relative; box-shadow: 0 4px 10px rgba(0, 0, 0, .14); }
.brand-mark span::after { content: ''; width: 6px; height: 6px; position: absolute; right: 11px; top: 4px; border-radius: 50%; background: #2379e9; }
.eyebrow { margin: 0 0 3px; color: #8bc1ff; font-size: 10px; letter-spacing: .14em; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 36px); line-height: 1.15; letter-spacing: -.035em; }
.subtitle { margin: 0; color: #d2e7ff; font-size: 13px; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.header-tools select { min-width: 122px; color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.12); }
.header-tools select option { color: var(--ink); background: var(--surface-2); }
.display-currency { display: flex; align-items: center; gap: 8px; color: #d8ebff; font-size: 12px; white-space: nowrap; }
.icon-button, .text-button { padding: 9px 12px; color: #e9f4ff; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(255,255,255,.1); font-size: 12px; }
.icon-button:hover, .text-button:hover { background: rgba(255,255,255,.18); }

.page-shell { width: min(1500px, calc(100% - 32px)); margin: 22px auto 34px; }
.top-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.mode-button, .theme-button { border: 0; border-radius: 8px; color: var(--muted); background: transparent; padding: 7px 12px; font-size: 12px; }
.mode-button.is-selected, .theme-button.is-selected { color: var(--blue); background: var(--panel); box-shadow: 0 2px 7px rgba(27, 71, 122, .12); font-weight: 750; }
.theme-switcher { display: flex; margin-left: auto; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.theme-button { padding: 6px 9px; font-size: 11px; }
.text-button { color: var(--blue); border-color: var(--line); background: transparent; }
.text-button:hover { background: var(--blue-pale); }
.fx-status { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 11px; }
.fx-status > span:last-child { display: grid; min-width: 0; }
.fx-status strong { color: var(--ink); font-size: 11px; }
.fx-status small { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--orange); }
.fx-status.success .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(11,148,104,.12); }
.fx-status.warning .status-dot { background: var(--orange); }
.help-panel { margin-bottom: 15px; padding: 16px 19px; border: 1px solid #b9d7ff; border-radius: 14px; background: var(--blue-pale); color: var(--muted); font-size: 12px; }
.help-panel strong { color: var(--blue); }
.help-panel p { margin: 5px 0 0; }
.form-error { margin-bottom: 15px; padding: 12px 15px; border: 1px solid #f0b9b9; border-radius: 11px; color: #a23d3d; background: #fff0f0; font-size: 13px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(340px, 1.13fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; gap: 11px; min-height: 42px; margin-bottom: 20px; }
.panel-heading > div:nth-child(2) { min-width: 0; flex: 1; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.panel-heading .header-action { min-height: 34px; padding: 7px 9px; font-size: 10px; white-space: nowrap; }
.panel-heading .header-action span { margin-right: 5px; font-size: 13px; }
.panel-heading .header-action em { margin-left: 4px; font-style: normal; font-size: 9px; }
.step-number { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 800; background: var(--blue); box-shadow: 0 7px 14px rgba(18,103,237,.23); }
.blue-heading .step-number { background: var(--blue); }.green-heading .step-number { background: var(--green); }.purple-heading .step-number { background: var(--purple); }.orange-heading .step-number { background: var(--orange); }.cyan-heading .step-number { background: var(--cyan); }
.field-label, legend { display: block; margin: 0 0 7px; color: var(--ink); font-size: 12px; font-weight: 750; }
.hint { display: inline-grid; width: 15px; height: 15px; place-items: center; margin-left: 2px; border: 1px solid var(--faint); border-radius: 50%; color: var(--muted); font-size: 10px; font-weight: 700; vertical-align: -1px; cursor: help; }
.optional { margin-left: 3px; color: var(--faint); font-size: 10px; font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--control-radius); color: var(--ink); background: var(--panel); transition: border-color .18s, box-shadow .18s; }
input, select { height: 40px; padding: 0 11px; }
textarea { min-height: 242px; padding: 13px; resize: vertical; line-height: 1.65; font-size: 12px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,103,237,.1); outline: 0; }
.money-input { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 7px; }
.field-help, .panel-note { margin: 7px 0 17px; color: var(--faint); font-size: 10px; line-height: 1.5; }
.period-field { padding: 0; border: 0; margin: 18px 0; }
.period-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.period-button { min-height: 35px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel); font-size: 11px; }
.period-button:hover, .period-button.is-selected { color: var(--blue); border-color: #8bb9fc; background: var(--blue-pale); font-weight: 750; }
.date-grid, .two-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.date-grid .field-label input { margin-top: 6px; }
.period-warning { margin: -7px 0 14px; padding: 9px 10px; border-radius: 8px; color: #96601d; background: var(--orange-pale); font-size: 11px; }
.divider-label { display: flex; align-items: center; gap: 8px; margin: 17px 0 12px; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.divider-label::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.advanced-fields .field-label { margin-top: 11px; }.advanced-fields .field-label + .money-input { margin-bottom: 10px; }.advanced-fields input, .advanced-fields select { height: 37px; }
.compact-fields .field-label { margin: 0; }.compact-fields .money-input { margin-top: 6px; }.compact-fields { margin-bottom: 16px; }
body:not(.advanced-mode) .advanced-only { display: none !important; }

.service-state { margin-left: auto; padding: 5px 9px; border-radius: 999px; color: var(--green); background: var(--green-pale); font-size: 10px; font-weight: 800; white-space: nowrap; }.service-state.expired { color: #ad4b3d; background: #ffeded; }.service-state.not-started { color: #8b681d; background: #fff5dc; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-card { position: relative; min-height: 116px; padding: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(140deg, var(--panel), var(--surface-2)); }
.metric-card::after { content: ''; position: absolute; width: 70px; height: 70px; right: -22px; bottom: -28px; border-radius: 50%; background: currentColor; opacity: .05; }.metric-card strong { display: block; margin-top: 11px; font-size: 27px; letter-spacing: -.045em; }.metric-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }.metric-label { display: block; color: var(--muted); font-size: 11px; }.metric-icon { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 9px; color: #fff; font-size: 14px; font-weight: 800; }.accent-blue { color: var(--blue); }.accent-blue .metric-icon { background: var(--blue); }.accent-green { color: var(--green); }.accent-green .metric-icon { background: #f0ad18; }.accent-indigo { color: #5c77ca; }.accent-indigo .metric-icon { background: #5c77ca; }.accent-purple { color: var(--purple); }.accent-purple .metric-icon { background: var(--purple); }
.progress-block { margin: 18px 0 14px; }.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 11px; }.progress-label b { color: var(--ink); font-weight: 600; }.progress-track { height: 11px; overflow: hidden; border-radius: 999px; background: #dcefe7; }.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #10b884, #70d7ad); transition: width .25s ease; }
.detail-table { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }.detail-table div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; background: var(--surface-2); font-size: 10px; }.detail-table span { color: var(--muted); }.detail-table b { color: var(--ink); font-size: 11px; }
.comparison-box { margin: 3px 0 12px; padding: 14px 15px; text-align: center; border-radius: 12px; background: linear-gradient(135deg, #fff0f5, var(--purple-pale)); }.comparison-title { color: var(--muted); font-size: 11px; }.comparison-box strong { display: block; margin: 4px 0; color: #b53a67; font-size: 28px; letter-spacing: -.045em; }.comparison-box small { color: var(--muted); font-size: 10px; }.analysis-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.analysis-pairs > div { min-height: 82px; padding: 12px 10px; text-align: center; border: 1px solid #dfcef4; border-radius: 11px; background: var(--purple-pale); }.analysis-pairs span { display: block; color: var(--muted); font-size: 10px; }.analysis-pairs strong { display: block; margin-top: 7px; color: var(--green); font-size: 18px; }.analysis-pairs .judgement.negative { color: #b33f55; }.analysis-pairs .judgement.neutral { color: var(--muted); }.analysis-help { margin: 12px 0 2px; color: var(--muted); font-size: 11px; }
.cost-panel { grid-column: 1 / 2; }.cost-summary { padding: 13px; border-radius: 12px; background: var(--orange-pale); }.cost-summary span, .cost-summary small { display: block; color: var(--muted); font-size: 10px; }.cost-summary strong { display: block; margin: 5px 0; color: var(--orange); font-size: 25px; }.cost-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }.cost-cards article { min-height: 118px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }.cost-cards article:first-child { background: var(--green-pale); }.cost-cards article strong { display: block; font-size: 12px; }.cost-cards article b { display: block; margin: 11px 0 2px; color: var(--green); font-size: 21px; }.cost-cards article small, .cost-placeholder { display: block; color: var(--muted); font-size: 10px; }.cost-placeholder { margin-top: 17px; line-height: 1.5; }.cost-note, .renewal-line { margin: 11px 0 0; color: var(--muted); font-size: 10px; }.renewal-line span { color: var(--ink); }
.payback-panel { grid-column: 2 / 4; }.payback-input-row { max-width: 410px; }.payback-help { margin: 7px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.55; }.payback-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }.payback-overview > div { padding: 11px 12px; border-radius: 11px; background: var(--purple-pale); }.payback-overview span, .payback-result span { display: block; color: var(--muted); font-size: 10px; }.payback-overview strong { display: block; margin-top: 5px; color: var(--purple); font-size: 20px; }.payback-result { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 9px; margin-bottom: 10px; }.payback-result > div { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }.payback-result strong { display: block; margin-top: 5px; color: var(--green); font-size: 15px; }.payback-result .judgement { color: var(--muted); }.payback-milestones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }.payback-milestones article { min-height: 150px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }.payback-milestones article:nth-child(2) { background: var(--blue-pale); }.payback-milestones b { display: block; color: var(--ink); font-size: 12px; }.payback-milestones strong { display: block; margin-top: 10px; color: var(--purple); font-size: 19px; }.payback-milestones small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }.milestone-net { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }.milestone-net span { color: var(--muted); font-size: 9px; }.milestone-net em { color: var(--green); font-size: 12px; font-style: normal; font-weight: 800; }.payback-note { margin: 11px 0 0; color: var(--muted); font-size: 10px; }
.payback-result { grid-template-columns: 1fr 1fr; }
body:not(.advanced-mode) .payback-panel { grid-column: 1 / -1; }
.quick-panel { grid-column: 1 / 2; }.quick-actions { display: grid; gap: 9px; }.primary-action, .secondary-action { min-height: 43px; padding: 10px 13px; border-radius: 10px; font-size: 12px; font-weight: 750; }.primary-action { border: 1px solid var(--blue); color: #fff; background: linear-gradient(120deg, #1478f5, #1255d4); box-shadow: 0 8px 14px rgba(18,103,237,.18); }.secondary-action { border: 1px solid var(--line); color: var(--blue); background: var(--surface-2); }.secondary-action:hover { border-color: #8dbbfb; background: var(--blue-pale); }.muted-action { color: var(--muted); }.primary-action span, .secondary-action span { margin-right: 7px; font-size: 15px; }.primary-action em, .secondary-action em { margin-left: 6px; color: #d4f7e9; font-style: normal; font-size: 10px; }.small-button { align-self: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); background: var(--blue-pale); font-size: 10px; white-space: nowrap; }.share-panel { grid-column: 2 / 3; }.stale-note { margin: 8px 0 0; color: var(--orange); font-size: 10px; }.example-panel { grid-column: 3 / 4; }.example-item { padding: 11px 0; border-top: 1px solid var(--line); }.example-item strong { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 12px; }.example-item span { display: block; color: var(--muted); font-size: 11px; line-height: 1.55; }
.site-footer { width: min(1500px, calc(100% - 32px)); display: flex; justify-content: space-between; gap: 12px; margin: 0 auto 25px; padding: 15px 3px; color: var(--faint); font-size: 10px; }.site-footer a { color: var(--blue); }

.fx-modal { width: min(500px, calc(100% - 26px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--panel); box-shadow: 0 28px 90px rgba(2, 26, 60, .34); }.fx-modal::backdrop { background: rgba(4, 19, 40, .55); backdrop-filter: blur(4px); }.fx-modal form { padding: 23px; }.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }.modal-heading h2 { margin: 0; font-size: 20px; }.close-button { width: 31px; height: 31px; border: 0; border-radius: 9px; color: var(--muted); background: var(--surface-2); font-size: 22px; }.modal-note { margin: 15px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }.fx-mode { display: flex; gap: 16px; padding: 0; border: 0; margin: 16px 0; }.fx-mode legend { width: 100%; margin-bottom: 7px; }.fx-mode label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }.fx-mode input { width: auto; height: auto; }.manual-rate-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.rate-field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }.rate-field input { height: 37px; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }.modal-actions button { min-width: 84px; }

@media (max-width: 1120px) { .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.cost-panel, .payback-panel, .quick-panel, .share-panel, .example-panel { grid-column: auto; } .example-panel { grid-column: 1 / -1; } }
@media (max-width: 760px) { .site-header { align-items: flex-start; flex-direction: column; padding: 20px 18px; }.header-tools { width: 100%; justify-content: flex-start; }.page-shell { width: min(100% - 20px, 600px); margin-top: 12px; }.top-strip { align-items: flex-start; flex-wrap: wrap; }.fx-status { order: 3; flex-basis: 100%; }.theme-switcher { margin-left: 0; }.dashboard-grid { display: flex; flex-direction: column; gap: 12px; }.panel { width: 100%; padding: 16px; border-radius: 15px; }.metric-card strong { font-size: 23px; }.date-grid { grid-template-columns: 1fr; gap: 11px; }.site-footer { width: calc(100% - 20px); flex-direction: column; }.cost-panel { order: 4; }.payback-panel { order: 5; }.quick-panel { order: 6; }.share-panel { order: 7; }.example-panel { order: 8; } }
@media (max-width: 420px) { .brand-mark { width: 55px; flex-basis: 55px; }.brand-mark span { height: 12px; }.subtitle { font-size: 11px; }.header-tools { gap: 6px; }.display-currency { flex-basis: 100%; }.header-tools select { flex: 1; }.money-input { grid-template-columns: minmax(0, 1fr) 112px; }.period-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.metric-card { min-height: 105px; padding: 11px; }.metric-card strong { font-size: 20px; }.metric-card small { font-size: 9px; }.detail-table { grid-template-columns: 1fr; }.analysis-pairs, .cost-cards, .payback-overview, .payback-result, .payback-milestones { grid-template-columns: 1fr; }.manual-rate-fields { grid-template-columns: 1fr; }.panel-heading { flex-wrap: wrap; }.panel-heading-actions { margin-left: auto; }.share-panel .panel-heading-actions { width: 100%; justify-content: flex-end; } }
