/* Dialwright — a drawing sheet, not a landing page. */
:root {
  --paper: #f3eee2;
  --plate: #fbf8f0;
  --tint: #e9e1cf;
  --ink: #1d1a16;
  --ink2: #4a443b;
  --rule: #8a8170;
  --hair: #c9bfa9;
  --red: #a8361f;
  --green: #2f5d50;
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --fell: 'IM Fell English', Georgia, serif;
  --fellsc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--serif);
}
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--ink); color: var(--paper); padding: 6px 10px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .9em; }
.small { font-size: .8rem; }
.dim { color: var(--rule); }
.sc { font-family: var(--fellsc); font-weight: normal; letter-spacing: .02em; }
.print-only { display: none; }
h1, h2, h3 { font-family: var(--fell); font-weight: normal; line-height: 1.2; }

/* ---------- the sheet ---------- */
.sheet {
  max-width: 1320px; margin: 18px auto; padding: 0 30px;
  border: 1.5px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 5px;
  background: transparent; position: relative;
}
.gridref { display: flex; justify-content: space-around; font: 11px/1 var(--mono); color: var(--rule); letter-spacing: .1em; }
.gridref span { flex: 1; text-align: center; padding: 5px 0; border-left: 1px solid var(--hair); }
.gridref span:first-child { border-left: 0; }
.gridref-top { border-bottom: 1px solid var(--hair); margin: 0 -30px; }
.gridref-bottom { border-top: 1px solid var(--hair); margin: 18px -30px 0; }

.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 18px 0 12px; border-bottom: 3px double var(--ink); flex-wrap: wrap; }
.mark { display: flex; align-items: flex-end; gap: 10px; text-decoration: none; color: var(--ink); }
.wordmark { font-family: var(--fellsc); font-size: 2.1rem; line-height: .9; letter-spacing: .03em; }
.mainnav { display: flex; flex-wrap: wrap; }
.mainnav a { font-family: var(--fellsc); font-size: 1.12rem; text-decoration: none; padding: 2px 14px; border-left: 1px solid var(--rule); }
.mainnav a:first-child { border-left: 0; }
.mainnav a[aria-current] { color: var(--red); }
.mainnav .no { font-family: var(--mono); font-size: .72rem; color: var(--rule); margin-right: 3px; }

main { padding: 26px 0 10px; min-height: 50vh; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--fellsc); font-size: 1.1rem; letter-spacing: .03em; line-height: 1.2;
  background: var(--ink); color: var(--plate); border: 1.5px solid var(--ink); padding: 9px 18px 10px;
  text-decoration: none; cursor: pointer; border-radius: 0;
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--plate); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--plate); }
.btn.big { font-size: 1.3rem; padding: 12px 26px; }
.btn[disabled] { opacity: .35; cursor: not-allowed; background: var(--ink); color: var(--plate); }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: .95rem; color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; cursor: pointer; text-align: left; }
.link:hover { color: var(--red); }
.quiet { margin-left: 14px; font-size: .95rem; }

/* ---------- home ---------- */
.opening { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.plate-fig { margin: 0; }
.plate-fig .dial-mount, .compare .dial-mount, .os-figure .dial-mount { border: 1px solid var(--ink); background: var(--plate); line-height: 0; box-shadow: 6px 6px 0 var(--tint); }
.dial-mount svg { width: 100%; height: auto; display: block; }
figcaption { font-size: .88rem; font-style: italic; color: var(--ink2); margin-top: 12px; line-height: 1.45; }
.fig-no { font-style: normal; font-family: var(--fellsc); color: var(--ink); }
.nowcap { color: var(--green); }
.lead { font-size: 1.5rem; line-height: 1.38; margin: 0 0 22px; }
.lead em { font-style: italic; }
.legend { list-style: none; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--hair); }
.legend li { padding: 10px 0 10px 40px; border-bottom: 1px solid var(--hair); position: relative; font-size: .97rem; }
.key { position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border: 1.4px solid var(--red); border-radius: 50%; color: var(--red); font-family: var(--fell); text-align: center; line-height: 24px; font-size: 1rem; background: var(--plate); }
.titleblock { width: 100%; border-collapse: collapse; border: 2px solid var(--ink); background: var(--plate); font-size: .95rem; }
.titleblock th, .titleblock td { border: 1px solid var(--ink); padding: 9px 12px; vertical-align: top; text-align: left; }
.titleblock th { font: 500 .72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; width: 6.5em; color: var(--ink2); padding-top: 12px; }
.tb-action td { padding: 12px; }

.sec { border-top: 1.5px solid var(--ink); margin-top: 46px; padding-top: 18px; }
.sec h2 { font-size: 1.75rem; margin: 0 0 12px; }
.secno { font-family: var(--mono); font-size: .8rem; color: var(--red); vertical-align: middle; margin-right: 8px; border: 1px solid var(--red); padding: 1px 5px; }
.sec-lede { max-width: 46em; font-size: 1.05rem; }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 22px 0; }
.compare figure { margin: 0; }
.aside { border-left: 3px solid var(--red); padding: 4px 0 4px 16px; max-width: 46em; }
.trades { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; margin: 10px 0 0; border-top: 1px solid var(--hair); }
.trades div { padding: 14px 18px 16px 0; border-bottom: 1px solid var(--hair); }
.trades dt { font-family: var(--fellsc); font-size: 1.15rem; margin-bottom: 4px; }
.trades dd { margin: 0; font-size: .95rem; color: var(--ink2); }
.workorder { counter-reset: wo; list-style: none; padding: 0; margin: 8px 0 18px; max-width: 52em; }
.workorder li { counter-increment: wo; padding: 8px 0 8px 52px; position: relative; border-bottom: 1px dotted var(--hair); }
.workorder li::before { content: counter(wo, upper-roman) "."; position: absolute; left: 0; top: 8px; font-family: var(--fell); color: var(--red); font-size: 1.1rem; width: 40px; text-align: right; }
.faq details { border-bottom: 1px solid var(--hair); padding: 10px 0; max-width: 52em; }
.faq summary { cursor: pointer; font-family: var(--fell); font-size: 1.15rem; }
.faq details p { margin: 8px 0 4px; color: var(--ink2); }

/* ---------- page heads ---------- */
.drawhead { display: grid; grid-template-columns: auto 1fr; gap: 10px 32px; align-items: baseline; margin-bottom: 18px; }
.pagetitle { font-size: 2rem; margin: 0; }
.drawhead-note { margin: 0; color: var(--ink2); font-style: italic; max-width: 50em; }

/* ---------- designer ---------- */
.designer { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 28px; align-items: start; }
.spec fieldset { border: 0; border-top: 1px solid var(--ink); margin: 0 0 12px; padding: 8px 0 4px; min-width: 0; }
.spec legend { font-family: var(--fellsc); font-size: 1.15rem; padding: 0 8px 0 0; }
.spec legend .secno { font-size: .7rem; }
.field { display: block; font-size: .88rem; margin: 6px 0 10px; color: var(--ink2); }
.field small { color: var(--rule); font-size: .78rem; }
.field input, .field select, .nowbar input {
  display: block; width: 100%; margin-top: 3px; font: 1rem var(--mono); color: var(--ink);
  background: var(--plate); border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); border-radius: 0; padding: 7px 8px; min-height: 40px;
}
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; font-family: var(--serif); }
.field input:focus, .field select:focus { outline: 2px solid var(--red); outline-offset: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--ink); margin: 6px 0 10px; }
.seg label { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: .92rem; cursor: pointer; border-left: 1px solid var(--ink); min-height: 40px; }
.seg label:first-child { border-left: 0; }
.seg label:has(input:checked) { background: var(--ink); color: var(--plate); }
.seg input { accent-color: var(--red); }
fieldset.field { border: 0; padding: 0; margin: 6px 0 10px; }
fieldset.field legend { font-family: var(--serif); font-size: .88rem; color: var(--ink2); }
.check { display: flex; gap: 8px; align-items: baseline; font-size: .92rem; margin: 6px 0; }
.check input { accent-color: var(--red); }
.hint { font-size: .85rem; color: var(--ink2); margin: 4px 0 8px; }
.bearing { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: center; }
.bearing input[type=range] { accent-color: var(--red); min-height: 0; border: 0; background: none; padding: 0; }

.board { min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-bottom: 8px; }
.saveline { min-height: 1.4em; font-size: .9rem; text-align: right; margin: 0 0 8px; }
.plate-wrap { position: relative; border: 1px solid var(--ink); background: var(--plate); box-shadow: 6px 6px 0 var(--tint); }
.plate { line-height: 0; }
.plate svg { width: 100%; height: auto; max-height: 80vh; display: block; margin: 0 auto; }
.plate-error { position: absolute; inset: 20% 10% auto; background: var(--plate); border: 2px solid var(--red); padding: 16px 20px; color: var(--red); font-size: 1rem; line-height: 1.5; }
.nowbar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; margin: 12px 0 0; font-size: .9rem; }
.nowbar .check { flex-wrap: wrap; align-items: center; }
.nowbar input[type=datetime-local] { display: inline-block; width: auto; min-height: 34px; padding: 3px 6px; font-size: .85rem; margin: 0 4px; }
#nowtext { color: var(--green); }

.sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 30px; }
.sheet-sec { border-top: 1.5px solid var(--ink); padding-top: 6px; margin-bottom: 24px; min-width: 0; }
.sheet-sec h2 { font-size: 1.35rem; margin: 4px 0 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .9rem; margin: 8px 0; }
.kv dt { color: var(--ink2); }
.kv dd { margin: 0; font-family: var(--mono); font-size: .85rem; }
.tablewrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.data { border-collapse: collapse; width: 100%; font: .82rem/1.35 var(--mono); }
.data th { text-align: left; font-weight: 500; color: var(--ink2); position: sticky; top: 0; background: var(--paper); border-bottom: 1px solid var(--ink); padding: 5px 8px; }
.data td { padding: 4px 8px; border-bottom: 1px dotted var(--hair); white-space: nowrap; }
.data tr.k-hour td { color: var(--ink); }
.data tr.k-half td, .data tr.k-quarter td { color: var(--rule); }
.gnomon-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.gnomon-fig svg { width: 100%; height: auto; max-height: 220px; }
.warnings { padding-left: 18px; color: var(--red); font-size: .9rem; }

.buybox { border: 2px solid var(--ink); background: var(--plate); padding: 18px 22px 22px; margin-top: 10px; position: relative; }
.buybox::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--hair); pointer-events: none; }
.buybox h2 { margin: 0 0 6px; font-size: 1.5rem; }
.buybox ul { padding-left: 20px; margin: 8px 0 12px; }
.buybox li { margin: 3px 0; }
.price { font-family: var(--fell); font-size: 2rem; color: var(--red); margin-right: 6px; }
.price-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }

/* ---------- wall finder ---------- */
.wallgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.wallgrid h2 { font-size: 1.4rem; border-top: 1.5px solid var(--ink); padding-top: 8px; margin: 0 0 10px; }
.wall-diagram { margin: 0 0 14px; border: 1px solid var(--ink); background: var(--plate); padding: 12px; }
.wall-diagram svg { width: 100%; height: auto; display: block; }
.result { border: 2px solid var(--ink); background: var(--plate); padding: 16px 20px; margin-top: 14px; }
.result-big { font-family: var(--fell); font-size: 1.4rem; margin: 0 0 8px; }
.result-big strong { color: var(--red); font-weight: normal; }
.warn { color: var(--red); font-size: .92rem; }

/* ---------- prices ---------- */
.schedule-wrap { overflow-x: auto; }
.schedule { width: 100%; border-collapse: collapse; border: 2px solid var(--ink); background: var(--plate); min-width: 640px; }
.schedule th, .schedule td { border: 1px solid var(--hair); padding: 9px 12px; }
.schedule tbody th { text-align: left; font-weight: normal; font-size: .95rem; }
.schedule td { text-align: center; font-family: var(--mono); font-size: .85rem; width: 17%; }
.schedule thead th { border-bottom: 2px solid var(--ink); vertical-align: bottom; padding: 14px 12px; }
.schedule .plan span { display: block; }
.plan-name { font-family: var(--fellsc); font-size: 1.3rem; font-weight: normal; }
.plan-price { font-family: var(--fell); font-size: 2rem; color: var(--red); font-weight: normal; line-height: 1.1; }
.plan-unit { font-size: .8rem; font-weight: normal; color: var(--ink2); font-style: italic; }
.schedule .feature, .schedule td:nth-child(3) { background: #f1e9d6; }
.schedule tfoot td { padding: 14px 8px; border-top: 2px solid var(--ink); }
.schedule tfoot .btn { font-size: 1rem; padding: 8px 12px; }
.price-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 34px; }
.price-notes h2 { font-size: 1.3rem; border-top: 1.5px solid var(--ink); padding-top: 8px; margin: 0 0 6px; }
.price-notes p { font-size: .95rem; color: var(--ink2); }

/* ---------- order ---------- */
.os-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.os-item h2 { font-size: 1.25rem; border-top: 1.5px solid var(--ink); padding-top: 6px; margin: 18px 0 8px; }
.os-item h2:first-child { margin-top: 0; }
.planpick { display: grid; gap: 8px; }
.planpick a { display: block; border: 1px solid var(--ink); padding: 10px 14px; text-decoration: none; background: var(--plate); }
.planpick a span { display: block; font-size: .85rem; color: var(--ink2); font-style: italic; }
.planpick a.on { border-width: 2px; box-shadow: inset 6px 0 0 var(--red); }
.emptyplate { aspect-ratio: 1; border: 1px dashed var(--rule); display: grid; place-items: center; color: var(--rule); font-style: italic; }
.os-total { margin: 30px 0 0 auto; max-width: 520px; border-top: 3px double var(--ink); padding-top: 12px; }
.os-total .data td { text-align: right; }
.os-total .data th, .os-total .data td { position: static; background: none; font-size: .9rem; padding: 6px 4px; }
.os-total tr.total th, .os-total tr.total td { font-size: 1.05rem; border-top: 1.5px solid var(--ink); color: var(--ink); }
.os-total .btn { width: 100%; margin-top: 14px; }

/* ---------- closed ---------- */
.closed { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.closed-notice { border: 2px solid var(--ink); background: var(--plate); padding: 22px 26px; position: relative; }
.closed-notice::after { content: "NOT YET OPEN"; position: absolute; right: 18px; top: -14px; background: var(--paper); color: var(--red); border: 1.5px solid var(--red); font: 500 .72rem/1 var(--mono); letter-spacing: .12em; padding: 6px 8px; transform: rotate(2deg); }
.closed-lead { font-size: 1.15rem; }
.plain { padding-left: 18px; }
.plain li { margin: 8px 0; }
.closed-next h2 { font-size: 1.4rem; border-top: 1.5px solid var(--ink); padding-top: 8px; margin: 0 0 8px; }

/* ---------- footer ---------- */
.foot { border-top: 3px double var(--ink); margin-top: 40px; padding-top: 14px; font-size: .85rem; color: var(--ink2); }
.foot-cols { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr; gap: 26px; }
.foot p { margin: 0; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .opening, .wallgrid, .os-grid, .closed { grid-template-columns: 1fr; gap: 26px; }
  .designer { grid-template-columns: 1fr; }
  .designer .board { order: -1; }
  .price-notes { grid-template-columns: 1fr; gap: 10px; }
  .foot-cols { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .sheet { margin: 8px; padding: 0 16px; outline: 0; }
  .gridref { display: none; }
  .wordmark { font-size: 1.75rem; }
  .mainnav { width: 100%; }
  .mainnav a { padding: 4px 10px 4px 0; border-left: 0; margin-right: 6px; font-size: 1.02rem; }
  .lead { font-size: 1.22rem; }
  .compare { grid-template-columns: 1fr 1fr; gap: 16px; }
  .compare figure:last-child { grid-column: span 2; max-width: 60%; }
  .sheets { grid-template-columns: 1fr; }
  .drawhead { grid-template-columns: 1fr; }
  .pagetitle { font-size: 1.65rem; }
  .toolbar { justify-content: stretch; }
  .toolbar .btn { flex: 1 1 auto; font-size: 1rem; padding: 8px 10px; }
  .saveline { text-align: left; }
  .gnomon-grid { grid-template-columns: 1fr; }
  .titleblock th { width: 5em; }
}
@media (max-width: 420px) {
  .compare { grid-template-columns: 1fr; }
  .compare figure:last-child { grid-column: auto; max-width: none; }
  .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ---------- print: a proof sheet ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 10pt; }
  .sheet { border: 0; outline: 0; margin: 0; padding: 0; max-width: none; }
  .gridref, .mainnav, .spec, .toolbar, .saveline, .nowbar, .buybox, .foot, .drawhead-note, .hint button, #csv { display: none !important; }
  .designer { display: block; }
  .plate-wrap { box-shadow: none; border: 0; }
  .plate svg { max-height: 175mm; width: auto; max-width: 100%; }
  .print-only { display: block; font: 8pt var(--mono); text-align: center; margin: 4mm 0; }
  .sheets { grid-template-columns: 1fr 1fr; gap: 0 10mm; break-before: page; }
  .tablewrap { max-height: none; overflow: visible; }
  .data th { position: static; }
  .masthead { border-bottom: 1px solid #000; padding: 0 0 4mm; }
  a { text-decoration: none; }
}
[hidden] { display: none !important; }
.gnomon-grid .kv { grid-template-columns: minmax(0, 1fr) auto; }
.kv dd { white-space: nowrap; }
.sheets .kv { grid-template-columns: minmax(0, 1fr) auto; }
.field input[type=radio], .field input[type=checkbox] { display: inline-block; width: auto; min-height: 0; margin: 0; padding: 0; border: 0; }
.os-total .data th { border-bottom: 1px dotted var(--hair); }
.nowbar input[type=checkbox] { display: inline-block; width: auto; min-height: 0; margin: 0 4px 0 0; padding: 0; border: 0; }
img, svg { max-width: 100%; }
