/* MR Arts control center — one hand-written stylesheet.
   No CDN, no external fonts, no build step (spec §9). Everything below is
   reachable from a phone on mobile data with one request.

   The look: a studio ledger. Warm paper, ink-black text, hairline rules,
   monospaced numerals, one vermilion for danger and one green for "alive".
   Nothing rounded, nothing glowing, nothing that moves without a reason. */

:root {
  --paper:      #f5f1e8;
  --surface:    #fffdf7;
  --surface-2:  #efeade;
  --ink:        #17140f;
  --ink-2:      #5f574b;
  --ink-3:      #8d8478;
  --rule:       #ddd5c4;
  --rule-2:     #c9c0ac;
  --ok:         #1c6b52;
  --warn:       #8f6208;
  --stop:       #b03a1e;
  --ok-bg:      #e4efe6;
  --warn-bg:    #f7ecd2;
  --stop-bg:    #f6e2da;

  --display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino,
             "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Roboto Mono", monospace;

  --pad: 16px;
  --tap: 44px;
  --shadow: 0 1px 0 rgba(23, 20, 15, .04), 0 6px 20px -14px rgba(23, 20, 15, .5);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #14120e;
    --surface:   #1c1915;
    --surface-2: #262119;
    --ink:       #f2ede2;
    --ink-2:     #b3a999;
    --ink-3:     #877e70;
    --rule:      #322c23;
    --rule-2:    #453d31;
    --ok:        #63c39c;
    --warn:      #e0a63f;
    --stop:      #f07c5c;
    --ok-bg:     #17281f;
    --warn-bg:   #2c2312;
    --stop-bg:   #331a13;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px -16px #000;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  /* A faint paper tooth. Two gradients, no image request. */
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 1px, transparent 1px 3px);
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim  { color: var(--ink-3); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------------ header */

.top {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top);
}

.top__inner {
  max-width: 940px; margin: 0 auto;
  padding: 10px var(--pad) 0;
  display: grid; gap: 8px;
}

.top__brand { display: flex; align-items: center; gap: 9px; }

.wordmark {
  font-family: var(--display); font-size: 20px; font-weight: 600;
  letter-spacing: .01em; text-decoration: none;
}

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-3); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-3) 18%, transparent);
}
.dot--ok   { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-bg); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot--stop { background: var(--stop); box-shadow: 0 0 0 3px var(--stop-bg);
             animation: throb 1.9s ease-in-out infinite; }

@keyframes throb { 50% { opacity: .35; } }

.top__gauges {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}

.pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--rule); background: var(--paper);
  padding: 5px 9px; border-radius: 2px;
  font-size: 12px; line-height: 1.2; text-decoration: none; color: var(--ink-2);
}
.pill__k { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.pill__v { font-family: var(--mono); font-size: 13px; color: var(--ink);
           font-variant-numeric: tabular-nums; }
.pill.is-hidden { display: none; }
.pill.is-warn .pill__v { color: var(--warn); }

.pill--switch { cursor: pointer; min-height: 32px; }
.pill--switch.is-on  { border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
.pill--switch.is-on  .pill__v { color: var(--ok); font-weight: 700; }
.pill--switch.is-off { border-color: color-mix(in srgb, var(--warn) 55%, var(--rule));
                       background: var(--warn-bg); }
.pill--switch.is-off .pill__v { color: var(--warn); font-weight: 700; }
.pill--switch:hover { border-color: var(--ink-3); }

.pill--queue { background: var(--surface-2); border-color: var(--rule-2); }
.pill--queue .pill__v { font-weight: 700; }

.tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad);
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none; text-decoration: none; color: var(--ink-2);
  padding: 10px 12px; font-size: 14px; letter-spacing: .01em;
  border-bottom: 2px solid transparent; white-space: nowrap;
  min-height: var(--tap); display: flex; align-items: center; gap: 5px;
}
.tab b { font-family: var(--mono); font-size: 11px; color: var(--surface);
         background: var(--ink); border-radius: 2px; padding: 1px 5px; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab:hover { color: var(--ink); }

/* -------------------------------------------------------------- alert bars */

.bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 11px var(--pad); font-size: 14px; line-height: 1.45;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.bar__body { flex: 1 1 320px; }
.bar__why { display: block; font-family: var(--mono); font-size: 12.5px; opacity: .9; }
.bar--stop  { background: var(--stop); color: #fff; }
.bar--warn  { background: var(--warn-bg); color: var(--ink); border-bottom-color: var(--rule-2); }
.bar--pause { background: var(--surface-2); color: var(--ink); border-bottom-color: var(--rule-2); }
.bar code { font-family: var(--mono); font-size: 12.5px;
            background: rgba(0, 0, 0, .16); padding: 1px 5px; border-radius: 2px; }

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

.wrap { max-width: 940px; margin: 0 auto; padding: 22px var(--pad) 64px; }

.screen-head { margin-bottom: 18px; }
.screen-title { margin: 0; font-size: 30px; line-height: 1.1; }
.screen-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 62ch; }
.screen-sub em { font-style: italic; }

.section {
  margin: 30px 0 4px; font-size: 19px;
  display: flex; align-items: center; gap: 8px;
}
.section__sub { margin: 0 0 14px; color: var(--ink-2); font-size: 13.5px; }
.subsection { margin: 22px 0 8px; font-size: 15px; }
.count {
  font-family: var(--mono); font-size: 12px; background: var(--ink);
  color: var(--surface); border-radius: 2px; padding: 1px 6px;
}

.empty {
  border: 1px dashed var(--rule-2); padding: 26px var(--pad);
  color: var(--ink-2); text-align: center; font-size: 14.5px; border-radius: 2px;
}
.empty--inline { padding: 14px; text-align: left; }

.foot {
  max-width: 940px; margin: 0 auto; padding: 0 var(--pad) 30px;
  color: var(--ink-3); font-size: 11.5px; font-family: var(--mono);
  display: flex; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere;
}
.foot span { min-width: 0; overflow-wrap: anywhere; }

/* ----------------------------------------------------------------- filters */

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }

.chip {
  font: inherit; font-size: 13px; text-decoration: none;
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2);
  padding: 7px 11px; border-radius: 2px; cursor: pointer; min-height: 34px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip b { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.is-active b { color: var(--paper); opacity: .7; }
.chip--urgent b { color: var(--stop); }

/* ------------------------------------------------------------------- posts */

.posts { display: grid; gap: 10px; }

.post {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-2); border-radius: 2px;
  box-shadow: var(--shadow);
}
.post[data-needs-price="1"] { border-left-color: var(--warn); }
.post[data-auto="off"] { border-left-color: var(--ink-3); }
.post[data-hold="1"]   { border-left-color: var(--stop); }
.post[open] { border-left-color: var(--ink); }
.post.is-hidden { display: none; }

.post__head {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px; cursor: pointer; list-style: none;
}
.post__head::-webkit-details-marker { display: none; }
.post__head::after {
  content: "+"; font-family: var(--mono); color: var(--ink-3);
  font-size: 18px; line-height: 1; flex: none; width: 16px; text-align: center;
}
.post[open] .post__head::after { content: "−"; color: var(--ink); }

.thumb {
  position: relative; flex: none; width: 62px; height: 62px;
  background: var(--surface-2); border: 1px solid var(--rule);
  overflow: hidden; border-radius: 2px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-broken img { display: none; }
.thumb__fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 20px; color: var(--ink-3);
}
.thumb img + .thumb__fallback { display: none; }
.thumb.is-broken img + .thumb__fallback { display: grid; }
.thumb--sm { width: 38px; height: 38px; }

.post__meta { flex: 1 1 auto; min-width: 0; }
.post__caption {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-family: var(--display); font-size: 16px;
  line-height: 1.35; max-height: 2.7em; overflow: hidden;
  overflow-wrap: anywhere;
}
.post__counts { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-2); }
.post__counts b { font-family: var(--mono); color: var(--ink); font-weight: 600; }

/* Inside the meta column, not beside it: a nowrap chip row as a flex SIBLING
   refuses to shrink below its content and pushes the whole document wider than
   the phone it is being read on. */
.post__state { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

.tag {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  border: 1px solid var(--rule-2); color: var(--ink-2);
  padding: 2px 6px; border-radius: 2px; white-space: nowrap;
}
.tag--price  { border-color: color-mix(in srgb, var(--ok) 40%, var(--rule)); color: var(--ok); }
.tag--none   { border-color: color-mix(in srgb, var(--warn) 40%, var(--rule)); color: var(--warn); }
.tag--off    { background: var(--surface-2); }
.tag--hold   { border-color: var(--rule-2); }
.tag--urgent { background: var(--stop); border-color: var(--stop); color: #fff; }

/* ------------------------------------------------------------ post editor */

.editor { padding: 4px 14px 16px; border-top: 1px solid var(--rule); }
.editor__switches {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 0 4px;
}

.field { display: block; margin: 14px 0 0; }
.field--inline { margin: 0; }

.label {
  display: block; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-2); margin-bottom: 5px;
}
.label small { text-transform: none; letter-spacing: 0; color: var(--ink-3); }

input[type=text], input[type=password], select, textarea {
  font: inherit; width: 100%; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-2);
  padding: 10px 11px; border-radius: 2px; min-height: var(--tap);
  -webkit-appearance: none; appearance: none;
}
select {
  min-height: 38px; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  width: auto; min-width: 140px;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 1px;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }

.check {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px;
  min-height: 38px; cursor: pointer;
}
/* No accent-color: the browser's own checkbox is the one control every phone
   renders unambiguously, and "is that square dark because it is checked or
   because the theme is dark?" is not a question to leave over an approval gate. */
.check input { width: 18px; height: 18px; margin: 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; min-height: 4px; }
.pricechip {
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--rule));
  background: var(--ok-bg); color: var(--ink);
  padding: 4px 8px; border-radius: 2px;
}
.pricechip i { font-style: normal; color: var(--ink-2); margin-right: 6px;
               font-family: var(--body); font-size: 12px; }
.pricechip.is-out { opacity: .5; text-decoration: line-through; }
.pricechip--bad {
  border-color: var(--stop); background: var(--stop-bg); color: var(--stop);
}

.hint { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-2); max-width: 68ch; }
.hint--warn { color: var(--warn); }
[data-when-off] { display: none; }
.post[data-auto="off"] [data-when-off] { display: block; }

.editor__foot {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding-top: 10px; border-top: 1px dotted var(--rule);
  font-size: 12.5px;
}
.saved { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }
.saved.is-fresh { color: var(--ok); }
.saved.is-bad   { color: var(--stop); }

.replies { margin-top: 12px; font-size: 13.5px; }
.replies > summary { cursor: pointer; color: var(--ink-2); padding: 6px 0; }
.replies ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.replies li { margin: 5px 0; }

/* ------------------------------------------------------------------- queue */

.cards { display: grid; gap: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-2); border-radius: 2px;
  padding: 14px; box-shadow: var(--shadow);
}
.card.is-urgent { border-left-color: var(--stop); }
.card.is-going  { opacity: .45; pointer-events: none; }
.card.is-done   { display: none; }

.card__head {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 10px;
}
.who { font-weight: 650; font-family: var(--mono); font-size: 14px; }
.on  { color: var(--ink-2); font-size: 13.5px; flex: 1 1 auto; }
.expiry { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
          color: var(--ink-2); }
.expiry b { font-family: var(--mono); font-size: 13px; letter-spacing: 0;
            text-transform: none; }
.expiry.is-urgent { color: var(--stop); }

.said {
  margin: 0 0 10px; padding: 9px 12px; border-left: 2px solid var(--rule-2);
  background: var(--paper); font-size: 14.5px; white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.said--bio { font-family: var(--body); color: var(--ink-2); }

.why { display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
       margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.reason { font-style: italic; }
.sig { font-size: 12.5px; color: var(--ink-2); }
.context { margin: 10px 0; font-size: 13.5px; color: var(--ink-2); }

.card__actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding-top: 12px; border-top: 1px dotted var(--rule);
}

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

.btn {
  font: inherit; font-size: 14px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
  padding: 0 16px; min-height: var(--tap); border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--surface-2); }
.btn--go   { background: var(--ink); color: var(--paper); }
.btn--go:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.btn--stop { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn--stop:hover { background: color-mix(in srgb, var(--stop) 85%, #000); }
.btn--quiet { border-color: var(--rule-2); color: var(--ink-2); }
.btn--wide { width: 100%; }
.btn--ghost-light {
  background: transparent; border-color: currentColor; color: inherit;
  min-height: 34px; padding: 0 12px; font-size: 13px;
}
.btn[disabled] { opacity: .4; cursor: not-allowed; }

.linkish {
  font: inherit; font-size: 13px; background: none; border: 0; padding: 4px 0;
  color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:hover { color: var(--ink); }
.linkish--danger { color: var(--stop); }

/* ---------------------------------------------------------------- settings */

.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 2px;
  padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.panel--danger { border-color: color-mix(in srgb, var(--stop) 35%, var(--rule)); }
.panel__head {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.panel__head h2 { margin: 0; font-size: 19px; }
.panel__body { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.panel__band {
  margin: 12px 0 0; padding: 10px 12px; font-size: 13.5px;
  background: var(--stop-bg); border-left: 3px solid var(--stop); color: var(--ink);
}
.panel__foot { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.why-stopped { display: block; margin-top: 6px; font-family: var(--mono);
               font-size: 12.5px; color: var(--stop); }

.bigswitch {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: none; border: 0; padding: 4px; font: inherit; min-height: var(--tap);
}
.bigswitch__track {
  width: 58px; height: 30px; border-radius: 15px; background: var(--surface-2);
  border: 1px solid var(--rule-2); position: relative; transition: background .15s;
}
.bigswitch__knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ink-3); transition: transform .15s, background .15s;
}
.bigswitch.is-on .bigswitch__track { background: var(--ok-bg);
                                     border-color: color-mix(in srgb, var(--ok) 50%, var(--rule)); }
.bigswitch.is-on .bigswitch__knob { transform: translateX(28px); background: var(--ok); }
.bigswitch__word { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.bigswitch.is-on  .bigswitch__word { color: var(--ok); }
.bigswitch.is-off .bigswitch__word { color: var(--ink-3); }

.addrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.addrow input { flex: 1 1 160px; width: auto; }

.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-2); font-weight: 600;
  padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule-2);
}
.table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tr.is-gone { opacity: .35; text-decoration: line-through; }

.policy { min-height: 320px; font-size: 13.5px; line-height: 1.6; }

.readout { display: grid; gap: 1px; margin: 12px 0 0;
           grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.readout > div { background: var(--paper); padding: 9px 11px; }
.readout__wide { grid-column: 1 / -1; }
.readout dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
              color: var(--ink-2); }
.readout dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }

.inflight { list-style: none; margin: 8px 0 0; padding: 0; }
.inflight li {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px;
}

/* ------------------------------------------------------------------ modal */

.modal {
  border: 1px solid var(--rule-2); border-top: 3px solid var(--stop);
  border-radius: 2px; padding: 0; max-width: 460px; width: calc(100% - 32px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(10, 8, 5, .55); }
.modal__body { padding: 18px; }
.modal h3 { margin: 0 0 10px; font-size: 20px; }
.modal p { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* --------------------------------------------------------------- activity */

.feed { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule);
        border-radius: 2px; }

.row { background: var(--surface); min-width: 0; }
.row__head {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  cursor: pointer; list-style: none;
}
.row__head::-webkit-details-marker { display: none; }
.row__main { flex: 1 1 auto; min-width: 0; }
/* Wraps before it truncates: an ellipsised @handle is a worse trade than a
   second line, because the handle is how the owner recognises the person. */
.row__top { display: flex; gap: 4px 8px; align-items: baseline; flex-wrap: wrap; }
.row__who { font-family: var(--mono); font-size: 13px; font-weight: 600;
            overflow-wrap: anywhere; }
.row__said {
  display: block; font-size: 13.5px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__sent { display: block; font-size: 12.5px; color: var(--ink-3);
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Wraps rather than refusing to shrink: three badges plus a timestamp is wider
   than a phone, and a row that pushes the page sideways is worse than one that
   uses two lines. */
.row__side {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  justify-content: flex-end; flex: 0 1 auto; min-width: 0; margin-left: auto;
}
.when { font-size: 11.5px; color: var(--ink-3); }

.badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 6px; border-radius: 2px; border: 1px solid var(--rule-2);
  color: var(--ink-2); white-space: nowrap;
}
.badge--public_reply     { border-color: color-mix(in srgb, var(--ok) 40%, var(--rule)); color: var(--ok); }
.badge--private_reply_dm { border-color: var(--ink); color: var(--ink); }
.badge--hide             { background: var(--surface-2); }
.badge--failed           { background: var(--stop); border-color: var(--stop); color: #fff; }
.badge--in_flight        { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }

.row--failed    { border-left: 3px solid var(--stop); }
.row--in_flight { border-left: 3px solid var(--warn); }

.row__body { padding: 4px 12px 16px; border-top: 1px dotted var(--rule); }
.kv { display: grid; gap: 10px; margin-top: 10px; }
.kv dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
         color: var(--ink-2); margin-bottom: 3px; }
.kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.trace { display: flex; gap: 4px; flex-wrap: wrap; }
.step {
  font-family: var(--mono); font-size: 11.5px; background: var(--paper);
  border: 1px solid var(--rule); padding: 2px 6px; border-radius: 2px;
}
.row__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }

/* ------------------------------------------------------------------ login */

.login-body { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; }
.login { width: min(380px, calc(100% - 32px)); text-align: center; padding: 24px 0 60px; }
.login--wide { width: min(600px, calc(100% - 32px)); text-align: left; }
.wordmark--big { font-size: 38px; margin: 0; letter-spacing: -.02em; }
.login__sub { margin: 2px 0 26px; color: var(--ink-2); font-size: 13px;
              text-transform: uppercase; letter-spacing: .18em; }
.login__form { text-align: left; display: grid; gap: 14px; }
.login__err { margin: 0; color: var(--stop); font-size: 13.5px; }
.login__foot { margin-top: 22px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.boot__msg { font-family: var(--mono); font-size: 13.5px; color: var(--stop);
             background: var(--stop-bg); padding: 12px; border-radius: 2px;
             overflow-wrap: anywhere; }
.boot__hint { color: var(--ink-2); font-size: 14px; }
.boot__steps { color: var(--ink-2); font-size: 14px; line-height: 1.7; padding-left: 20px; }
.boot__steps code, .panel code { font-family: var(--mono); font-size: 12.5px;
                                 background: var(--surface-2); padding: 1px 5px; }

/* ----------------------------------------------------------------- toasts */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 90;
  display: grid; gap: 8px; width: min(520px, calc(100% - 24px));
}
.toast {
  background: var(--ink); color: var(--paper); padding: 11px 14px;
  border-radius: 2px; font-size: 13.5px; box-shadow: var(--shadow);
  animation: rise .18s ease-out;
}
.toast--bad { background: var(--stop); color: #fff; }
.toast--ok  { background: var(--ok); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------- wider than a
   phone. The panel is mobile-first; this is the only breakpoint. */

@media (min-width: 720px) {
  .top__inner {
    grid-template-columns: auto 1fr;
    grid-template-areas: "brand gauges" "tabs tabs";
    align-items: center;
  }
  .top__brand  { grid-area: brand; }
  .top__gauges { grid-area: gauges; justify-content: flex-end; }
  .tabs        { grid-area: tabs; }
  .screen-title { font-size: 34px; }
  .editor { padding-left: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
