/* The public pages around the tool. Loaded after app/css/tokens.css and app/css/app.css, so the
   pages share the tool's tokens, type and controls (.in, .seg, .err, .pill-over, the dot meter
   .dm and the rack drawing). This file only lays out reading pages and turns off the tool's
   one-screen body. Colour means power and trouble, as in the tool: the interface is greys and ink,
   hazard yellow marks the problem, and the feed colours appear only on feeds. */

body {
  display: block; height: auto; overflow: visible; overflow-x: hidden;
  font-size: 16px; line-height: 1.55; background: var(--canvas);
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.fig { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; }

/* ---------- bar ---------- */
.bar { display: flex; align-items: center; gap: 20px; height: 64px; }
.bar .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.bar .brand-name { display: inline; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 18px; font-size: 14px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav a:hover { background: var(--card-sel); }
.nav a[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--ink); }

/* the tool's ink pill, as a link */
.go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 22px; background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.go:hover { background: #2B2B2A; }
.go.quiet { background: transparent; color: var(--ink); border-color: var(--stroke); }
.go.quiet:hover { background: var(--card-sel); }
.go.sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 19px; }
.go .ic { width: 16px; height: 16px; }

/* ---------- type ---------- */
h1 { font-weight: 300; font-size: clamp(38px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -0.025em; max-width: 15ch; }
h2 { font-weight: 400; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-weight: 500; font-size: 16px; line-height: 1.35; }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink); max-width: 36em; margin-top: 18px; font-weight: 300; }
.prose p, .prose li { max-width: 38em; }
.prose p + p { margin-top: 12px; }
.small { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ---------- page head ---------- */
.head { padding-top: 56px; padding-bottom: 36px; }
.head .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- home: the rack is the hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 48px; align-items: start; padding: 40px 0 56px; }
.hero-text { padding-top: 48px; }
.hero h1 { max-width: 12ch; }
.hero .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.hero .also { margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.hero .also a { color: var(--ink); }
.live { display: grid; gap: 14px; justify-items: center; }
.live-ctl { display: grid; gap: 10px; justify-items: center; text-align: center; }
.live-say { min-height: 3em; max-width: 34em; font-size: 15px; color: var(--ink); }
.live-say b { font-weight: 500; }
.live-rack { width: 100%; display: flex; justify-content: center; }
.live-rack svg { display: block; width: 100%; height: auto; max-height: 78vh; }
.live-rack .rv .fine, .live-rack .rv .finer { display: none; }
.live-rack .rv * { cursor: default; }
.live-note { font-size: 12.5px; color: var(--ink-2); text-align: center; }

/* ---------- sections ---------- */
.band { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }
.band > .wrap > h2 { margin-bottom: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; }
.grid2 p { margin-top: 6px; color: var(--ink); max-width: 34em; }
.split { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 32px 56px; }
.split > h2 { margin: 0; }

/* the calculators, listed */
.tools-list { display: grid; }
.tools-list a { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto; gap: 8px 32px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); text-decoration: none; }
.tools-list a:last-child { border-bottom: 1px solid var(--line); }
.tools-list a:hover .t-name { text-decoration: underline; text-underline-offset: 4px; }
.t-name { font-size: 20px; font-weight: 400; }
.t-what { color: var(--ink-2); }
.t-eg { font-family: var(--font-mono); font-size: 13px; color: var(--ink); white-space: nowrap; }

/* what it assumes: a plain list, each line a fact */
.assume { display: grid; gap: 0; }
.assume li { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 4px 32px; padding: 14px 0; border-top: 1px solid var(--line); }
.assume li:last-child { border-bottom: 1px solid var(--line); }
.assume b { font-weight: 500; }

/* questions */
.faq { display: grid; max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 32px 14px 0; font-weight: 500; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 22px; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); }
.faq details[open] summary::after { transform: rotate(-135deg); top: 26px; }
.faq details p { padding: 0 0 16px; max-width: 40em; }

/* ---------- the calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--r-card); overflow: hidden; }
.calc-in { padding: 28px 32px 32px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.calc-out { padding: 28px 32px 32px; background: var(--card-sel); display: grid; gap: 14px; align-content: start; min-width: 0; border-left: 1px solid var(--card-edge); }
.calc h2 { font-size: 18px; font-weight: 500; }
.eg { font-size: 12.5px; color: var(--ink-2); }
.field { display: grid; align-content: start; gap: 4px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.field .in { height: 42px; font-size: 16px; }
.field .hint { font-size: 12px; color: var(--ink-2); }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc .err { font-size: 13px; }
.unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.unit select.in { width: auto; padding-right: 6px; }

/* rows of devices */
.rows { display: grid; gap: 8px; }
.row-h, .row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.7fr) 40px; gap: 8px; align-items: center; }
.row-h { font-size: 12.5px; color: var(--ink-2); }
.row .in { height: 40px; font-size: 15px; }
.row .err { grid-column: 1 / -1; }
.row-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.row-x:hover { border-color: var(--stroke); color: var(--ink); }
.add-row { justify-self: start; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--stroke); background: transparent; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.add-row:hover { background: var(--card-sel); }
.add-row:disabled { opacity: .4; cursor: default; }
.elev-rows .row-h, .elev-rows .row { grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, .7fr) minmax(0, 1.1fr) 40px; }

/* the readout */
.big { font-family: var(--font-mono); font-weight: 500; font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.big small { font-size: 18px; font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.of { color: var(--ink-2); font-size: 14px; }
.of .fig { color: var(--ink); font-size: 14px; }
.meter .dm { width: 100%; max-width: 360px; height: auto; }
.meter-key { display: flex; justify-content: space-between; max-width: 360px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.verdict-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.verdict-line .pill-over { height: 26px; font-size: 13px; padding: 0 12px; border-radius: 13px; }
.v-ok { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 13px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 500; }
.facts { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px 18px; font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { font-family: var(--font-mono); font-weight: 500; text-align: right; }
.est { font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.handover { display: grid; gap: 8px; justify-items: start; padding-top: 4px; }
.handover .small { max-width: 30em; }

/* PDU: the two sides, normally and with one lost */
.sides { display: grid; gap: 16px; }
.side { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.side:first-child { border-top: 0; padding-top: 0; }
.side-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.side-top h3 { font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.side-top .fig { font-size: 15px; }
.side .dm { width: 100%; max-width: 360px; height: auto; }
.side .verdict-line { font-size: 13.5px; }
.fsq { width: 10px; height: 10px; display: inline-block; flex: none; background: var(--fc); }
.fci { width: 10px; height: 10px; display: inline-block; flex: none; background: var(--fc); border-radius: 50%; }

/* elevation: the tool's drawing, front and rear */
.elev-out { grid-template-columns: minmax(0, 1fr); }
.elev-draw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.elev-draw figure { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.elev-draw figcaption { font-size: 12.5px; color: var(--ink-2); }
.elev-draw svg { display: block; width: 100%; height: auto; max-height: 640px; }
.elev-draw .rv * { cursor: default; }
.elev-draw .rv .add, .live-rack .rv .add { display: none; }
/* a device here has no power data, so the tool's dashed "not in the check yet" outline would be
   noise: on this page every device is drawn as placed */
.elev-draw .dv.is-unfinished .dv-plate, .elev-draw .dv.is-unfinished rect { stroke-dasharray: none; }

/* ---------- reading sections on entry pages ---------- */
.after { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; }
.after section p { margin-top: 6px; max-width: 34em; }
.others { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }

/* ---------- foot ---------- */
.foot { border-top: 1px solid var(--line); padding: 32px 0 48px; margin-top: 24px; font-size: 13px; color: var(--ink-2); }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 48px; }
.foot p { max-width: 60em; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: start; }
.foot a { color: var(--ink); }

/* ---------- plain pages (privacy, not found) ---------- */
.plain { padding-top: 64px; padding-bottom: 40px; min-height: 50vh; }
.plain h1 { font-size: clamp(34px, 4vw, 48px); }
.plain .prose { margin-top: 24px; }
.plain .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- narrower ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-text { padding-top: 8px; }
  .live-rack svg { max-height: none; max-width: 520px; margin: 0 auto; }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-out { border-left: 0; border-top: 1px solid var(--card-edge); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .bar { height: auto; flex-wrap: wrap; gap: 6px 12px; padding-top: 12px; padding-bottom: 8px; }
  .bar > .go { margin-left: auto; height: 36px; padding: 0 14px; font-size: 14px; }
  .nav { order: 3; width: 100%; margin: 0 -10px; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 0 10px; font-size: 13.5px; }
  .head { padding-top: 28px; padding-bottom: 24px; }
  .lede { font-size: 17px; }
  .grid2, .after, .split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tools-list a { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .t-eg { white-space: normal; }
  .assume li { grid-template-columns: minmax(0, 1fr); }
  .calc-in, .calc-out { padding: 20px 16px 24px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-h, .row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .7fr) 36px; gap: 6px; }
  .elev-rows .row-h, .elev-rows .row { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, .8fr) 36px; }
  .elev-rows .row .depth { grid-column: 1 / -2; }
  .elev-rows .row-h .depth { display: none; }
  .row-x { width: 36px; height: 36px; }
  .big { font-size: 38px; }
  .band { padding-top: 40px; padding-bottom: 40px; }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .bar .brand-name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media print {
  .bar, .foot, .calc-in, .handover, .after, .faq, .head .acts, .skip { display: none !important; }
  .calc { border: 0; display: block; }
  .calc-out { border: 0; background: #fff; }
  body { background: #fff; }
}

/* small additions */
.sub-h { font-size: 12.5px; font-weight: 400; color: var(--ink-2); margin-top: 4px; }
.field.is-off { opacity: .45; }
.big-facts { font-size: 15px; }
.big-facts dd { font-size: 22px; }

/* every band's rule sits on the content's box, on the home page as on the entry pages */
div.band:not(.wrap) { border-top: 0; padding-top: 0; }
div.band:not(.wrap) > .wrap { border-top: 1px solid var(--line); padding-top: 56px; }
.hero + .band > .wrap { border-top-color: var(--line); }

/* PDU: columns are the PDUs, rows are the states, so the survivor sits under its own PDU */
.calc.pdu-calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.lead-out { display: grid; gap: 4px; }
.sides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.sides .sub-h { grid-column: 1 / -1; margin: 6px 0 -4px; padding-top: 10px; border-top: 1px solid var(--line); }
.sides .sub-h:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.side { border-top: 0; padding-top: 0; }
.side-top { flex-wrap: wrap; }

/* elevation: the drawing is the result, so it takes the larger half */
.calc.elev-calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.elev-draw figure > div { width: 100%; }
.elev-draw svg { max-height: 720px; }
.free { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }
.free .big { font-size: 40px; }
.free .of { flex-basis: 100%; }

@media (max-width: 1080px) {
  .calc.pdu-calc, .calc.elev-calc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  div.band:not(.wrap) > .wrap { padding-top: 40px; }
  .sides { grid-template-columns: minmax(0, 1fr); }
  .elev-draw svg { max-height: 560px; }
}

/* a band's rule runs the width of the text, not of the page's padding */
.wrap.band, div.band:not(.wrap) > .wrap { border-top: 0; background: linear-gradient(var(--line), var(--line)) no-repeat 32px 0 / calc(100% - 64px) 1px; }
.calc { margin-bottom: 56px; }
.lead-out + .sides { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .wrap.band, div.band:not(.wrap) > .wrap { background-position: 16px 0; background-size: calc(100% - 32px) 1px; }
  .calc { margin-bottom: 40px; }
}

/* a number typed in another form than a plain one, as it was read (Site.field) */
.read-as { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); font-family: var(--font-mono); }

/* the answer in one line, where the result sits below the boxes (one column): it is the first thing
   in the calculator and stays at the top of the screen while the boxes are edited. overflow: clip
   (not hidden) on the card, so the line can stick. */
.peek { display: none; }
@media (max-width: 1080px) {
  .calc { overflow: clip; }
  .peek { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; position: sticky; top: 0; z-index: 3; margin: -28px -32px 0; padding: 12px 32px; min-height: 52px;
    background: var(--card-sel); border-bottom: 1px solid var(--card-edge); font-size: 14px; line-height: 1.35; color: var(--ink); }
  .peek .fig { font-size: 17px; }
  .peek .peek-est { font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
  .peek .pill-over, .peek .v-ok { height: 24px; font-size: 12.5px; padding: 0 10px; border-radius: 12px; }
}
@media (max-width: 760px) {
  .peek { margin: -20px -16px 0; padding: 10px 16px; }
}
@media print { .peek { display: none !important; } }

/* elevation: one face at a time on screen, both on paper */
.elev-out .seg { justify-self: start; }
.elev-draw { grid-template-columns: minmax(0, 1fr); }
.elev-draw figure.is-off { display: none; }
/* the tool's "add watts" prompt belongs to the tool, not to a drawing with no power data */
.elev-draw .is-todo { display: none; }
.elev-draw svg { max-height: 820px; }
@media (max-width: 760px) { .elev-draw svg { max-height: 640px; } }
@media print {
  .elev-out .seg { display: none; }
  .elev-draw figure.is-off { display: grid; }
  .elev-draw { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
