/* Milkwood Intelligence Agency, the private page. One dark theme: near-black, hairline rules, square corners, IBM Plex (self-hosted, OFL; see
   fonts/*-LICENSE.txt). Colours are variables so charts.js uses the same ones. Lettings = steel, sales = signal orange,
   estimates = greys. */
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
             font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
             font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
             font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0a0c0e; --grid: rgba(255, 255, 255, 0.022);
  --panel: #0f1215; --panel-2: #14181c;
  --line: #1c2127; --line-2: #2a3138;
  --text: #e3e6e9; --muted: #8a939c; --faint: #5a636c;
  --accent: #ff6a1a; --ok: #3ccf7e; --warn: #ffb020;
  --c1: #c9d1d9; --c2: #ff6a1a; --c3: #55606b; --c4: #3e4750; --c5: #2d343b; --c6: #6b7680;
  --on-accent: #0a0c0e;
  --sans: "Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--text); font: 400 14px/1.5 var(--sans); overflow-x: clip;
       background-color: var(--bg);
       background-image: linear-gradient(var(--grid) 1px, transparent 1px),
                         linear-gradient(90deg, var(--grid) 1px, transparent 1px);
       background-size: 48px 48px; background-position: -1px -1px;
       -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
[hidden] { display: none !important; }

/* labels: the one small-caps voice used for every heading, tab, column and control */
.label, nav.sections a, nav.tabs a, th, .crumbs, .meta, figure.chart h3, .periods button, .signout button, .brand,
.signin label, .signin .kicker, .card .index, .card .pages a, .deal, table.fees td:first-child, button {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }

/* top bar */
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px; height: 52px;
             padding: 0 24px; background: rgba(10, 12, 14, 0.94); border-bottom: 1px solid var(--line);
             backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.2em;
         color: var(--text); white-space: nowrap; }
.brand .mark { width: 10px; height: 10px; background: var(--accent); }
nav.sections { display: flex; gap: 22px; flex: 1; height: 100%; padding-left: 28px; border-left: 1px solid var(--line); }
nav.sections a { display: flex; align-items: center; font-size: 11px; color: var(--muted); }
nav.sections a.on { color: var(--text); }
.signout { margin: 0 0 0 auto; }
.signout button { background: transparent; color: var(--muted); border: 1px solid var(--line-2); padding: 6px 11px;
                  font-size: 10.5px; cursor: pointer; border-radius: 0; white-space: nowrap; }
.signout button:hover { color: var(--text); border-color: var(--muted); }

/* page tabs */
nav.tabs { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg);
           overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { padding: 13px 14px 11px; font-size: 11px; color: var(--muted); border-bottom: 2px solid transparent;
             white-space: nowrap; }
nav.tabs a:hover { color: var(--text); }
nav.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 56px; }

/* page head */
.pagehead { margin: 0 0 22px; }
.crumbs { font-size: 10.5px; color: var(--faint); margin-bottom: 8px; }
.crumbs span + span::before { content: "/"; margin: 0 8px; color: var(--line-2); }
h1 { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 11px; font-weight: 500; margin: 0 0 14px; color: var(--muted);
     font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.meta { font-size: 10.5px; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead { color: var(--muted); margin: 0; max-width: 72ch; }
.dot { display: inline-block; width: 6px; height: 6px; background: var(--ok); box-shadow: 0 0 6px var(--ok);
       vertical-align: 1px; margin-right: 2px; }
.meta .sep { color: var(--line-2); }
.small { color: var(--muted); font-size: 12.5px; }

/* panels */
.block, figure.chart, .card, .signin { background: var(--panel); border: 1px solid var(--line); }
.block { padding: 18px 20px; margin: 0 0 16px; overflow-x: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 16px; }
.grid > .span { grid-column: 1 / -1; }

/* charts */
figure.chart { margin: 0; padding: 16px 18px 14px; min-width: 0; }
figure.chart .head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
figure.chart h3 { font-size: 11px; font-weight: 500; color: var(--muted); margin: 0; order: 0; }
figure.chart .sub { order: 2; flex-basis: 100%; margin: -4px 0 0; color: var(--muted); font-size: 13px; }
figure.chart .kpi { order: 3; flex-basis: 100%; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
                    margin-top: 2px; }
.stack { display: grid; gap: 16px; }
figure.chart .kpi .fig { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
                         font-variant-numeric: tabular-nums; }
figure.chart .kpi .cap { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
figure.chart .box { position: relative; height: 250px; }
figure.chart.wide .box { height: 360px; }
figure.chart .empty { color: var(--faint); padding: 3rem 0; text-align: center; margin: 0;
                      font-family: var(--mono); font-size: 11.5px; }
.periods { order: 1; margin-left: auto; display: inline-flex; border: 1px solid var(--line-2); }
.periods button { background: transparent; color: var(--muted); border: 0; border-radius: 0; padding: 6px 10px;
                  font-size: 10px; cursor: pointer; }
.periods button + button { border-left: 1px solid var(--line-2); }
.periods button:hover { color: var(--text); }
.periods button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* tables */
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 10px; font-weight: 500; color: var(--faint); padding: 0 12px 10px;
     border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--panel-2); }
td.n, th.n { text-align: right; white-space: nowrap; }
td.n, td.time { font-family: var(--mono); font-size: 12.5px; }
td.time { color: var(--muted); white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
table.feed { min-width: 780px; }
table.feed td:nth-child(3) { min-width: 240px; }
.deal { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; white-space: nowrap; color: var(--text); }
.deal::before { content: ""; width: 7px; height: 7px; background: var(--c1); }
.deal.sale::before { background: var(--c2); }
.deal.done::before { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px currentColor; }
table.fees { min-width: 680px; }
table.fees td { color: var(--muted); }
table.fees td:first-child { white-space: nowrap; font-size: 10.5px; color: var(--text); width: 110px; }
table.fees td:last-child { color: var(--text); }
.source { margin: 12px 0 0; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* home */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; transition: border-color 0.15s; }
.card:hover { border-color: var(--line-2); color: var(--text); }
.card .index { font-size: 10.5px; color: var(--faint); }
.card h2 { font-family: var(--sans); text-transform: none; letter-spacing: -0.01em; font-size: 22px; font-weight: 500;
           color: var(--text); margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card .pages { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; padding-top: 14px;
               border-top: 1px solid var(--line); }
.card .pages a { font-size: 10.5px; color: var(--muted); }
.card .pages a:hover { color: var(--accent); }

/* sign-in */
.signin { max-width: 400px; margin: 9vh auto 0; padding: 28px 28px 24px; }
.signin .kicker { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--faint);
                  margin-bottom: 22px; }
.signin .kicker .mark { width: 8px; height: 8px; background: var(--accent); }
.signin h1 { font-size: 24px; }
.signin p { color: var(--muted); }
.signin label { display: block; font-size: 10.5px; color: var(--muted); margin: 22px 0 8px; }
input { width: 100%; padding: 12px 14px; font: 500 16px var(--mono); letter-spacing: 0.04em; color: var(--text);
        background: var(--bg); border: 1px solid var(--line-2); border-radius: 0; outline: none; }
input:focus { border-color: var(--accent); }
button { border-radius: 0; cursor: pointer; }
.signin button { width: 100%; margin-top: 16px; padding: 13px; font-size: 11.5px; font-weight: 500;
                 color: var(--on-accent); background: var(--text); border: 0; }
.signin button:hover { background: var(--accent); }
.signin .small { margin-top: 18px; }
.signin .small a { color: var(--muted); border-bottom: 1px solid var(--line-2); }
.signin .small a:hover { color: var(--text); }
.banner { padding: 10px 14px; border-left: 2px solid var(--line-2); background: var(--panel-2); color: var(--muted); }
.banner.warn { border-left-color: var(--warn); color: var(--text); }

@media (max-width: 720px) {
  header.top { gap: 16px; padding: 0 16px; }
  nav.sections { padding-left: 16px; gap: 16px; }
  nav.tabs { padding: 0 8px; }
  main { padding: 22px 16px 40px; }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  figure.chart .kpi .fig { font-size: 26px; }
  figure.chart.wide .box { height: 300px; }
  .periods { margin-left: 0; }
}
@media (max-width: 720px) {   /* tables become stacked rows on a phone */
  table.feed, table.fees { min-width: 0; }
  table.feed thead, table.fees thead { display: none; }
  table.feed tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px 0;
                        border-bottom: 1px solid var(--line); }
  table.feed tbody tr:hover td { background: none; }
  table.feed td { padding: 0; border: 0; min-width: 0 !important; }
  table.feed td:nth-child(1) { grid-column: 2; grid-row: 1; text-align: right; font-size: 11px; }
  table.feed td:nth-child(2) { grid-column: 1; grid-row: 1; }
  table.feed td:nth-child(2) .deal { white-space: normal; }
  table.feed td:nth-child(3) { grid-column: 1 / -1; }
  table.feed td:nth-child(4) { grid-column: 1; text-align: left; align-self: end; white-space: normal; }
  table.feed td:nth-child(5) { grid-column: 2; }
  table.feed td:nth-child(5)::before { content: "Est. commission"; display: block; color: var(--faint); font-size: 9.5px;
                                       text-transform: uppercase; letter-spacing: 0.08em; }
  table.fees tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.fees td { display: block; padding: 0; border: 0; width: auto !important; }
  table.fees td + td { margin-top: 8px; }
  table.fees td:nth-child(2)::before, table.fees td:nth-child(3)::before {
    display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 2px; }
  table.fees td:nth-child(2)::before { content: "Published fee (ex VAT)"; }
  table.fees td:nth-child(3)::before { content: "Estimate used"; }
}
@media (max-width: 480px) {
  header.top { gap: 12px; padding: 0 12px; }
  .brand { letter-spacing: 0.06em; gap: 8px; font-size: 10.5px; }
  nav.sections { display: none; }      /* the breadcrumb and tabs say where you are; the brand links home */
  .signout button { padding: 6px 8px; }
}
