:root {
    --ink: #162322;
    --muted: #64706f;
    --line: #d9e1df;
    --paper: #f7faf8;
    --panel: #ffffff;
    --brand: #007c89;
    --brand-dark: #005b64;
    --accent: #ffc857;
    --danger: #b42318;
    --table-header-bg: color-mix(in srgb, var(--brand) 8%, white);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
a { color: var(--brand-dark); text-decoration: none; font-weight: 650; }
button, .button { border: 0; background: var(--brand); color: white; min-height: 40px; padding: 0 16px; border-radius: 6px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; }
button:hover, .button:hover { background: var(--brand-dark); color: white; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.button.quiet { background: #eef4f2; color: var(--ink); }
.button.quiet:hover { background: #dce9e6; color: var(--ink); }
.button.danger { background: #fff0ed; color: var(--danger); }
.button.danger:hover { background: #ffd8d2; color: var(--danger); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: inherit; background: white; color: var(--ink); }
input[type="checkbox"] { width: auto; }
textarea { min-height: 96px; resize: vertical; }
label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 700; }
h1 { font-size: 2rem; margin: 0; }
h2 { margin: 0 0 8px; }
table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; color: var(--brand-dark); background: var(--table-header-bg); letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
tr:target { scroll-margin-top: 18px; }
tr:target td { background: #fff8e1; box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
tr:target td:first-child { box-shadow: inset 5px 0 0 var(--brand), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.cell-label { display: block; margin: -14px -16px 10px; padding: 10px 16px; color: var(--brand-dark); background: var(--table-header-bg); border-bottom: 1px solid var(--line); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
tbody tr:first-child .cell-label { display: none; }
.tool-panel:target { scroll-margin-top: 18px; border-color: var(--accent); box-shadow: inset 5px 0 0 var(--brand), 0 0 0 3px rgba(255, 200, 87, 0.28); }

.topbar { min-height: 72px; padding: 0 28px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; color: var(--ink); min-width: 190px; }
.brand-logo { width: clamp(170px, 22vw, 230px); max-width: 100%; height: auto; display: block; }
.auth-logo { width: 240px; max-width: 100%; height: auto; display: block; margin: 0 auto 14px; }
.global-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 460px; margin: 0; }
.global-search input { min-width: 180px; }
.user-chip { display: grid; gap: 2px; min-width: 150px; max-width: 220px; padding: 8px 12px; border-left: 4px solid var(--accent); background: #f7faf8; border-radius: 6px; }
.user-chip span { color: var(--brand-dark); font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.user-chip strong { overflow: hidden; color: var(--ink); font-size: 0.86rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar form { margin: 0; }
.topbar button { background: #eef4f2; color: var(--ink); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page { max-width: 1180px; margin: 0 auto; padding: 34px 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.muted { color: var(--muted); margin: 6px 0 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.metrics a, .tool-panel { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.metrics strong { display: block; color: var(--brand-dark); font-size: 2.4rem; line-height: 1; }
.metrics span { color: var(--muted); font-weight: 750; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; max-width: 520px; }
.toolbar.wide-toolbar { max-width: none; flex-wrap: wrap; align-items: end; }
.toolbar.wide-toolbar label { min-width: 160px; flex: 1 1 160px; }
.toolbar.wide-toolbar button, .toolbar.wide-toolbar .button { flex: 0 0 auto; }
.diary-toolbar { align-items: end; }
.diary-filter-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px 0 18px; }
.diary-filter-summary span { background: #e7f6f4; color: var(--brand-dark); border-radius: 999px; padding: 6px 10px; font-size: 0.84rem; font-weight: 800; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 4px 0 14px; }
.pagination { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pagination span { color: var(--muted); font-weight: 800; }
.button.disabled { opacity: 0.45; pointer-events: none; cursor: default; }
.billing-page { max-width: 100%; }
.payment-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: stretch; min-width: 0; max-width: 260px; }
#billing-results { max-width: 100%; overflow-x: hidden; }
#billing-results table { min-width: 0; table-layout: fixed; }
.billing-table th, .billing-table td { padding: 12px 10px; overflow-wrap: anywhere; word-break: normal; }
.billing-table th:nth-child(1), .billing-table td:nth-child(1) { width: 23%; }
.billing-table th:nth-child(2), .billing-table td:nth-child(2) { width: 9%; }
.billing-table th:nth-child(3), .billing-table td:nth-child(3),
.billing-table th:nth-child(4), .billing-table td:nth-child(4),
.billing-table th:nth-child(5), .billing-table td:nth-child(5) { width: 7%; }
.billing-table th:nth-child(6), .billing-table td:nth-child(6) { width: 7%; }
.billing-table th:nth-child(7), .billing-table td:nth-child(7) { width: 25%; }
.billing-table th:nth-child(8), .billing-table td:nth-child(8) { width: 15%; }
.billing-table input, .billing-table select, .billing-table button, .billing-table .button { min-width: 0; }
.billing-table .inline-check { white-space: normal; }
.inline-check { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 8px; font-weight: 650; white-space: nowrap; }
.compact-history { min-width: 190px; }
.compact-history .timeline-item { padding: 8px 0; }
.compact-history .timeline-item p { margin: 2px 0; }
.compact-action { display: grid; grid-template-columns: minmax(110px, 1fr) auto; gap: 6px; align-items: center; margin-top: 8px; }
.compact-action select { min-width: 120px; }
.compact-action:has(select) { grid-template-columns: 120px minmax(120px, 1fr) auto; }
.billing-table .compact-action,
.billing-table .compact-action:has(select) { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.item-form { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) 100px 110px auto; gap: 8px; align-items: end; margin: 12px 0; }
.item-edit-form { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(110px, 0.8fr) 90px 110px auto; gap: 8px; align-items: end; }
.delete-form { margin-top: 8px; }
.inline-role-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-width: 320px; }
.inline-role-form label, .check-grid label { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 8px; font-weight: 650; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.inline-actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.inline-actions select { min-width: 150px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.field-label { width: 100%; color: var(--muted); font-size: 0.9rem; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 780px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.form-grid.compact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; border: 0; padding: 0; margin: 14px 0 20px; }
.wide { grid-column: 1 / -1; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.diary-settings-grid { display: grid; gap: 22px; align-items: start; }
.diary-settings-grid .tool-panel { overflow: hidden; }
.diary-settings-form { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-items: end; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.diary-settings-form .wide { grid-column: auto; }
.settings-table-wrap { width: 100%; overflow-x: auto; padding-bottom: 2px; }
.compact-table th, .compact-table td { padding: 10px 12px; }
.settings-edit-table { min-width: 820px; border: 0; border-radius: 0; }
.settings-edit-table th:first-child, .settings-edit-table td:first-child { padding-left: 0; }
.settings-edit-table th:last-child, .settings-edit-table td:last-child { padding-right: 0; }
.settings-edit-table input { min-width: 92px; padding: 8px 10px; }
.working-hours-table { min-width: 680px; }
.blocked-time-table { min-width: 1120px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-actions form { margin: 0; }
.table-actions button, .table-actions .button { min-height: 36px; padding: 0 12px; }
.details { display: grid; grid-template-columns: 180px 1fr; gap: 12px 20px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 22px; max-width: 760px; }
.details dt { color: var(--muted); font-weight: 750; }
.details dd { margin: 0; }
.compact-details { grid-template-columns: 110px 1fr; max-width: none; margin-top: 14px; }
.tenant-preview { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-left: 6px solid var(--brand); background: var(--paper); border-radius: 8px; padding: 16px; }
.tenant-preview strong { color: var(--brand-dark); font-size: 1.2rem; overflow-wrap: anywhere; }
.tenant-preview span { background: var(--accent); color: var(--ink); border-radius: 999px; padding: 6px 10px; font-size: 0.82rem; font-weight: 850; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.alert-banner { display: grid; gap: 10px; margin-bottom: 18px; }
.alert-banner article { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: #fff8e1; border: 1px solid #f6cf69; border-left: 6px solid var(--accent); border-radius: 8px; padding: 14px; }
.alert-banner article.severity-critical { background: #fff0ed; border-color: #f1a59c; border-left-color: var(--danger); }
.alert-banner article.severity-warning { background: #fff8e1; border-left-color: var(--accent); }
.alert-banner article.severity-info { background: #e7f6f4; border-left-color: var(--brand); }
.summary-strip div, .summary-strip a { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 6px; color: inherit; }
.summary-strip a:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, white); color: inherit; }
.summary-strip span { color: var(--muted); font-size: 0.82rem; font-weight: 750; text-transform: uppercase; }
.summary-strip strong { color: var(--brand-dark); font-size: 1.05rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; border-radius: 999px; background: #e7f6f4; color: var(--brand-dark); padding: 4px 10px; font-size: 0.8rem; font-weight: 800; }
.section-title { margin-top: 30px; margin-bottom: 14px; font-size: 1.2rem; }
.diary { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.chair-lane { background: #f0f6f4; border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-height: 180px; }
.chair-lane h2 { font-size: 1rem; margin: 0 0 12px; }
.week-diary { display: grid; grid-template-columns: repeat(7, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.week-day { background: #f0f6f4; border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-height: 220px; }
.week-day header { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 12px; }
.week-day header strong { display: block; color: var(--brand-dark); }
.week-day header span { color: var(--muted); font-size: 0.85rem; }
.week-day header a { font-size: 0.85rem; }
.time-lane-body { display: grid; grid-template-rows: repeat(40, minmax(18px, 1fr)); gap: 0; min-height: 760px; position: relative; background: linear-gradient(to bottom, rgba(217, 225, 223, 0.9) 1px, transparent 1px) 0 0 / 100% 72px; border-radius: 6px; overflow: hidden; }
.time-tick { grid-row: var(--tick-row); grid-column: 1; border-top: 1px solid rgba(100, 112, 111, 0.18); color: var(--muted); font-size: 0.72rem; line-height: 1; padding-top: 3px; z-index: 0; }
.time-tick span { display: block; width: 48px; background: #f0f6f4; padding-right: 6px; }
.slot-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 48px; margin-top: 4px; opacity: 0; transition: opacity 0.16s ease; }
.time-lane-body:hover .slot-links, .slot-links:focus-within { opacity: 1; }
.slot-links a { display: inline-flex; justify-content: center; background: rgba(0, 120, 128, 0.1); border-radius: 999px; color: var(--brand-dark); font-size: 0.66rem; font-weight: 800; padding: 3px 4px; text-decoration: none; }
.slot-links a:hover { background: rgba(0, 120, 128, 0.18); }
.empty-lane { grid-row: 2 / span 4; grid-column: 1; align-self: start; background: rgba(255, 255, 255, 0.74); border-radius: 6px; padding: 10px; z-index: 1; }
.appointment-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; background: white; border-left: 5px solid var(--brand); border-radius: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px; margin-bottom: 12px; }
.appointment-card.compact-card { grid-template-columns: 54px 1fr; gap: 10px; padding: 10px; }
.appointment-card.compact-card .badge, .appointment-card.compact-card .appointment-actions { grid-column: 1 / -1; }
.appointment-card.timed-card { grid-row: var(--row-start) / span var(--row-span); grid-column: 1; margin: 4px 4px 4px 52px; min-height: 0; z-index: 1; box-shadow: 0 8px 18px rgba(12, 32, 31, 0.08); overflow: hidden; }
.appointment-card.status-cancelled { border-left-color: #9ca3af; opacity: 0.72; }
.appointment-card.status-arrived { border-left-color: var(--accent); }
.appointment-card.status-seen { border-left-color: #16a34a; }
.appointment-card.status-fta { border-left-color: var(--danger); }
.appointment-time { display: grid; align-content: start; gap: 2px; color: var(--muted); }
.appointment-time strong { color: var(--ink); font-size: 1.05rem; }
.appointment-main { display: grid; align-content: start; gap: 4px; min-width: 0; }
.appointment-main span { color: var(--muted); }
.reminder-chip { color: var(--brand-dark); font-weight: 800; }
.appointment-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.appointment-actions form { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.appointment-actions select { min-width: 130px; }
.status-reason-panel { display: grid; grid-template-columns: minmax(180px, 1fr); gap: 8px; width: min(360px, 100%); }
.status-reason-panel[hidden] { display: none; }
.quick-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-reasons button { min-height: 30px; padding: 0 9px; background: #eef4f2; color: var(--brand-dark); font-size: 0.76rem; }
.quick-reasons button:hover { background: #dce9e6; color: var(--brand-dark); }
.status-update-form .form-message { width: 100%; }
.icon-link { min-height: 36px; display: inline-flex; align-items: center; }
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(145deg, #eef7f5, #f9fbfb); padding: 24px; }
.auth-panel { width: min(420px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 32px; box-shadow: 0 22px 60px rgba(12, 32, 31, 0.12); }
.auth-panel > .muted { text-align: center; margin: 0 0 18px; }
.auth-panel > a { display: block; margin-top: 18px; text-align: center; }
.inline-form { display: flex; justify-content: center; margin-top: 14px; }
.link-button { min-height: auto; padding: 0; background: transparent; color: var(--brand-dark); font: inherit; font-weight: 650; }
.link-button:hover { background: transparent; color: var(--brand); text-decoration: underline; }
.stack { display: grid; gap: 16px; margin-top: 24px; }
.alert, .notice { border-radius: 6px; padding: 12px 14px; font-weight: 700; }
.alert { background: #fff0ed; color: var(--danger); }
.notice { background: #edf8ef; color: #166534; }
.form-message { margin: 0; color: #166534; font-weight: 750; }
.form-message.error { color: var(--danger); }
.qr-panel { display: flex; align-items: center; gap: 24px; max-width: 680px; }
.qr-panel img { width: 240px; height: 240px; }
code { display: inline-block; background: #eef4f2; border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow-wrap: anywhere; }
.record-layout { display: grid; grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr); gap: 18px; margin-top: 22px; align-items: start; }
.compact { margin-top: 14px; }
.timeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item strong { display: block; }
.timeline-item time, .timeline-item small { color: var(--muted); font-size: 0.85rem; }
.timeline-item p { margin: 6px 0; }
.label-link { display: inline-flex; width: fit-content; margin-bottom: 4px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand-dark); padding: 3px 8px; font-size: 0.78rem; font-weight: 900; }
.plain-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: grid; gap: 8px; border-left: 3px solid var(--line); padding-left: 10px; }
.note-fields { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 10px 0; }
.note-fields dt { color: var(--muted); font-weight: 800; }
.note-fields dd { margin: 0; }
.error-panel { max-width: 680px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 34px; display: grid; gap: 14px; }
.error-panel h1 { font-size: 2.2rem; }
.error-code { color: var(--brand-dark); font-size: 0.85rem; font-weight: 900; letter-spacing: 0.08em; }
.print-document { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 34px; display: grid; gap: 26px; }
.print-header { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--line); padding-bottom: 20px; }
.print-header div:first-child { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.print-header img.print-logo { width: 260px; height: auto; }
.print-header h2, .print-header p { margin: 0; text-align: right; }
.estimate-title { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.estimate-title h1, .estimate-title h2, .estimate-title p { margin: 4px 0; }
.label-text { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; }
.estimate-section { display: grid; gap: 10px; }
.receipt-warning { background: #fff8e1; border: 1px solid #f6cf69; border-left: 6px solid var(--accent); border-radius: 8px; padding: 14px 16px; }
.receipt-warning strong { color: var(--brand-dark); display: block; margin-bottom: 4px; }
.receipt-warning p { margin: 4px 0; }
.estimate-table tfoot th { background: #f7faf8; font-size: 1rem; }
.numeric { text-align: right; }
.acceptance-box { border-top: 1px solid var(--line); padding-top: 20px; }
.signature-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px; }
.signature-grid div { border-bottom: 1px solid var(--ink); min-height: 54px; display: flex; align-items: end; }
.signature-grid span { color: var(--muted); font-size: 0.85rem; padding-bottom: 6px; }

@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-direction: column; padding: 18px; }
    .global-search { max-width: none; width: 100%; }
    .metrics, .form-grid, .form-grid.compact-form, .summary-strip, .settings-grid { grid-template-columns: 1fr; }
    .page-head, .toolbar, .qr-panel { flex-direction: column; align-items: stretch; }
    .details { grid-template-columns: 1fr; }
    .record-layout, .timeline-grid { grid-template-columns: 1fr; }
    .week-diary { grid-template-columns: 1fr; overflow-x: visible; }
    .alert-banner article { grid-template-columns: 1fr; }
    .payment-form { grid-template-columns: 1fr; min-width: 0; }
    .item-form, .item-edit-form { grid-template-columns: 1fr; }
    .diary-settings-form { grid-template-columns: 1fr; }
    .diary-settings-form .wide { grid-column: 1; }
    .appointment-card { grid-template-columns: 58px 1fr; }
    .appointment-card .badge { grid-column: 1 / -1; width: fit-content; }
    .appointment-actions, .appointment-actions form { align-items: stretch; flex-direction: column; }
    .auth-panel { padding: 26px 22px; }
    .auth-logo { width: 220px; }
    table { display: block; overflow-x: auto; }
}

@media (max-width: 1040px) {
    #billing-results { overflow-x: hidden; }
    .billing-table { display: block; border: 0; background: transparent; }
    .billing-table thead { display: none; }
    .billing-table tbody { display: grid; gap: 14px; }
    .billing-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
    .billing-table td { display: block; width: auto !important; min-width: 0; border-bottom: 1px solid var(--line); }
    .billing-table td:nth-child(1),
    .billing-table td:nth-child(7),
    .billing-table td:nth-child(8) { grid-column: 1 / -1; }
    .billing-table tbody tr:first-child .cell-label { display: block; }
    .billing-table .payment-form { max-width: none; }
    .billing-table .compact-history { min-width: 0; }
    .billing-table tr:target td { background: #fff8e1; }
}

@media (max-width: 620px) {
    .billing-table tr { grid-template-columns: 1fr; }
}

@media print {
    body { background: white; }
    .topbar, .no-print { display: none !important; }
    .page { max-width: none; padding: 0; }
    .print-document { border: 0; border-radius: 0; padding: 0; }
    a { color: var(--ink); }
    table { border-radius: 0; }
}
