/* Monday Automation console.
 *
 * Light theme only, on purpose: an internal console read at a desk in daylight
 * does not need a second palette kept validated against a second surface.
 *
 * Layout is a fixed sidebar plus a scrolling body. Under 900px the sidebar
 * becomes an off-canvas drawer driven by a checkbox, so navigation works with
 * no JavaScript. Something you open when a run has gone wrong should not need a
 * script to show you its own menu.
 *
 * Chart colours are the data-viz reference palette's light steps, validated
 * against the white panel surface. Do not change them without re-running the
 * validator: the aqua slot is already below 3:1, which is why every mark
 * carries a direct label and every chart ships a table view.
 */

/* ============================== tokens ============================== */
:root {
  color-scheme: light;

  --brand: #1f4fb5;
  --brand-ink: #ffffff;
  --brand-wash: #eef3fd;
  --brand-line: #c7d8f6;

  --page: #f6f7f9;
  --panel: #ffffff;
  --sunken: #f8f9fb;

  --ink: #14161a;
  --ink-2: #4d535f;
  --ink-3: #7c828f;

  --line: #e6e8ed;
  --line-2: #d3d7df;

  --ok: #12703f;
  --ok-wash: #e6f4ec;
  --warn: #8a5300;
  --warn-wash: #fdf2e2;
  --bad: #a81f1f;
  --bad-wash: #fdecec;

  /* validated categorical slots */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --st-good: #0ca30c;
  --st-warning: #fab219;
  --st-critical: #d03b3b;
  --grid: #e6e5de;
  --baseline: #c9c8bf;
  --muted-ink: #898781;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --r: 10px;
  --r-sm: 7px;
  --side-w: 244px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 1px 1px rgba(20, 22, 26, .04);
  --shadow-lg: 0 18px 48px rgba(20, 22, 26, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100;
        background: var(--panel); padding: 10px 14px; }
.skip:focus { left: 0; }

.mono { font-family: var(--mono); font-size: .92em; }
.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.quiet { color: var(--ink-3); }

/* ============================== shell ============================== */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.shell { display: flex; min-height: 100vh; }

/* Fixed rather than sticky, with the body padded to match. Sticky left the
   sidebar's white panel ending partway down a long page, with the page colour
   showing beneath it and the border stopping in mid-air. */
.side {
  width: var(--side-w);
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 20;
}
.body { padding-left: var(--side-w); }

.side-head { padding: 16px 16px 13px; border-bottom: 1px solid var(--line);
             display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 640; font-size: 13.5px; letter-spacing: -.012em;
              color: var(--ink); white-space: nowrap; overflow: hidden;
              text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--ink-3); }

.side-nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-label { display: block; font-size: 10.5px; font-weight: 650;
             letter-spacing: .09em; text-transform: uppercase;
             color: var(--ink-3); padding: 12px 10px 6px; }
.nav-label:first-child { padding-top: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
              border-radius: var(--r-sm); color: var(--ink-2);
              font-weight: 500; font-size: 13.5px; }
.side-nav a:hover { background: var(--sunken); color: var(--ink);
                    text-decoration: none; }
.side-nav a.on { background: var(--brand-wash); color: var(--brand);
                 font-weight: 600; }
.side-nav a svg { width: 15px; height: 15px; flex: 0 0 15px;
                  fill: currentColor; opacity: .7; }
.side-nav a.on svg { opacity: 1; }
.badge { margin-left: auto; background: var(--brand); color: var(--brand-ink);
         font-size: 10.5px; font-weight: 650; padding: 1px 6px;
         border-radius: 999px; font-variant-numeric: tabular-nums; }

.side-foot { padding: 13px 16px 16px; border-top: 1px solid var(--line); }
.acct-row { display: flex; gap: 6px; margin-bottom: 10px; }
.acct-chip { font-size: 10.5px; font-weight: 650; letter-spacing: .04em;
             text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.acct-chip.ok { background: var(--ok-wash); color: var(--ok); }
.acct-chip.off { background: var(--bad-wash); color: var(--bad); }
.side-note { font-size: 11.5px; color: var(--ink-3); margin: 0 0 8px;
             line-height: 1.5; }

.nav-close, .nav-open, .scrim-nav { display: none; }

.body { flex: 1; min-width: 0; display: flex; flex-direction: column;
        padding-left: var(--side-w); }

.topbar { display: none; align-items: center; gap: 12px; padding: 10px 16px;
          background: var(--panel); border-bottom: 1px solid var(--line);
          position: sticky; top: 0; z-index: 30; }
.topbar-title { font-weight: 600; flex: 1; }

.main { padding: 28px 32px 72px; max-width: 1140px; width: 100%; }

@media (max-width: 900px) {
  .side { z-index: 50; transform: translateX(-100%);
          transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .body { padding-left: 0; }
  .nav-toggle:checked ~ .shell .side { transform: translateX(0); }
  .nav-toggle:checked ~ .shell .scrim-nav {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(20, 22, 26, .38); }
  .nav-close { display: block; font-size: 22px; line-height: 1;
               color: var(--ink-3); cursor: pointer; padding: 0 4px; }
  .topbar { display: flex; }
  .nav-open { display: flex; flex-direction: column; justify-content: center;
              gap: 4px; width: 34px; height: 34px; padding: 8px;
              cursor: pointer; border: 1px solid var(--line-2);
              border-radius: var(--r-sm); }
  .nav-open span { display: block; height: 1.5px; background: var(--ink-2);
                   border-radius: 2px; }
  .main { padding: 20px 18px 64px; }
}
@media (max-width: 560px) {
  .main { padding: 16px 14px 56px; }
  .split { grid-template-columns: 1fr; }
}

/* ============================== type ============================== */
/* Headings are styled on the bare elements rather than through wrapper
   classes, so every page gets the hierarchy without each template having to
   opt in. h1 is the page title, h2 is a section rule. */
.main > h1 { font-size: 25px; font-weight: 660; letter-spacing: -.024em;
             margin: 0 0 6px; line-height: 1.2; }
.main > p.lede { color: var(--ink-2); margin: 0 0 28px; max-width: 66ch; }

.main > h2 { font-size: 11.5px; font-weight: 650; letter-spacing: .09em;
             text-transform: uppercase; color: var(--ink-3);
             margin: 36px 0 13px; padding-bottom: 8px;
             border-bottom: 1px solid var(--line); }
.main > h2:first-child { margin-top: 0; }
h3 { font-size: 14px; font-weight: 620; margin: 0 0 6px;
     letter-spacing: -.01em; }

/* ============================== surfaces ============================== */
.panel { background: var(--panel); border: 1px solid var(--line);
         border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stats, .grid.stats {
         gap: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
         background: var(--panel); border: 1px solid var(--line);
         border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.stats > div, .grid.stats > div {
         padding: 14px 16px; border-right: 1px solid var(--line);
         background: var(--panel); border-radius: 0; box-shadow: none; }
.stats > div:last-child, .grid.stats > div:last-child { border-right: 0; }
.stats .n, .grid.stats .n { font-size: 22px; font-weight: 640; letter-spacing: -.02em;
            font-variant-numeric: tabular-nums; line-height: 1.15; }
.stats .k, .grid.stats .k { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase;
            letter-spacing: .07em; margin-top: 3px; }

/* ============================== pills ============================== */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px;
        font-size: 10.5px; font-weight: 650; letter-spacing: .045em;
        text-transform: uppercase; white-space: nowrap;
        border: 1px solid transparent; }
.pill.ok { color: var(--ok); background: var(--ok-wash); }
.pill.warn { color: var(--warn); background: var(--warn-wash); }
.pill.bad { color: var(--bad); background: var(--bad-wash); }
.pill.quiet { color: var(--ink-2); background: var(--sunken);
              border-color: var(--line); }
.pill.accent { color: var(--brand); background: var(--brand-wash);
               border-color: var(--brand-line); }
a.pill:hover { text-decoration: none; filter: brightness(.97); }

/* ============================== notices ============================== */
.notice { border-radius: var(--r); padding: 12px 14px; margin: 0 0 18px;
          border: 1px solid var(--line-2); background: var(--panel);
          font-size: 13.5px; }
.notice.warn { background: var(--warn-wash); border-color: #f0dcb8;
               color: #6f4300; }
.notice.bad { background: var(--bad-wash); border-color: #f2caca;
              color: #8f1a1a; }
.notice strong { font-weight: 650; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice li { margin: 2px 0; }
.notice a { color: inherit; text-decoration: underline; }

/* ============================== tables ============================== */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase;
     letter-spacing: .07em; color: var(--ink-3); font-weight: 650;
     padding: 9px 14px; border-bottom: 1px solid var(--line);
     background: var(--sunken); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line);
     vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--sunken); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================== buttons ============================== */
.btn { display: inline-flex; align-items: center; justify-content: center;
       gap: 7px; padding: 8px 14px; border-radius: var(--r-sm);
       border: 1px solid var(--line-2); background: var(--panel);
       color: var(--ink); font: 550 13.5px/1 var(--sans); cursor: pointer;
       white-space: nowrap; }
.btn:hover { background: var(--sunken); border-color: var(--ink-3);
             text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand);
               color: var(--brand-ink); }
.btn.primary:hover { background: #1a459f; border-color: #1a459f; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #8f1a1a; border-color: #8f1a1a; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.lg { padding: 10px 18px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================== forms ============================== */
.control { margin: 16px 0 0; }
.control > .lbl { display: block; font-weight: 560; margin-bottom: 5px;
                  font-size: 13px; }
.control > .hint { display: block; color: var(--ink-3); font-size: 12px;
                   margin-top: 5px; line-height: 1.45; }

input[type=text], input[type=number], input[type=date], input[type=password] {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--panel); color: var(--ink);
  font: inherit; }
input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px;
                      border-color: var(--brand); }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none;
                                                margin: 0; }
input[type=date] { min-height: 37px; }

fieldset.mode { border: 1px solid var(--line-2); border-radius: var(--r);
                padding: 12px 14px 14px; margin: 20px 0 0; }
fieldset.mode legend { padding: 0 6px; font-weight: 650; font-size: 10.5px;
                       text-transform: uppercase; letter-spacing: .08em;
                       color: var(--ink-3); }
#confirm-box[hidden], #modal-confirm[hidden] { display: none !important; }

form.filters { display: flex; gap: 14px; align-items: flex-end;
               flex-wrap: wrap; }
form.filters .control { margin: 0; min-width: 190px; flex: 1 1 190px; }
form.filters .actions { flex: 0 0 auto; }
form.inline { display: inline; }

/* ---- custom select ---- */
.sel { position: relative; }
.sel-button { width: 100%; display: flex; align-items: center; gap: 8px;
              padding: 8px 11px; border: 1px solid var(--line-2);
              border-radius: var(--r-sm); background: var(--panel);
              color: var(--ink); font: inherit; cursor: pointer;
              text-align: left; }
.sel-button:hover { border-color: var(--ink-3); }
.sel-button:focus-visible { outline: 2px solid var(--brand);
                            outline-offset: 1px; }
.sel-label { flex: 1; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; }
.sel-caret { color: var(--ink-3); font-size: 9px; transition: transform .12s; }
.sel.open .sel-caret { transform: rotate(180deg); }
.sel.open .sel-button { border-color: var(--brand); }
.sel-list { position: absolute; z-index: 35; left: 0; right: 0;
            top: calc(100% + 5px); background: var(--panel);
            border: 1px solid var(--line-2); border-radius: var(--r-sm);
            padding: 5px; max-height: 270px; overflow-y: auto;
            box-shadow: var(--shadow-lg); }
.sel-option { padding: 7px 10px; border-radius: 5px; cursor: pointer;
              display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.sel-option .tick { width: 12px; color: var(--brand); font-size: 11px; }
.sel-option.active { background: var(--sunken); }
.sel-option.on { font-weight: 600; }
.sel-option[data-disabled=true] { opacity: .45; cursor: not-allowed; }
.sel-option .sub { color: var(--ink-3); font-size: 12px; }

/* ---- switch ---- */
.sw { display: flex; gap: 11px; align-items: flex-start; margin: 16px 0 0; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw-track { flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px;
            background: var(--line-2); border: 1px solid var(--line-2);
            position: relative; cursor: pointer; transition: background .13s;
            margin-top: 1px; }
.sw-track:focus-visible { outline: 2px solid var(--brand);
                          outline-offset: 2px; }
.sw-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
           border-radius: 50%; background: #fff; transition: transform .13s;
           box-shadow: 0 1px 3px rgba(0, 0, 0, .28); }
.sw.on .sw-track { background: var(--brand); border-color: var(--brand); }
.sw.on .sw-knob { transform: translateX(16px); }
.sw .sw-text .t { font-weight: 560; display: block; font-size: 13px; }
.sw .sw-text .d { color: var(--ink-3); font-size: 12px; line-height: 1.45; }

/* ---- choice cards ---- */
.choices { display: grid; gap: 8px; margin: 8px 0 0; }
.choice { border: 1px solid var(--line-2); border-radius: var(--r-sm);
          padding: 11px 13px; cursor: pointer; display: flex; gap: 11px;
          align-items: flex-start; background: var(--panel); }
.choice:hover { border-color: var(--ink-3); }
.choice:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.choice .dot { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%;
               border: 1.5px solid var(--line-2); margin-top: 2px;
               position: relative; }
.choice.on { border-color: var(--brand); background: var(--brand-wash); }
.choice.on .dot { border-color: var(--brand); }
.choice.on .dot::after { content: ''; position: absolute; inset: 3px;
                         border-radius: 50%; background: var(--brand); }
.choice[data-disabled=true] { opacity: .5; cursor: not-allowed; }
.choice .t { font-weight: 560; display: block; font-size: 13.5px; }
.choice .d { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.choice.danger.on { border-color: var(--bad); background: var(--bad-wash); }
.choice.danger.on .dot { border-color: var(--bad); }
.choice.danger.on .dot::after { background: var(--bad); }

/* ---- file picker ---- */
.filepick { display: flex; gap: 10px; align-items: center; }
.filepick input[type=file] { position: absolute; width: 1px; height: 1px;
                             opacity: 0; pointer-events: none; }
.file-name { color: var(--ink-3); font-size: 13px; }

/* ============================== runners ============================== */
.runners { display: grid; gap: 14px;
           grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.runner { background: var(--panel); border: 1px solid var(--line);
          border-radius: var(--r); padding: 18px; display: flex;
          flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.runner h3 { font-size: 16px; margin: 0; letter-spacing: -.016em; }
.runner p { color: var(--ink-2); font-size: 13px; margin: 0; flex: 1;
            line-height: 1.5; }
.runner .go { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.runner .meta { border-top: 1px solid var(--line); padding-top: 10px;
                display: flex; gap: 10px; align-items: center; font-size: 12px;
                color: var(--ink-3); flex-wrap: wrap; }
.runner .meta .end { margin-left: auto; }

.jobs { display: grid; gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.job { background: var(--panel); border: 1px solid var(--line);
       border-radius: var(--r); padding: 15px; display: flex;
       flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.job .head { display: flex; align-items: flex-start; gap: 8px; }
.job .title { font-weight: 600; flex: 1; letter-spacing: -.01em; }
.job .blurb { color: var(--ink-2); font-size: 12.5px; margin: 0; flex: 1;
              line-height: 1.5; }
.job .foot { margin-top: auto; padding-top: 9px; display: flex;
             align-items: center; gap: 9px; font-size: 12px;
             color: var(--ink-3); border-top: 1px solid var(--line);
             flex-wrap: wrap; }
.job.off { opacity: .62; }

/* ============================== account cards ============================== */
.overview { display: grid; gap: 14px;
            grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.acct { background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.acct > h3 { display: flex; align-items: center; gap: 8px; font-size: 15px;
             margin: 0 0 14px; }
.acct > h3 .who { flex: 1; }

.hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero .fig { font-size: 30px; font-weight: 660; letter-spacing: -.03em;
             font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero .unit { color: var(--ink-3); font-size: 12.5px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
         padding: 14px 0; border-top: 1px solid var(--line);
         border-bottom: 1px solid var(--line); margin: 16px 0; }
.split .k { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase;
            letter-spacing: .07em; margin-bottom: 4px; }
.split .v { font-size: 19px; font-weight: 620;
            font-variant-numeric: tabular-nums; letter-spacing: -.016em; }
.split .d { color: var(--ink-3); font-size: 12px; margin-top: 2px;
            line-height: 1.45; }
.asof { color: var(--ink-3); font-size: 11.5px; margin: 14px 0 0; }
.money { font-variant-numeric: tabular-nums; letter-spacing: -.016em; }

dl.meta { display: grid; grid-template-columns: max-content 1fr;
          gap: 7px 18px; margin: 0; font-size: 13px; align-items: baseline; }
dl.meta dt { color: var(--ink-3); }
dl.meta dd { margin: 0; }

/* ============================== charts ============================== */
.chart { margin: 0; }
.chart figcaption { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.chart .sub { color: var(--ink-3); font-size: 12px; margin: 0 0 12px;
              line-height: 1.45; }
.chart .empty { color: var(--ink-3); font-size: 12.5px; padding: 26px 0;
                text-align: center; border-bottom: 1px solid var(--baseline); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 12px;
          font-size: 12px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px;
                  flex: 0 0 auto; }

.hbars { display: grid; gap: 11px; }
.hbar .top { display: flex; justify-content: space-between; gap: 12px;
             font-size: 12.5px; margin-bottom: 5px; }
.hbar .top .name { color: var(--ink-2); }
.hbar .top .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar .track { height: 10px; background: var(--grid); border-radius: 3px;
               display: flex; overflow: hidden; }
.hbar .track > i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar .track > i + i { margin-left: 2px; }
.hbar .track > i:first-child { border-radius: 3px 4px 4px 3px; }
.hbar:hover .track { outline: 2px solid var(--line-2); outline-offset: 2px; }

.vbars { display: flex; align-items: flex-end; gap: 6px; height: 150px;
         margin-top: 12px; border-bottom: 1px solid var(--baseline); }
.vbar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
        justify-content: flex-end; height: 100%; overflow: visible; }
.vbar .cap { text-align: center; font-size: 10.5px; color: var(--ink-2);
             font-variant-numeric: tabular-nums; white-space: nowrap;
             line-height: 1.3; margin-bottom: 2px; }
.vbar .stack { display: flex; flex-direction: column-reverse;
               justify-content: flex-start; }
.vbar .seg { border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar .seg + .seg { margin-bottom: 2px; }
.vbar:hover .stack { filter: brightness(.94); }
.vaxis { display: flex; gap: 6px; margin-top: 7px; }
.vaxis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 10.5px;
              color: var(--muted-ink); overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; }

.viewtoggle { background: none; border: 0; color: var(--brand); font: inherit;
              font-size: 12px; cursor: pointer; padding: 6px 0 0; }
.viewtoggle:hover { text-decoration: underline; }
.chart .tableview[hidden] { display: none !important; }
.chart .tableview { margin-top: 10px; border: 1px solid var(--line);
                    border-radius: var(--r-sm); overflow: hidden; }

/* ============================== log ============================== */
pre.log { background: #101317; color: #d8dce3; border-radius: var(--r);
          padding: 16px; overflow-x: auto; font-family: var(--mono);
          font-size: 12px; line-height: 1.6; max-height: 68vh; margin: 0;
          white-space: pre; tab-size: 4; }
.log-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
            flex-wrap: wrap; }
.log-head .spacer { margin-left: auto; }

/* ============================== modal ============================== */
.scrim { position: fixed; inset: 0; background: rgba(20, 22, 26, .45);
         display: flex; align-items: flex-start; justify-content: center;
         padding: 5vh 16px 24px; z-index: 60; overflow-y: auto; }
.scrim[hidden] { display: none !important; }
.modal { background: var(--panel); border-radius: 14px; width: 100%;
         max-width: 560px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal .mhead { padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
                display: flex; align-items: flex-start; gap: 12px; }
.modal .mhead h2 { margin: 0; font-size: 17px; letter-spacing: -.018em; }
.modal .mhead p { margin: 4px 0 0; color: var(--ink-2); font-size: 12.5px; }
.modal .mbody { padding: 2px 20px 18px; max-height: 62vh; overflow-y: auto; }
.modal .mfoot { padding: 14px 20px; border-top: 1px solid var(--line);
                display: flex; gap: 10px; justify-content: flex-end;
                background: var(--sunken); }
.xbtn { background: none; border: 0; font-size: 21px; line-height: 1;
        color: var(--ink-3); cursor: pointer; padding: 0 2px; }
.xbtn:hover { color: var(--ink); }
body.modal-open { overflow: hidden; }

/* ============================== login ============================== */
.login-page { min-height: 100vh; display: flex; align-items: center;
              justify-content: center; padding: 24px;
              background: linear-gradient(180deg, #f6f7f9 0%, #eaeef5 100%); }
.login-card { width: 100%; max-width: 372px; background: var(--panel);
              border: 1px solid var(--line); border-radius: 14px;
              padding: 28px; box-shadow: 0 12px 40px rgba(20, 22, 26, .09); }
.login-card .brand { margin-bottom: 22px; }
.login-card .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
.login-card .brand-name { font-size: 15px; }
.login-card h1 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.018em; }
.login-card .lede { color: var(--ink-2); font-size: 13px; margin: 0 0 18px; }
