:root {
  color-scheme: light;
  --canvas: #f6f7f4;
  --paper: #fff;
  --ink: #222c26;
  --muted: #616b63;
  --line: #e2e7df;
  --green: #275f43;
  --green-hover: #1d4c34;
  --green-light: #edf4ed;
  --danger: #a63c32;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .6; cursor: wait; }
button, input, select, textarea { border-radius: 7px; }
button { border: 0; }
input, select, textarea { width: 100%; border: 1px solid #c9d2c8; background: var(--paper); padding: 10px 12px; min-height: 43px; color: var(--ink); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: #71796f; }
textarea { resize: vertical; }
select { padding-right: 28px; }
:focus-visible { outline: 3px solid #528764; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-size: 32px; line-height: 1.35; font-weight: 650; }
h2 { font-size: 22px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 600; letter-spacing: .08em; margin-bottom: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; min-height: 42px; font-size: 13px; line-height: 1.5; font-weight: 600; white-space: nowrap; transition: background .15s ease; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-hover); }
.secondary { background: var(--paper); border: 1px solid #cfd8cc; color: var(--green); }
.secondary:hover { background: var(--green-light); }
.quiet { background: transparent; padding: 8px 10px; color: var(--muted); }
.quiet:hover { background: var(--green-light); color: var(--ink); }
.danger-text { color: var(--danger); }
.danger-button { background: var(--danger); color: #fff; }
.danger-button:hover { background: #853027; }
.brand { display: flex; gap: 11px; align-items: center; font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
.brand-mark { display: grid; place-items: center; background: var(--green); color: #fff; width: 34px; height: 34px; border-radius: 8px; font-size: 21px; line-height: 1; font-weight: 600; letter-spacing: -.07em; padding-right: 2px; }
.topbar { height: 76px; padding: 0 max(28px, calc((100vw - 1380px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line); }
.account-actions { display: flex; align-items: center; gap: 22px; }
.private-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--green); }
.status-dot { display: inline-block; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.workspace { max-width: 1400px; padding: 36px 30px 22px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.page-heading .eyebrow { margin-bottom: 6px; }
.page-heading .muted { margin-top: 8px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 20px 0; margin-bottom: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats > div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; padding: 0 26px; border-right: 1px solid var(--line); }
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { border: 0; }
.stats span { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }
.stats strong { font-size: 29px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; }
.stats small { color: var(--muted); font-size: 11px; margin-left: 12px; }
.records-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.subscription-sidebar { padding: 3px 0; min-width: 0; }
.list-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 16px; }
.list-heading h2 { font-size: 15px; }
.list-heading span { font-size: 12px; }
.subscription-sidebar input { background: var(--paper); font-size: 12px; }
.subscription-sidebar select { margin: 10px 0 18px; min-height: 36px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; background: transparent; }
.subscription-list { display: flex; flex-direction: column; gap: 10px; }
.subscription-item { text-align: left; width: 100%; display: flex; align-items: start; gap: 11px; padding: 16px 13px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.subscription-item:hover { border-color: #9fb49e; }
.subscription-item.selected { background: var(--green-light); border-color: #729574; box-shadow: inset 3px 0 0 var(--green); }
.service-monogram { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: #e9ece5; color: #435640; font-size: 18px; font-weight: 650; flex: none; }
.service-monogram.large { width: 49px; height: 49px; font-size: 27px; border-radius: 10px; }
.subscription-item-content { min-width: 0; flex: 1; }
.subscription-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subscription-item-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.badge { display: inline-flex; gap: 5px; align-items: center; padding: 2px 7px; font-size: 10px; font-weight: 500; border-radius: 4px; background: #f0f1ed; color: #61655d; white-space: nowrap; }
.badge.active, .badge.trial { color: #28633c; background: #e5f0e4; }
.badge.paused { background: #f7efdb; color: #7b5c1c; }
.badge.expired, .badge.cancelled { background: #f0efed; color: #62635f; }
.badge.banned { background: #fff0ed; color: var(--danger); }
.subscription-plan, .subscription-email, .subscription-age { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.subscription-plan { margin-top: 3px; }
.subscription-email { margin-top: 1px; }
.subscription-age { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.subscription-age > span { font-size: 15px; color: var(--green); }
.list-empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.renewal-countdown { display: inline-block; margin-top: 8px; padding: 3px 7px; border-radius: 4px; background: #f0f2ed; color: #52624c; font-size: 11px; font-weight: 600; }
.renewal-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 28px 22px; padding: 15px 18px; border: 1px solid #d5dfd0; border-radius: 7px; background: #f2f6ef; color: #3e5735; }
.renewal-banner strong { font-size: 20px; }
.renewal-banner > span { font-size: 11px; }
.renewal-soon { color: #795509; background: #fff6dc; border-color: #e7ce8d; }
.renewal-urgent { color: #a12e24; background: #ffede8; border-color: #e8b1a3; }
.renewal-overview { margin-bottom: 24px; padding: 17px 20px; background: #fff9e9; border: 1px solid #e7ce8d; border-left: 4px solid #b88623; border-radius: 7px; }
.renewal-overview h2 { font-size: 15px; color: #795509; }
.renewal-overview h2 > span { font-size: 11px; margin-left: 6px; font-weight: 400; }
.renewal-overview ul { list-style: none; margin: 10px 0 0; padding: 0; }
.renewal-overview li { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 5px 0; font-size: 12px; overflow-wrap: anywhere; }
.renewal-overview .renewal-countdown { margin-top: 0; }
.detail-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; min-height: 570px; min-width: 0; }
.detail-heading { padding: 27px 28px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.detail-identity > div { min-width: 0; }
.detail-identity .muted { font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h2 { overflow-wrap: anywhere; line-height: 1.25; }
.detail-actions { display: flex; gap: 3px; margin-left: auto; }
.detail-actions .button { font-size: 11px; padding: 5px 7px; min-height: 32px; }
.duration-stats { margin: 0 28px; padding: 19px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.15fr 1fr 1.1fr; gap: 20px; }
.duration-stats div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.duration-stats span { color: var(--muted); font-size: 11px; }
.duration-stats strong { font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; }
.duration-stats > div:first-child strong { color: var(--green); }
.current-info { padding: 23px 28px 0; }
.current-info-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.current-info-heading .button { min-height: 32px; font-size: 11px; padding: 4px 7px; }
.section-label { font-size: 12px; font-weight: 650; }
dl { display: grid; grid-template-columns: 1.5fr 1fr; gap: 15px 25px; margin: 13px 0 0; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
dl > div { min-width: 0; }
dt { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.notes-row { grid-column: 1 / -1; }
.timeline-section { padding: 24px 28px 28px; }
.timeline-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; }
.timeline-heading h3 span { color: var(--muted); font-size: 11px; background: var(--canvas); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; vertical-align: middle; margin-left: 4px; }
.timeline-heading p { font-size: 11px; margin-top: 5px; }
.timeline-heading .button { min-height: 36px; font-size: 12px; padding: 7px 12px; }
.timeline-now { position: relative; margin-left: 5px; padding: 0 0 24px 24px; border-left: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 11px; color: var(--green); }
.timeline-now > span:nth-child(2) { font-weight: 650; }
.timeline { padding: 0; margin: 0 0 0 5px; list-style: none; }
.timeline-event { position: relative; border-left: 1px solid var(--line); padding: 0 0 29px 24px; }
.timeline-event:last-child { border-color: transparent; padding-bottom: 0; }
.timeline-dot { position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; background: #fff; border: 2px solid #9bab99; border-radius: 50%; }
.now-dot { background: var(--green); border-color: var(--green); outline: 4px solid var(--green-light); }
.event-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; }
.event-top time { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-top time span { font-size: 11px; font-weight: 400; margin-left: 5px; color: var(--muted); }
.event-gap { font-size: 10px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.event-action { margin: 10px 0; font-size: 13px; line-height: 1.85; }
.event-snapshot { display: flex; align-items: center; gap: 7px 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.event-notes { margin-top: 9px; font-size: 11px; color: var(--muted); }
.event-notes summary { width: fit-content; padding: 3px 0; }
.event-notes p { margin-top: 8px; padding: 10px 13px; background: var(--canvas); border-radius: 6px; }
.event-actions { margin-top: 8px; display: flex; gap: 13px; }
.text-button { background: transparent; color: var(--muted); font-size: 10px; padding: 4px 0; min-height: 28px; }
.text-button:hover { text-decoration: underline; }
.text-button.danger-text { color: var(--danger); }
.empty-state { min-height: 568px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 24px; }
.empty-mark { display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid #cddcc9; border-radius: 16px; background: var(--green-light); color: var(--green); font-size: 32px; font-weight: 600; margin-bottom: 24px; }
.empty-state .eyebrow { font-size: 11px; margin-bottom: 8px; }
.empty-state h2 { font-size: 23px; }
.empty-state p.muted { font-size: 13px; line-height: 1.9; margin-top: 12px; }
.empty-state .button { margin-top: 25px; }
.empty-footnote { color: var(--muted); font-size: 11px; margin-top: 11px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 10px; margin-top: 20px; }
.page-error { display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; background: #fff0ed; color: var(--danger); margin-bottom: 15px; border-radius: 7px; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; background: var(--green); color: #fff; padding: 12px; z-index: 10; }
.skip-link:focus { top: 8px; }

/* Forms keep the same layout for a new subscription and a historical node. */
dialog { border: 1px solid var(--line); border-radius: 12px; width: min(580px, calc(100vw - 32px)); padding: 28px; max-height: calc(100dvh - 40px); color: var(--ink); box-shadow: 0 24px 90px #152c2329; }
dialog::backdrop { background: #15251e66; }
.small-dialog { width: min(440px, calc(100vw - 32px)); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.dialog-heading h2 { font-size: 21px; }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.close-button { width: 33px; height: 33px; font-size: 25px; line-height: 1; color: var(--muted); background: var(--canvas); flex: none; }
.field { margin-top: 17px; min-width: 0; }
.field small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-help { color: var(--muted); font-size: 12px; line-height: 1.8; }
.renewal-help { margin-top: 8px; font-size: 11px; }
.required { color: var(--green); }
.snapshot-label { display: flex; justify-content: space-between; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.snapshot-label .muted { font-size: 11px; font-weight: 400; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-error { background: #fff1ed; color: #933328; padding: 10px 12px; border-radius: 6px; font-size: 12px; margin-top: 15px; }
.confirm-message { line-height: 1.9; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #233d2e; color: #fff; font-size: 13px; padding: 12px 23px; border-radius: 8px; box-shadow: 0 4px 20px #152c231c; max-width: calc(100vw - 32px); width: max-content; z-index: 20; }

.login-layout { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-intro { background: #edf2e9; padding: 43px clamp(36px, 6vw, 100px) 30px; display: flex; flex-direction: column; }
.intro-copy { margin: auto 0; padding: 70px 0; }
.intro-copy .eyebrow { font-size: 12px; margin-bottom: 19px; }
.intro-copy h1 { font-size: clamp(32px, 3.3vw, 50px); line-height: 1.45; font-weight: 620; letter-spacing: -.045em; }
.intro-description { color: #5d6d5a; font-size: 14px; line-height: 2; margin-top: 22px; }
.intro-points { margin-top: 47px; }
.intro-points p { font-size: 12px; padding: 13px 0; border-bottom: 1px solid #d9e2d4; }
.intro-points span { font-size: 10px; color: #607958; margin-right: 17px; font-variant-numeric: tabular-nums; }
.intro-footer { color: #617159; font-size: 11px; }
.login-panel { display: grid; align-items: center; justify-items: center; padding: 60px 35px; background: var(--paper); }
.login-card { width: min(100%, 340px); }
.login-card .private-label { margin-bottom: 21px; }
.login-card h2 { font-size: 29px; }
.login-card > .muted { font-size: 13px; margin-top: 10px; }
#login-form { margin-top: 34px; }
#login-form input { min-height: 49px; }
.login-submit { width: 100%; margin-top: 22px; min-height: 47px; justify-content: space-between; }
.login-note { margin-top: 23px; color: var(--muted); font-size: 11px; text-align: center; }

@media (min-width: 1500px) { .workspace { padding-top: 44px; } }
@media (max-width: 1050px) {
  .records-layout { grid-template-columns: 265px minmax(0, 1fr); gap: 18px; }
  .detail-heading, .current-info, .timeline-section { padding-left: 22px; padding-right: 22px; }
  .duration-stats { margin-left: 22px; margin-right: 22px; gap: 14px; }
  .renewal-banner { margin-left: 22px; margin-right: 22px; }
  .duration-stats strong { font-size: 12px; }
  .stats small { display: none; }
  .detail-actions { width: 100%; justify-content: flex-end; margin-top: -5px; }
}
@media (max-width: 760px) {
  .topbar { height: 65px; padding: 0 20px; }
  .account-actions { gap: 5px; }
  .account-actions .private-label { display: none; }
  .workspace { padding: 25px 18px 20px; }
  .page-heading { gap: 12px; align-items: flex-start; margin-bottom: 23px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading .eyebrow { font-size: 10px; }
  .page-heading .muted { font-size: 12px; max-width: 210px; }
  .page-heading > .button { margin-top: 24px; font-size: 12px; padding: 9px 12px; min-height: 38px; }
  .stats { padding: 16px 0; margin-bottom: 24px; }
  .stats > div { padding: 0 14px; }
  .stats span { font-size: 10px; }
  .stats strong { font-size: 26px; }
  .records-layout { grid-template-columns: 1fr; gap: 23px; }
  .subscription-sidebar { display: grid; grid-template-columns: 1fr 110px; gap: 11px; }
  .list-heading { grid-column: 1 / -1; margin-bottom: 0; }
  .subscription-sidebar select { margin: 0; font-size: 11px; min-height: 43px; }
  .subscription-list { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; padding: 2px 2px 9px; scroll-snap-type: x proximity; }
  .subscription-item { flex: 0 0 258px; scroll-snap-align: start; }
  .subscription-plan { min-height: 17px; }
  .subscription-email { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .subscription-age { margin-top: 10px; }
  .list-empty { padding: 18px 10px; text-align: left; width: 100%; font-size: 12px; }
  .list-empty br { display: none; }
  .detail-panel { min-height: 430px; }
  .empty-state { min-height: 430px; }
  .detail-heading { padding-top: 21px; padding-bottom: 18px; }
  .detail-actions { width: auto; margin-top: 0; }
  .duration-stats { grid-template-columns: 1fr 1fr; gap: 16px; }
  .duration-stats > div:last-child { grid-column: 1 / -1; }
  .duration-stats strong { font-size: 13px; }
  .workspace-footer { flex-direction: column; gap: 4px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { padding: 24px; }
  .intro-copy { padding: 37px 0 6px; }
  .intro-copy h1 { font-size: 32px; }
  .intro-copy .eyebrow { margin-bottom: 10px; }
  .intro-description { margin-top: 12px; font-size: 12px; }
  .intro-points, .intro-footer { display: none; }
  .login-panel { padding: 34px 25px 45px; }
  .login-card { width: 100%; max-width: 400px; }
  .login-card .private-label { margin-bottom: 13px; }
  .login-card h2 { font-size: 25px; }
  #login-form { margin-top: 24px; }
}
@media (max-width: 440px) {
  .brand { font-size: 14px; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: 19px; }
  .account-actions .button { font-size: 11px; }
  .stats > div { padding: 0 11px; }
  .detail-heading, .current-info, .timeline-section { padding-left: 18px; padding-right: 18px; }
  .detail-actions { width: 100%; }
  .duration-stats { margin-left: 18px; margin-right: 18px; }
  .renewal-banner { margin-left: 18px; margin-right: 18px; padding: 12px; }
  .detail-title h2 { font-size: 21px; }
  .timeline-heading { align-items: flex-start; }
  .timeline-heading p { max-width: 170px; }
  .timeline-heading .button { font-size: 11px; padding-left: 9px; padding-right: 9px; }
  .event-top { flex-direction: column; align-items: flex-start; }
  .event-gap { border: 0; padding: 0; }
  dialog { padding: 21px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .dialog-heading h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
