:root {
  color-scheme: light;
  --canvas: #f5f4fb;
  --paper: #fff;
  --ink: #211e37;
  --muted: #605c75;
  --line: #e5e2ef;
  --accent: #5741c0;
  --accent-soft: #eee9ff;
  --night: #241d46;
  --mint: #baf3d5;
  --data-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell { width: min(1536px, calc(100% - 64px)); margin-inline: auto; }
.site-footer { border-top: 1px solid var(--line); padding-block: 8px 16px; font-size: .875rem; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.topbar { border-bottom: 1px solid var(--line); background: #fcfbff; }
.topbar-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand, .top-actions { display: flex; align-items: center; gap: 12px; }
.brand { color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 750; letter-spacing: -.055em; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 33px;
  height: 24px;
  border-radius: 5px;
  background: var(--accent);
  transform: rotate(-10deg);
}
.brand-mark::before, .brand-mark::after {
  position: absolute;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fcfbff;
  content: "";
}
.brand-mark::before { left: -3px; }
.brand-mark::after { right: -3px; }
.brand-mark i {
  width: 10px;
  height: 10px;
  border: 1.7px solid white;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-30deg);
}
.top-actions { gap: 21px; }
.language-switch { min-width: 44px; }

.button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 650;
}
.button-outline { border-color: #dcd5f0; color: var(--accent); background: var(--paper); }
.button-outline:hover { border-color: var(--accent); background: var(--accent-soft); }
.button-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 47px;
  padding-inline: 16px;
  color: white;
  background: var(--accent);
  font-size: .96rem;
}
.button-primary:hover { background: #4933aa; }
.button-primary > [aria-hidden] { font-family: var(--data-font); font-size: 1.27rem; }

.page-title { padding-block: 30px 22px; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; letter-spacing: -.045em; font-weight: 770; }
.page-intro, .guide-lead { margin-block-end: 18px; color: var(--muted); line-height: 1.6; }
.page-intro a { display: inline-block; }
.guide { max-width: 800px; padding-block-end: 32px; }
.guide .page-title { letter-spacing: -.028em; }
.guide-content { padding: clamp(18px, 4vw, 32px); line-height: 1.65; }
.guide-content h2:not(:first-child) { margin-block-start: 1.35em; }
.guide-content :is(p, ul, ol) { margin-block: .55em 0; }
.guide-content li + li { margin-block-start: .35em; }
.guide-content table { width: 100%; margin-block-start: 12px; border-collapse: collapse; font-size: .9rem; }
.guide-content :is(th, td) { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.guide-content thead { background: var(--accent-soft); }
.guide-content td { font-variant-numeric: tabular-nums; }
.guide-content .guide-actions { margin-block-start: 16px; }
.guide-actions .button, .top-actions a.button { display: inline-flex; align-items: center; text-decoration: none; }

.workspace { display: grid; grid-template-columns: minmax(322px, .92fr) minmax(0, 1.45fr); gap: 24px; align-items: start; margin-bottom: 40px; }
.plan-shortcut { display: none; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.settings-top { padding: 19px 20px 15px; }
h2 { font-size: 1.22rem; line-height: 1.4; font-weight: 720; letter-spacing: -.02em; }
#awake-hours { margin-top: 12px; }
.mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  margin: 13px 0 0;
  padding: 4px;
  border: 0;
  border-radius: 9px;
  background: #f3f0fa;
}
.mode-picker label { position: relative; min-width: 0; cursor: pointer; }
.mode-picker input { position: absolute; opacity: 0; }
.mode-picker label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 8px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: .89rem;
  font-weight: 620;
}
.mode-picker input:checked + span { border-color: #ded5f7; background: var(--paper); color: var(--accent); box-shadow: 0 1px 2px #36275b13; }
.mode-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.mode-icon { display: inline-block; flex: none; width: 12px; height: 12px; }
.mode-icon.heart { font: 15px/12px Arial, sans-serif; }
.mode-icon.bolt { background: currentColor; clip-path: polygon(56% 0, 18% 57%, 49% 57%, 38% 100%, 87% 36%, 55% 36%, 68% 0); }

.setting { border-top: 1px solid var(--line); }
.setting > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
.setting > summary { min-height: 49px; padding: 9px 20px; font-size: .91rem; font-weight: 660; }
.setting > summary:hover { background: #faf8ff; }
.summary-note { flex: none; margin-left: auto; color: var(--muted); font-size: .75rem; font-weight: 470; }
.setting > summary::after {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  margin-right: 2px;
  border: solid #817394;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
  content: "";
}
#time-setting > summary::after { margin-left: auto; }
#time-setting .field { grid-template-rows: 1fr auto; }
#snapshot-hint { margin-block-start: -5px; }
details[open] > summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.setting-content, .conditional-fields { display: grid; gap: 11px; }
.setting-content { padding: 0 20px 16px; }
.core-fields { padding-block-start: 15px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: .79rem; font-weight: 590; }
.field-caption { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.field input, .field select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #ddd8ea;
  border-radius: 7px;
  background: #fcfbff;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 460;
  font-variant-numeric: tabular-nums;
}
.field input[type="datetime-local"] { padding-inline: 7px; font-size: .76rem; }
.field input[type="number"] { appearance: textfield; }
.field input::-webkit-inner-spin-button, .field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.field :is(input, select)[aria-invalid="true"] { border-color: #b72e4a; }
.input-unit { position: relative; display: block; font-variant-numeric: tabular-nums; }
.input-unit input { padding-right: 29px; }
.input-unit > span { position: absolute; right: 9px; top: 9px; color: var(--muted); font-size: .78rem; pointer-events: none; }
.field-hint { color: var(--muted); font-size: .75rem; line-height: 1.55; font-weight: 420; }
.check-row { display: flex; align-items: center; gap: 7px; font-size: .83rem; }
.check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.subscription-fields { display: grid; gap: 8px; }
.subscription-fields > .mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.card-settings { display: grid; gap: 8px; padding-block-start: 5px; }
.card-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-settings-head h3 { margin: 0; font-size: .88rem; }
.card-settings-head .button { min-height: 32px; padding: 4px 9px; font-size: .76rem; }
.card-fields { display: grid; gap: 8px; }
.card-field { display: flex; align-items: end; gap: 8px; }
.card-field .field { flex: 1; }
.card-field .remove-button { min-height: 36px; flex: none; }
.settings-bottom { display: grid; gap: 10px; padding: 0 20px 16px; }
.error-message { padding: 8px 11px; border-radius: 6px; background: #fff0f3; color: #8d203c; font-size: .83rem; line-height: 1.5; }
.add-button { justify-self: start; }
.announcements:not(:empty) { display: grid; gap: 9px; }
.announcement {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.announcement legend { padding-inline: 5px; color: var(--muted); font-size: .75rem; }
.remove-button {
  justify-self: end;
  min-height: 31px;
  padding: 3px 5px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #91304e;
  font-size: .8rem;
}
.remove-button:hover { text-decoration: underline; }

.results {
  position: sticky;
  top: 12px;
  min-width: 0;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  scrollbar-width: thin;
}
#results-title { scroll-margin-top: 12px; }
.section-heading > .result-status { font-size: .76rem; font-weight: 620; color: #5640ad; background: var(--accent-soft); padding: 5px 9px; border-radius: 5px; }
.result-body, .plan-overview { display: grid; gap: 15px; min-width: 0; }
.result-body[data-stale] .ticket { filter: saturate(.7); }
.ticket {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
  border-radius: 15px;
  background: var(--night);
  color: #fff;
}
.ticket-main { display: flex; align-items: center; justify-content: space-between; min-height: 116px; gap: 16px; padding: 22px 27px; }
.ticket-main > div:first-child { min-width: 0; }
.ticket-label { color: #d2c8f4; font-size: .84rem; line-height: 1.5; letter-spacing: .03em; }
.ticket h2 {
  margin-top: 4px;
  font-size: clamp(1.5rem, 3.5vw, 2.65rem);
  line-height: 1.23;
  letter-spacing: -.06em;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ticket-detail { margin-top: 7px; color: #d4cbed; font-size: .83rem; line-height: 1.55; }
.ticket-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 78px;
  height: 54px;
  margin-right: 7px;
  border: 1px solid #9785d1;
  border-radius: 8px;
  color: #c4b2fd;
  transform: rotate(-13deg);
  box-shadow: 4px 5px 0 #392f64;
}
.ticket-icon::before, .ticket-icon::after {
  position: absolute;
  top: 20px;
  width: 12px;
  height: 13px;
  border: 1px solid #9785d1;
  border-radius: 50%;
  background: var(--night);
  content: "";
}
.ticket-icon::before { left: -7px; clip-path: inset(0 0 0 50%); }
.ticket-icon::after { right: -7px; clip-path: inset(0 50% 0 0); }
.ticket-icon i {
  position: relative;
  display: block;
  width: 23px;
  height: 23px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-31deg);
}
.ticket-icon i::after {
  position: absolute;
  top: 1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: "";
}
.ticket-metrics {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  padding: 14px 27px 17px;
  border-top: 1px dashed #695a94;
  background: #2d2554;
}
.ticket-metrics::before, .ticket-metrics::after {
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--canvas);
  content: "";
}
.ticket-metrics::before { left: -7px; }
.ticket-metrics::after { right: -7px; }
.ticket-metrics div { display: grid; align-content: start; gap: 4px; min-width: 0; }
.ticket-metrics div > span { color: #d4cbed; font-size: .76rem; }
.ticket-metrics strong { font-size: 1.03rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ticket-metrics #gain { color: var(--mint); font-family: var(--data-font), sans-serif; font-size: 1.28rem; }
.ticket-actions { display: grid; gap: 0; margin: 0; padding: 0 27px 14px; list-style: none; }
.ticket-actions li { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; padding: 7px 0; border-top: 1px solid #6d5c96; }
.ticket-actions span { color: #e4dbfb; font-size: .81rem; }
.ticket-actions .ticket-card-gain { display: block; margin-block-start: 2px; color: #d4cbed; font-size: .75rem; font-variant-numeric: tabular-nums; }
.ticket-actions strong { font-size: .88rem; font-variant-numeric: tabular-nums; }
.ticket-action-time { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 9px; min-width: 0; }
.ticket-adjust { min-height: 30px; padding: 3px 6px; border: 0; border-radius: 4px; background: transparent; color: #e4dbfb; font-size: .76rem; text-decoration: underline; text-underline-offset: 3px; }
.ticket-adjust:hover, .ticket-adjust[aria-expanded="true"] { background: #45396e; color: white; }
.ticket-adjust:focus-visible { outline-color: #e4dbfb; }
.result-actions { display: flex; justify-content: end; gap: 6px 8px; flex-wrap: wrap; padding: 0 27px 14px; }
.result-actions:not(:has(button:not([hidden]))) { display: none; }
.plan-adjustment { flex: 1 0 100%; min-width: 0; margin-block: 5px 3px; padding: 10px; border-radius: 8px; background: #f7f4ff; color: var(--ink); }
.adjustment-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.plan-adjustment .button { min-height: 34px; padding: 4px 9px; font-size: .79rem; }
.add-button:disabled, .plan-adjustment .button:disabled { border-color: var(--line); background: #eeebf3; color: #70687d; cursor: default; opacity: .75; }
.adjustment-close { margin-inline-start: auto; }
.adjustment-message { color: var(--muted); font-size: .79rem; line-height: 1.4; }
.adjustment-message:not(:empty) { margin-block-start: 8px; }
.adjustment-changes { display: grid; gap: 4px; margin: 8px 0; font-size: .82rem; }
.adjustment-changes dd { margin: 0 0 3px; color: var(--accent); font-weight: 680; }
.adjustment-use { width: auto; }

.comparison, .timeline { padding: 17px 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 5px 15px; flex-wrap: wrap; }
.section-heading h3, .section-heading h4 { margin: 0; font-size: .99rem; font-weight: 710; }
.section-heading > span { color: var(--muted); font-size: .74rem; }
.plan-chart { --fold-fill: repeating-linear-gradient(135deg, #f5f1fb 0 3px, #eae4f5 3px 4px); position: relative; min-width: 0; margin: 14px 0 0; padding: 10px 11px 8px; border: 1px solid #e5dff1; border-radius: 9px; background: #fcfbff; }
.plan-chart-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 10px; }
.plan-chart-labels, .plan-chart-tracks { display: grid; grid-auto-rows: 26px; }
.plan-chart-labels { align-items: center; color: var(--muted); font-size: .75rem; font-weight: 600; }
.plan-chart-plot, .plan-chart-tracks, .plan-chart-track { position: relative; min-width: 0; }
.plan-chart-tracks { pointer-events: none; }
.plan-chart-track::before { position: absolute; inset-inline: 0; top: calc(50% - 1px); border-block-start: 1px solid #d9d0e9; content: ""; }
.plan-chart-folds { position: absolute; inset: 0; }
.plan-chart-fold, .plan-chart-swatch { background: var(--fold-fill); }
.plan-chart-fold { position: absolute; inset-block: 0; border-inline: 1px dashed #c4b7dc; }
.plan-chart-mark { position: absolute; top: 50%; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; appearance: none; cursor: help; pointer-events: auto; transform: translateY(-50%); }
.plan-chart-mark::before { position: absolute; top: 50%; background: var(--mark-ink); content: ""; }
.plan-chart-bar { left: clamp(0px, var(--chart-at), calc(100% - 7px)); width: max(7px, var(--chart-width)); }
.plan-chart-bar::before { inset-inline: 0; height: 9px; border-radius: 4px; transform: translateY(-50%); }
.plan-chart-bar::after { position: absolute; inset-block: 0; left: 50%; width: max(100%, 24px); transform: translateX(-50%); content: ""; }
.plan-chart-bar.routine::before { height: 7px; background: #baaed8; }
.plan-chart-point { left: clamp(5px, var(--chart-at), calc(100% - 5px)); width: 24px; transform: translate(-50%, -50%); }
.plan-chart-point::before { left: 50%; width: 9px; height: 9px; border-radius: 2px; transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 0 2px #fcfbff; }
.plan-chart-tooltip { position: absolute; z-index: 2; display: grid; gap: 3px; width: max-content; max-width: min(250px, calc(100% - 12px)); padding: 8px 10px; border-radius: 7px; background: #2d2450; color: white; font-size: .77rem; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; box-shadow: 0 3px 9px #211e3735; }
.plan-chart-tooltip > span { color: #f1ebff; }
.plan-chart-axis { position: relative; grid-column: 2; height: 21px; margin-block-start: 2px; border-block-start: 1px solid #c8bcde; }
.plan-chart-tick { position: absolute; left: var(--chart-at); top: 5px; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; transform: translateX(-50%); }
.plan-chart-tick::before { position: absolute; top: -6px; left: 50%; height: 4px; border-inline-start: 1px solid #9f92b8; content: ""; }
.plan-chart-tick:first-child, .plan-chart-tick:last-child { transform: none; }
.plan-chart-tick:first-child::before { left: 0; }
.plan-chart-tick:last-child { transform: translateX(-100%); }
.plan-chart-tick:last-child::before { left: 100%; }
.plan-chart-note { display: flex; align-items: center; gap: 6px; margin-block-start: 2px; color: var(--muted); font-size: .72rem; }
.plan-chart-swatch { width: 14px; height: 9px; flex: none; border-inline: 1px dashed #c4b7dc; }
.plan-sequence { position: relative; display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.plan-sequence:empty { display: none; }
.plan-sequence:has(.plan-node)::before { position: absolute; inset-block: 8px; inset-inline-start: 6px; border-inline-start: 2px solid #d6cdee; content: ""; }
.plan-sequence > li { position: relative; min-width: 0; margin-inline-start: 24px; }
.plan-sequence:not(:has(.plan-node)) > li { margin-inline-start: 0; }
.plan-node { padding: 9px 11px; border: 1px solid #e0d9f2; border-radius: 8px; background: #faf8ff; }
.plan-node::before { position: absolute; inset-block-start: 15px; inset-inline-start: -25px; width: 13px; height: 9px; border-radius: 3px; background: var(--mark-ink); box-shadow: 0 0 0 3px var(--paper); content: ""; }
.plan-node.renewal::before { inset-inline-start: -24px; width: 11px; height: 11px; border-radius: 2px; transform: rotate(45deg); }
.plan-phase { padding: 3px 4px 3px 10px; }
.plan-phase .step-heading, .plan-phase .step-value { color: var(--muted); font-size: .77rem; }
.plan-phase .step-heading > strong { font-weight: 510; font-variant-numeric: tabular-nums; }
.step-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; font-size: .9rem; }
.step-value { color: var(--accent); font-size: .86rem; font-weight: 675; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.step-detail { margin-top: 4px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.comparison-row { display: grid; align-items: center; grid-template-columns: clamp(75px, 24%, 104px) minmax(24px, 1fr) minmax(68px, auto); gap: 10px; margin-top: 13px; font-size: .83rem; }
.comparison-row strong { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { height: 9px; overflow: hidden; border-radius: 20px; background: #eeeaf5; }
.meter div { width: 0; height: 100%; border-radius: inherit; background: #a19ab7; }
.meter.best div { background: var(--accent); }
.comparison-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 11px; color: var(--muted); font-size: .75rem; }

.usage-scenario { margin-top: 8px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.usage-details { margin-block-start: 14px; border-top: 1px solid var(--line); }
.usage-details summary { display: flex; align-items: center; gap: 9px; min-height: 37px; padding-block-start: 5px; list-style: none; color: var(--accent); font-size: .83rem; font-weight: 650; cursor: pointer; }
.usage-details summary::before { width: 7px; height: 7px; margin-inline-start: 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); content: ""; }
.usage-details[open] summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.usage-table { width: 100%; margin-top: 10px; border-collapse: collapse; text-align: left; font-size: .875rem; font-variant-numeric: tabular-nums; }
.usage-table th, .usage-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.usage-table thead { color: var(--muted); font-size: .8rem; }
.usage-table th[scope="row"] { font-weight: 500; overflow-wrap: anywhere; }
.usage-table thead th:last-child, .usage-table td { padding-inline-start: 12px; text-align: right; }
.usage-table td { font-weight: 700; white-space: nowrap; }
.usage-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.plan-milestones { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.plan-milestones .timeline-name { padding-inline-start: 16px; }
.plan-milestones .card { color: var(--accent); font-weight: 700; }

.timeline { --mark-ink: var(--muted); }
.timeline .start { --mark-shape: inset(35% 0); }
.timeline .cycle { --mark-radius: 50%; }
.timeline .short { --mark-radius: 50%; --mark-ink: #66568b; --mark-fill: var(--paper); --mark-border: 2px solid var(--mark-ink); }
.timeline .announced { --mark-ink: #246858; }
.timeline .card { --mark-ink: var(--accent); --mark-radius: 3px; }
.timeline .card-expiry { --mark-ink: #8a4669; --mark-shape: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.timeline .grace { --mark-ink: #865311; --mark-shape: polygon(50% 0, 100% 100%, 0 100%); }
.timeline .lapse { --mark-ink: #91304e; --mark-shape: polygon(0 15%, 100% 15%, 50% 95%); }
.timeline :is(.renewal, .tier-change) { --mark-ink: #246858; --mark-shape: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }
.timeline .end { --mark-ink: var(--ink); --mark-shape: inset(0 32%); }
.timeline-name { position: relative; }
.timeline-name::before {
  position: absolute;
  inset-inline-start: 0;
  top: .21em;
  width: 11px;
  height: 11px;
  border: var(--mark-border, 0);
  border-radius: var(--mark-radius, 0);
  background: var(--mark-fill, var(--mark-ink));
  clip-path: var(--mark-shape, none);
  content: "";
}
.timeline-name.card::before {
  top: .36em;
  width: 14px;
  height: 7px;
}

@media (forced-colors: active) {
  .timeline .short { --mark-fill: Canvas; }
  .timeline-name::before, .plan-node::before {
    forced-color-adjust: none;
    border-color: CanvasText;
    background: var(--mark-fill, CanvasText);
  }
  .plan-chart-mark::before, .plan-chart-bar.routine::before { forced-color-adjust: none; background: CanvasText; }
  .plan-chart-tooltip { border: 1px solid CanvasText; }
  .plan-chart-fold, .plan-chart-swatch { border-color: CanvasText; }
}

@media (min-width: 1180px) {
  .workspace { grid-template-columns: minmax(322px, .9fr) minmax(0, 2.7fr); gap: 20px; }
  #weekly-fields { grid-template-columns: minmax(0, 1fr) minmax(170px, 1.6fr); align-items: end; }
  #time-setting .date-pair { grid-template-columns: minmax(0, 1fr); }
  .result-body { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); align-items: start; gap: 20px; }
  .plan-breakdown { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; scrollbar-width: thin; }
  .ticket h2 { font-size: clamp(1.75rem, 2.65vw, 2.65rem); }
  .ticket-main, .ticket-actions, .ticket-metrics, .result-actions { padding-inline: 22px; }
}
@media (max-width: 900px) {
  .shell { width: calc(100% - 40px); }
  .workspace { gap: 15px; }
  .date-pair { grid-template-columns: 1fr; }
  .ticket-main { padding-inline: 20px; }
  .ticket-icon { display: none; }
  .ticket-actions, .result-actions { padding-inline: 20px; }
  .ticket-metrics { padding-inline: 20px; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .page-title { padding-block: 22px 16px; }
  .top-actions { gap: 12px; }
  .date-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results { position: static; max-height: none; overflow: visible; }
  .plan-shortcut {
    position: sticky;
    z-index: 3;
    top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    margin: 8px 8px 0;
    padding: 9px 13px;
    border-radius: 10px;
    color: white;
    background: var(--night);
    box-shadow: 0 3px 12px #241d4626;
    text-decoration: none;
  }
  .shortcut-summary { display: grid; gap: 3px; min-width: 0; margin-right: auto; }
  .shortcut-summary span { color: #d2c8f4; font-size: .73rem; }
  .shortcut-summary strong { font-size: .91rem; overflow-wrap: anywhere; }
  .shortcut-gain { color: var(--mint); white-space: nowrap; font-size: .88rem; }
  .ticket h2 { font-size: clamp(1.65rem, 7vw, 2.7rem); }
  .ticket-icon { display: grid; }
}
@media (max-width: 440px) {
  .date-pair { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { min-height: 57px; }
  .ticket-icon { display: none; }
  .comparison, .timeline { padding-inline: 15px; }
  .field input, .field select, .field input[type="datetime-local"] { font-size: 1rem; }
}
