:root {
  color-scheme: light;
  --ledger-header-top: calc(var(--masthead-height, 0px) + var(--ledger-filters-height, 0px));
  scroll-padding-block-start: calc(var(--ledger-header-top) + 8px);
  --ink: #172b42;
  --muted: #4d6178;
  --line: #d8e2ed;
  --control-line: #bacbdd;
  --canvas: #f1f5fa;
  --surface-tint: #f5f8fc;
  --hover: #edf4fb;
  --panel-radius: 12px;
  --white: #fff;
  --primary: #21568d;
  --primary-dark: #193e67;
  --soft: #e5effa;
  --focus: #2e6ca9;
  --masthead: #102a49;
  --masthead-rail: #173657;
  --masthead-hover: #214670;
  --masthead-text: #e4edf8;
  --masthead-mark: #b4d7fa;
  --shell-gutter: clamp(14px, 4vw, 52px);
  --danger: #a7272e;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.52;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { color: var(--primary-dark); background: #cce0f5; }
input, textarea { caret-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
button, .button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 39px; padding: 7px 13px; border: 1px solid var(--control-line); border-radius: 7px;
  background: var(--white); color: var(--ink); cursor: pointer; white-space: nowrap;
}
button:hover, .button:hover { background: var(--hover); text-decoration: none; }
.primary, .primary:hover { color: white; border-color: var(--primary); background: var(--primary); }
.primary:hover { background: var(--primary-dark); }
.danger { color: var(--danger); }
button:disabled, input:disabled, select:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-shell, main { max-width: 1490px; margin-inline: auto; padding-inline: var(--shell-gutter); }
.masthead {
  position: sticky; top: 0; z-index: 5;
  background: var(--masthead); color: var(--white);
}
.masthead-identity { display: flex; align-items: center; justify-content: center; min-height: 83px; }
.brand {
  --symbol-size: 44px;
  display: inline-grid; grid-template-columns: var(--symbol-size) minmax(0, auto) var(--symbol-size);
  align-items: center; column-gap: 14px; min-width: 0; text-align: center;
  color: var(--white); font-size: 2.125rem; font-weight: 700; line-height: 1.3; letter-spacing: .01em;
}
.brand:hover { color: var(--masthead-text); text-decoration: none; }
.brand-symbol {
  display: grid; place-items: center; width: var(--symbol-size); height: var(--symbol-size);
  border: 1px solid #547397; border-radius: 8px; color: var(--masthead-mark);
}
.brand svg { width: 26px; height: 26px; }
.nav-rail { background: var(--masthead-rail); border-top: 1px solid #315273; }
.masthead nav { display: flex; justify-content: safe center; gap: 8px; min-width: 0; overflow-x: auto; }
.masthead nav a {
  padding: 10px 20px 9px; white-space: nowrap; color: var(--masthead-text); font-size: 1rem;
  border-bottom: 3px solid transparent;
}
.masthead nav a:hover { color: var(--white); background: var(--masthead-hover); text-decoration: none; }
.masthead nav a[aria-current="page"] {
  color: var(--masthead); border-color: #6d9fda; background: var(--soft); font-weight: 700;
}
.masthead a:focus-visible { outline-offset: -3px; outline-color: #a5d0fa; }
.masthead nav a[aria-current="page"]:focus-visible { outline-color: var(--primary); }
main { padding-block: 27px 44px; }
.page-heading, .section-heading, .dialog-head, .dialog-actions, .utilities {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.page-heading { margin-bottom: 20px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.page-heading .button, .page-heading button { min-height: 42px; }
.add-icon { position: relative; width: 14px; height: 14px; flex: 0 0 14px; }
.add-icon::before, .add-icon::after { content: ''; position: absolute; inset: 6px 1px; border-radius: 2px; background: currentColor; }
.add-icon::after { transform: rotate(90deg); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 2.125rem; line-height: 1.25; letter-spacing: -.025em; color: var(--masthead); }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.muted, small, .subtle { color: var(--muted); }
.stack { display: grid; gap: 13px; }
.metrics {
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0;
  margin: 0 0 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--panel-radius);
}
.metric {
  display: flex; text-align: left; justify-content: space-between; align-items: center;
  gap: 4px 10px; padding: 10px 18px; min-width: 0; border: 0; border-radius: 0;
}
.metric + .metric { border-left: 1px solid var(--line); }
.metric:first-child { border-radius: 11px 0 0 11px; }
.metric:last-child { border-radius: 0 11px 11px 0; }
.metric span { font-size: 13px; color: var(--muted); }
.metric strong { font-size: 1.75rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.metric[aria-pressed="true"] { background: var(--soft); color: var(--primary-dark); }
.metric[aria-pressed="true"] span { color: var(--primary-dark); font-weight: 650; }
.metric[data-status="OVERDUE"][data-has-items="true"] strong { color: var(--danger); }
.metric:focus-visible { outline-offset: -3px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--panel-radius); overflow: hidden; }
.ledger-panel { display: grid; gap: 14px; min-width: 0; }
.filters {
  display: flex; align-items: end; gap: 9px; flex-wrap: wrap; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.filters > label, .field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.filters > label:first-child { flex: 1 1 200px; }
.ledger-filters {
  position: sticky; top: var(--masthead-height, 0px); z-index: 4;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--white); border: 1px solid var(--line); border-radius: var(--panel-radius);
}
@media (max-height: 480px) {
  .ledger-filters {
    max-block-size: max(88px, calc(100dvh - var(--masthead-height, 0px) - 96px));
    overflow-y: auto;
  }
}
.ledger-filters > .date-range-field, .filter-actions { grid-column: span 2; }
.filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.filter-actions button { font-size: 13px; }
.ledger-filters > label, .ledger-filters > .date-range-field { font-weight: 600; }
.ledger-filters input, .ledger-filters select, .ledger-filters .date-range-toggle { font-weight: 450; }
.ledger-results, .batch-results { min-width: 0; }
@media (min-width: 1100px) {
  .ledger-filters {
    grid-template-columns: minmax(144px, 1.3fr) minmax(141px, 1.1fr) minmax(104px, .72fr)
      minmax(104px, .72fr) minmax(227px, 1.2fr) auto;
  }
  .ledger-filters > .date-range-field, .filter-actions { grid-column: auto; }
}
input:not([type="checkbox"]), select, textarea {
  padding: 8px 10px; background: white; border: 1px solid var(--control-line); min-height: 39px;
  border-radius: 6px; width: 100%; min-width: 0; color: var(--ink);
}
input[type="file"] { padding: 5px; }
input::file-selector-button { border: 0; border-radius: 4px; padding: 4px 8px; background: var(--soft); color: var(--primary-dark); font: inherit; }
textarea { resize: vertical; min-height: 75px; }
.table-scroll { overflow: auto; scrollbar-color: #a3b6cd var(--surface-tint); }
.table-scroll:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
th, td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid #e4ebf3; overflow-wrap: anywhere; }
th { background: var(--surface-tint); color: var(--muted); font-size: .8125rem; font-weight: 650; white-space: nowrap; }
tbody tr:hover { background: var(--surface-tint); }
.data-table { min-width: 840px; }
.mobile-cell-label, .mobile-table-header { display: none; }
@media (min-width: 761px) {
  .ledger-results, .batch-list .batch, .ledger-panel .table-scroll { overflow: visible; }
  .ledger-panel .data-table { min-width: 0; border-collapse: separate; border-spacing: 0; }
  .ledger-panel thead {
    position: sticky; top: var(--ledger-header-top); z-index: 3;
  }
  .ledger-panel th { white-space: normal; }
  .ledger-results > .ledger-table:first-child th:first-child { border-top-left-radius: calc(var(--panel-radius) - 1px); }
  .ledger-results > .ledger-table:first-child th:last-child { border-top-right-radius: calc(var(--panel-radius) - 1px); }
}
.cell-content { min-width: 0; }
.cell-description .cell-content { font-weight: 550; }
.batch-table { table-layout: fixed; min-width: 720px; }
.batch-table th:nth-child(1) { width: 13%; }
.batch-table th:nth-child(2) { width: 28%; }
.batch-table th:nth-child(3) { width: 12%; }
.batch-table th:nth-child(4) { width: 15%; }
.batch-table th:nth-child(5), .batch-table th:nth-child(7) { width: 10%; }
.batch-table th:nth-child(6) { width: 12%; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.wide { min-width: 180px; max-width: 400px; }
.short-text { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.actions button, .actions .button { min-height: 31px; padding: 4px 9px; font-size: 13px; }
.link-button { display: inline; padding: 0; border: 0; min-height: 0; color: var(--primary); background: none; text-align: left; white-space: normal; }
.link-button:hover { background: none; text-decoration: underline; text-underline-offset: .2em; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 1px 1px 9px; }
.results-heading h2, .ledger-heading { font-size: 1rem; }
.results-heading small, .batch-count { font-size: .8125rem; font-variant-numeric: tabular-nums; }
.batch-list { display: grid; gap: 12px; }
.batch { border: 1px solid var(--line); border-radius: var(--panel-radius); overflow: hidden; background: var(--white); }
.batch-head {
  padding: 13px 15px; display: flex; flex-wrap: wrap; gap: 9px 18px;
  align-items: center; justify-content: space-between; background: var(--surface-tint);
}
.batch-title { min-width: 0; overflow-wrap: anywhere; }
.batch-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.batch-title h3 { font-size: 1rem; line-height: 1.35; }
.batch-title p { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.batch-title p span:first-child { font-weight: 660; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.batch-tools { display: flex; align-items: center; gap: 8px 13px; flex-wrap: wrap; }
.batch-count { color: var(--muted); white-space: nowrap; }
.batch-actions, .report-actions { gap: 6px; }
.report-actions .button, .report-actions button { color: var(--primary); border-color: transparent; background: transparent; }
.report-actions .button:hover { background: var(--soft); }
.report-actions button:disabled { color: var(--muted); opacity: .7; }
.batch-head + .table-scroll { border-top: 1px solid var(--line); }
.batch table th { background: var(--white); }
.status { display: inline-block; white-space: nowrap; border-radius: 5px; padding: 2px 7px; font-size: 12px; background: #eef2f3; color: #4d6268; }
.status.PENDING_RECTIFICATION, .status.RECTIFYING { background: #e8f0fc; color: #235589; }
.status.PENDING_ACCEPTANCE { background: #fff1d6; color: #795000; }
.status.CLOSED { background: #dff2e9; color: #156147; }
.status.OVERDUE, .status.MAJOR { background: #fae8e8; color: #932c35; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 42px 18px; }
.empty-state p { color: var(--ink); font-weight: 650; }
.empty-state small { font-size: .8125rem; }
.empty-state button { margin-top: 6px; }
.batch-results > .empty-state { background: var(--white); border: 1px solid var(--line); border-radius: var(--panel-radius); }
.pagination { display: flex; gap: 9px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); padding: 10px 15px; }
.pagination button { min-height: 32px; padding: 4px 9px; }
.batch-results .pagination { margin-top: 10px; }
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.settings section { padding: 16px; }
.clean-list { list-style: none; padding: 0; margin: 7px 0 0; }
.clean-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
dialog {
  width: min(840px, calc(100% - 24px)); max-height: min(92vh, 930px); padding: 0;
  border: 1px solid var(--control-line); border-radius: 11px; color: var(--ink); box-shadow: 0 15px 70px #142d4b40;
}
dialog::backdrop { background: #142d4b99; }
.dialog-head { position: sticky; top: 0; z-index: 1; background: white; padding: 14px 19px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 16px 19px; }
.dialog-actions { justify-content: flex-end; position: sticky; bottom: 0; background: white; padding: 12px 19px; border-top: 1px solid var(--line); z-index: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 15px; }
.full { grid-column: 1 / -1; }
fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
legend { color: var(--primary-dark); font-weight: 650; }
.editor-row { display: grid; gap: 8px; }
.editor-row > .actions { justify-content: flex-end; }
.check-row { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.check-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.error { color: var(--danger); background: #fff2f2; border-radius: 6px; padding: 10px; }
.notice { position: fixed; right: 17px; bottom: 17px; max-width: calc(100% - 34px); z-index: 9; background: var(--primary-dark); color: white; padding: 10px 15px; border-radius: 7px; }
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px 16px; margin: 0; }
.detail-summary { padding: 10px 12px; background: var(--surface-tint); border-radius: 7px; overflow-wrap: anywhere; }
.detail-summary span, .details dt { color: var(--muted); font-size: 12px; }
.detail-summary p { margin: 3px 0 0; font-weight: 560; white-space: pre-wrap; }
.details dd { margin: 3px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.record { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; overflow-wrap: anywhere; }
.file-list { display: flex; flex-wrap: wrap; gap: 9px; }
.file-list a { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.file-list img { width: 38px; height: 38px; border-radius: 4px; object-fit: cover; }
.timeline { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 13px; }
.timeline p { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (min-width: 761px) and (max-width: 1000px) {
  .ledger-panel th, .ledger-panel td { padding-inline: 9px; }
  .ledger-panel .code, .ledger-panel .status { white-space: normal; }
  .ledger-panel .wide { min-width: 0; }
  .batch-table th:nth-child(1) { width: 15%; }
  .batch-table th:nth-child(2) { width: 25%; }
  .batch-table th:nth-child(6) { width: 13%; }
  .batch-table .code { font-size: .8125rem; }
}
@media (max-width: 760px) {
  .ledger-results, .batch-list .batch { overflow: clip; }
  .ledger-table { display: grid; grid-template-columns: minmax(0, 1fr); }
  .ledger-table > .table-scroll { grid-area: 1 / 1; }
  .ledger-table .data-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
  .ledger-table th, .ledger-table td { padding: 10px; }
  .ledger-table th { white-space: normal; }
  .ledger-table tr > :first-child {
    position: sticky; inset-inline-start: 0; z-index: 1;
    box-shadow: 1px 0 var(--line);
  }
  .ledger-table th:first-child { width: 112px; }
  .ledger-table td:first-child { background: var(--white); }
  .ledger-table tbody tr:hover td:first-child { background: var(--surface-tint); }
  .ledger-table .link-button { display: inline-flex; min-height: 34px; }
  .ledger-table .wide { min-width: 0; }
  .ledger-table .code, .ledger-table .status { white-space: normal; }
  .ledger-table:has(th:nth-child(5):last-child) .data-table { min-width: 540px; }
  /* Keep the visible header sticky to the page while each strip can scroll sideways. */
  .mobile-table-header {
    display: block; align-self: start; position: sticky; top: var(--ledger-header-top); z-index: 3;
    scrollbar-width: none;
  }
  .mobile-table-header::-webkit-scrollbar { display: none; }
  .ledger-table > .table-scroll:not(.mobile-table-header) thead { opacity: 0; }
  .card-table, .card-table tbody { display: block; min-width: 0; }
  .card-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .card-table tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
  }
  .card-table tbody tr:last-child { border-bottom: 0; }
  .card-table tbody td { padding: 0; border: 0; min-width: 0; max-width: none; }
  .mobile-cell-label { display: block; color: var(--muted); font-size: .75rem; }
  .card-table .wide { grid-column: 1 / -1; }
  .card-table .cell-action { grid-column: 2; justify-self: end; align-self: end; }
  .card-table .cell-action button { min-height: 30px; }
}
@media (max-width: 900px) {
  .masthead-identity { min-height: 74px; }
  .brand { font-size: 1.75rem; }
  .masthead nav { gap: 6px; }
  .masthead nav a { padding-inline: 14px; font-size: .9375rem; }
}
@media (max-width: 600px) {
  .masthead-identity { min-height: 53px; }
  .brand { --symbol-size: 31px; column-gap: 9px; font-size: 1.25rem; }
  .brand-symbol { border-radius: 6px; }
  .brand svg { width: 20px; height: 20px; }
  .masthead nav { gap: 2px; }
  .masthead nav a { padding: 8px 2px 6px; font-size: .8125rem; }
  main { padding-top: 16px; }
  .page-heading { margin-bottom: 14px; padding-bottom: 9px; gap: 8px; }
  .page-heading .button, .page-heading button { min-height: 38px; padding-inline: 9px; font-size: .8125rem; }
  h1 { font-size: 1.4375rem; }
  .metric { flex-direction: column; justify-content: center; padding: 6px 1px; }
  .metric span { font-size: .6875rem; white-space: nowrap; }
  .metric strong { font-size: 1.125rem; }
  .ledger-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 11px 12px; gap: 8px; }
  .ledger-filters > label { grid-column: span 3; }
  .ledger-filters > .date-range-field { grid-column: span 4; }
  .filter-actions { grid-column: span 2; }
  .filter-actions button { min-height: 39px; padding-inline: 8px; }
  .ledger-filters .date-range-toggle { white-space: normal; gap: 6px; padding-inline: 9px; }
  .batch-head { padding: 11px 13px; }
  .batch-tools { gap: 5px 9px; }
  .batch-count { font-size: .75rem; }
  .batch-title p { column-gap: 8px; }
  .details { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings, .form-grid { grid-template-columns: 1fr; }
  .dialog-body, .dialog-head, .dialog-actions { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 380px) {
  .masthead nav { gap: 0; }
}
@media (max-width: 360px) {
  .brand { --symbol-size: 27px; column-gap: 7px; font-size: 1.125rem; }
  .masthead nav a { padding-inline: 1px; font-size: .75rem; }
  .ledger-filters > .date-range-field, .filter-actions { grid-column: 1 / -1; }
  .filter-actions { justify-content: flex-start; }
  .filter-actions button { min-height: 34px; }
  .ledger-filters input[type="search"]::placeholder { font-size: .75rem; }
}
.ledger-heading { padding: 12px 15px; border-block: 1px solid var(--line); }
.ledger-heading:first-child { border-top: 0; }
.code { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Date fields and the shared calendar */
.date-input { display: flex; width: 100%; min-width: 0; }
.date-input input:not([type="checkbox"]) {
  flex: 1 1 auto; border-radius: 6px 0 0 6px; border-right: 0;
  font-variant-numeric: tabular-nums;
}
.date-input input:focus-visible, .date-input button:focus-visible { position: relative; outline-offset: -2px; }
.date-input [aria-invalid="true"] { border-color: var(--danger); }
.date-field small { color: var(--danger); }
.date-field:has(:disabled) small { color: var(--muted); }
.date-input button {
  background: var(--surface-tint); border-color: var(--control-line); border-radius: 0 6px 6px 0;
  flex: 0 0 38px; padding: 0; color: var(--primary);
}
.date-input button:hover, .date-input button[aria-expanded="true"] { background: var(--soft); }
.calendar-icon {
  position: relative; display: block; width: 16px; height: 15px;
  border: 1.6px solid currentColor; border-radius: 3px;
  background: linear-gradient(currentColor, currentColor) 0 4px / 100% 1px no-repeat;
}
.calendar-icon::before {
  content: ''; position: absolute; width: 1.6px; height: 4px; top: -3px; left: 3px;
  background: currentColor; box-shadow: 6px 0 currentColor; border-radius: 2px;
}
.calendar-popover {
  position: fixed; z-index: 10; inset: auto; margin: 0; width: min(316px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px); overflow: auto; padding: 11px;
  color: var(--ink); background: var(--white); border: 1px solid var(--control-line);
  border-radius: 10px; box-shadow: 0 12px 36px #142d4b33; font-size: 14px;
}
.calendar-header, .calendar-period, .calendar-footer { display: flex; align-items: center; gap: 6px; }
.calendar-header { justify-content: space-between; }
.calendar-period input:not([type="checkbox"]) { width: 58px; padding: 4px; text-align: center; }
.calendar-period select { width: 74px; padding: 4px 6px; }
.calendar-period input:not([type="checkbox"]), .calendar-period select, .calendar-header button, .calendar-footer button {
  min-height: 33px;
}
.calendar-header button { width: 33px; padding: 0; }
.calendar-chevron {
  display: block; width: 8px; height: 8px; border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor; transform: rotate(45deg);
}
.calendar-chevron-next { transform: rotate(225deg); }
.calendar-grid { margin-top: 7px; }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; gap: 3px; }
.calendar-week + .calendar-week { margin-top: 2px; }
.calendar-week [role="columnheader"] { color: var(--muted); padding: 4px 0; font-size: 12px; }
.calendar-week button {
  min-height: 34px; width: 100%; padding: 2px; border: 1px solid transparent;
  background: transparent; color: var(--ink); font-variant-numeric: tabular-nums;
}
.calendar-week button:hover:not(:disabled) { background: var(--soft); }
.calendar-week button:disabled { color: #617478; opacity: .65; text-decoration: line-through; }
.calendar-week button[aria-current="date"] { border-color: #93afd1; color: var(--primary); font-weight: 700; }
.calendar-week [aria-selected="true"] button { background: var(--primary); color: var(--white); }
.calendar-week [aria-selected="true"] button:hover:not(:disabled) { background: var(--primary-dark); }
.calendar-footer { justify-content: space-between; border-top: 1px solid var(--line); margin-top: 7px; padding-top: 7px; }
.calendar-footer button { color: var(--primary); font-size: 13px; }
@media (max-width: 540px) {
  .calendar-week button { min-height: 36px; }
}

.date-range-toggle {
  justify-content: space-between; gap: 12px; text-align: left;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.date-range-toggle[aria-expanded="true"] { border-color: var(--primary); background: var(--soft); }
.date-range-toggle .calendar-icon { color: var(--primary); flex: 0 0 16px; }
.calendar-range-popover { width: min(350px, calc(100vw - 16px)); }
.calendar-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 9px; }
.calendar-presets button { min-height: 32px; padding: 3px 7px; color: var(--primary); }
.calendar-presets button[aria-pressed="true"] { background: var(--soft); border-color: #93afd1; }
.calendar-range-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.calendar-range-inputs label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.calendar-range-inputs input:not([type="checkbox"]) { min-height: 33px; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.calendar-range-inputs input[aria-invalid="true"] { border-color: var(--danger); }
.calendar-range-message { min-height: 18px; margin: 4px 0 6px; color: var(--muted); font-size: 12px; }
.calendar-range-error { color: var(--danger); }
.calendar-week .calendar-in-range { background: var(--soft); border-radius: 5px; }
.calendar-week .calendar-in-range[aria-selected="true"] button { background: transparent; color: var(--primary-dark); }
.calendar-week .calendar-in-range[aria-selected="true"] button:hover { background: #d4e5f7; }
.calendar-footer button.primary { color: white; }
