/* ========================================
   ALLOTMENT — operator view

   The site's palette and type, a different density. esxcs.com is read once;
   this is scanned repeatedly by one person who already knows what the columns
   mean, so the rows are tight and the marks carry the meaning.

   brand.css is generated by esxcs-web's src/bin/brand.rs and supplies the
   colour tokens plus .masthead--general. Never hand-edit either.
   ======================================== */

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/TX-02-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}

:root {
    --gutter: 1.5rem;
    --rule: 1px solid var(--color-mist);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-ink);
    background: var(--color-paper);
}

/* --- chrome ------------------------------------------------------------ */

header {
    /* §7: 2px Void is the primary division. The 1px Mist below is for
       secondary ones -- using the lighter weight here let the header blend
       into the content on the public site, which is the bug this avoids. */
    border-bottom: 2px solid var(--color-void);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem var(--gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.25rem;
}

.wordmark {
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--color-void);
    text-decoration: none;
}

.nav-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; }
.nav-links a { color: var(--color-harbor); text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
.nav-links a.quiet { color: var(--color-slate); }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem var(--gutter) 3rem; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; font-size: 1.5rem; color: var(--color-void); }
.subtitle { margin: 0.25rem 0 0; color: var(--color-slate); }

h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-slate);
    margin: 2rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: var(--rule);
}

/* --- tables ------------------------------------------------------------ */

/* Wide tables scroll inside their own box. Without this the whole page
   scrolls sideways on a phone, which is the failure the public site had. */
.scroller { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-slate);
    padding: 0.4rem 0.6rem;
    border-bottom: var(--rule);
    white-space: nowrap;
}
tbody td { padding: 0.35rem 0.6rem; border-bottom: var(--rule); }
tbody tr:hover { background: var(--color-ice); }
td a { color: var(--color-harbor); }

.num { text-align: right; }
.mono, td.mono { font-family: 'Berkeley Mono', ui-monospace, monospace; }

table.facts th {
    text-align: left;
    font-weight: 400;
    color: var(--color-slate);
    width: 10rem;
    padding: 0.35rem 0.6rem;
    border-bottom: var(--rule);
}

tr.detail td { padding-top: 0; border-bottom: var(--rule); }
tr.detail pre {
    margin: 0 0 0.4rem;
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--color-void);
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- the four marks ---------------------------------------------------- */

/* The estate's vocabulary, and the reason these rows need no status column:
   =  correct    +  created or changed    ~  worth a look    !  needs a human */
.mark, td.mark {
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    font-weight: 600;
    text-align: center;
    width: 1.5rem;
    /* Colour is a second channel, never the only one -- the glyph carries the
       meaning on its own for anyone who cannot separate these hues. */
    color: var(--color-slate);
}
.mark.ok { color: var(--color-harbor); }
.mark.add { color: var(--color-harbor); }
.mark.note { color: var(--color-slate); }
.mark.warn { color: var(--color-void); }

.banner {
    padding: 0.6rem 0.8rem;
    border-left: 3px solid var(--color-void);
    background: var(--color-ice);
    margin: 0 0 1.5rem;
}

.error-detail {
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.8rem;
    background: var(--color-ice);
    border-left: 3px solid var(--color-void);
}

.meta { color: var(--color-slate); font-size: 13px; max-width: 62ch; }
code {
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    font-size: 0.92em;
    background: var(--color-ice);
    padding: 0.05em 0.3em;
}

/* --- footer ------------------------------------------------------------ */

footer {
    border-top: var(--rule);
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem var(--gutter) 2rem;
    color: var(--color-slate);
    font-size: 13px;
}
footer p { margin: 0.35rem 0; }
.legend .mark { display: inline-block; margin-right: 0.15rem; margin-left: 0.75rem; }
.legend .mark:first-child { margin-left: 0; }
.dev-warning { color: var(--color-void); font-weight: 600; }

/* --- the gate ---------------------------------------------------------- */

.gate-page { display: flex; flex-direction: column; min-height: 100vh; }
.gate { max-width: 28rem; margin: 4rem auto; padding: 0 var(--gutter); }
.gate h1 {
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    letter-spacing: 0.08em;
    color: var(--color-void);
    margin: 0;
}
.gate form { margin: 2rem 0 1rem; }
.gate label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-slate);
    margin-bottom: 0.35rem;
}
.gate input {
    width: 100%;
    padding: 0.55rem 0.6rem;
    font-family: 'Berkeley Mono', ui-monospace, monospace;
    font-size: 15px;
    border: 1px solid var(--color-slate);
    background: var(--color-paper);
    color: var(--color-ink);
}
.gate input:focus { outline: 2px solid var(--color-harbor); outline-offset: -1px; }
.gate button {
    margin-top: 0.75rem;
    padding: 0.55rem 1.25rem;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-paper);
    background: var(--color-void);
    border: none;
    cursor: pointer;
}
.gate button:hover { background: var(--color-harbor); }
.gate-error { color: var(--color-void); font-weight: 600; }
.gate-note { color: var(--color-slate); font-size: 13px; margin-top: 2rem; }

/* --- narrow ------------------------------------------------------------ */

@media (max-width: 48rem) {
    :root { --gutter: 1rem; }
    .nav-links { margin-left: 0; width: 100%; }
    header nav { border-bottom: none; }
    main { padding-top: 1rem; }
}
