:root {
  color-scheme: light;
  /* Visual tokens from MonuStrand-GUI_demo.html. */
  --bg: #f3f1ec;
  --panel: #fff;
  --accent: #2f5d50;
  --soft: #dfe9e4;
  --warm: #f2ead6;
  --shadow: 0 12px 32px rgb(0 0 0 / 7%);
  --header: #202723;
  --sidebar: #29312d;
  --paper: var(--bg);
  --surface: var(--panel);
  --ink: #242622;
  --muted: #747970;
  --line: #deded8;
  --pine: var(--accent);
  --moss: var(--soft);
  --rust: #8b382d;
  font: 16px/1.45 Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: inherit; line-height: 1.25; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
button, select, input, textarea { font: inherit; }
button, select, input, progress { accent-color: var(--pine); }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #795f20; outline-offset: 3px; }
button, select, input:not([type="checkbox"]) { min-height: 44px; }
select, input:not([type="checkbox"]) { color: var(--ink); width: 100%; padding: 10px; border: 1px solid #ccd0ca; background: var(--surface); border-radius: 7px; }
.btn { background: #e5e7e4; color: #28302c; border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 650; }
.btn:hover { background: var(--moss); }
.primary { color: white; background: var(--pine); border-color: var(--pine); }
.primary:hover { background: #244a3f; }
.danger { color: var(--rust); }
.subtle { background: transparent; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: inline-block; flex: 0 0 auto; background: currentColor; -webkit-mask: url("/brand-mark.svg") center / contain no-repeat; mask: url("/brand-mark.svg") center / contain no-repeat; }
.app-shell { display: grid; grid-template-columns: 235px minmax(0, 1fr); grid-template-rows: 70px 1fr; min-height: 100svh; }
.header { grid-column: 1 / -1; color: #fff; background: var(--header); display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 26px; gap: 20px; }
.header .brand { color: inherit; text-decoration: none; }
.header-controls, .header-desktop-settings { display: flex; align-items: center; gap: .35rem; }
.header .btn, .header select { color: #d7ddd9; background: #39443f; border-color: #526059; font-size: 13px; width: auto; }
.header .btn:hover { color: #fff; background: #46534c; }
.header option { color: var(--ink); background: var(--surface); }
.nav { grid-column: 1; grid-row: 2; background: var(--sidebar); color: #dce2de; padding: 20px 13px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.nav > button { border: 0; border-radius: 8px; background: transparent; color: #dce2de; padding: 11px 12px; text-align: left; font-size: 14px; font-weight: 500; flex: 0 0 auto; }
.nav > button[aria-current="page"], .nav > button:hover { background: #3a4741; color: #fff; }
.module-menu, .nav-mobile-settings { display: none; }
.main { grid-column: 2; grid-row: 2; min-width: 0; width: 100%; max-width: 1500px; margin: 0 auto; padding: 27px; }
.page-head { margin-bottom: 20px; display: flex; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.page-head h1 { font-size: 28px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; min-height: 2.75rem; padding: .45rem; }
.icon-button svg { width: 1.1rem; height: 1.1rem; }
.task-row > .check { width: 40px; height: 40px; min-height: 40px; flex-basis: 40px; border-radius: 10px; font-size: 1.05rem; }
.date { color: var(--muted); margin-bottom: .45rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card-head { padding: 19px 19px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-body { padding: 0 19px 19px; }
.columns { display: grid; gap: 18px; align-items: start; }
.stack { display: grid; gap: 13px; }
.list { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 13px 19px; border-top: 1px solid #ecece7; font-size: 14px; }
.row:first-child { border-top: 0; }
.card > .list > .row:first-child { border-top: 1px solid var(--line); }
.row-main { min-width: 0; flex: 1 1 12rem; }
.title { font-weight: 650; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .83rem; margin-top: .15rem; overflow-wrap: anywhere; }
.overdue { color: var(--rust); }
.row.done .title { color: var(--muted); text-decoration: line-through; }
.area-tint {
  background: color-mix(in srgb, var(--area-color), white 70%);
  background: hsl(from var(--area-color) h s max(l, 82));
}
:is(.task-note, .routine-note) > summary { cursor: pointer; }
.task-note-form { display: grid; justify-items: start; gap: .3rem; margin-block: .4rem; }
.task-note-form .field { width: 100%; font-size: .85rem; }
.task-note-form textarea { min-width: 0; width: 100%; }
:is(.task-note-text, .routine-note-text) { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: .4rem; }
.area-colors {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .85rem 1rem;
  min-width: 0; margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 8px;
}
.area-color-wheel {
  position: relative; width: min(10rem, 100%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle closest-side, #808080, transparent),
    conic-gradient(in srgb, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  touch-action: none; cursor: crosshair;
}
.area-color-marker {
  position: absolute; width: 1rem; height: 1rem; border: 2px solid white; border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 1px #242d28; pointer-events: none;
}
.area-color-fields { display: grid; gap: .55rem; flex: 1 1 12rem; min-width: 0; }
.area-color-hex { display: flex; align-items: end; gap: .45rem; }
.area-color-hex .field { flex: 1; }
.area-color-swatch { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 8px; }
.area-color-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.area-color-fields .field { font-size: .8rem; }
.area-color-fields input { width: 100%; min-width: 0; }
.area-color-fields > button { justify-self: start; }
.check { display: grid; place-content: center; width: 44px; height: 44px; border-radius: 12px; background: transparent; border: 1px solid #8a9d90; flex: 0 0 44px; font-size: 1.18rem; font-weight: 800; }
.check[aria-pressed="true"] { background: var(--moss); border-color: #6c8a73; color: var(--pine); }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.actions .btn { font-size: .86rem; }
.empty { color: var(--muted); padding: .2rem 1rem 1rem; }
.field { display: grid; gap: 5px; font-size: 12px; color: #60665f; font-weight: 650; }
.field input, .field select, .field textarea { font-size: 14px; font-weight: 400; }
.field small { color: var(--muted); font-weight: 400; }
.inline { display: flex; gap: .45rem; align-items: end; flex-wrap: wrap; }
.inline > label { flex: 1 1 9rem; }
.filter { min-width: 10rem; }
progress { width: min(10rem, 100%); height: .5rem; display: block; margin-top: .36rem; }
.status { min-height: 1.5rem; margin: 0 0 .4rem; color: var(--rust); }
.status:empty { display: none; }
.login { min-height: 100svh; display: grid; place-items: center; padding: 1rem; }
.login .card { width: min(100%, 28rem); padding: 28px; }
.login .brand { margin: 0 0 24px; color: var(--accent); font-size: 27px; }
.login .brand-mark { width: 40px; height: 40px; }
.login select { width: auto; }
.initial { padding: 2rem; }
.card-body a { color: var(--pine); }
dialog { width: min(calc(100% - 24px), 32rem); max-height: 90vh; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--ink); background: var(--panel); padding: 24px; }
dialog::backdrop { background: rgb(32 39 35 / 55%); }
dialog h2 { margin-bottom: 1rem; }
dialog .status { margin: 0; }
dialog .actions { margin-top: .3rem; }
.checkbox { display: flex; align-items: center; min-height: 44px; gap: .5rem; }
.checkbox input { width: 1.15rem; height: 1.15rem; }
[hidden] { display: none !important; }
@media (min-width: 901px) {




.columns { grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); }
.card-head, .row { padding-inline: 1.25rem; }
.card-body, .empty { padding-inline: 1.25rem; }
}
@media (max-width: 26rem) {
.row { flex-wrap: wrap; }
.row-main { flex-basis: 8rem; }
.row > .actions { margin-left: auto; }
}
@media (max-width: 900px) {
.app-shell { grid-template-columns: minmax(0, 1fr); }
.main { grid-column: 1; padding: 20px 16px; }
.columns, .tasks-columns { grid-template-columns: minmax(0, 1fr); }
.header { position: relative; padding: 0 16px; gap: 12px; }
.header-desktop-settings { display: none; }
.module-menu { display: grid; place-items: center; min-width: 44px; }
.module-menu span { width: 1rem; height: 2px; background: currentColor; box-shadow: 0 -5px currentColor, 0 5px currentColor; }
.nav { display: none; position: absolute; z-index: 3; top: 70px; right: 12px; width: min(19rem, calc(100% - 24px)); padding: 13px; border-radius: 0 0 12px 12px; background: var(--sidebar); box-shadow: var(--shadow); }
.nav.nav-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; }
.nav button { text-align: left; }
.nav-mobile-settings { display: flex; grid-column: 1 / -1; gap: .4rem; padding-top: .4rem; border-top: 1px solid #698278; }
.nav-mobile-settings .btn, .nav-mobile-settings select { color: #d7ddd9; background: #39443f; border: 1px solid #526059; border-radius: 8px; text-align: center; font-size: 13px; }
}
textarea { width: 100%; resize: vertical; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #ccd0ca; border-radius: 7px; padding: 10px; }
.task-area-group h3, .task-project h4 { margin: 0; overflow-wrap: anywhere; }
.task-area-group { display: grid; gap: .45rem; }
.task-area-group + .task-area-group { padding-top: .65rem; border-top: 1px solid var(--line); }
.task-project { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; }
.task-project-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.task-completed-projects > summary, .completed-items > summary { color: var(--muted); cursor: pointer; }
.completed-items.card > summary { padding: .8rem 1rem; }
.task-completed-projects > .task-project { margin-top: .45rem; }
.task-tree .task-tree { margin-inline-start: .65rem; border-inline-start: 1px solid var(--line); }
.task-tree > li > .row { padding: .45rem .25rem; }
.task-tree > li + li { border-top: 1px solid var(--line); }
.task-tree .actions .btn { padding-inline: .5rem; }
@media (min-width: 901px) {
.tasks-columns { grid-template-columns: minmax(0, 3fr) minmax(14rem, 1fr); }
}
.routine-credit { color: var(--muted); min-width: 2.25rem; }
.routine-bank-details { margin: .4rem 0; }
.checklist-editor { padding: .4rem 0; }
.checklist-editor summary { color: var(--muted); cursor: pointer; }
.checklist-editor textarea { margin-top: .5rem; }
.procedure-steps { display: grid; gap: .25rem; margin: .6rem 0; }
.procedure-step { display: flex; align-items: flex-start; gap: .6rem; padding: .35rem .15rem; min-height: 2.4rem; }
.procedure-step input[type=checkbox] { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; margin-top: .15rem; }
.procedure-step span { overflow-wrap: anywhere; }
.row.done .procedure-steps { color: var(--ink); }

@media (max-width: 480px) {
  .header { padding-inline: 12px; gap: 10px; }
  .header .brand { font-size: 21px; gap: 8px; }
  .header .brand-mark { width: 28px; height: 28px; }
  .header-controls { gap: 6px; }
  .header-controls > .btn { padding-inline: 10px; }
}

.inscription { white-space: pre-wrap; font: inherit; }

/* Operational workspaces follow the mockup's grouping and density. */
h3 { margin: 0; font-size: 14px; }
.intro { color: var(--muted); max-width: 75ch; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid > * { min-width: 0; }
.detail p { white-space: pre-wrap; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 14px; }
.stat { padding: 20px; }
.stat strong { font-size: 30px; color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-strip { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
.stage { border:1px solid var(--line); border-radius:8px; padding:10px; font-size:12px; display:grid; gap:5px; background:#fff; }
.stage.done { border-color:#a4c1b4; background:var(--soft); }
.filter-bar { display:flex; align-items:end; gap:12px; flex-wrap:wrap; }
.filter-bar .field { flex:1 1 140px; }
.filter-bar .field:first-child { flex:2 1 220px; }
/* Order filters: one search row, paired dates and a consistently aligned registry row. */
.filter-bar.order-filters {
  display:grid; gap:18px; padding:20px; min-width:0;
  background:var(--panel); border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow);
}
.order-filter-primary {
  display:grid; grid-template-columns:minmax(0,1.6fr) minmax(9rem,.8fr) minmax(19rem,1.4fr);
  align-items:start; gap:16px;
}
.order-filter-dates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-width:0; }
.order-filter-relations {
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)) auto;
  align-items:start; gap:12px; border-top:1px solid var(--line); padding-top:18px;
}
.order-filters .field { min-width:0; align-content:start; margin:0; }
.order-filters input,.order-filters select { min-width:0; }
.order-filters input[type=date] { display:block; min-inline-size:0; font-variant-numeric:tabular-nums; }
.order-filters .registry-picker { align-content:start; }
.order-filters .registry-picker > .meta:empty { display:none; }
.order-filter-apply { align-self:end; white-space:nowrap; }
.order-filter-context { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.order-filter-context .meta { margin:0; flex:1 1 15rem; }
@media (max-width:1199px) {
  .order-filter-relations { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:1100px) {
  .order-filter-primary { grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); }
  .order-filter-dates { grid-column:1/-1; }
}
@media (max-width:600px) {
  .filter-bar.order-filters { padding:16px; gap:16px; }
  .order-filter-primary { grid-template-columns:minmax(0,1fr); gap:12px; }
  .order-filter-relations { grid-template-columns:repeat(2,minmax(0,1fr)); padding-top:16px; }
  .order-filter-apply { width:100%; }
}
@media (max-width:359px) {
  .filter-bar.order-filters { padding:12px; }
  .order-filter-relations { grid-template-columns:minmax(0,1fr); }
  .order-filter-dates { gap:8px; }
  .order-filter-dates input { padding-inline:7px; }
}
.user-import-modal { width:min(52rem,calc(100vw - 32px)); }
.user-import-modal .field,.user-import-modal input,.user-import-modal select { min-width:0; }
.user-import-modal .csv-row { overflow-wrap:anywhere; }
.user-import-modal .csv-row > form,.user-import-modal .csv-row > p { margin:16px; }
.user-import-fields { border:0; padding:0; margin:0; min-width:0; }
.user-import-fields dl { margin:0; }
.user-import-fields dt { font-weight:600; }
.user-import-fields dd { margin:4px 0 12px; }
.table-scroll { overflow-x:auto; }
table { border-collapse:collapse; width:100%; text-align:left; font-size:14px; }
th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); background:#fafaf7; }
th,td { padding:13px 18px; border-top:1px solid #ecece7; vertical-align:middle; }
.text-button { color:var(--accent); background:transparent; padding:0; text-align:left; }
.badge { display:inline-block; font-size:11px; padding:4px 8px; border-radius:20px; background:var(--soft); color:#2b5547; white-space:nowrap; }
.btn:is(a) { display:inline-flex; align-items:center; text-decoration:none; font-size:13px; }
fieldset { border:1px solid var(--line); border-radius:8px; padding:14px; margin:0; min-width:0; }
legend { font-size:12px; color:var(--muted); padding:0 6px; }
.item-detail + .item-detail { border-top:1px solid var(--line); padding-top:16px; }
dialog.wide { width:min(calc(100% - 24px),900px); }
.price-line .form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.nav-group > summary { padding:11px 12px; border-radius:8px; font-size:14px; cursor:pointer; }
.nav-group[open] > summary { color:#fff; }
.subnav { display:grid; gap:2px; padding:2px 0 8px 14px; }
.subnav button { text-align:left; font-size:12px; color:#b8c6bd; border:0; border-radius:7px; background:transparent; padding:8px 12px; min-height:36px; }
.subnav button:hover,.subnav button[aria-current=page] { background:#3a4741; color:#fff; }
.company-selector { max-width:420px; margin-bottom:20px; }
@media (max-width:1100px) { .stage-strip { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:600px) { .form-grid,.price-line .form-grid { grid-template-columns:minmax(0,1fr); } .stage-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .main { padding:16px 12px; } .nav.nav-open { display:flex; max-height:calc(100svh - 85px); overflow-y:auto; } }

.content-operation .list { max-height: 18rem; overflow-y: auto; }
.checksum { overflow-wrap:anywhere; }

/* Reusable private sticky note and registry widgets. */
.sticky-icon { color:var(--muted,#777); background:transparent; min-width:2.75rem; min-height:2.75rem; font-size:1.25rem; }
.sticky-icon.has-note { color:#665000; background:#ffe56b; border-color:#ccb749; }
dialog.sticky-note { background:#fff2a8; color:#27220f; width:min(28rem,calc(100vw - 2rem)); padding:1.1rem; border:1px solid #c2ac49; border-radius:.35rem; box-shadow:0 .6rem 2rem #0003; }
.sticky-surface { min-height:9rem; max-height:55vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; margin:1rem 0; outline-offset:.25rem; }
.sticky-actions { display:flex; justify-content:flex-end; gap:.5rem; }
.address-widget { display:grid; gap:.5rem; }
.address-results { display:grid; gap:.35rem; max-height:min(14rem,35svh); overflow:auto; }
.registry-results { display:grid; gap:.75rem; }
.registry-matches { display:grid; gap:.4rem; max-height:min(14rem,35svh); overflow:auto; }
.suggestion { text-align:left; white-space:normal; }
.duplicate-panel { border:2px solid #b89533; border-radius:.4rem; padding:1rem; display:grid; gap:.5rem; }
.lookup-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
@media print { .internal-only,.sticky-note,.sticky-icon { display:none !important; } }

.registry-search { border:1px solid var(--line); border-radius:8px; padding:1rem; }
.registry-match { display:grid; gap:.25rem; width:100%; }
.registry-review { border:1px solid var(--line); border-radius:8px; background:var(--surface); padding:1rem; scroll-margin:1rem; }
.registry-review h3 { margin:0; }
.registry-review-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem 1.25rem; margin:0; }
.registry-review-values dt { color:var(--muted); font-size:.85em; margin-bottom:.2rem; }
.registry-review-values dd { margin:0; white-space:pre-line; overflow-wrap:anywhere; }
.municipality-field { flex:1 1 14rem; }
.lookup-actions { align-items:end; }
@media (max-width:600px) { .registry-review-values { grid-template-columns:minmax(0,1fr); } .registry-search { padding:.75rem; } }

.vehicle-categories { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.4rem; }

.related-context { padding: 1rem; border-inline-start: 3px solid var(--accent); background: var(--surface); }

/* Quiet order context, shared by full screens and order-related dialogs. */
.order-flow { display:flex; align-items:center; gap:.6rem; min-width:0; padding:.3rem 0; color:var(--muted,#657078); font-size:.69rem; }
.order-flow-steps { display:flex; align-items:center; flex-wrap:nowrap; list-style:none; margin:0; padding:0; min-width:0; gap:.35rem; }
.flow-step { display:flex; align-items:center; gap:.25rem; white-space:nowrap; }
.flow-step:not(:last-child)::after { content:'›'; opacity:.4; margin-left:.1rem; }
.flow-dot { width:5px; height:5px; border:1px solid currentColor; border-radius:50%; opacity:.4; flex:none; }
.flow-step.done .flow-dot { background:currentColor; opacity:.7; }
.flow-step.current { color:var(--accent,#315a66); font-weight:650; }
.flow-step.current .flow-dot { opacity:1; box-shadow:0 0 0 2px color-mix(in srgb,currentColor 14%,transparent); }
.flow-side { display:flex; gap:.3rem; margin-left:auto; white-space:nowrap; }
.flow-chip { padding:.08rem .3rem; border:1px solid var(--line,#dde2e5); border-radius:1rem; font-weight:400; }
@media(max-width:650px) { .flow-step:not(.neighbour) .flow-label { display:none; } .flow-side { display:none; } .order-flow-steps { gap:.25rem; } }
@media print { .order-flow { display:none; } }

/* Link the complete count card; preserve its compact overview presentation. */
.stat-link { color: var(--ink); text-decoration: none; cursor: pointer; }
.stat-link:hover { background: var(--soft); }
.stat-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.role-choices { display: grid; gap: .5rem; }
.role-choice { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); align-items: start; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 7px; }
.role-choice input[type="checkbox"] { margin: .15rem 0 0; }
.role-choice span { line-height: 1.5; overflow-wrap: anywhere; }

.order-action-bar { display:flex; flex-wrap:wrap; align-items:center; gap:1rem; }
.order-action-group { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; min-width:0; }
.order-report-actions { border-inline-start:1px solid var(--line); padding-inline-start:1rem; }
.order-report-actions { margin-inline-start:auto; }
.action-group-label { color:var(--muted); font-size:.8rem; padding-inline-end:.25rem; }
.order-progress-toolbar { align-items:flex-start; }
.order-progress-actions { flex:1; background:var(--soft); border:1px solid var(--line); border-radius:9px; padding:.65rem; }
.order-progress-actions > .action-group-label { flex-basis:100%; }
.progress-step-button { color:var(--accent); background:var(--surface); border:1px solid var(--accent); }
.progress-step-button:hover { background:var(--soft); }
.lettering-field { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:.3rem; min-width:0; }
.lettering-field .field { min-width:0; }
.lettering-field select { width:100%; min-width:0; }
.lettering-field .add-registry-entry { font-size:.75rem; padding:.4rem; white-space:nowrap; }
.lettering-specification { grid-column:1/-1; overflow-wrap:anywhere; font-size:.8rem; }
.position-map { margin-block:.65rem; min-width:0; }
.position-map-canvas { height:220px; width:100%; min-width:0; border:1px solid var(--line); border-radius:8px; background:var(--soft); isolation:isolate; }
.position-map-pin { background:transparent; border:0; }
.position-map-pin span { display:block; width:22px; height:22px; border:3px solid white; background:var(--accent); border-radius:50% 50% 50% 0; transform:rotate(-45deg); box-shadow:0 1px 5px #3338; }
.position-map-pin:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
.order-status-actions { flex:0 1 auto; }
@media (max-width:640px) {
  .order-action-bar { align-items:stretch; gap:.7rem; }
  .order-action-group { width:100%; }
  .order-report-actions { border-inline-start:0; border-block-start:1px solid var(--line); padding-inline-start:0; padding-block-start:.7rem; margin-inline-start:0; }
}

/* Search choices keep the company name, identifier and full address on separate lines. */
.registry-matches { align-items:start; grid-auto-rows:max-content; max-height:min(24rem,45svh); }
.registry-match { min-height:max-content; height:auto; align-content:start; padding:.8rem 1rem; overflow:visible; font-size:.95rem; line-height:1.45; font-weight:400; }
.registry-match strong { font-size:1rem; line-height:1.4; font-weight:650; overflow-wrap:anywhere; }
.registry-match .meta, .registry-match-address { display:block; font-size:.875rem; line-height:1.45; font-weight:400; white-space:normal; overflow-wrap:anywhere; }
.registry-match .meta { color:var(--muted); }
@media(max-width:480px){.registry-search{padding:.7rem}.registry-match{padding:.7rem}.registry-matches{max-height:40svh}}

.registry-review-modal { width:min(calc(100% - 24px),48rem); }
.registry-review-modal .registry-review { border:0; padding:0; }
dialog h2 > .sticky-icon { float:inline-end; margin-inline-start:.5rem; }

/* Registry file operations stay secondary to adding a single record. */
.registry-file-actions { display:inline-flex; flex-wrap:wrap; gap:.3rem; margin-inline:.3rem; }
.registry-file-actions .btn { font-size:.82rem; padding:.35rem .55rem; font-weight:500; }
.registry-csv-modal { width:min(55rem,calc(100vw - 2rem)); max-height:calc(100dvh - 2rem); overflow:auto; }
.csv-replace-warning { border-inline-start:4px solid #b37a19; background:#fff6df; padding:.8rem; }
.csv-row { border-bottom:1px solid var(--line,#ddd); padding:.6rem 0; }
.csv-row summary { cursor:pointer; }
.csv-row dl { margin:.7rem 0; }
.csv-row dl > div { display:grid; grid-template-columns:minmax(8rem,1fr) minmax(0,2fr); gap:.5rem; margin:.35rem 0; }
.csv-row dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.catalogue-matches { max-height:22rem; overflow:auto; }
.catalogue-price-details { display:grid; gap:.25rem; }
.catalogue-price-details p { margin:.15rem 0; }
.catalogue-choice { border-bottom:1px solid var(--line,#ddd); padding:.7rem 0; }
.catalogue-guide-steps { display:flex; flex-wrap:wrap; gap:.4rem .8rem; font-size:.78rem; color:var(--muted,#666); }
.catalogue-guide-steps .current { color:var(--accent,#315a4f); font-weight:700; }
.catalogue-panel details > .actions { margin:.7rem 0; }

/* Shared colour selection in order entry, quotations and register maintenance. */
.colour-chooser { position:relative; min-width:0; width:100%; }
.colour-chooser > select[hidden] { display:none; }
.colour-choice, .colour-option { display:flex; align-items:center; gap:.65rem; text-align:start; font:inherit; }
.colour-choice { width:100%; min-height:2.75rem; padding:.6rem .75rem; color:var(--ink); background:var(--paper,#fff); border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.colour-choice > span:not(.colour-swatch):not(.colour-chevron), .colour-option > span:not(.colour-swatch) { min-width:0; overflow-wrap:anywhere; }
.colour-chevron { margin-inline-start:auto; color:var(--muted); }
.colour-options { position:absolute; inset-inline:0; top:calc(100% + .25rem); z-index:1100; overflow:auto; overscroll-behavior:contain; padding:.25rem; border:1px solid var(--line); border-radius:8px; background:var(--paper,#fff); color:var(--ink); box-shadow:0 6px 18px #0002; }
.colour-options[hidden] { display:none; }
.colour-opens-up .colour-options { top:auto; bottom:calc(100% + .25rem); }
.colour-option { min-height:2.75rem; padding:.5rem; cursor:pointer; border-radius:5px; }
.colour-option[aria-selected=true] { font-weight:650; }
.colour-option:hover, .colour-option.highlighted { background:var(--soft); outline:1px solid var(--accent); outline-offset:-1px; }
.colour-swatch { display:inline-block; flex:0 0 1.35rem; width:1.35rem; height:1.35rem; border:1px solid #777; border-radius:4px; box-shadow:inset 0 0 0 1px #fff8; }
.colour-swatch-empty { background:repeating-linear-gradient(135deg,#eee 0 4px,#fff 4px 8px); border-style:dashed; }
.colour-definition-name { display:flex; align-items:center; gap:.6rem; }
.colour-preview-editor { display:grid; grid-template-columns:minmax(7rem,1fr) minmax(9rem,2fr); gap:.75rem; min-width:0; }
.colour-preview-editor input[type=color] { width:100%; height:2.75rem; padding:.2rem; cursor:pointer; }
.colour-preview-result { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; }
.colour-live-preview .colour-swatch { display:block; width:3rem; height:2.25rem; }
.colour-preview-value { overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
@media(max-width:380px){.colour-preview-editor{grid-template-columns:minmax(0,1fr)}.colour-preview-result{grid-column:auto}}

.ornament-preview { display:flex; align-items:center; justify-content:center; min-width:0; }
.ornament-preview:empty { display:none; }
.ornament-preview img { display:block; max-width:100%; width:7rem; height:6rem; object-fit:contain; background:#fff; border:1px solid var(--line); border-radius:6px; padding:.35rem; }
.ornament-editor .ornament-preview img { width:100%; height:12rem; }
.ornament-definition { display:flex; align-items:center; gap:.75rem; min-width:0; }
.ornament-definition .ornament-preview { flex:0 0 5rem; }
.ornament-definition .ornament-preview img { width:5rem; height:4rem; }
.ornament-editor textarea { font-family:monospace; font-size:.8rem; overflow-wrap:anywhere; }

/* Explicit read-only presentation; edit fields and reports are unaffected. */
.compact-details:not(.show-empty-details) [data-detail-empty="true"] { display:none; }
.detail-view-options { display:flex; justify-content:flex-end; }
.detail-view-options .btn { font-size:.85rem; min-height:2rem; padding:.3rem .65rem; }
.order-editor > .order-section { scroll-margin-top:1rem; }
.card[data-section=sales_arrangement], .card[data-section=customer_message] { background:#f8faf6; }
.card[data-section=end_customer], .card[data-section=lettering] { background:#f5f9fb; }
.card[data-section=order_information], .card[data-section=production_instructions] { background:#faf7f2; }
.card[data-section=delivery], .card[data-section=quotation] { background:#f8f6fb; }
.card[data-section=stone_specification] { background:#f3f8f6; }
.order-section .card { background:#ffffffb8; }
.wizard-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; }
.wizard-toolbar [aria-pressed=true] { background:var(--soft); border:1px solid var(--accent); }
.wizard-current { margin:0; font-size:.9rem; color:var(--muted); }
.wizard-navigation { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.5rem; }
.order-editor > [hidden], .wizard-navigation[hidden], .wizard-current[hidden], .order-editor button[hidden] { display:none; }
.ornament-chooser .ornament-thumbnail { width:2.75rem; height:2.75rem; flex:0 0 2.75rem; color:var(--muted); }
.ornament-chooser .ornament-thumbnail img { width:100%; height:100%; padding:.2rem; }
.ornament-chooser .colour-option { min-height:3.5rem; }
.ornament-chooser .colour-choice { min-height:3.75rem; }

.registry-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap:1rem; }
.line-lettering { border-top:1px solid var(--line); padding-top:1rem; }
.line-lettering-body, .line-lettering-readonly { border-inline-start:3px solid #dbe6e3; padding-inline-start:1rem; }
.live-dimensions { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; }
.combined-dimensions { font-weight:600; font-variant-numeric:tabular-nums; }
.dimension-sketch { margin:0; max-width:16rem; }
.dimension-sketch:empty { display:none; }
.dimension-sketch svg { display:block; width:100%; max-height:12rem; }
.dimension-sketch polygon { stroke:#466256; stroke-width:1; stroke-linejoin:round; }
.dimension-front { fill:#edf2ef; }.dimension-top { fill:#f8faf8; }.dimension-side { fill:#cbd9d0; }
.dimension-sketch text { font:10px sans-serif; fill:#33473e; }
.dimension-sketch figcaption { font-size:.72rem; color:var(--muted); }
.legacy-dimensions { flex-basis:100%; font-size:.85rem; }
.item-detail + .item-detail { padding-top:1rem; border-top:1px solid var(--line); }
.card[data-section=order_work], .card[data-section=order_text] { background:#f8f6fb; }

/* Corresponding edit/read-only sections share the palette above. */
.readonly-colour-value { display:flex; align-items:center; gap:.55rem; min-width:0; }
.readonly-ornament-value { display:flex; align-items:center; gap:.75rem; min-width:0; }
.readonly-ornament-value > p { min-width:0; overflow-wrap:anywhere; }
.readonly-ornament-value .ornament-preview { flex:0 0 4rem; }
.readonly-ornament-value .ornament-preview img { width:4rem; height:3.5rem; }

.weight-estimate { margin-top:.6rem; padding-top:.5rem; border-top:1px solid var(--line); font-size:.85rem; overflow-wrap:anywhere; }
.weight-estimate p { margin:.2rem 0; }
.weight-formula { font-variant-numeric:tabular-nums; }
.dimension-sketch .weight-estimate { max-width:24rem; }
.weight-estimate-missing { max-width:24rem; font-size:.75rem; }

.search-matches { margin-top:.5rem; max-width:34rem; font-size:.85rem; }
.search-match { margin:.35rem 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.search-match strong { color:var(--muted); }
.search-match mark { background:#f6df83; color:#252516; border-radius:.15rem; padding:0 .08rem; }
.microsoft-sign-in { border:1px solid var(--line); background:#fff; width:100%; }


/* Related measurements stay together; the same overview is used for orders and offers. */
.dimension-fields { margin:0; padding:.6rem .75rem; min-width:0; }
.dimension-inputs { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) 4.25rem; align-items:end; gap:.45rem; }
.dimension-inputs label { min-width:0; overflow-wrap:anywhere; }
.dimension-inputs input,.dimension-inputs select { min-width:0; width:100%; padding-inline:.4rem; }
.dimension-times { padding-bottom:.65rem; color:var(--muted); }
.stone-overview { display:grid; grid-template-columns:1fr; gap:1rem; align-items:start; }
.stone-overview.has-sketch { grid-template-columns:minmax(8rem,11rem) minmax(0,1fr); }
.stone-facts { min-width:0; }
.stone-facts > .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem 1rem; }
.stone-overview .dimension-sketch { width:100%; max-width:11rem; }
.stone-overview .weight-estimate { margin-top:0; }
.weight-estimate details { color:var(--muted); font-size:.75rem; }
.weight-estimate summary { cursor:pointer; margin-top:.3rem; }
@media(max-width:600px) {
  .stone-overview { gap:.75rem; }
  .stone-overview.has-sketch { grid-template-columns:7.5rem minmax(0,1fr); }
  .stone-overview .dimension-sketch { max-width:7.5rem; }
  .stone-facts > .form-grid { grid-template-columns:1fr; }
  .dimension-inputs { gap:.25rem; }
  .dimension-inputs label { font-size:.8rem; }
}

.line-lettering-readonly { padding-inline-start:.65rem; }
.line-lettering-readonly .readonly-ornament-value .ornament-preview { flex-basis:3rem; }
.line-lettering-readonly .readonly-ornament-value .ornament-preview img { width:3rem; height:2.5rem; }

/* Order content and document presentation use the same quiet visual language. */
.text-entry-editor{padding:1rem;border:1px solid var(--border,#d8ddda);border-radius:.5rem;background:#f7faf7}
.preserve-lines,.document-text{white-space:pre-wrap;overflow-wrap:anywhere}
.historical-context{padding:1rem;border:1px solid var(--border,#d8ddda);border-radius:.5rem}
.registry-picker{display:grid;gap:.35rem;min-width:0}.registry-picker>input,.registry-picker>select{width:100%;min-width:0}
.registry-picker-pager{display:flex;align-items:center;justify-content:space-between;gap:.25rem;flex-wrap:wrap;min-width:0}.registry-picker-pager[hidden]{display:none}.registry-picker-pager .btn{padding-inline:.4rem}.registry-picker-pager .meta{margin:0}
.registry-pager{margin-block:.75rem;justify-content:flex-end}.category-sort{list-style:none;padding:0;display:grid;gap:.4rem}
.category-sort>li{display:flex;align-items:center;gap:.75rem;padding:.65rem;border:1px solid var(--border,#d8ddda);border-radius:.4rem;background:#f7faf7}
.category-sort>li .actions{margin-inline-start:auto}.sort-handle{cursor:grab;color:#667a70}

.category-name{min-width:0;overflow-wrap:anywhere;flex:1}
.category-sort>li{flex-wrap:wrap}
@media(max-width:600px){.category-sort>li{display:grid;grid-template-columns:auto minmax(0,1fr)}.category-sort>li .actions{grid-column:2/-1;margin-inline-start:0;flex-wrap:wrap}}

.company-role-context { display:flex; flex-wrap:wrap; align-items:end; gap:16px; }
.company-role-context > .field { flex:1 1 17rem; min-width:0; }
.company-role-context > .field select { min-width:0; }
.company-role-context .role-view-single { display:grid; gap:5px; flex:1 1 12rem; color:var(--muted); font-size:.875rem; }
.role-view-description { color:var(--muted); font-size:.875rem; }

.route-county { border:1px solid var(--line); border-radius:var(--radius, .5rem); padding:.75rem; }
.route-county summary { cursor:pointer; font-weight:600; margin-bottom:.75rem; }
.route-municipalities { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); gap:.35rem .75rem; margin-top:.75rem; }
.route-municipalities .checkbox { align-items:flex-start; }
.itinerary-map { min-height:24rem; }
.itinerary-pin span { display:grid; place-items:center; width:28px; height:28px; border:2px solid white; border-radius:50%; background:var(--pine); color:white; font-weight:700; box-shadow:0 1px 4px #0006; }
.itinerary-stop { border-top:1px solid var(--line); padding-top:1rem; }
.itinerary-stop-editor { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; }
.itinerary-stop-editor strong { flex:1 1 14rem; }
.itinerary-rest { border-left:3px solid var(--rust); padding:.5rem .75rem; background:var(--warm); }
