:root {
  color-scheme: light;
  --white: #fff;
  --paper: #faf7f7;
  --ink: #2d2428;
  --muted: #665a60;
  --line: #e3dadd;
  --rule: #a5a5ad;
  --accent: #a8233c;
  --brand-red: #d92339;
  --wine: #792035;
  --tint: color-mix(in srgb, var(--accent) 6%, var(--white));
  --work-width: 210px;
  font: 100%/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
input, button, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
details > summary:focus { outline: none; }
details > summary:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .25em;
}
.shell {
  --page-gutter: clamp(16px, 4vw, 76px);
  width: min(calc(100% - 2 * var(--page-gutter)), 1320px); margin-inline: auto;
}

.masthead {
  background: #fffcfa; border-bottom: 1px solid #dfd9d5;
  box-shadow: 0 2px 10px #39222808;
}
.masthead-inner { display: grid; grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center; min-height: 80px; gap: clamp(18px, 2vw, 32px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-title { padding-left: 12px; border-left: 1px solid #ded4d2;
  color: #32292b; font: 500 1.32rem/.99 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.brand-title em { display: block; color: var(--wine); font-weight: 400; font-style: normal; }
.brand-symbol { position: relative; flex: none; }
.brand-mark {
  display: block; width: auto; height: 52px; object-fit: contain;
}
@media (any-hover: hover) and (prefers-reduced-motion: no-preference) {
  .brand-symbol:hover::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    mask: url("/ano-smg.png") center / contain no-repeat;
    clip-path: inset(0 0 18%); /* Keep the wordmark below the symbol untouched. */
    background: linear-gradient(110deg, transparent 39%, #fff9 50%, transparent 61%) no-repeat;
    background-size: 300% 100%;
    animation: brand-glint 650ms ease-in-out both;
  }
  @keyframes brand-glint {
    from { background-position: 100% 50%; }
    to { background-position: 0% 50%; }
  }
}
.nav-wrap { min-width: 0; justify-self: center; max-width: 100%; overflow-x: auto; }
.tabs { display: flex; gap: 2px; width: max-content; padding: 3px;
  background: #f3efed; border: 1px solid #e6dfdb; border-radius: 11px; }
.tabs button {
  position: relative;
  min-height: 42px; padding: 8px 11px; border: 0; border-radius: 7px;
  background: transparent; color: #62595a; font-weight: 600; font-size: .875rem;
  text-align: left; white-space: nowrap;
}
.tabs button:hover, .tabs button[aria-current="page"] { color: var(--accent); }
.tabs button[aria-current="page"] { background: #fff; color: var(--wine); box-shadow: 0 1px 4px #4b33332b; }
.tab-indicator {
  position: absolute; left: 11px; right: 11px; bottom: 4px; height: 2px; z-index: 1;
  background: var(--brand-red); border-radius: 2px; transform-origin: left center; pointer-events: none;
}
.tabs button:focus-visible { outline-offset: -3px; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.account-identity { display: grid; justify-items: start; gap: 3px; min-width: 0; }
#account-name { max-width: 17ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 600 .87rem/1.2 "Segoe UI", Arial, sans-serif; color: var(--ink); }
#account-role { display: flex; }
#account-role .role-badge { font-size: .72rem; padding: .12rem .48rem; }
.masthead #logout { color: #625457; background: transparent; border-color: #ded5d3;
  border-radius: 8px; min-height: 44px; padding-inline: 11px; font-weight: 550; }
.masthead #logout:hover { background: var(--tint); color: var(--wine); }
.login-panel, .account-dialog {
  width: min(100%, 390px); padding: clamp(19px, 4vw, 30px); border: 1px solid var(--line);
  border-top: 3px solid var(--brand-red); border-radius: 12px; background: white; color: var(--ink);
}
.login-panel { margin: clamp(16px, 8vh, 92px) auto; }
.account-dialog { max-width: calc(100% - 24px); }
.account-dialog::backdrop { background: rgb(40 25 32 / 32%); }
.sheet-editor { width: min(36rem, calc(100% - 24px)); max-height: 88dvh; overflow: auto; }
.sheet-fields { display: grid; gap: 12px; min-width: 0; }
.sheet-editor input, .sheet-editor textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.sheet-editor textarea { resize: vertical; }
.sheet-dates, .month-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.month-fields { grid-template-columns: 1.3fr 1fr 1fr; margin-block: 12px; }
.sheet-editor label { min-width: 0; }
.editor-months summary { cursor: pointer; font-weight: 600; color: var(--wine); }
.editor-months .button, .source-details .button { margin-top: 10px; }
.ledger-table .edit-work { padding: 4px 0; background: transparent; border: 0; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
.edit-work span { color: var(--wine); }
.edit-work:hover { text-decoration: underline; text-underline-offset: 3px; }
.ledger-number { border: 0; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; padding: 4px; cursor: text; text-decoration: underline dotted #ad9198; text-underline-offset: .28em; }
.ledger-number:hover, .ledger-number:focus-visible { color: var(--wine); background: var(--tint); border-radius: 4px; }
.measurement-date { display: block; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.cell-editor { display: grid; grid-template-columns: minmax(5em, 8em) auto auto; gap: 3px; align-items: center; }
.cell-editor input { width: 100%; min-width: 0; padding: 5px; text-align: right; }
.cell-editor button { min-width: 30px; min-height: 32px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--wine); cursor: pointer; }
.cell-editor small { grid-column: 1/-1; white-space: normal; max-width: 18em; text-align: left; color: var(--wine); }
.cell-editor small:empty { display: none; }
@media (max-width: 460px) {
  .month-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .month-fields label:first-child { grid-column: 1/-1; }
  .sheet-dates { grid-template-columns: 1fr; }
}
.account-form { display: grid; gap: 14px; }
.account-form h1 { font-size: 1.65rem; }
.account-form input { font-size: 1rem; }
.account-form .form-error { color: var(--accent); }
.account-form .form-error:empty { display: none; }
.import-form { max-width: 52rem; min-width: 0; padding: 8px 0; }
.import-form input, .import-form select { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; }
.import-form select { margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.import-form input::file-selector-button { color: var(--wine); background: var(--tint); border: 0;
  border-radius: 5px; padding: 6px 10px; margin-right: 10px; cursor: pointer; }
#import-result:not(:empty), .source-details { border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-wrap: anywhere; }
#import-result ul { padding-left: 1.3rem; }
#import-registry { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); }
#import-registry p, #registry-result ul { margin: 0; }
#registry-result ul { padding: 6px 0 0 1.3rem; }
.source-details { margin: 10px 0; }
.source-details summary { cursor: pointer; color: var(--wine); font-weight: 650; }
.source-details dl { display: grid; grid-template-columns: minmax(7rem, 1fr) 3fr; gap: 8px; }
.source-details dd { margin: 0; white-space: pre-line; }
.source-details details { margin-block: 8px; }
.source-details p { margin-block: 8px; }
.info-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: start; }
.info-card > details { grid-area: 1/1/2/-1; min-width: 0; margin: 0; }
.info-card > details > summary { margin-inline-end: 13rem; min-height: 40px; align-content: center; }
.info-card > .info-action { grid-area: 1/2; align-self: start; margin: 0; }
.info-card > span.info-action { padding-block: 10px; font-size: .84rem; }
.info-value { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: start;
  white-space: pre-line; overflow-wrap: anywhere; cursor: pointer; text-decoration: underline dotted #bda8ab; text-underline-offset: .23em; }
.info-value:hover, .info-value:focus-visible { color: var(--wine); }
@media (max-width: 580px) {
  .info-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .info-card > details > summary { margin-inline-end: 0; }
  .info-card dl { grid-template-columns: minmax(6rem, 1fr) minmax(0, 1.7fr); }
}
[data-role="admin"] { --role-ink: #88243e; --role-wash: #faedf0; --role-line: #e8ccd4; }
[data-role="inspector"] { --role-ink: #894623; --role-wash: #fbf1e9; --role-line: #e9d3c2; }
[data-role="analyst"] { --role-ink: #315e61; --role-wash: #edf4f3; --role-line: #cddfdd; }
.role-badge {
  display: inline-flex; align-items: center; gap: .45rem; width: fit-content;
  padding: .22rem .65rem; border: 1px solid var(--role-line); border-radius: 99px;
  color: var(--role-ink); background: var(--role-wash); font-size: .78rem; font-weight: 650;
}
.role-badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.role-choices { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.role-choices legend { margin-bottom: 4px; font-weight: 650; }
.role-choices label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px;
  color: var(--role-ink); background: white; border: 1px solid var(--role-line); border-radius: 8px; cursor: pointer; }
.role-choices label:has(:checked) { background: var(--role-wash); border-color: var(--role-ink); box-shadow: inset 3px 0 var(--role-ink); }
.role-choices input[type=radio] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--role-ink); }
.user-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.user-heading h2 { display: flex; align-items: center; gap: 9px; }
.user-heading h2 small { padding: 2px 8px; border-radius: 6px; background: #f4f2f2; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.user-list { margin: 18px 0 0; padding: 0; list-style: none; }
.user-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .36fr) 78px;
  grid-template-areas: "identity role action"; gap: 16px; align-items: center;
  padding: 14px 12px; border-top: 1px solid var(--line); }
.user-identity { grid-area: identity; min-width: 0; display: flex; align-items: center; gap: 12px; }
.user-initials { flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid #e5dcdf; border-radius: 10px; background: #f7f4f5; color: #624650; font-size: .86rem; font-weight: 700; }
.user-info { min-width: 0; overflow-wrap: anywhere; }
.user-info strong, .user-info small { display: block; }
.user-info small { margin-top: 1px; color: var(--muted); font-size: .81rem; }
.user-list .role-badge { grid-area: role; }
.user-list .user-remove { grid-area: action; justify-self: end; min-height: 44px; padding-inline: 8px; color: var(--muted); }
.user-list .user-remove:hover, .user-list .user-remove:focus-visible { color: var(--wine); background: var(--tint); border-radius: 6px; }
@media (hover: hover) { .user-list li:hover { background: #fcfafb; } }
@media (max-width: 600px) {
  .user-list li { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "identity identity" "role action";
    gap: 6px 8px; padding: 12px 4px; }
  .user-list .role-badge { margin-left: 52px; }
}
@media (max-width: 380px) {
  .user-list .role-badge { margin-left: 0; }
}
.login-link { color: var(--accent); font-size: .875rem; }

.page { padding-block: 25px 42px; }
@media (prefers-reduced-motion: no-preference) {
  .view-enter > * { animation: view-arrive 220ms cubic-bezier(.2,.75,.25,1) backwards; }
  .view-enter .work-card { animation: card-arrive 240ms cubic-bezier(.2,.75,.25,1) backwards; }
  .view-enter .work-card:nth-child(2) { animation-delay: 30ms; }
  .view-enter .work-card:nth-child(3) { animation-delay: 60ms; }
  .work-details[open] > .ledger-section, .revision-list details[open] > dl {
    animation: card-arrive 180ms ease-out;
  }
  .toast:not([hidden]) { animation: card-arrive 180ms ease-out; }
  .tabs button, .button { transition: background-color 140ms, color 140ms, border-color 140ms; }
  .button:active:not(:disabled) { transform: translateY(1px); }
}
@keyframes view-arrive {
  from { opacity: .35; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes card-arrive {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.page-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 17px;
}
h1 { font-size: clamp(1.85rem, 3.1vw, 2.55rem); line-height: 1.04; font-weight: 700; letter-spacing: -.048em; }
h2 { font-size: 1.17rem; line-height: 1.25; letter-spacing: -.026em; }
.button {
  min-height: 42px; padding: 9px 14px; display: inline-flex; justify-content: center; align-items: center;
  gap: 9px; border: 1px solid transparent; border-radius: 8px; font-size: .875rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.primary {
  background: linear-gradient(115deg, var(--wine), var(--accent) 45%, #c6233b);
  background-size: 145% 100%; color: white; box-shadow: 0 2px 5px #79203524;
}
.primary:hover:not(:disabled), .primary:focus-visible { background-position: 100% 50%; }
.secondary { background: var(--white); color: var(--accent); border-color: #d8bec5; }
.secondary:hover:not(:disabled) { background: var(--tint); }
.filter-bar {
  display: flex; align-items: end; gap: 14px; padding: 10px 12px; margin-bottom: 16px;
  background: linear-gradient(105deg, #fffafb 15%, #f8edef 78%, #f3e1e5);
  border: 1px solid #e7d3d8; border-inline-start: 3px solid var(--accent); border-radius: 10px;
}
label, .field-label { display: block; font-size: .875rem; font-weight: 700; }
.filter-bar .field-label { margin-bottom: 5px; }
.filter-bar:focus-within { position: relative; z-index: 4; }
.object-field { flex: 0 1 465px; min-width: 0; }
.date-field { flex: 0 0 161px; }
input, textarea {
  display: block; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--white); color: var(--ink); font-size: .9375rem; font-weight: 400;
}
label input, label textarea { margin-top: 4px; }
.download { margin-left: auto; }
.download-icon { width: 12px; height: 12px; border-bottom: 1px solid; position: relative; }
.download-icon::before, .download-icon::after { content: ""; position: absolute; left: 5px; }
.download-icon::before { height: 7px; top: -1px; border-left: 1px solid; }
.download-icon::after {
  width: 5px; height: 5px; top: 2px; translate: -2px; rotate: 45deg;
  border: solid; border-width: 0 1px 1px 0;
}

.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 17px;
  border-block: 1px solid var(--line);
}
.stat {
  display: flex; flex-direction: column-reverse; align-items: start; justify-content: center;
  gap: 1px; min-width: 0; padding: 8px 15px; border-right: 1px solid var(--line);
}
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat span { color: var(--muted); font-size: .875rem; }
.stat strong { font-size: 1.625rem; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-complete strong, .positive { color: var(--accent); }
.stat-behind strong, .negative { font-weight: 700; }

.section { border: 1px solid var(--line); }
.section + .section { margin-top: 16px; }
.section-heading {
  padding: 13px 14px 12px; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px;
}
.section-heading p { margin-top: 4px; max-width: 116ch; color: var(--muted); font-size: .875rem; }
.table-scroll { overflow: auto; scrollbar-color: var(--rule) var(--paper); }
.table-scroll:focus-visible { outline-offset: -2px; }
.ledger-scrollbar {
  --thumb-width: 44px;
  --thumb-paint: repeating-linear-gradient(90deg, #ffdbdf 0 1px, transparent 1px 4px) center / 9px 5px no-repeat,
                linear-gradient(90deg, var(--wine), var(--accent));
  display: block; appearance: none; width: calc(100% - 24px); height: 30px; min-height: 0;
  padding: 0; margin: 0 12px; border: 0; border-radius: 3px; cursor: pointer;
  background: linear-gradient(#e3dcde, #e3dcde) center / 100% 6px no-repeat;
}
.ledger-scrollbar::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.ledger-scrollbar::-webkit-slider-thumb {
  appearance: none; width: var(--thumb-width); height: 100%; border: solid transparent; border-width: 9px 0;
  border-radius: 5px / 14px; background: var(--thumb-paint); background-clip: padding-box; cursor: grab;
}
.ledger-scrollbar::-moz-range-track { height: 100%; background: transparent; }
.ledger-scrollbar::-moz-range-thumb {
  box-sizing: border-box; width: var(--thumb-width); height: 100%; border: solid transparent; border-width: 9px 0;
  border-radius: 5px / 14px; background: var(--thumb-paint); background-clip: padding-box; cursor: grab;
}
.ledger-scrollbar:active::-webkit-slider-thumb { cursor: grabbing; }
.ledger-scrollbar:active::-moz-range-thumb { cursor: grabbing; }
@media (pointer: coarse) {
  .ledger-scrollbar { height: 44px; }
  .ledger-scrollbar::-webkit-slider-thumb { border-block-width: 15px; }
  .ledger-scrollbar::-moz-range-thumb { border-block-width: 15px; }
}
@media (forced-colors: none) {
  .table-scroll.with-scrollbar { scrollbar-width: none; }
  .table-scroll.with-scrollbar::-webkit-scrollbar { display: none; }
}
@media (forced-colors: active) { .ledger-scrollbar { display: none; } }
table { border-spacing: 0; width: 100%; font-size: .875rem; font-variant-numeric: tabular-nums; }
thead th {
  padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: middle;
  background: var(--paper); color: var(--ink); text-align: center; font-weight: 700; line-height: 1.18;
}
thead tr:last-child th, thead th[rowspan="2"] { border-bottom: 1px solid var(--rule); }
thead th[colspan] { color: var(--accent); }
thead th[colspan] + th[colspan] { border-left: 1px solid var(--line); }
tbody td, tbody th {
  padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; background: var(--white);
}
tbody tr:hover td, tbody tr:hover th { background: var(--paper); }
tbody th { font-weight: 650; text-align: left; }
tbody td { white-space: nowrap; }
thead .fact-cell, tbody .fact-cell, tbody tr:hover .fact-cell {
  background: var(--tint); color: var(--accent); font-weight: 700;
}
thead tr:last-child .fact-cell { border-bottom: 2px solid var(--accent); }
.heading-name { text-align: left; }
.heading-number { width: 48px; }
.dashboard-table { min-width: 945px; }
.dashboard-table th[scope="row"] { min-width: 220px; max-width: 370px; }
.dashboard-table .work-start, .dashboard-table .work-finish, .row-number { text-align: center; }
.dashboard-table .work-progress { text-align: center; min-width: 142px; }
.row-number, .unit-line, .muted { color: var(--muted); }
.unit-line { display: inline-block; margin-left: 4px; font-weight: 400; }
.progress { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress span { min-width: 3.5rem; text-align: right; font-weight: 700; }
progress { appearance: none; display: block; width: 100%; height: 6px; border: 0; background: var(--line); color: var(--accent); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.table-note, .entry-hint { padding: 10px 14px; font-size: .875rem; color: var(--muted); }

.ledger-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px;
  border-top: 1px solid var(--line);
}
.ledger-nav button, .text-button, .today-button {
  min-height: 38px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px;
  text-align: center; color: var(--accent); background: white; font-size: .875rem; font-weight: 650;
}
.ledger-nav button:hover, .text-button:hover, .today-button:hover { border-color: #ceadb6; background: var(--tint); }
.ledger-table { width: max-content; min-width: 100%; }
.ledger-table .metric.positive { color: #146343; font-weight: 700; }
.ledger-table .metric.negative { color: #ab263b; font-weight: 700; }
.ledger-table .metric:not(.positive):not(.negative) { color: var(--ink); }
.ledger-table thead th { min-width: 106px; white-space: nowrap; }
.ledger-table .pinned-work, .ledger-table .pinned-unit { position: sticky; z-index: 1; }
.ledger-table .pinned-work {
  left: 0; min-width: var(--work-width); width: var(--work-width); max-width: var(--work-width);
  text-align: left; white-space: normal; overflow-wrap: anywhere;
}
.ledger-table .pinned-unit { left: var(--work-width); text-align: center; min-width: 59px; border-right: 1px solid var(--rule); }
.ledger-table sup { margin-left: 3px; color: var(--accent); font-weight: 700; }

.entry-hint { margin: 0 14px 13px; padding: 8px 11px; background: var(--paper); border-left: 2px solid var(--accent); }
.entry-table { min-width: 748px; }
.entry-table td, .history-table td { text-align: center; }
.entry-table th:first-child, .history-table th:first-child { padding-left: 14px; text-align: left; }
.entry-table input { max-width: 142px; min-height: 35px; padding: 5px 8px; margin-inline: auto; text-align: right; }
.quantity-field {
  display: inline-flex; align-items: stretch; width: 100%; max-width: 156px;
  border: 1px solid #cbbbc0; background: var(--white); border-radius: 8px; overflow: hidden;
}
.quantity-field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.quantity-field .volume { min-width: 0; border: 0; outline: 0; }
.quantity-unit {
  display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; min-width: 32px;
  background: var(--paper); color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap;
}
.entry-table input:focus, textarea:focus { background: var(--tint); }
.entry-count { font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.entry-table tr.has-entry .quantity-field { border-color: #307656; }
.reading-controls, .entry-measure [data-completed] { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.entry-measure .text-button { font-size: .8125rem; padding: 4px 6px; }
.entry-measure [data-completed] strong { color: #286646; font-size: .875rem; }
.work-dates { display: block; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.form-footer { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; gap: 10px; }
.actions { display: flex; gap: 8px; }
.reason { max-width: 560px; margin: 13px 14px 0; }
.reason textarea { resize: vertical; }
.form-error { color: var(--ink); font-size: .875rem; font-weight: 700; }
.section-error { margin: 0 14px 10px; border-left: 2px solid var(--accent); padding-left: 8px; }
.history-table { min-width: 665px; }
.history-table tbody tr:last-child > * { border-bottom: 0; }
.revision-list { padding-bottom: 9px; }
.revision-list details {
  margin: 0 14px 7px; padding: 9px 10px; border: 1px solid var(--line); font-size: .875rem;
}
.revision-list summary { cursor: pointer; color: var(--accent); }
.revision-list details p { white-space: pre-wrap; margin-top: 7px; }
.revision-list dl { margin: 8px 0 2px; max-width: 610px; }
.revision-list dl div {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line);
}
.revision-list dd { margin: 0; }
.empty-state { padding: 23px 14px; border: 1px solid var(--line); color: var(--muted); }
.empty-state button { display: flex; margin-top: 11px; }
.toast {
  position: fixed; bottom: 16px; right: 16px; z-index: 5; max-width: min(405px, calc(100% - 32px));
  padding: 9px 13px; background: var(--accent); color: var(--white); font-weight: 650;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.mobile-label, .mobile-unit { display: none; }

.overview-date { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.overview-date .date-trigger { min-width: 152px; }
.portfolio { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 2fr); gap: 16px; margin: 22px 0 30px; }
.watch-total {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  justify-content: space-between; min-height: 184px; padding: 22px 24px; border-radius: 10px;
  color: white; background: linear-gradient(115deg, #681d34, #a82441 60%, #c52940);
}
.watch-total::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 18px, #ffffff24 18px 19px, transparent 19px 31px);
  mask-image: linear-gradient(90deg, transparent 10%, black);
}
.watch-total h2, .object-list h2 { font-size: 1rem; }
.watch-total strong { font-size: clamp(3.1rem, 5.5vw, 4.8rem); line-height: 1; letter-spacing: -.06em; }
.watch-total p { color: #ffe1e5; font-size: .875rem; }
.watch-total.is-clear { background: #43574e; }
.watch-total.is-clear p { color: white; }
.table-status { display: block; font-size: .8125rem; font-weight: 400; color: var(--muted); }
.watch-total progress { margin-top: 8px; height: 4px; background: #ffffff40; color: white; }
.watch-total progress::-webkit-progress-bar { background: #ffffff40; }
.watch-total progress::-webkit-progress-value { background: white; }
.watch-total progress::-moz-progress-bar { background: white; }
.object-list {
  display: flex; flex-direction: column; justify-content: center; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px;
  background: linear-gradient(145deg,#fff 45%,#fcf7f8);
}
.object-list h2 { margin-bottom: 8px; font-size: .875rem; color: var(--muted); }
.portfolio:focus-within { position: relative; z-index: 3; }
.priority-picker { position: relative; }
#priority-trigger, #priority-options [role=option] {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 26px;
  align-items: center; gap: 8px 12px; text-align: left;
}
#priority-trigger {
  width: 100%; min-height: 55px; padding: 11px 14px; border: 1px solid #cfb9bf;
  border-radius: 9px; color: var(--ink); background: white;
  font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 650;
}
#priority-trigger[aria-expanded=true] { border-color: var(--accent); box-shadow: 0 0 0 3px #a32e420c; }
.picker-caret {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
}
.picker-caret { color: var(--accent); background: #f7edef; }
.picker-caret::after {
  content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 1.6px 1.6px 0;
  transform: translateY(-2px) rotate(45deg);
}
[aria-expanded=true] .picker-caret { transform: rotate(180deg); }
#priority-options {
  position: absolute; z-index: 4; inset: calc(100% + 6px) 0 auto; padding: 5px;
  max-height: min(330px, 45dvh); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid #ddcdd1; border-radius: 12px; background: white;
  box-shadow: 0 14px 35px -12px #48273140, 0 2px 5px #4827310c; transform-origin: top center;
}
#priority-options [role=option] {
  position: relative; grid-template-columns: minmax(0, 1fr) auto;
  min-height: 47px; padding: 10px 13px; border-radius: 7px; cursor: pointer;
  font-size: .94rem; font-weight: 600; line-height: 1.3;
}
#priority-name, .option-name { min-width: 0; overflow-wrap: anywhere; }
#priority-options [aria-selected=true] { color: var(--wine); background: #fae9ed; font-weight: 700; }
#priority-options [aria-selected=true]::before {
  content: ""; position: absolute; inset: 9px auto 9px 0; width: 3px; border-radius: 2px; background: var(--accent);
}
#priority-trigger:focus-visible + #priority-options .is-active {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
@media (hover: hover) {
  #priority-trigger:hover { border-color: var(--accent); }
  #priority-options [role=option]:not([aria-selected=true]):hover { background: #f7f3f4; }
}
@media (prefers-reduced-motion: no-preference) {
  #priority-options [aria-selected=true]::before { animation: accent-reveal 220ms ease-out; }
  .entry-table tr.has-entry .quantity-unit { animation: unit-confirm 380ms ease-out; }
  .button.primary { transition: background-position 220ms ease-out, box-shadow 160ms; }
  .picker-caret { transition: transform 200ms ease; }
  #priority-trigger { transition: border-color 160ms, box-shadow 160ms; }
  #priority-options { animation: menu-appear 180ms cubic-bezier(.2,.75,.25,1); }
  #priority-options [role=option] { animation: card-arrive 180ms backwards; transition: background-color 110ms; }
  #priority-options [role=option]:nth-child(2) { animation-delay: 20ms; }
  #priority-options [role=option]:nth-child(n+3) { animation-delay: 40ms; }
  .object-enter .work-card, .object-enter .review-empty, .object-enter .selected-state { animation: card-arrive 230ms ease-out backwards; }
  .object-enter .work-card:nth-child(2) { animation-delay: 35ms; }
  .object-enter .work-card:nth-child(3) { animation-delay: 70ms; }
  :is(.object-enter,.view-enter) .actual-bar { transform-origin: left; animation: bar-fill 480ms cubic-bezier(.2,.7,.25,1) 80ms backwards; }
}
@keyframes accent-reveal { from { transform: scaleY(.2); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes unit-confirm { from { background: #c9e8d8; } to { background: #edf5f0; } }
.entry-table tr.has-entry .quantity-unit { background: #edf5f0; color: #23593e; }
@keyframes menu-appear {
  from { opacity: 0; transform: translateY(-5px) scale(.99); }
  to { opacity: 1; transform: none; }
}
@keyframes bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.selected-state { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin-top: 12px; }
.selected-state small, .work-card p { color: var(--muted); font-size: .875rem; }
.work-card p { margin-top: 5px; }
.status {
  display: inline-block; width: fit-content; padding: 4px 8px; border-radius: 5px;
  font-size: .8125rem; line-height: 1.2; font-weight: 700; white-space: nowrap;
}
.status.overdue { background: #952b41; color: white; }
.status.behind { background: #f9e5e7; color: #8a2437; }
.status.unknown { background: #f4ede4; color: #6e4e2c; }
.status.clear { background: #ecf1ee; color: #375346; }
.review-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.review-heading p { margin: 0 0 4px; color: var(--muted); font-size: .875rem; }
.review-heading h2 { font-size: clamp(1.35rem, 2.3vw, 2rem); }
.work-cards { display: grid; grid-auto-flow: column; grid-auto-columns: min(86%, clamp(16rem, 22vw, 20rem));
  gap: 12px; margin-top: 10px; padding-block: 2px 8px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; }
.work-cards::-webkit-scrollbar { display: none; }
.review-heading h2 small { color: var(--muted); font-size: .6em; vertical-align: middle; }
.review-actions, .review-arrows { display: flex; align-items: center; gap: 8px; }
.review-arrows button { width: 38px; height: 38px; line-height: 1; font-size: 1.45rem; border: 1px solid var(--panel-edge);
  border-radius: 50%; background: var(--white); color: var(--wine); }
.review-arrows button:disabled { opacity: .4; }
.work-card {
  display: flex; flex-direction: column; align-items: start; min-width: 0; padding: clamp(14px, 1.2vw, 18px);
  scroll-snap-align: start; overflow-wrap: anywhere;
  border: 1px solid var(--line); border-radius: 9px; background: var(--white);
}
.work-card h3 { margin: 8px 0 0; font-size: 1rem; line-height: 1.25; letter-spacing: -.025em; }
.compare { margin-top: auto; padding-top: 12px; width: 100%; }
.compare-values { display: flex; justify-content: space-between; align-items: end; gap: 10px; font-variant-numeric: tabular-nums; }
.compare-values small { display: block; color: var(--muted); font-size: .8125rem; }
.compare-values strong { font-size: 1.65rem; letter-spacing: -.05em; color: #7c2638; }
.plan-value { text-align: right; }
.plan-value b { font-size: 1rem; }
.compare-rail { position: relative; height: 8px; margin: 10px 0 2px; background: #eee6e8; }
.compare-rail progress { position: absolute; inset: 0; border: 0; height: 100%; background: transparent; }
.compare-rail progress::-webkit-progress-bar { background: transparent; }
.compare-rail .plan-marker { height: 14px; top: -3px; }
.plan-marker::-webkit-progress-value { background: transparent; border-right: 2px solid var(--ink); }
.plan-marker::-moz-progress-bar { background: transparent; border-right: 2px solid var(--ink); }
.work-details { margin-top: 22px; overflow: hidden; border-radius: 8px; }
.work-details summary { padding: 14px 16px; cursor: pointer; font-weight: 700; }
.work-details summary span { margin-left: 6px; color: var(--muted); }
.review-empty { padding-block: 18px; color: var(--muted); }
@media (max-width: 760px) {
  .portfolio { grid-template-columns: 1fr; gap: 9px; margin: 15px 0 22px; }
  .watch-total { min-height: 110px; display: grid; grid-template-columns: 1fr auto; align-content: center; padding: 17px; }
  .watch-total strong { grid-column: 2; grid-row: 1 / 3; }
  .watch-total p { align-self: end; }
  .object-list { padding: 12px; }
  .brand-mark { height: 42px; }
  .watch-total progress { grid-column: 1 / -1; }
  .work-card { padding: 14px; }
  .review-heading { flex-wrap: wrap; }
  .overview-date { flex-wrap: wrap; gap: 4px 9px; }
}

@media (max-width: 560px) {
  #priority-trigger { grid-template-columns: minmax(0, 1fr) 26px; gap: 5px 8px; }
  #priority-options [role=option] { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .priority-picker .status { grid-column: 1; grid-row: 2; }
  .picker-caret { grid-column: 2; grid-row: 1 / 3; }
  #priority-options { position: relative; inset: auto; margin-top: 6px; max-height: min(330px, 52dvh); box-shadow: 0 4px 12px #4827310c; }
}

@media (min-width: 1009px) {
  .dashboard-table thead th { background: var(--accent); color: var(--white); border-color: #c67581; }
  .dashboard-table thead th[colspan] { text-align: left; }
  .dashboard-table thead tr:last-child th, .dashboard-table thead tr:first-child th:nth-child(5) { text-align: right; }
  .dashboard-table thead .fact-cell { background: #752235; }
  .dashboard-table tbody tr:nth-child(even) > :not(.fact-cell) { background: var(--paper); }
}

@media (max-width: 1199px) {
  .masthead-inner { grid-template-columns: auto minmax(0,1fr); gap: 8px 12px; padding-block: 10px; }
  .account-actions { grid-column: 2; grid-row: 1; }
  .nav-wrap { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .tabs button { min-height: 44px; }
}

@media (max-width: 1008px) {
  .dashboard-table { min-width: 0; }
  .dashboard-table, .dashboard-table tbody { display: block; }
  .dashboard-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .dashboard-table tbody tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start;
    gap: 9px 10px; padding: 11px 13px 12px; border-top: 1px solid var(--line);
  }
  .dashboard-table tbody tr:nth-child(even) { background: var(--paper); }
  .dashboard-table tbody tr > *, .dashboard-table tbody tr:hover > * {
    min-width: 0; max-width: none; padding: 0; border: 0; background: transparent; text-align: left;
  }
  .dashboard-table tbody tr th[scope="row"] {
    grid-column: 1 / -1; grid-row: 1; min-width: 0; max-width: none; padding-left: 30px; font-size: 1rem;
  }
  .dashboard-table .row-number { grid-column: 1; grid-row: 1; color: var(--accent); font-weight: 650; }
  .dashboard-table .work-plan { grid-area: 2 / 1; padding: 3px 0; }
  .dashboard-table tbody tr .work-fact, .dashboard-table tbody tr:hover .work-fact {
    grid-area: 2 / 2; padding: 3px 6px; background: var(--tint);
  }
  .dashboard-table .work-delta { grid-area: 2 / 3; padding: 3px 0; }
  .dashboard-table .work-progress { grid-area: 3 / 2 / 4 / 4; min-width: 0; text-align: left; }
  .dashboard-table .work-remaining { grid-area: 3 / 1; }
  .dashboard-table .work-start { grid-area: 4 / 1; text-align: left; }
  .dashboard-table .work-finish { grid-area: 4 / 2; text-align: left; }
  .dashboard-table .work-total { grid-area: 4 / 3; }
  .dashboard-table .mobile-label {
    display: block; margin-bottom: 1px; color: var(--muted); font-size: .8125rem; font-weight: 400;
  }
}

@media (max-width: 760px) {
  :root { --work-width: 130px; }
  .page { padding-block: 19px 30px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 13px; }
  .masthead-inner { min-height: 60px; }
  .tabs button { padding-inline: 8px; }
  .tabs button { font-size: .875rem; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 7px 9px; }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat:nth-child(even) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .filter-bar { flex-wrap: wrap; gap: 8px; padding: 8px; margin-bottom: 13px; }
  .object-field { flex: 1 1 100%; }
  .date-field { flex: 1 1 130px; min-width: 0; }
  .section-heading, .form-footer { padding-inline: 11px; }
  .table-note { padding-inline: 11px; }
  .entry-hint { margin-inline: 11px; }
  .entry-table, .history-table { display: block; min-width: 0; }
  .entry-table tbody, .history-table tbody { display: block; }
  .entry-table thead, .history-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .entry-table tbody tr, .history-table tbody tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 9px;
    padding: 10px 11px; border-top: 1px solid var(--line);
  }
  .entry-table tbody tr > *, .entry-table tbody tr:hover > *,
  .history-table tbody tr > *, .history-table tbody tr:hover > * {
    padding: 0; border: 0; background: transparent; text-align: left;
  }
  .entry-table tbody tr th:first-child { grid-column: 1 / -1; padding-left: 0; }
  .history-table tbody tr th:first-child { padding-left: 0; }
  .entry-table tbody tr th label { font-size: 1rem; }
  #inspection .table-scroll { background: var(--paper); padding: 8px; }
  .entry-table tbody tr { background: white; border: 1px solid var(--line); border-radius: 8px; }
  .entry-table tbody tr + tr { margin-top: 8px; }
  .entry-table tbody tr.has-entry { border-left: 3px solid #307656; }
  .entry-table .quantity-field { border-radius: 6px; overflow: hidden; }
  #inspection .form-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .entry-unit { display: none; }
  .entry-table .mobile-unit { display: inline; font-weight: 400; color: var(--muted); }
  .entry-table .entry-measure {
    display: grid; grid-template-columns: minmax(105px, 1fr) minmax(110px, 1fr);
    grid-column: 1 / -1; align-items: center; gap: 8px;
  }
  .entry-table .entry-measure input { min-height: 44px; max-width: none; font-size: 1rem; }
  .entry-measure .quantity-field { max-width: none; }
  .entry-measure .text-button { min-height: 44px; }
  .entry-table .entry-measure .mobile-label { font-size: .875rem; font-weight: 700; color: var(--ink); }
  .entry-table .mobile-label, .history-table .mobile-label {
    display: block; margin-bottom: 1px; color: var(--muted); font-size: .8125rem; font-weight: 400;
  }
  .form-footer { position: sticky; bottom: 0; z-index: 2; background: var(--white); border-top: 1px solid var(--line); }
  .form-footer .button { min-height: 44px; }
  .history-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-table .history-inspector { white-space: normal; }
  .history-table .history-open { align-self: end; }
  .history-table .text-button { min-height: 44px; }
  .ledger-nav { padding-inline: 11px; }
  .ledger-section .section-heading h2 { font-size: 1rem; letter-spacing: -.015em; }
  .ledger-table td, .ledger-table th { padding-inline: 8px; }
  .ledger-table .week-metric { min-width: 79px; }
  .ledger-table .pinned-unit { min-width: 53px; }
}

@media (max-width: 485px) {
  .brand { gap: 8px; }
  .brand-title { padding-left: 8px; font-size: 1.12rem; }
  .account-actions { gap: 6px; }
  .masthead #logout { padding-inline: 7px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { min-height: 42px; }
  #new-visit { display: none; }
  .form-footer { flex-wrap: wrap; gap: 5px; }
  .form-footer > .muted { display: none; }
  .form-footer .actions { flex: 1 1 auto; }
  .form-footer .actions > .primary { flex: 1; }
}

@media (max-width: 400px) {
  .masthead-inner { grid-template-columns: minmax(0,1fr) auto; }
  .account-actions { display: contents; }
  .account-identity { grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
  .masthead #logout { grid-row: 1; grid-column: 2; }
  .nav-wrap { grid-row: 3; }
}

.compact-picker #priority-trigger, .compact-picker #priority-options [role=option] {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.compact-picker #priority-name, .compact-picker .option-name {
  flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; text-align: start;
}
.compact-picker #priority-trigger, .date-trigger {
  min-height: 46px; padding: 9px 12px; font-size: .9375rem; font-weight: 600; letter-spacing: normal;
}
.compact-picker .picker-caret { flex: none; }
.compact-picker #priority-options [role=option] { min-height: 46px; padding: 10px 12px; }
.compact-picker #priority-options [role=option] + [role=option] { margin-top: 2px; }
.compact-picker #priority-trigger:focus-visible {
  outline-offset: 2px;
}
.date-trigger {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid #cfb9bf; border-radius: 9px; background: white; color: var(--ink); font-variant-numeric: tabular-nums;
}
.date-trigger:hover { border-color: var(--accent); }
.calendar-icon {
  display: block; position: relative; width: 17px; height: 16px; margin-inline: 4px;
  border: 1.6px solid var(--accent); border-radius: 4px;
  background: linear-gradient(to bottom, transparent 4px, var(--accent) 4px 5px, transparent 5px);
}
.calendar-icon::before, .calendar-icon::after {
  content: ""; position: absolute; top: -3px; left: 3px; width: 2px; height: 4px; border-radius: 2px; background: var(--accent);
}
.calendar-icon::after { left: auto; right: 3px; }
#calendar {
  width: min(370px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 18px; color: var(--ink); background: white; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 20px 75px #38212d33; font-variant-numeric: tabular-nums;
}
#calendar::backdrop { background: rgb(40 25 32 / 32%); }
.calendar-top, .month-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.calendar-top { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.calendar-top h2 { font-size: 1.25rem; }
.month-nav { margin-block: 9px 3px; }
#calendar-month { font-size: 1.05rem; }
#calendar-month::first-letter { text-transform: uppercase; }
.icon-button {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid transparent; border-radius: 9px; color: var(--accent); background: var(--tint);
}
.icon-button:hover { border-color: #d9c0c7; }
.month-prev::before, .month-next::before {
  content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(135deg);
}
.month-next::before { transform: rotate(-45deg); }
.calendar-close { background: transparent; }
.calendar-close::before, .calendar-close::after {
  content: ""; position: absolute; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(45deg);
}
.calendar-close::after { transform: rotate(-45deg); }
.weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays span { padding-block: 9px; color: var(--muted); font-size: .8rem; font-weight: 650; text-align: center; }
.calendar-days button {
  position: relative; min-height: 43px; padding: 0; border: 1px solid transparent; border-radius: 8px;
  color: var(--ink); background: white; font-size: .94rem; font-weight: 600;
}
.calendar-days button:hover { background: var(--tint); border-color: #e6cdd4; }
.calendar-days button[aria-pressed=true] { background: var(--accent); color: white; }
.calendar-days button[aria-current=date]::after {
  content: ""; position: absolute; bottom: 4px; left: calc(50% - 2px); width: 4px; height: 4px;
  border-radius: 50%; background: currentColor;
}
.calendar-days button:focus-visible { outline-offset: -3px; }
.calendar-days button[aria-pressed=true]:focus-visible { outline-color: white; }
.calendar-shortcuts { margin-block: 9px 12px; }
.calendar-entry { border-top: 1px solid var(--line); padding-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; }
.calendar-entry label { grid-column: 1 / -1; }
.calendar-entry input { min-width: 0; font-variant-numeric: tabular-nums; }
.calendar-entry input[aria-invalid=true] { border-color: var(--accent); }
#date-error { grid-column: 1 / -1; color: var(--accent); font-size: .85rem; }
.work-details summary, .revision-list summary { position: relative; padding-right: 44px; list-style: none; }
summary::-webkit-details-marker { display: none; }
.work-details summary::after, .revision-list summary::after {
  content: ""; position: absolute; top: calc(50% - 5px); right: 16px; width: 8px; height: 8px;
  border: solid var(--accent); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg);
}
details[open] > summary::after { transform: rotate(225deg); }
.revision-list details { border-radius: 8px; }
@media (prefers-reduced-motion: no-preference) {
  #calendar[open] { animation: menu-appear 170ms ease-out; }
  .date-trigger, .ledger-nav button, .text-button, .icon-button, .today-button, .calendar-days button {
    transition: border-color 140ms, background-color 140ms, color 140ms;
  }
  summary::after { transition: transform 160ms; }
}
@media (max-width: 560px) {
  #calendar {
    width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0;
    border-radius: 18px 18px 0 0; padding: 14px 16px max(16px, env(safe-area-inset-bottom));
  }
  .calendar-days button, .icon-button, .today-button, .calendar-entry input, .calendar-entry button { min-height: 44px; }
  .icon-button { width: 44px; }
  .calendar-entry input { font-size: 1rem; }
}

/* Architectural plates: the artwork has its own clipped coordinate space. */
:root { --graphite: #1c2023; --signal: #e23d35; --sheet: #f4f3ef; --ink: #24282b; --line: #d8d7d2; }
body { background: var(--sheet); min-height: 100vh; isolation: isolate; }
.drawing-paper {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 86% 14%, #e9e6dd, transparent 65%), var(--sheet);
}
.drawing-paper i { position: absolute; inset: -38px; opacity: .42;
  background-image: linear-gradient(#c7c9c1 1px, transparent 1px), linear-gradient(90deg,#c7c9c1 1px, transparent 1px);
  background-size: 36px 36px; }
.page { padding-block: clamp(15px, 2.5vw, 36px) 44px; }
.page-heading, .studio-cover, .filter-bar, .work-card, .section-heading, .account-dialog, #calendar {
  isolation: isolate;
}
.page-heading, .studio-cover, .work-card, .section-heading, .filter-bar { position: relative; }
.scene-art {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit;
  pointer-events: none; --dx: 0px; --dy: 0px;
}
.scene-art i { display: block; position: absolute; }
@media (prefers-reduced-motion: no-preference) {
  .page-heading .scene-art i { transition: transform 180ms ease-out; }
}
.page-heading:not(:hover) .scene-art i { transform: none; }
.scene-model {
  inset: -42px -30px; background: #111 url("/architectural-model.jpg") 68% 51% / cover no-repeat;
  transform: translate3d(calc(var(--dx) * -.65), calc(var(--dy) * -.92), 0);
}
.scene-grid {
  inset: -55px; opacity: .5;
  background-image: linear-gradient(#ffffff36 1px, transparent 1px), linear-gradient(90deg, #ffffff36 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(115deg, transparent 32%, black);
  transform: translate3d(var(--dx), var(--dy), 0);
}
.scene-trace {
  width: 38%; height: 72%; right: 9%; top: 19%; border: solid #ff6255; border-width: 1px 0 0 1px;
  transform: translate3d(calc(var(--dx) * 1.7), calc(var(--dy) * 1.45), 0);
}
.scene-trace::before, .scene-trace::after { content: ""; position: absolute; width: 8px; height: 8px; background: #ff6255; }
.scene-trace::before { left: -4px; top: -4px; }
.scene-trace::after { right: -2px; top: -4px; background: transparent; border: 1px solid #ff6255; }
.page-heading {
  min-height: clamp(126px, 14vw, 206px); padding: clamp(19px, 3vw, 44px); margin-bottom: 16px;
  background: var(--graphite); color: white; border-radius: 3px;
}
.page-heading h1 { max-width: 19ch; font-size: clamp(1.9rem, 4.2vw, 4.4rem); line-height: .99; text-wrap: balance; }
.page-heading .scene-model { inset-inline-start: 29%; background-position: 68% 47%; }
.page-heading .scene-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--graphite) 13%, #1c2023ee 32%, #1c20236d 65%, #1c20231c); }
.page-heading .scene-grid, .page-heading .scene-trace { z-index: 1; }
.page-heading .scene-trace { height: 55%; width: 16%; right: 9%; opacity: .8; }
.page-heading .overview-date { display: grid; gap: 5px; color: white; background: #202326e8; padding: 9px 12px; border-left: 2px solid #f65d50; }
.overview-date .field-label { font-size: .76rem; }
.page[data-view="dashboard"] .page-heading { min-height: clamp(154px, 17vw, 245px); }
.page[data-view="inspection"] .scene-model { background-position-y: 64%; }
.page[data-view="history"] .scene-model { background-position-y: 33%; }
.page[data-view="ledger"] .scene-model { background-position-y: 72%; }
.panel.section, .work-card, .object-list, .filter-bar { background-color: #fff; }
:root {
  --panel-edge: #dfdeda;
  --panel-inset: clamp(10px, 1.8vw, 28px);
  --panel-radius: 12px;
}
.panel.section, .object-list, .work-card, .filter-bar, .empty-state, .revision-list details {
  border-color: var(--panel-edge);
}
.panel.section { padding: clamp(10px, 1.3vw, 20px) var(--panel-inset); }
.panel.section, .object-list, .work-card, .filter-bar, .watch-total {
  box-shadow: 0 3px 12px rgb(44 39 36 / 4%);
}
.work-details > .ledger-section { padding: 0; border: 0; box-shadow: none; }
.work-details summary { padding: 8px 38px 8px 0; }
.work-details summary::after { right: 6px; }
.work-details[open] > summary { margin-bottom: 14px; }
.ledger-section .ledger-nav { padding: 12px 0; border-top: 0; }
.ledger-section .ledger-scrollbar { width: 100%; margin-inline: 0; }
.ledger-section .table-note { padding: 8px 0 2px; }
.watch-total { border: 1px solid transparent; }
.watch-total.is-clear { border-color: transparent; }
@media (max-width: 760px) { .entry-table tbody tr { border-color: var(--panel-edge); } }
.watch-total, .object-list, .work-card, .filter-bar, .panel.section, .empty-state { border-radius: var(--panel-radius); }
.portfolio { gap: clamp(12px, 1.6vw, 24px); }
.object-list, .watch-total { padding: clamp(16px, 1.85vw, 28px); }
.watch-total { background: linear-gradient(122deg, #722333, #ac2a38 64%, #cc4436); }
.watch-total::after { display: none; }
.watch-total .scene-trace { opacity: .8; right: 8%; width: 24%; }
.watch-total.is-clear { background: #375747; }
.watch-total.is-clear .scene-trace { display: none; }
.filter-bar { padding: clamp(12px, 1.4vw, 20px) var(--panel-inset); background: #fff; border-inline-start: 1px solid var(--panel-edge); }
.section-heading { padding: 5px 0 14px; background-color: transparent; }
.work-card .scene-art, .section-heading .scene-art, .filter-bar .scene-art, dialog .scene-art {
  mask-image: linear-gradient(110deg, transparent 45%, #000 100%);
}
.work-card .scene-grid, .section-heading .scene-grid, .filter-bar .scene-grid, dialog .scene-grid {
  background-image: linear-gradient(#979f9e40 1px, transparent 1px), linear-gradient(90deg, #979f9e40 1px, transparent 1px);
  background-size: 23px 23px;
}
.work-card .scene-trace, .section-heading .scene-trace, .filter-bar .scene-trace {
  width: 52px; height: 28px; right: 9%; top: 21%; opacity: .4;
}
.review-heading { margin-top: 20px; }
.entry-table .quantity-field, .primary, .secondary { border-radius: 5px; }
.login-layout {
  max-width: 1420px; margin: clamp(0px, 2vh, 24px) auto; display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr); background: #fcfbf8;
  border: 1px solid #cecec8; box-shadow: 0 14px 40px #26272b0e;
}
.studio-cover { min-height: clamp(440px, 68vh, 720px); background: #191b1b; color: white; }
.studio-cover .scene-model { background-position: 68% center; }
.studio-cover .scene-grid { opacity: .32; }
.studio-cover .scene-trace { width: 29%; height: 36%; top: 41%; right: 14%; }
.cover-title { padding: clamp(24px, 4vw, 66px); font-size: clamp(3rem, 6.6vw, 7.7rem); line-height: .9;
  font-weight: 650; letter-spacing: -.075em; text-shadow: 0 1px 16px #16161650; }
.cover-title strong { display: inline-block; color: #ff6051; font-weight: 750; }
.login-layout .login-panel { width: 100%; margin: 0; padding: clamp(24px, 3vw, 50px); border: none; border-radius: 0;
  background: transparent; align-self: center; }
.login-panel .account-form { max-width: 360px; margin-inline: auto; gap: 17px; }
.login-panel .account-form h1 { padding-top: 15px; margin-bottom: 5px; border-top: 2px solid var(--graphite); font-size: clamp(1.65rem, 2.4vw, 2.4rem); }
.login-panel .primary { min-height: 46px; }
@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; margin-top: 0; }
  .studio-cover { min-height: clamp(165px, 28vh, 235px); }
  .studio-cover .scene-model { background-position: 67% 48%; }
  .cover-title { padding: 24px; font-size: clamp(2.25rem, 9vw, 4.5rem); }
  .login-layout .login-panel { padding: 23px clamp(16px, 5vw, 34px) 29px; }
  .login-panel .account-form { max-width: none; gap: 12px; }
  .page-heading { min-height: 105px; gap: 13px; }
  .page-heading h1 { font-size: clamp(1.65rem, 5.8vw, 2.55rem); }
  .page-heading .scene-model { inset-inline-start: 10%; }
  .page-heading .overview-date { display: flex; flex-wrap: wrap; padding: 5px 8px; }
  .overview-date .date-trigger { min-width: 115px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-art i, .drawing-paper i { transform: none; }
}
