/*
 * Trade Desk.
 *
 * ONE RULE ABOVE ALL: no physical edges. No `left`, no `right`, no
 * `margin-left`, no `padding-right`, no `text-align: left`. Use the logical
 * properties — inline-start / inline-end, margin-inline, padding-inline,
 * border-inline-start, text-align: start / end, inset-inline. They flip with
 * the document direction; the physical ones do not, and this app is
 * English-first rather than English-only. CssLogicalPropertiesTest greps this
 * file and fails the build.
 *
 * The palette is dark and committed: no light variant. These are numeric,
 * dense screens that people leave open for hours, and a half-considered second
 * theme reads worse than one theme done properly. Every colour is painted
 * explicitly for the same reason.
 *
 * Semantic colour is separate from the accent. Teal is "actionable"; green and
 * red mean long and short, or safe and dangerous, and are never spent on a
 * button just because it needs colour.
 */

:root {
    --ground: #0d1211;
    --surface: #141a19;
    --surface-2: #1b2321;
    --line: #27302e;
    --line-strong: #3a4643;

    --ink: #e8efec;
    --ink-2: #b3c0bc;
    --ink-3: #7e8c88;

    --accent: #3cc0a8;
    --accent-dark: #2a9c88;
    --accent-wash: #10312c;

    --long: #45b878;
    --short: #e2695f;
    --warn: #d8a548;
    --warn-wash: #2e2612;
    --danger-wash: #33191a;

    --radius: 8px;
    --radius-sm: 5px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -20px rgba(0, 0, 0, .9);

    --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 15px/1.55 var(--sans);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

h1 {
    font-size: 22px;
    margin: 0 0 4px;
    letter-spacing: -.01em;
}

h2 {
    font-size: 15px;
    margin: 0 0 14px;
    font-weight: 600;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface);
    border-block-end: 1px solid var(--line);
    padding-inline: 20px;
    height: 54px;
}

.topbar a {
    color: var(--ink-2);
}

.topbar .logo {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-weight: 600;
    white-space: nowrap;
}

.topbar .logo:hover {
    text-decoration: none;
}

.mark {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--accent-wash);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
}

.topnav {
    display: flex;
    gap: 4px;
}

.topnav a {
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.topnav a:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.topnav a.on {
    background: var(--accent-wash);
    color: var(--accent);
}

.spacer {
    flex: 1;
}

.who {
    color: var(--ink-3);
    font-size: 13px;
    max-width: 26ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * The environment band. Persistent on every screen, because somebody who
 * cannot tell at a glance whether they are looking at testnet or live will
 * eventually arm the wrong one. It says NONE while no key is connected rather
 * than guessing a default — claiming "TESTNET" with no key is worse than
 * admitting there is nothing there.
 */
.envband {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid currentColor;
    color: var(--ink-3);
    white-space: nowrap;
}

.envband.e-TESTNET {
    color: var(--warn);
}

.envband.e-LIVE {
    color: var(--short);
}

/* ---------------------------------------------------------------- layout */

.wrap {
    max-width: 1080px;
    margin-inline: auto;
    padding: 26px 20px 80px;
}

.pagehead {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-block-end: 20px;
}

.sub {
    color: var(--ink-3);
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.card.wide {
    grid-column: 1 / -1;
}

/* ---------------------------------------------------------------- fields */

.fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 9px 18px;
    margin: 0;
    font-size: 14px;
}

.fields dt {
    color: var(--ink-3);
    white-space: nowrap;
}

.fields dd {
    margin: 0;
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.fields dd.mono {
    font-family: var(--mono);
}

.empty {
    color: var(--ink-2);
    font-size: 14px;
    margin: 0;
}

.hint {
    color: var(--ink-3);
    font-size: 13px;
    margin: 12px 0 0;
    padding-block-start: 12px;
    border-block-start: 1px solid var(--line);
}

/* ---------------------------------------------------------------- table */

.tablewrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: start;
    padding: 11px 14px 11px 0;
    border-block-end: 1px solid var(--line);
    vertical-align: middle;
}

thead th {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 500;
    border-block-end: 1px solid var(--line-strong);
}

tbody tr:last-child td {
    border-block-end: none;
}

td.num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

td.actions {
    text-align: end;
}

.muted {
    color: var(--ink-3);
}

/* ---------------------------------------------------------------- chips */

.chip {
    display: inline-block;
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    white-space: nowrap;
}

.chip.ok {
    background: var(--accent-wash);
    color: var(--accent);
}

.chip.off {
    background: var(--danger-wash);
    color: var(--short);
}

.chip.role {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-block;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.btn-sm {
    font-size: 13px;
    padding: 5px 10px;
}

.btn-danger:hover {
    border-color: var(--short);
    color: var(--short);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    border-color: var(--accent);
    color: #06201c;
    font-weight: 600;
    padding: 11px 20px;
    font-size: 15px;
}

.btn-google:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* ---------------------------------------------------------------- flash */

.flash {
    background: var(--accent-wash);
    color: var(--accent);
    border: 1px solid var(--accent-dark);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-block-end: 16px;
    font-size: 14px;
}

.flash.error {
    background: var(--danger-wash);
    color: var(--short);
    border-color: var(--short);
}

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

.signin {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.signin-card {
    width: min(440px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.signin-card .mark {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-block-end: 16px;
}

.signin-card h1 {
    font-size: 24px;
}

.signin-card p {
    color: var(--ink-2);
    font-size: 14.5px;
    margin: 10px 0 22px;
}

.signin-card .note {
    color: var(--ink-3);
    font-size: 12.5px;
    margin: 22px 0 0;
    padding-block-start: 18px;
    border-block-start: 1px solid var(--line);
}

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

.foot {
    max-width: 1080px;
    margin-inline: auto;
    padding: 0 20px 30px;
    color: var(--ink-3);
    font-size: 12px;
    font-family: var(--mono);
}
