/* [hidden] has to beat a class that sets display. .masthead is display:flex in
   app.css, so without this the header shows on the sign in screen complete with
   a Sign out button for a session that does not exist. */
[hidden] { display: none !important; }

/* Shell.
   app.css is the prototype's stylesheet, carried over intact. This file holds
   only what the real application needs and the prototype did not have: a sign
   in screen, a saving indicator, an offline toast, and the masthead for a page
   that is one surface rather than two side by side. */

.root { max-width: 1180px; margin: 0 auto; padding: 18px 20px 64px; }
.booting { color: var(--ink-3); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }

.masthead-in {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-family: var(--display); font-weight: 800; font-size: 17px; margin: 0; letter-spacing: -.01em; }
.brand em { font-style: normal; font-weight: 500; opacity: .62; }
.masthead-right { display: flex; align-items: center; gap: 14px; }
.who { font-size: 12px; opacity: .72; letter-spacing: .02em; }
/* app.css styles .btn-quiet for the light surfaces it was written for: a full
   width block, near white background, near white border. Dropped into the dark
   masthead and given only a new text colour, that became pale text on a pale
   pill - a Sign out button that read as disabled, which is how it looked on the
   live site on 22/09/2026. The background and the width have to be reset, not
   just the colour. */
.masthead .btn-quiet {
  display: inline-block; width: auto;
  background: transparent; border: 1px solid rgba(242,244,241,.32);
  color: var(--paper); opacity: .85; font-size: 12px; padding: 4px 10px;
}
.masthead .btn-quiet:hover {
  opacity: 1; background: rgba(242,244,241,.12); border-color: rgba(242,244,241,.6);
}

/* ---------- sign in ---------- */

.signin-wrap { display: flex; justify-content: center; padding: 48px 0; }
.signin {
  width: 100%; max-width: 360px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 26px 24px 22px;
}
.signin-title { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 4px; }
.signin-note { color: var(--ink-2); font-size: 14px; margin: 0 0 20px; }
.field-label {
  display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.signin input[type="email"] {
  width: 100%; padding: 10px 11px; font: inherit; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 16px;
}
.btn-primary {
  width: 100%; padding: 11px; background: var(--cobalt); color: #fff;
  border-radius: var(--r); font-weight: 600; margin-bottom: 9px;
}
.btn-secondary {
  width: 100%; padding: 11px; background: var(--card); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r); font-weight: 500;
}
.btn-link { display: block; width: 100%; padding: 10px; color: var(--ink-3); font-size: 13px; }
.signin-message {
  margin: 14px 0 0; padding: 9px 11px; background: var(--clay-bg); color: var(--clay);
  border-radius: var(--r); font-size: 13px;
}
.signin-foot { margin: 18px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.5; }

.code-boxes { display: flex; gap: 8px; margin-bottom: 18px; }
.code-boxes input {
  flex: 1; min-width: 0; height: 52px; text-align: center; font-family: var(--data);
  font-size: 22px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r);
}

/* ---------- saving state ----------
   Every field saves as it changes, so the screen has to say so. A number that
   has been typed and not yet stored looks identical to one that has, and the
   difference matters at 5:59pm. */

.cell-saving { box-shadow: inset 0 -2px 0 var(--cobalt); }
.cell-saved   { box-shadow: inset 0 -2px 0 var(--moss); }
.cell-failed  { box-shadow: inset 0 -2px 0 var(--clay); background: var(--clay-bg); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  border-radius: var(--r); font-size: 13px; max-width: min(520px, calc(100vw - 32px));
  z-index: 50; box-shadow: 0 6px 24px rgba(22,32,46,.22);
}
.toast.bad { background: var(--clay); }

/* ---------- lock banners ----------
   Four reasons a day cannot be edited, reported separately. "Locked" on its own
   sends somebody to ask why. */

.lockbar {
  padding: 11px 13px; border-radius: var(--r); font-size: 13px; margin-bottom: 14px;
  background: var(--ochre-bg); color: var(--ochre); border: 1px solid rgba(169,117,20,.24);
}
.lockbar.hard { background: var(--clay-bg); color: var(--clay); border-color: rgba(179,69,58,.24); }

/* ---------- desktop grid ---------- */

.grid-wrap { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--rule-soft); padding: 7px 9px; text-align: right; }
table.grid th:first-child, table.grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
table.grid thead th {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; white-space: nowrap;
}
table.grid tbody input {
  width: 62px; padding: 5px 6px; text-align: right; font-family: var(--data);
  background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--r);
}
table.grid tbody input:disabled { opacity: .5; background: transparent; }
table.grid tfoot td { font-family: var(--data); font-weight: 600; border-top: 1px solid var(--rule); }
.offlist { color: var(--ink-3); font-size: 11px; display: block; }

.layout-toggle { display: flex; gap: 6px; margin-bottom: 14px; }
.layout-toggle button {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  padding: 6px 11px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card);
}
.layout-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (max-width: 720px) {
  .root { padding: 12px 14px 80px; }
}

/* ---------- contacts ---------- */

.contacts { display: grid; gap: 10px; margin-bottom: 18px; }
.contact {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 13px 15px;
}
.contact.off { opacity: .6; }
.contact-name { font-weight: 600; margin: 0 0 3px; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.contact-role {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
}
.contact-line { margin: 0; font-size: 13px; color: var(--ink-2); display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.contact-warn { margin: 6px 0 0; font-size: 12.5px; color: var(--clay); }
.contact-actions { display: flex; gap: 6px; flex-shrink: 0; }

.sms-state { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--rule-soft); color: var(--ink-3); }
.sms-state.ok { background: var(--moss-bg); color: var(--moss); }
.sms-state.opted_out { background: var(--clay-bg); color: var(--clay); }
.sms-state.no_consent { background: var(--ochre-bg); color: var(--ochre); }

.contact-form {
  background: var(--card); border: 1px solid var(--cobalt); border-radius: var(--r);
  padding: 16px 16px 14px; display: grid; gap: 4px;
}
.contact-form input, .contact-form select {
  padding: 8px 10px; font: inherit; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 10px;
}
.contact-form input:disabled { opacity: .6; }

/* The opt in. The wording is served by the API so the screenshot that goes with
   the short code application is the same text a person agrees to. */
.consent {
  background: var(--paper); border: 1px solid var(--rule-soft);
  border-radius: var(--r); padding: 11px 12px; margin: 4px 0 12px;
}
.consent-tick { display: flex; gap: 9px; align-items: flex-start; font-weight: 600; font-size: 14px; }
.consent-tick input { margin: 2px 0 0; }
.consent-text {
  margin: 9px 0 0; font-family: var(--body); font-size: 12.5px; line-height: 1.5;
  color: var(--ink-2); white-space: pre-wrap;
}

/* ---------- surface nav ---------- */

.surfacenav { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.surfacenav button {
  padding: 9px 14px; font-size: 13px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.surfacenav button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--cobalt); font-weight: 600; }

/* ---------- dashboard additions ----------
   .compliance, .dchip, .periodbar, .band and .region already come from the
   prototype stylesheet. Only what it did not have is below. */

.compliance-head {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 8px; font-weight: 600;
}
.compliance-counts { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 11px; font-size: 13px; }
.cc { display: flex; align-items: center; gap: 6px; }
.cc::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--rule); }
.cc.confirmed::before { background: var(--moss); }
.cc.nil::before { background: var(--ink-3); }
.cc.partial::before { background: var(--ochre); }
.cc.out::before { background: var(--clay); }

.periodbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
/* margin-left:auto rather than a flex spacer. A spacer with flex:1 fills the
   first line when the bar wraps, which pushed the export link onto its own row
   and stretched it across the screen. */
.periodbar .export {
  /* .btn-quiet is a full width block in the prototype stylesheet, which made
     this stretch to the whole bar and take a line of its own. */
  width: auto; flex: 0 0 auto; display: inline-block;
  margin-left: auto; border: 1px solid var(--rule); background: var(--card);
  border-radius: var(--r); padding: 6px 12px; text-decoration: none;
  font-size: 13px; color: var(--ink);
}

/* The rolling window note. Shown beside every rate, and shown when a rate is
   missing, because "why is this blank" and "what does this measure" are the
   same question from two directions. */
.rollnote {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  background: var(--card); border-left: 2px solid var(--cobalt);
  padding: 9px 12px; border-radius: 0 var(--r) var(--r) 0;
}
.rollnote.warn { border-left-color: var(--ochre); background: var(--ochre-bg); color: var(--ochre); }

.ratecards { display: flex; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.ratecard {
  flex: 1; min-width: 190px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px;
}
.ratecard-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
.ratecard-value { font-family: var(--data); font-size: 30px; font-weight: 600; margin: 0; }
.ratecard-value.green { color: var(--moss); }
.ratecard-value.amber { color: var(--ochre); }
.ratecard-value.red { color: var(--clay); }
.ratecard-target { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }

.websitebox, .feedstatus {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 14px 16px; margin: 16px 0;
}
.feedstatus p { margin: 0 0 7px; font-size: 13px; }
.feedstatus strong { font-weight: 600; }

table.grid td .region {
  display: block; font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ---------- my numbers ---------- */

.panelbox {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px;
}
.panelhead {
  font-family: var(--display); font-size: 15px; font-weight: 700;
  margin: 0 0 12px; letter-spacing: -.01em;
}
.panelhead-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panelhead-row .panelhead { margin-bottom: 12px; }
.btn-quiet.small { width: auto; font-size: 12px; padding: 4px 9px; border: 1px solid var(--rule); border-radius: var(--r); }

/* Funnel: magnitude across four named stages of one measure. Length carries it;
   colour carries nothing, because there is nothing for colour to say. */
.funnel { display: grid; gap: 9px; }
.funnel-row {
  display: grid; grid-template-columns: 110px 1fr 46px 96px;
  align-items: center; gap: 12px;
}
.funnel-label { font-size: 13px; color: var(--ink-2); }
.funnel-track { background: var(--rule-soft); border-radius: 3px; height: 15px; overflow: hidden; }
.funnel-bar {
  display: block; height: 100%; background: #1F4FD8;
  border-radius: 0 3px 3px 0;   /* rounded data end, square against the baseline */
}
.funnel-value { text-align: right; font-size: 14px; font-weight: 600; }
.funnel-note { font-size: 11.5px; color: var(--ink-3); }

/* Chart */
.legend { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.chartwrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--rule-soft); stroke-width: 1; }
.chart .axislabel { font-family: var(--data); font-size: 10px; fill: var(--ink-3); }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* A 2px ring in the surface colour so a marker crossing the other line still
   reads as one mark rather than a smudge. */
.chart .marker { stroke: var(--card); stroke-width: 2; }
.chart .endlabel { font-family: var(--data); font-size: 11px; font-weight: 600; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hotspot { cursor: crosshair; }

.charttip {
  position: absolute; top: 4px; pointer-events: none;
  background: var(--ink); color: var(--paper); border-radius: var(--r);
  padding: 7px 10px; font-size: 12px; display: grid; gap: 3px; min-width: 140px;
  box-shadow: 0 4px 14px rgba(22,32,46,.2);
}
.charttip span { display: flex; align-items: center; gap: 6px; }

/* ---------- ateco admin ---------- */

.inline-select {
  padding: 5px 9px; font: inherit; font-size: 13px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r);
}
.attention-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.attention-list li { margin-bottom: 3px; }

.monthrow { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 10px; }
.monthpill {
  display: flex; align-items: center; gap: 8px; font-family: var(--data);
  font-size: 13px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 5px 6px 5px 11px;
}
.monthpill.locked { background: var(--clay-bg); border-color: rgba(179,69,58,.28); color: var(--clay); }

/* Ateco staff sign in */
.signin-sep {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 12px;
  color: var(--ink-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.signin-sep::before, .signin-sep::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.btn-secondary.sso { display: block; text-align: center; text-decoration: none; }

/* Add another model */
.addlist {
  background: var(--card); border: 1px solid var(--cobalt); border-radius: var(--r);
  padding: 13px 14px; margin: 12px 0;
}
.addlist input[type="search"] {
  width: 100%; padding: 8px 10px; font: inherit; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 10px;
}
.addlist-results { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; margin-bottom: 8px; }
.addlist-item {
  text-align: left; padding: 8px 10px; border-radius: var(--r); font-size: 14px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.addlist-item:hover { background: var(--cobalt-soft); }
.addlist-item .offlist { font-family: var(--data); font-size: 11px; }

/* The standing sign in code banner. Ateco staff only, and only while one is
   configured. Deliberately the loudest thing on the page - it is a bypass, and
   it should read as one every single time somebody signs in. */
.bypass-banner {
  max-width: 1180px; margin: 12px auto 0; padding: 11px 14px;
  border: 1px solid var(--clay); border-left: 4px solid var(--clay);
  border-radius: var(--r); background: var(--clay-bg); color: var(--clay);
  font-size: 13px; line-height: 1.5;
}
