@charset "UTF-8";
:root {
  --bg: #f3f6fa; --paper: #fff; --ink: #24354b; --muted: #586b80; --line: #dae3ed;
  --blue: #3975b8; --blue-deep: #245f9f; --light: #eaf3ff; --pale: #f7faff; --danger: #a53e3e;
  --radius: 12px; --shadow: 0 6px 24px #243e5910; --text: 16px; --secondary: 14px;
  --page-width: 1400px; --sidebar-width: 288px; --page-padding: 24px; --gap: 24px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-synthesis: none;
}
/* Keep touch scrolling, including nested scrollers and dialogs, without pinch or double-tap zoom. */
* { box-sizing: border-box; touch-action: pan-x pan-y; }
html { scrollbar-gutter: stable; }
html:has(dialog:modal), body:has(dialog:modal) { overflow: hidden; overscroll-behavior: none; }
body { margin: 0; font-size: var(--text); line-height: 1.65; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.4; font-weight: 650; }
h2 { font-size: 21px; line-height: 1.5; font-weight: 650; }
h3 { font-size: 18px; line-height: 1.5; font-weight: 650; }
small, .small { font-size: var(--secondary); }
strong { font-weight: 650; }
svg { flex-shrink: 0; }
button, a, summary, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #75a6df; outline-offset: 3px; }
select, input { border: 1px solid #b9c9da; border-radius: 8px; background: var(--paper); min-height: 44px; padding: 9px 12px; max-width: 100%; }
input[type="radio"] { width: 20px; height: 20px; min-height: auto; accent-color: var(--blue); }
select { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 12px; background: var(--ink); color: white; }
.skip-link:focus { top: 8px; }
.muted, .subtle { color: var(--muted); }
.risk-text { color: var(--danger); }
.full { width: 100%; }

/* Shared controls and readable text scale. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 16px; border: 1px solid #c5d7eb; border-radius: 8px; background: var(--light); color: var(--blue-deep); line-height: 1.5; font-weight: 600; text-align: center; }
.button:hover:not(:disabled) { background: #dfecfc; border-color: #9fbddd; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover:not(:disabled) { background: var(--blue-deep); }
.button.danger { background: var(--danger); border-color: var(--danger); color: white; }
.button.ghost { background: white; color: var(--muted); border-color: #bdccdc; }
.button:disabled { background: #edf1f6; color: #637185; border-color: #d5dee8; }
.button span { font-size: var(--secondary); font-weight: 400; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.text-button { min-height: 44px; padding: 8px 4px; color: var(--blue-deep); background: transparent; text-align: left; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { color: var(--muted); }
.small-button { font-size: var(--secondary); }
.eyebrow { font-size: var(--secondary); color: var(--muted); margin-bottom: 4px; letter-spacing: .3px; }
.orange-line { display: inline-block; width: 20px; height: 3px; margin-right: 10px; background: var(--blue); vertical-align: middle; }
.tag { display: inline-flex; align-items: center; background: #f0f3f7; border-radius: 5px; padding: 3px 9px; color: #52667e; font-size: var(--secondary); white-space: nowrap; }
.tag.orange { background: var(--light); color: var(--blue-deep); }
.tag.dark { background: var(--blue); color: white; }
.section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; min-width: 0; scroll-margin-top: 96px; }
.section-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.section-top .subtle { font-size: var(--secondary); }
.section-description { color: var(--muted); margin-bottom: 24px; }
.fine-print, .disabled-reason { font-size: var(--secondary); color: var(--muted); line-height: 1.7; }
.fine-print { margin-top: 14px; }
.disabled-reason { display: block; margin-top: 8px; }
.lead { font-size: 18px; color: var(--muted); line-height: 1.9; }
.notice, .save-warning { padding: 16px 18px; background: #edf4fd; border: 1px solid #d3e2f3; border-radius: 8px; margin-bottom: 24px; font-size: var(--secondary); line-height: 1.8; }
.save-warning { background: #fff5e6; color: #75501e; }
.loading { display: grid; place-content: center; justify-items: center; gap: 24px; padding: 32px; min-height: 90vh; }

/* One navigation tree: header on PC, bottom bar on phones. */
.masthead { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 32px; min-height: 76px; padding: 0 max(var(--page-padding), calc((100vw - var(--page-width)) / 2 + var(--page-padding))); background: #fffffffa; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 22px; font-weight: 700; flex-shrink: 0; line-height: 1.3; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 44px; background: var(--blue); color: white; border-radius: 10px 10px 10px 3px; font-size: 27px; }
.brand-sub { display: block; font-size: var(--secondary); color: var(--muted); font-weight: 400; margin-top: 3px; }
.masthead-message { flex: 1; color: var(--muted); font-size: var(--secondary); }
.top-nav { display: flex; align-self: stretch; align-items: stretch; gap: 8px; flex: 1; justify-content: center; }
.top-nav button { position: relative; padding: 0 15px; background: transparent; color: var(--muted); white-space: nowrap; }
.top-nav button:hover { background: var(--pale); }
.top-nav button.active { color: var(--blue-deep); font-weight: 650; }
.top-nav button.active::after { position: absolute; content: ""; height: 3px; bottom: 0; left: 15px; right: 15px; background: var(--blue); border-radius: 3px 3px 0 0; }
.nav-icon { display: none; }
.utility-menu { position: relative; margin-left: auto; flex-shrink: 0; }
.utility-menu > summary { padding: 12px 4px; min-height: 44px; list-style: none; color: var(--muted); font-size: var(--secondary); cursor: pointer; }
.utility-menu > summary::-webkit-details-marker { display: none; }
.utility-menu > summary span { margin-left: 5px; }
.utility { display: grid; position: absolute; top: calc(100% + 8px); right: 0; width: 168px; padding: 8px 12px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.utility .text-button { padding: 10px; }

/* Real columns reserve space for the calendar. */
.dashboard { max-width: var(--page-width); margin: 0 auto; padding: 28px var(--page-padding) 40px; display: block; }
.dashboard-content, .workspace, .workspace-main { min-width: 0; }
@media (min-width: 901px) {
  .dashboard { display: grid; grid-template-columns: minmax(0,1fr) var(--sidebar-width); column-gap: 24px; }
}
.day-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; }
.day-heading h1 { font-size: 26px; }
.day-counter { display: flex; align-items: baseline; flex-shrink: 0; gap: 7px; color: var(--muted); font-size: var(--secondary); }
.day-counter strong { font-size: 38px; line-height: 1.2; color: var(--blue-deep); font-weight: 500; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 16px 0; margin-bottom: 16px; }
.metric { padding: 0 16px; border-right: 1px solid var(--line); min-width: 0; }
.metric:last-child { border: 0; }
.metric > span { display: block; font-size: var(--secondary); color: var(--muted); margin-bottom: 6px; }
.metric > strong { display: block; font-size: 24px; font-weight: 550; white-space: nowrap; line-height: 1.4; font-variant-numeric: tabular-nums; }
.metric strong small { margin-left: 4px; color: var(--muted); font-weight: 400; }
.metric > small { display: block; color: var(--muted); font-size: var(--secondary); margin-top: 8px; }
.alert-metric > strong { color: var(--danger); }
.ap-dots { display: flex; gap: 6px; margin-top: 14px; }
.ap-dots i { width: 26px; height: 5px; background: #e6edf5; border-radius: 3px; }
.ap-dots i.filled { background: #5e95cf; }
.energy-meter { height: 5px; width: 95px; max-width: 100%; background: #e6edf5; margin-top: 14px; border-radius: 3px; }
.energy-meter i { display: block; height: 100%; background: #5e95cf; border-radius: 3px; }
.role-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; font-size: var(--secondary); }
.strip-label { color: var(--muted); margin-right: 4px; }
.role-pill { min-height: 44px; background: white; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
.role-pill strong { margin-left: 8px; }
.role-pill.active { background: var(--light); color: var(--blue-deep); border-color: #aac5e5; }
.resume-value { color: var(--muted); margin-left: auto; }
.resume-value strong { color: var(--ink); margin-left: 8px; }

/* Job cards emphasize work, company, pay and the current action. */
.job-filters { display: flex; flex-wrap: wrap; gap: 12px 20px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 20px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 0; }
.filter-label { min-width: 0; margin-right: 6px; font-size: var(--secondary); color: var(--muted); }
.filter-button { background: transparent; color: var(--muted); font-size: var(--secondary); border-radius: 7px; min-height: 44px; padding: 8px 10px; }
.filter-button:hover { background: #f0f5fb; }
.filter-button.active { color: var(--blue-deep); background: var(--light); font-weight: 600; }
.tier-row { margin-bottom: 0; }
.job-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; }
.job-card { border: 1px solid var(--line); padding: 22px; border-radius: 10px; display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,.46fr); gap: 10px 24px; min-width: 0; background: white; }
.job-card:hover { border-color: #a9c3df; box-shadow: 0 4px 16px #2a4a6b08; }
.job-card-top { display: flex; gap: 12px; align-items: center; grid-column: 1; grid-row: 1; }
.job-card-top > div { flex: 1; min-width: 0; }
.job-card-top > .tag { align-self: flex-start; }
.company-logo { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; background: #eff5fc; color: var(--blue-deep); border-radius: 9px; font-size: 20px; }
.company-name { font-size: var(--secondary); color: var(--muted); margin-bottom: 2px; overflow-wrap: anywhere; }
.salary { color: var(--blue-deep); font-size: 25px; font-weight: 600; margin: 0; grid-column: 2; grid-row: 1; text-align: right; align-self: center; }
.salary span { font-size: var(--secondary); color: var(--muted); font-weight: 400; }
.job-tags { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: var(--secondary); color: var(--muted); grid-column: 1; grid-row: 2; }
.job-details { border-top: 1px solid #e6ecf3; margin-top: 18px; margin-bottom: 18px; }
.job-card > .job-details { grid-column: 1; grid-row: 3; margin: 0; }
.job-details > summary { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; list-style: none; font-size: var(--secondary); color: var(--blue-deep); cursor: pointer; }
.job-details > summary::-webkit-details-marker { display: none; }
.job-details[open] > summary > span { transform: rotate(45deg); }
.job-apply { margin-top: auto; grid-column: 2; grid-row: 2 / 4; align-self: end; }
.job-apply .button { flex-wrap: wrap; gap: 4px 10px; }
.job-apply .disabled-reason { margin: 0 0 8px; }
.job-card.unavailable { background: #fbfcfe; }

/* Calendar and controls open above the shared fixed launchers. */
.resource-controls { --controls-width: var(--sidebar-width); position: fixed; top: auto; right: 24px; bottom: 24px; width: min(var(--controls-width),calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.mobile-sheet-toggle { display: none; }
.sheet-backdrop { display: none; }
.calendar-panel, .life-control-panel { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.calendar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.calendar-top h2 { font-size: 16px; }
.calendar-top .eyebrow { display: none; }
.controls-actions .calendar-launcher { display: flex; }
.controls-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.calendar-day { display: grid; grid-template-rows: 20px 5px; gap: 3px; align-content: center; justify-items: center; min-height: 36px; border-radius: 4px; font-size: var(--secondary); line-height: 20px; font-variant-numeric: tabular-nums; color: #42566e; }
.calendar-number { grid-row: 1; }
.calendar-day.past { color: #758396; background: #f4f6f9; }
.calendar-day.today { background: var(--blue); color: white; font-weight: 700; }
.calendar-day.has-deadline { box-shadow: inset 0 0 0 1px #abc8e8; }
.calendar-day > i { grid-row: 2; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.calendar-day.today > i { background: white; }
.calendar-caption { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: var(--secondary); margin-top: 8px; }
.calendar-key { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--blue); vertical-align: middle; }
.calendar-invite { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--line); }
.calendar-invite p { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 0; font-size: var(--secondary); }
.calendar-invite p span { color: var(--muted); }
.controls-launcher { display: flex; align-items: center; width: 100%; gap: 10px; min-height: 48px; padding: 10px 14px; background: white; border: 1px solid #b8cee5; border-radius: 10px; text-align: left; box-shadow: var(--shadow); }
.controls-launcher:hover { background: var(--pale); }
.launcher-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--blue-deep); background: var(--light); border-radius: 7px; font-size: 22px; flex-shrink: 0; }
.launcher-content { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.launcher-content strong { font-size: var(--text); }
.launcher-content > span { font-size: var(--secondary); color: var(--muted); }
.launcher-arrow { font-size: 22px; color: var(--blue-deep); flex-shrink: 0; }
.life-control-panel .section-top { margin-bottom: 14px; }
.life-control-panel h2 { font-size: 18px; }
.control-resources { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.control-mood { grid-column: 1 / -1; }
.control-resource > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font-size: 14px; }
.control-resources strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.control-resources strong small { color: var(--muted); font-weight: 400; }
.control-resource-track { height: 6px; margin-top: 3px; border-radius: 3px; background: #e7edf5; overflow: hidden; }
.control-resource-track > i { display: block; height: 100%; background: #5a92ce; }
.control-mood .control-resource-track { height: 8px; }
.control-mood .control-resource-track > i { background: #4f9c7b; }
.control-life-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.control-life-actions .button { display: grid; grid-template-rows: 1.5em 1.3125em; align-content: center; justify-items: center; gap: 2px; height: 64px; min-height: 64px; padding: 6px 3px; }
.control-life-actions .disabled-reason { margin-top: 4px; }
.control-life-actions p { font-size: var(--secondary); color: var(--muted); margin-top: 8px; }

/* The same spacing and type scale across applications, training and finance. */
.count { font-size: var(--secondary); color: var(--blue-deep); background: var(--light); border-radius: 5px; padding: 3px 8px; margin-left: 6px; }
.application-list, .offer-list { display: grid; gap: 18px; }
.application-row, .offer-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.application-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pipeline-track { display: flex; align-items: center; gap: 8px; margin: 20px 0; font-size: var(--secondary); color: var(--muted); }
.pipeline-track i { height: 1px; background: var(--line); min-width: 6px; flex: 1; }
.pipeline-track .done { color: var(--blue-deep); }
.application-salary { color: var(--blue-deep); font-size: 20px; margin-bottom: 8px; }
.application-salary span { color: var(--muted); font-size: var(--secondary); }
.application-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--secondary); color: var(--muted); margin-bottom: 18px; }
.application-actions { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.offer-card { background: var(--pale); border-color: #b8cfe9; margin-bottom: 20px; }
.offer-card h3 { margin: 12px 0; }
.offer-details { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.offer-details > strong { color: var(--blue-deep); font-size: 22px; }
.offer-details > span { font-size: var(--secondary); color: var(--muted); }
.personal-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.personal-tabs button { padding: 9px 12px; min-height: 44px; font-size: var(--secondary); background: #f0f4f9; border-radius: 7px; color: var(--muted); }
.personal-tabs button.active { background: var(--light); color: var(--blue-deep); font-weight: 600; }
.history-record { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.history-record:last-child { border-bottom: 0; }
.history-record small { display: block; color: var(--muted); margin-top: 5px; }
.history-record > span { font-size: var(--secondary); color: var(--muted); }
.training-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 20px; }
.training-card { display: flex; flex-direction: column; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.training-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; background: var(--light); border-radius: 9px; font-size: 24px; color: var(--blue-deep); }
.training-card > p { color: var(--muted); margin: 12px 0 20px; }
.training-card > .training-status { min-height: 1.7em; margin: 8px 0 0; }
.training-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; color: var(--muted); margin-top: auto; margin-bottom: 20px; }
.training-stat > strong { color: var(--blue-deep); font-size: 28px; }
.training-role-summary { display: grid; gap: 12px; margin-top: 22px; }
.training-role-summary > div, .training-role-summary > label { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; border: 1px solid var(--line); padding: 16px; border-radius: 8px; font-size: var(--secondary); }
.training-role-summary > label { justify-content: start; cursor: pointer; }
.training-role-summary .disabled-reason { width: 100%; }
.skill-meter { display: inline-block; vertical-align: middle; margin-left: 12px; width: 90px; height: 5px; background: #e6edf5; border-radius: 3px; }
.skill-meter > i { display: block; height: 100%; background: #79a7d7; border-radius: 3px; }
.relation-band { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px; border-radius: 8px; background: #f3f6fb; margin-bottom: 20px; font-size: var(--secondary); }
.relation-band > div { flex: 1; min-width: 120px; }
.relation-band strong, .relation-band span { display: block; }
.relation-band span { color: var(--muted); margin-top: 4px; }
.relation-return { width: 100%; }
.product-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 20px; }
.product-card { display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; padding: 22px; min-width: 0; }
.product-index { color: var(--muted); font-size: var(--secondary); margin-bottom: 10px; }
.product-card > p { color: var(--muted); margin-top: 12px; }
.product-payment { display: flex; align-items: baseline; gap: 10px; margin: 20px 0; }
.product-payment strong { font-size: 30px; color: var(--blue-deep); }
.product-payment > span { color: var(--muted); font-size: var(--secondary); }
.product-card dl { margin: 0 0 18px; }
.product-card dd small { display: block; color: var(--muted); }
.product-relationship { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 20px; font-size: var(--secondary); color: var(--muted); }
.product-card > .button { margin-top: 8px; }
.ledger { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 24px; }
.ledger .section-top > span { color: var(--muted); font-size: var(--secondary); }
.table-scroll { overflow-x: auto; margin: 0 -6px 20px; padding: 0 6px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: var(--secondary); }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); background: var(--pale); font-weight: 600; }
td { white-space: nowrap; }
td small { display: block; color: var(--muted); margin-top: 5px; }
.priority-control { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 16px; }
.priority-control label { font-size: var(--secondary); }
.forecast { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; font-size: var(--secondary); }
.forecast > strong { width: 100%; }
.forecast > div { background: var(--pale); padding: 10px 14px; border-radius: 7px; }
.forecast span, .forecast b { display: block; }
.forecast span { color: var(--muted); }
dl { margin: 12px 0; font-size: var(--secondary); }
dl > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f6; }
dt { color: var(--muted); }
dd { text-align: right; margin: 0; overflow-wrap: anywhere; }
.empty-state { display: flex; align-items: start; flex-wrap: wrap; gap: 16px; padding: 28px 0; }
.empty-state p { color: var(--muted); margin-top: 7px; }
.empty-icon { color: var(--blue); font-size: 28px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.log-date { color: var(--blue-deep); font-size: var(--secondary); font-variant-numeric: tabular-nums; }
.timeline summary { cursor: pointer; color: var(--blue-deep); padding: 10px 0; font-size: var(--secondary); }
.report-messages { font-size: var(--secondary); padding-left: 20px; margin-bottom: 0; }
.report-messages li { margin-top: 8px; }

/* Setup, endings and dialogs share the same font scale. */
.setup-page { max-width: 1220px; margin: 0 auto; padding: 48px 32px; display: grid; grid-template-columns: minmax(260px,.8fr) minmax(0,1.2fr); gap: 64px; align-items: start; }
.setup-intro { padding: 30px 0; position: relative; }
.setup-intro h1 { font-size: clamp(36px,4vw,52px); line-height: 1.45; margin: 20px 0; }
.highlight { color: var(--blue-deep); }
.title-period { margin-left: 10px; color: #92b4d8; }
.intro-note { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.intro-note > span { color: var(--blue-deep); font-size: var(--secondary); }
.intro-note p { margin-top: 12px; color: var(--muted); }
.setup-stamp { display: inline-block; margin-top: 28px; transform: rotate(-9deg); border: 2px solid #9db8d5; border-radius: 8px; color: #5b7ea2; padding: 10px 16px; font-size: 22px; }
.setup-form { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.allocation-left { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: var(--secondary); }
.allocation-left strong { color: var(--blue-deep); font-size: 28px; }
.allocation-left.zero strong { color: #327558; }
.role-allocation { display: grid; gap: 16px; margin-top: 24px; }
.allocation-row { border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.allocation-row.selected { border-color: #8eb4df; background: #f7faff; }
.allocation-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.role-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 44px; text-align: left; padding: 0; background: transparent; }
.role-choice strong { font-size: 17px; }
.role-choice .subtle { font-size: var(--secondary); }
.role-index { color: var(--muted); font-size: var(--secondary); }
.skill-total { font-size: 23px; color: var(--blue-deep); white-space: nowrap; }
.skill-total small { display: block; text-align: right; color: var(--muted); font-weight: 400; }
.allocation-row > p { font-size: var(--secondary); color: var(--muted); margin: 10px 0; }
.role-facts { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: var(--secondary); color: var(--muted); }
.allocation-control { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.allocation-control button { width: 44px; height: 44px; border: 1px solid #bacce0; border-radius: 7px; background: white; color: var(--blue-deep); font-size: 22px; }
.allocation-control output { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; font-size: 18px; }
.setup-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.ending-page { max-width: 1000px; padding: 40px 24px; margin: 0 auto; }
.ending { position: relative; padding: 32px; border: 1px solid var(--line); background: white; border-radius: var(--radius); margin-bottom: 24px; }
.ending-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.ending h1 { margin-bottom: 18px; }
.ending-stamp { display: inline-block; border: 2px solid #8dadce; color: #527da8; padding: 8px 16px; border-radius: 8px; transform: rotate(-6deg); margin-top: 22px; }
.accepted-job { background: var(--pale); border-radius: 10px; padding: 24px; margin-top: 24px; }
.accepted-job h2 { margin: 8px 0; }
.accepted-job > strong { color: var(--blue-deep); font-size: 24px; }
.ending-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 28px; }
.ending-metrics span { display: block; color: var(--muted); font-size: var(--secondary); }
.ending-metrics strong { font-size: 28px; }
.ending-details { margin: 28px 0; }
.ending-details summary { cursor: pointer; color: var(--blue-deep); padding: 12px 0; }
.footer { max-width: var(--page-width); display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 12px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--secondary); }
.footer-home-link { grid-column: 2; justify-self: center; color: inherit; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: min(600px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); color: var(--ink); box-shadow: 0 20px 70px #142b4a35; overscroll-behavior: contain; }
dialog::backdrop { background: #1b2d4760; }
dialog h2 { margin-bottom: 20px; }
.dialog-body { line-height: 1.8; }
.dialog-body p + p { margin-top: 16px; }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.dialog-actions .button { min-width: 100px; }
.amount-input { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.field-label { display: block; color: var(--muted); margin: 16px 0 8px; }
.toast { position: fixed; top: calc(20px + env(safe-area-inset-top)); bottom: auto; left: 50%; transform: translateX(-50%); z-index: 80; max-width: min(480px,calc(100vw - 48px)); border: 1px solid #bfd2e8; border-radius: 10px; padding: 16px 20px; background: #f5f9ff; color: var(--ink); box-shadow: var(--shadow); font-size: var(--secondary); }
.toast.error { border-color: #d6a4a4; background: #fff4f3; color: #8b3636; }

/* V0.4: state, growth, mail and the deliberately separate credit storefront. */
.game-shell { min-height: 100vh; background: var(--bg); }
.mood-metrics { grid-template-columns: 1.25fr 1fr 1fr; }
.mood-metric > strong { color: var(--blue-deep); }
.mood-meter { height: 7px; max-width: 160px; margin-top: 14px; background: #e5ebf3; border-radius: 4px; overflow: hidden; }
.mood-meter i { display: block; height: 100%; background: var(--blue); }
.mood-narrative { margin: -4px 0 18px; color: var(--muted); font-size: var(--secondary); }
.role-strip .role-pill { display: flex; flex: 1; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.role-strip .role-pill > span:first-child { width: 100%; color: var(--ink); font-weight: 600; }
.role-strip .role-pill strong { margin-left: 4px; }
.resource-controls .control-resources { grid-template-columns: repeat(2,minmax(0,1fr)); }
.control-mood strong { color: var(--blue-deep); }
.calendar-day { background: transparent; padding: 0; }
.calendar-day:hover { background: var(--light); }
.calendar-day.selected { outline: 1px solid var(--blue); outline-offset: -1px; }
.calendar-day.today:hover { background: var(--blue-deep); }
.calendar-invite > strong { color: var(--muted); }
.growth-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 14px; margin-top: 24px; }
.growth-card { padding: 18px; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.growth-values { display: grid; gap: 8px; margin: 14px 0; }
.growth-values > span { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.growth-values strong { color: var(--blue-deep); font-size: 24px; }
.growth-card summary { color: var(--blue-deep); font-size: var(--secondary); min-height: 44px; padding: 8px 0; cursor: pointer; }
.ability-sources { margin-bottom: 18px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.ability-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.ability-role { min-width: 0; }
.ability-role-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.control-role-next { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #6eafea; font-size: 24px; }
.control-role-next:hover { background: transparent; color: #347fbe; }
.control-role-next:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ability-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 28px; align-items: center; gap: 5px; font-size: 14px; line-height: 1.6; }
.ability-row > b { text-align: right; font-weight: 500; }
.ability-track { display: flex; height: 6px; overflow: hidden; border-radius: 3px; background: #edf0f5; }
.ability-track i { display: block; flex-shrink: 0; height: 100%; }
.ability-base { background: #4b956c; }
.ability-today { background: #4384c9; }
.ability-loan { background: #986bc4; }
.ability-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 14px; margin-top: 8px; }
.ability-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 2px; }
.ability-sources.compact { padding: 0; border: 0; margin: 0 0 10px; }
.compact .ability-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
.compact .ability-role-heading { margin-bottom: 3px; }
.compact .ability-row { grid-template-columns: 28px minmax(0,1fr) 22px; gap: 3px; }
.compact .ability-legend { gap: 4px 9px; margin-top: 5px; }
.mail-launcher { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue-deep); background: white; }
.mail-icon { display: block; width: 24px; height: 24px; }
.unread-dot { position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; background: #bf4848; border-radius: 50%; }
.mail-notice { position: fixed; left: 24px; bottom: 24px; z-index: 60; width: min(360px,calc(100% - 48px)); padding: 16px 18px 18px; background: white; border: 1px solid #bcd0e7; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; pointer-events: none; }
.mail-notice > strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.mail-notice > p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.mail-notice-progress { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #4b85c8; transform-origin: left; animation: mail-countdown var(--notice-time) linear forwards; }
@keyframes mail-countdown { from { transform: scaleX(var(--notice-fraction)); } to { transform: scaleX(0); } }
.mail-notice-sender { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.mail-dialog { width: min(1120px,calc(100vw - 32px)); height: min(740px,calc(100dvh - 40px)); max-width: none; max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; }
.mailbox { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; }
.mailbox-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.mailbox-top h2 { margin: 0; }
.mail-columns { display: grid; grid-template-columns: minmax(230px,32%) minmax(0,1fr); min-height: 0; }
.mail-list-panel { min-width: 0; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--line); background: var(--pale); }
.mail-list { display: grid; gap: 0; }
.mail-row { display: flex; flex-direction: column; gap: 5px; width: 100%; min-width: 0; padding: 16px; border-bottom: 1px solid var(--line); text-align: left; background: transparent; }
.mail-row:hover { background: #edf3fb; }
.mail-row.selected { background: #e7f0fc; box-shadow: inset 3px 0 var(--blue); }
.mail-row-sender { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; color: var(--muted); font-size: 14px; }
.mail-row-sender > span:not(.sender-avatar) { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-row-title, .mail-row-summary { display: block; width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-row-title { font-size: 16px; font-weight: 600; }
.mail-row-summary { color: var(--muted); font-size: 14px; }
.mail-row-dot { width: 7px; height: 7px; background: #bf4848; border-radius: 50%; flex-shrink: 0; }
.sender-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; padding: 4px; border: 1px solid #d0deed; border-radius: 7px; background: #edf4fc; color: var(--blue-deep); }
.sender-avatar .mail-icon { width: 100%; height: 100%; }
.sender-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: white; }
.mail-detail { min-width: 0; padding: 28px 32px; overflow-y: auto; overscroll-behavior: contain; }
.mail-sender { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.mail-sender .sender-avatar { width: 42px; height: 42px; padding: 8px; }
.mail-sender > div { min-width: 0; overflow-wrap: anywhere; }
.mail-sender p { margin-top: 2px; font-size: 14px; color: var(--muted); }
.mail-body > h3 { margin: 0 0 20px; overflow-wrap: anywhere; }
.mail-body .notice { margin-top: 20px; }
.mail-body .button-row > .button { max-width: 100%; }
.mail-placeholder { display: grid; place-content: center; justify-items: center; gap: 20px; height: 100%; min-height: 160px; color: #7b9bbd; }
.mail-placeholder-icon { width: min(140px,70%); height: auto; stroke-width: 1; }
.mail-placeholder p, .mail-list-empty { font-size: 14px; color: var(--muted); }
.mail-list-empty { padding: 20px 16px; }
.story-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.story-image { display: block; width: 100%; max-height: 280px; object-fit: contain; margin: 14px 0; border-radius: 8px; background: var(--pale); }
.ending-details > p { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dream-finance { --blue: #614747; --blue-deep: #543231; --light: #f2e8df; --line: #d8c9bc; --muted: #68574f; --pale: #faf4ec; background: #f7f1e8; border-color: #cfbaaa; }
.dream-finance > .section-top { border-bottom: 2px solid #9d7464; padding-bottom: 20px; }
.dream-finance h2 { font-family: Georgia,"Microsoft YaHei",serif; font-size: 26px; }
.dream-finance .product-card { background: #fffaf4; border-top: 4px solid #8c6254; }
.dream-finance .product-index { letter-spacing: 1px; }
.dream-finance .product-card > .button { background: #614747; color: #fffaf4; border-color: #614747; }
.dream-finance .product-card > .button:disabled { background: #e7dfd7; color: #675d54; }
.dream-finance .field-label { margin-top: 12px; }
.reduced-stimulus { --bg: #f3f6fa; --blue: #3975b8; --blue-deep: #245f9f; --light: #eaf3ff; --line: #dae3ed; }

@media (max-width: 1180px) and (min-width: 901px) {
  :root { --sidebar-width: 288px; --page-padding: 20px; --gap: 20px; }
  .masthead { gap: 16px; }
  .top-nav button { padding: 0 10px; }
  .job-list, .training-grid, .product-list { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 0; }
  .metric:nth-child(2) { border: 0; }
  .mood-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; }
  .mood-metrics .metric:nth-child(2) { border-right: 1px solid var(--line); }
  .growth-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html:has(.resource-controls:is(.is-open,.is-calendar-open,.is-sheet-dragging)),
  body:has(.resource-controls:is(.is-open,.is-calendar-open,.is-sheet-dragging)) { overflow: hidden; overscroll-behavior: none; }
  .sheet-backdrop { display: block; position: fixed; inset: 0 0 calc(76px + env(safe-area-inset-bottom)); z-index: 39; background: #152a4026; touch-action: none; }
  :root { --page-padding: 20px; }
  .masthead { min-height: 76px; padding-top: env(safe-area-inset-top); gap: 16px; }
  .masthead-message { display: none; }
  .masthead { padding-right: 76px; }
  .mail-launcher { position: fixed; right: 16px; top: calc(16px + env(safe-area-inset-top)); z-index: 55; }
  .mail-notice { left: 16px; right: 16px; bottom: auto; top: calc(84px + env(safe-area-inset-top)); width: auto; }
  .mood-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; }
  .mood-metrics .metric { padding: 0 10px; }
  .mood-metrics .metric > strong { font-size: 22px; }
  .mood-metrics .metric strong small { margin-left: 0; }
  .mood-metrics .metric:nth-child(2) { border-right: 1px solid var(--line); }
  .growth-grid { grid-template-columns: 1fr; }
  .role-strip .role-pill { min-width: 0; gap: 4px 8px; padding: 8px; }
  .job-card { display: flex; flex-direction: column; gap: 12px; }
  .job-card-top { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; }
  .job-card-top h3 { overflow-wrap: anywhere; }
  .job-card > .salary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; align-self: stretch; margin: 0; text-align: left; }
  .job-card > .salary span { white-space: nowrap; }
  .job-tags { gap: 4px 12px; }
  .job-tags > span { max-width: 100%; overflow-wrap: anywhere; }
  .job-apply { align-self: stretch; margin-top: 0; }
  .job-apply .button { min-height: 48px; }
  .allocation-heading { flex-wrap: wrap; }
  .dream-finance h2 { font-size: 24px; }
  .top-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(76px + env(safe-area-inset-bottom)); padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; background: #fffffffa; border-top: 1px solid var(--line); box-shadow: 0 -3px 20px #243e5908; z-index: 35; }
  .top-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--secondary); padding: 6px 0; border-radius: 8px; }
  .top-nav button.active { background: var(--light); }
  .top-nav button.active::after { display: none; }
  .nav-icon { display: block; width: 23px; height: 23px; }
  .dashboard { display: block; padding-top: 22px; padding-bottom: 160px; }
  .day-heading h1 { font-size: 24px; }
  .resource-controls, .resource-controls.is-open { position: fixed; top: auto; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); width: min(var(--controls-width),calc(100% - 32px)); padding: 0; gap: 8px; z-index: 40; }
  .calendar-panel, .life-control-panel { padding: 14px; box-shadow: var(--shadow); }
  .calendar-top { gap: 6px; margin-bottom: 10px; }
  .calendar-top h2 { font-size: 16px; }
  .calendar-top .tag { margin-left: auto; }
  .resource-controls .calendar-panel[hidden] { display: none; }
  .resource-controls.is-calendar-open .calendar-panel { display: block; }
  .controls-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .controls-actions .controls-launcher { padding: 10px 12px; gap: 6px; }
  .controls-actions .launcher-icon { display: none; }
  .controls-actions .launcher-content > span { font-size: 14px; }
  .controls-actions .launcher-content > span { white-space: nowrap; }
  .controls-actions #controls-toggle .launcher-content > span { white-space: normal; }
  .controls-actions .calendar-launcher { display: flex; }
  .life-control-panel .section-top { margin-bottom: 8px; }
  .control-resources { gap: 8px 16px; padding-bottom: 10px; margin-bottom: 10px; }
  .control-resources strong { font-size: 20px; }
  .control-life-actions .button { padding: 6px; }
  .control-life-actions p { margin-top: 4px; }
  .life-control-panel .fine-print { margin-top: 8px; }
  .footer { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
  body:has(.resource-controls) .footer { padding-bottom: calc(320px + env(safe-area-inset-bottom)); }
  .setup-page { grid-template-columns: 1fr; max-width: 700px; padding: 28px 20px; gap: 28px; }
  .setup-intro { padding: 0; }
  .setup-intro h1 { font-size: 38px; margin: 14px 0; }
  .setup-stamp { display: none; }
  .intro-note { margin-top: 20px; padding-top: 18px; }
  .ending-page { padding-bottom: 160px; }
  .toast { top: calc(16px + env(safe-area-inset-top)); bottom: auto; left: 50%; right: auto; width: calc(100vw - 32px); max-width: 480px; z-index: 60; }
}
@media (max-width: 600px) {
  :root { --page-padding: 16px; }
  .brand { font-size: 20px; }
  .brand-mark { width: 36px; height: 40px; font-size: 24px; }
  .brand-sub { font-size: 14px; }
  .utility-menu > summary { font-size: 14px; }
  .day-heading { gap: 12px; margin-bottom: 20px; }
  .day-heading .eyebrow { display: none; }
  .day-heading h1 { font-size: 22px; }
  .day-counter { gap: 5px; }
  .day-counter > span { display: none; }
  .day-counter strong { font-size: 30px; }
  .metrics { display: grid; }
  .mood-metrics .metric > strong { font-size: 20px; white-space: normal; }
  .mood-metrics .metric > strong small { display: block; }
  .controls-launcher { min-height: 48px; padding: 10px 14px; }
  .launcher-content { line-height: 1.4; }
  .metric { padding: 0 16px; }
  .metric:nth-child(2) { border: 0; }
  .metric > strong { font-size: 24px; }
  .role-strip { gap: 8px; }
  .strip-label { width: 100%; }
  .role-pill { flex: 1; padding: 7px 6px; }
  .resume-value { width: 100%; margin-left: 0; }
  .section { padding: 20px 16px; }
  .section-top { align-items: start; margin-bottom: 16px; }
  h2 { font-size: 20px; }
  .job-list, .training-grid, .product-list { grid-template-columns: 1fr; }
  .job-card, .application-row, .product-card, .training-card { padding: 18px; }
  .job-card-top { gap: 10px; }
  .company-logo { width: 38px; height: 40px; font-size: 18px; }
  .job-card-top > .tag { padding: 3px 7px; }
  .salary { font-size: 24px; }
  .filter-label { width: 100%; min-width: 0; }
  .filter-row { gap: 4px 6px; }
  .filter-button { padding: 8px 10px; }
  .pipeline-track { gap: 5px; }
  .pipeline-track i { min-width: 3px; }
  .application-actions > div { width: 100%; }
  .application-actions > div .button { width: 100%; }
  .priority-control { grid-template-columns: 1fr; gap: 8px; }
  .relation-band > b { display: none; }
  .relation-band > div { flex-basis: 100%; }
  .timeline > li { grid-template-columns: 1fr; gap: 8px; }
  .setup-form { padding: 20px 16px; }
  .allocation-row { padding: 16px; }
  .role-choice .tag { display: none; }
  .role-choice .subtle { width: 100%; }
  .setup-bottom .button { width: 100%; }
  .ending { padding: 24px 18px; }
  .ending-metrics { gap: 18px 12px; }
  .ending-metrics strong { font-size: 24px; }
  dialog { padding: 24px 18px; }
  .dialog-actions .button { flex: 1; }
  .training-role-summary > label .subtle { width: 100%; padding-left: 28px; }
}
@media (max-width: 600px) {
  dialog.mail-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 10px; padding: 0; }
  .mailbox-top { padding: 8px 12px; gap: 8px; }
  .mailbox-top h2 { font-size: 19px; }
  .mail-columns { grid-template-columns: minmax(112px,38%) minmax(0,1fr); }
  .mail-row { padding: 12px 9px; gap: 4px; }
  .mail-row-sender { gap: 5px; }
  .mail-row-sender .sender-avatar { width: 23px; height: 23px; padding: 3px; }
  .mail-row-title { font-size: 14px; }
  .mail-detail { padding: 18px 12px; }
  .mail-sender { gap: 8px; margin-bottom: 18px; align-items: flex-start; }
  .mail-sender .sender-avatar { width: 30px; height: 30px; padding: 5px; }
  .mail-sender strong { font-size: 14px; }
  .mail-body > h3 { font-size: 18px; }
  .mail-body .button-row { gap: 8px; }
  .mail-body .button { font-size: 14px; padding: 10px 12px; }
  .mail-placeholder { gap: 14px; }
  .mail-placeholder-icon { width: min(110px,80%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Shared non-financial interaction panels. */
.resource-controls > [hidden] { display: none !important; }
.resource-controls .calendar-panel, .resource-controls .life-control-panel { max-height: calc(100dvh - 200px); overflow: auto; overscroll-behavior: contain; box-shadow: var(--shadow); }
.resource-controls .control-resources { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 10px; padding-bottom: 14px; margin-bottom: 14px; }
.control-resource > div:first-child > span, .control-resource strong { white-space: nowrap; }
.control-resource > div:first-child { gap: 8px; }
.control-resource strong small { display: inline; font-size: 13px; }
.control-ability-pair { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.control-ability-pair .ability-row { grid-template-columns: 1fr auto; gap: 2px 6px; }
.control-ability-pair .ability-track { grid-column: 1 / -1; grid-row: 2; height: 7px; }
.control-ability-pair .ability-row > b { grid-column: 2; grid-row: 1; }
.control-ability-pair .ability-row > span { white-space: nowrap; }
.persistent-day { display: grid; gap: 8px; padding: 10px 12px; border-radius: 8px; background: #f7faff; border: 1px solid var(--line); color: var(--blue-deep); font-size: 14px; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.persistent-day-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.persistent-day-meta > strong { white-space: nowrap; }
.persistent-day-meta > span { color: var(--muted); font-size: 12px; text-align: right; }
.persistent-day .button { min-height: 40px; padding: 7px 12px; }
.personal-tabs > button { display: inline-flex; align-items: center; gap: 8px; }
.personal-tabs > button > span { font-size: 12px; opacity: .7; }
dialog.review-dialog { padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
.review-card { border: 0; border-radius: 0; overflow: hidden; touch-action: pan-y; background: white; }
.review-media { position: relative; }
.review-media > .story-image { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; margin: 0; border: 0; border-radius: 0; background: var(--light); }
.review-card-copy { padding: 18px; }
.review-card-copy h3 { margin-bottom: 10px; }
.review-card-copy ul { padding-left: 20px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.review-changes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.review-changes > span { background: var(--light); color: var(--blue-deep); padding: 4px 9px; border-radius: 5px; font-size: 14px; }
.review-navigation { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.review-navigation > button { width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--blue-deep); font-size: 26px; pointer-events: auto; }
.review-navigation > button:disabled { visibility: hidden; }
.daily-review .dialog-actions { margin-top: 16px; padding-top: 0; border: 0; }
.daily-review .dialog-actions > .button { width: 100%; }
@media (max-width: 900px) {
  .resource-controls, .resource-controls.is-open {
    left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto;
    max-height: calc(100dvh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    gap: 12px; padding: 0 16px 12px; background: var(--paper); color: var(--ink);
    border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 24px #243e5920;
  }
  .mobile-sheet-toggle { display: grid; justify-items: center; gap: 8px; order: 0; flex-shrink: 0; width: 100%; min-height: 56px; padding: 8px 0 0; background: transparent; color: var(--blue-deep); text-align: left; }
  .mobile-sheet-toggle { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
  .resource-controls.is-sheet-dragging { overflow: hidden; }
  .is-sheet-dragging .mobile-sheet-toggle { cursor: grabbing; }
  .sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .45; }
  .mobile-sheet-toggle .persistent-day-meta { width: 100%; font-size: 14px; }
  .resource-controls .controls-actions { order: 1; flex-shrink: 0; gap: 4px; padding: 4px; border-radius: 10px; background: var(--pale); }
  .resource-controls .controls-actions .controls-launcher { justify-content: center; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); box-shadow: none; text-align: center; }
  .resource-controls .controls-actions .controls-launcher[aria-expanded="true"] { background: var(--light); color: var(--blue-deep); }
  .resource-controls > section:is(.calendar-panel,.life-control-panel,.persistent-day) { min-height: 0; max-height: none; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  .resource-controls .calendar-panel, .resource-controls .life-control-panel { order: 2; flex: 1 1 auto; }
  .resource-controls .persistent-day { order: 3; flex-shrink: 0; }
  .resource-controls .persistent-day .button { min-height: 44px; }
  .control-resources strong { font-size: 18px; }
  .review-card-copy { padding: 14px; }
}
