/* JRA Research — "cavaletes de vidro": concrete ground, glass panels, a navy beam. */

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --concrete: #e6e4df;
  --concrete-deep: #dbd8d1;
  --glass: #fcfcfa;
  --glass-tint: #f4f3ef;
  --line: #d6d2ca;
  --line-strong: #8f8a81;
  --ink: #1c2024;
  --ink-2: #4b5158;
  --ink-3: #646a71;
  --beam: #17354a;
  --beam-deep: #0f2636;
  --beam-ink: #f3f1ec;
  --beam-ink-2: #b9c6d0;
  --action: #17354a;
  --action-hover: #23506f;
  --focus: #2f6c9c;
  --buy: #23744a;    --buy-bg: #e2efe6;
  --hold: #865a0c;   --hold-bg: #f5ead2;
  --sell: #a8342c;   --sell-bg: #f6e1de;
  --void: #63686e;   --void-bg: #ebeae7;
  --changed: #5b3f97; --changed-bg: #ece6f6;
  --shadow: 0 1px 0 rgba(255,255,255,.75) inset, 0 7px 5px -6px rgba(46,40,30,.38), 0 1px 1px rgba(46,40,30,.07);
  --radius: 4px;
  --rail-w: 212px;
  --beam-h: 58px;
  --font: "Archivo", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --concrete: #1b1d20;
    --concrete-deep: #16181a;
    --glass: #24272b;
    --glass-tint: #2a2e33;
    --line: #353a40;
    --line-strong: #6a7178;
    --ink: #ebe9e4;
    --ink-2: #b7b4ad;
    --ink-3: #95928b;
    --beam: #18405b;
    --beam-deep: #102c40;
    --beam-ink-2: #a9bccb;
    --action: #2d628a;
    --action-hover: #3874a0;
    --focus: #7fb0d8;
    --buy: #63c48f;    --buy-bg: #1d3327;
    --hold: #e0b25b;   --hold-bg: #3a2f1a;
    --sell: #ec8a80;   --sell-bg: #3d2321;
    --void: #a2a7ad;   --void-bg: #2e3135;
    --changed: #b9a2ea; --changed-bg: #2f2842;
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 7px 5px -6px rgba(0,0,0,.7), 0 1px 1px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--concrete); color: var(--ink);
  font: 400 14px/1.45 var(--font); font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--beam); color: var(--beam-ink); }
a { color: var(--action); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* Shell ------------------------------------------------------------------ */
.shell {
  min-height: 100vh; display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--beam-h) minmax(0, 1fr);
  grid-template-areas: "beam beam" "rail hall";
}
.beam {
  grid-area: beam; position: sticky; top: 0; z-index: 20; height: var(--beam-h);
  display: flex; align-items: center; gap: 24px; padding: 0 20px 0 18px;
  background: var(--beam); color: var(--beam-ink);
  border-bottom: 1px solid var(--beam-deep);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 30px;
  border-top: 3px solid currentColor; border-bottom: 3px solid currentColor;
  font-weight: 760; font-size: 13px; letter-spacing: .06em; font-stretch: 112%;
}
.brand-name { display: block; font-weight: 640; font-size: 16px; letter-spacing: -.005em; line-height: 1.1; }
.brand-sub { display: block; font-size: 12px; color: var(--beam-ink-2); line-height: 1.2; }
.beam .brand-sub { color: var(--beam-ink-2); }
.beam-status { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.engine-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 420px; min-height: 32px;
  padding: 0 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--beam-ink); font-size: 13px; white-space: nowrap; overflow: hidden;
}
.engine-chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.engine-chip:hover { background: rgba(255,255,255,.12); }
.activity { font-size: 13px; color: var(--beam-ink-2); white-space: nowrap; }
.beam-actions { display: flex; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius);
  background: transparent; color: inherit;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.beam :focus-visible { outline-color: var(--beam-ink); }
/* System state on the beam: shape, not the rating hues. Filled = ready, ring = needs attention, square = unavailable. */
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--beam-ink-2); flex: none; }
.status-dot.ok { background: var(--beam-ink); box-shadow: none; }
.status-dot.warn { box-shadow: inset 0 0 0 2px var(--beam-ink); }
.status-dot.bad { border-radius: 0; background: transparent; box-shadow: inset 0 0 0 2px var(--beam-ink); }

.rail {
  grid-area: rail; position: sticky; top: var(--beam-h); height: calc(100vh - var(--beam-h));
  display: flex; flex-direction: column; gap: 18px; padding: 18px 12px;
  background: var(--concrete-deep); border-right: 1px solid var(--line); overflow-y: auto;
}
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-bottom { margin-top: auto; }
.rail-item {
  display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 0 10px;
  border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.rail-item:hover { background: var(--glass-tint); color: var(--ink); }
.rail-item[aria-current="page"] { background: var(--glass); color: var(--ink); font-weight: 620; box-shadow: var(--shadow); }
.rail-item[aria-current="page"] svg { color: var(--beam); }
@media (prefers-color-scheme: dark) { .rail-item[aria-current="page"] svg { color: var(--focus); } a { color: var(--focus); } }

.hall { grid-area: hall; min-width: 0; padding: 28px 32px 64px; outline: none; }
.view { display: none; max-width: 1320px; margin: 0 auto; }
.view.active { display: block; }

/* Page heads ------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 28px; line-height: 1.12; font-weight: 640; letter-spacing: -.018em; font-stretch: 96%; }
.page-lede { margin: 6px 0 0; color: var(--ink-2); max-width: 70ch; }
.section-title { margin: 0; font-size: 16px; font-weight: 640; letter-spacing: -.005em; }
.section-note { margin: 3px 0 0; color: var(--ink-3); font-size: 13px; max-width: 75ch; }
.stack { display: grid; gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; }

/* Glass ------------------------------------------------------------------ */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.glass-pad { padding: 20px 22px; }
.glass-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 22px 14px; border-bottom: 1px solid var(--line); }
.glass-head .count { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Forms ------------------------------------------------------------------ */
.form-grid { display: grid; gap: 14px 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; }
.form-grid > .span-2 { grid-column: span 2; } .form-grid > .span-3 { grid-column: span 3; }
.form-grid > .span-4 { grid-column: span 4; } .form-grid > .span-5 { grid-column: span 5; }
.form-grid > .span-6 { grid-column: span 6; } .form-grid > .span-8 { grid-column: span 8; }
.form-grid > .span-12 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-width: 0; min-height: 36px; padding: 7px 10px;
  background: var(--glass); border: 1px solid var(--line-strong); border-radius: 3px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.4; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .85; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--action); margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; color: var(--ink); }
.ticker-input { text-transform: uppercase; font-weight: 600; letter-spacing: .02em; }
.form-error { margin: 0; color: var(--sell); font-size: 13px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.day-picker label { position: relative; }
.day-picker input { position: absolute; opacity: 0; inset: 0; }
.day-picker span { display: inline-grid; place-items: center; min-width: 46px; height: 32px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 13px; color: var(--ink-2); }
.day-picker input:checked + span { background: var(--beam); border-color: var(--beam); color: var(--beam-ink); }
.day-picker input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 3px; background: var(--glass); color: var(--ink);
  font-weight: 560; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--glass-tint); border-color: var(--ink-3); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--action); border-color: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding: 0 8px; min-height: 30px; }
.btn-quiet:hover { background: var(--glass-tint); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--sell); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn-file { position: relative; overflow: hidden; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Ratings ---------------------------------------------------------------- */
.rating { display: inline-flex; align-items: center; gap: 8px; font-weight: 620; white-space: nowrap; }
.rating::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.rating.compra { color: var(--buy); }
.rating.neutra { color: var(--hold); }
.rating.venda { color: var(--sell); }
.rating.inconclusiva { color: var(--void); font-weight: 520; }
.rating.inconclusiva::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.changed { display: flex; width: max-content; margin-top: 5px; padding: 1px 7px; border-radius: 999px; background: var(--changed-bg); color: var(--changed); font-size: 12px; font-weight: 560; white-space: nowrap; }

/* Tables ----------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table.assets, table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.assets { font-stretch: 92%; }
.assets td .sub { white-space: nowrap; }
.assets th, .list th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-size: 12.5px; font-weight: 560; color: var(--ink-3);
  padding: 10px 14px; background: var(--glass); border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.assets td, .list td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.assets tbody tr.row:hover td, .list tbody tr:hover td { background: var(--glass-tint); }
.assets tr.row.lit td { background: color-mix(in srgb, var(--changed-bg) 55%, transparent); }
.num { font-variant-numeric: tabular-nums lining-nums; text-align: right; white-space: nowrap; }
th.num { text-align: right; }
.ticker { font-weight: 680; letter-spacing: .015em; font-stretch: 104%; }
.sub { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.asset-name { display: block; color: var(--ink-3); font-size: 12.5px; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-summary { min-width: 260px; }
.summary { color: var(--ink-2); max-width: 54ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Colour belongs to the rating only: upside, system states and checks are ink with a sign. */
.up, .down { color: var(--ink); }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: center; align-self: start; }
.btn[aria-expanded="true"] { background: var(--glass-tint); color: var(--ink); border-color: var(--line-strong); }
.btn-label { display: none; }
.path { display: block; margin-top: 4px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--ink-2); text-align: left; }
.empty { padding: 34px 22px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-weight: 620; margin-bottom: 4px; }

/* The signature move: the back of the label ------------------------------ */
tr.verso > td { padding: 0 14px 14px; background: var(--glass-tint); border-bottom: 1px solid var(--line); }
.label-back {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 26px;
  padding: 16px 18px; margin-top: 2px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transform-origin: 50% 0; animation: turn-down .22s cubic-bezier(.2,.8,.2,1) both;
}
.label-back dt { font-size: 12px; color: var(--ink-3); }
.label-back dd { margin: 2px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.label-back .wide { grid-column: 1 / -1; }
.label-back .hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--ink-2); }
@keyframes turn-down { from { transform: perspective(900px) rotateX(-82deg); opacity: 0; } to { transform: perspective(900px) rotateX(0); opacity: 1; } }

/* Jobs ------------------------------------------------------------------- */
.jobs { list-style: none; margin: 0; padding: 0; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.job-meta { color: var(--ink-3); font-size: 12.5px; }
.job-message { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; grid-column: 1 / -1; }
.job .row-actions { align-self: start; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 560; color: var(--ink-2); }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--void); }
.state.running::before, .state.validating::before, .state.queued::before { background: var(--action); }
.state.error { color: var(--ink); font-weight: 640; }
.state.error::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); border-radius: 0; }
@media (prefers-color-scheme: dark) { .state.running::before, .state.validating::before, .state.queued::before { background: var(--focus); } }
.state.done::before { background: var(--ink-3); }
.elapsed { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.log { grid-column: 1 / -1; margin: 4px 0 0; max-height: 260px; overflow: auto; padding: 12px; background: var(--concrete); border: 1px solid var(--line); border-radius: 3px; font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

/* Settings ---------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 20px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 14px; color: var(--ink-2); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--beam); }
@media (prefers-color-scheme: dark) { .tab[aria-selected="true"] { border-bottom-color: var(--focus); } }
.engines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.engine { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.engine.is-default { border-color: var(--beam); box-shadow: var(--shadow), 0 0 0 1px var(--beam); }
@media (prefers-color-scheme: dark) { .engine.is-default { border-color: var(--focus); box-shadow: var(--shadow), 0 0 0 1px var(--focus); } }
.engine-name { margin: 0; font-size: 16px; font-weight: 640; }
.engine-vendor { color: var(--ink-3); font-size: 12.5px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.ok-text { color: var(--ink); }
.bad-text { color: var(--ink); font-weight: 640; }
.bad-text::before { content: "! "; }
.warn-text { color: var(--ink-2); font-style: italic; }
details.more summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 560; padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
details.more[open] summary::before { transform: rotate(45deg); }
details.more[open] summary { margin-bottom: 10px; }
.code-inline { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; background: var(--glass-tint); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
.kv-list { display: grid; gap: 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--ink-3); }
.kv > span:last-child { text-align: right; overflow-wrap: anywhere; }
.notice { padding: 12px 14px; border-radius: 3px; background: var(--glass-tint); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.notice.warn { background: var(--hold-bg); border-color: color-mix(in srgb, var(--hold) 30%, transparent); color: var(--ink); }
.notice.bad { background: var(--sell-bg); border-color: color-mix(in srgb, var(--sell) 30%, transparent); color: var(--ink); }

/* Schedules -------------------------------------------------------------- */
.schedule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.schedule:last-child { border-bottom: 0; }
.schedule-name { margin: 0; font-size: 15.5px; font-weight: 640; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.paused { font-size: 12px; font-weight: 560; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 7px; }
.when { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 13px; }
.when b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tickers { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; grid-column: 1 / -1; }
.runs { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }

/* Login ------------------------------------------------------------------ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--concrete); }
.login::before { content: ""; position: fixed; inset: 0 0 auto; height: 58px; background: var(--beam); }
.login-panel { position: relative; width: min(380px, 100%); display: grid; gap: 18px; padding: 28px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-panel .brand-lockup { color: var(--ink); }
.login-panel .brand-sub { color: var(--ink-3); }

/* Toasts ----------------------------------------------------------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; background: var(--glass); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 3px 6px -3px rgba(0,0,0,.3); font-size: 13.5px; animation: toast-in .18s ease-out both; }
.toast.error { border-color: color-mix(in srgb, var(--sell) 45%, var(--line)); color: var(--ink); }
.toast.error::before { content: "Erro: "; font-weight: 640; color: var(--sell); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.skeleton { height: 14px; margin: 18px 22px; border-radius: 3px; background: linear-gradient(90deg, var(--line) 0 30%, var(--glass-tint) 50%, var(--line) 70% 100%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1180px) {
  .engines { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  :root { --rail-w: 64px; }
  .rail-item span { display: none; }
  .rail-item { justify-content: center; padding: 0; }
  .hall { padding: 22px 20px 56px; }
  .form-grid > [class*="span-"] { grid-column: span 6; }
  .form-grid > .span-12 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "beam" "rail" "hall"; }
  .beam { gap: 10px; padding: 0 10px 0 12px; }
  .brand-sub, .activity { display: none; }
  .engine-chip { max-width: 46vw; }
  .rail { position: sticky; top: var(--beam-h); z-index: 15; height: auto; flex-direction: row; gap: 4px; padding: 6px 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-group { flex-direction: row; gap: 2px; }
  .rail-bottom { margin-top: 0; }
  .rail-item { padding: 0 10px; min-height: 34px; }
  .rail-item span { display: inline; font-size: 13px; }
  .rail-item svg { display: none; }
  .hall { padding: 18px 14px 48px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-title { font-size: 28px; }
  .form-grid > [class*="span-"] { grid-column: 1 / -1; }
  .glass-pad { padding: 16px; }
  .glass-head { padding: 14px 16px 12px; }
  /* Asset table becomes a stack of labels, one asset per glass card. */
  table.assets, .assets tbody, .assets tr, .assets td { display: block; }
  .assets thead { display: none; }
  .assets tr.row { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
  .assets td { padding: 3px 0; border: 0; text-align: left; }
  .assets td[data-label] { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); column-gap: 10px; align-items: baseline; }
  .assets td[data-label]::before { content: attr(data-label); grid-row: span 3; color: var(--ink-3); font-size: 12.5px; }
  .assets .row-actions .btn { min-height: 44px; padding: 0 14px; border-color: var(--line-strong); }
  .btn-label { display: inline; }
  .assets td.cell-asset::before, .assets td.cell-summary::before, .assets td.cell-actions::before { display: none; }
  .assets td.num { text-align: left; }
  .assets .summary { max-width: none; margin: 6px 0; }
  .assets .row-actions { justify-content: flex-start; margin-top: 4px; }
  tr.verso { display: block; padding: 0 12px 12px; }
  tr.verso > td { padding: 0; }
  .job, .schedule { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .job .row-actions, .schedule .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .toasts { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .label-back { animation: label-fade .18s ease-out both !important; }
}
@keyframes label-fade { from { opacity: 0; } to { opacity: 1; } }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--ink-3); }
.rail-item, .brand-name { white-space: nowrap; }
@media (max-width: 720px) {
  .beam .brand-lockup > span:last-child { display: none; }
  .engine-chip { max-width: none; flex: 1 1 auto; }
  .beam-status { flex: 1 1 auto; justify-content: flex-end; }
}
.kv > span.path { text-align: left; }
