/* Trình chỉnh sửa Devic — cùng tinh thần "màn hình phi công" của web: nền đen, chữ trắng ngà, nhãn mono. */
:root {
  color-scheme: dark;
  --ink: #0b0c0d;
  --carbon: #131516;
  --panel: #181a1c;
  --raise: #202326;
  --white: #f5f5f2;
  --fog: #c3c5c4;
  --ash: #8a8d8f;
  --dim: #5f6366;
  --line: rgba(245, 245, 242, .12);
  --line-2: rgba(245, 245, 242, .24);
  --accent: #6aa8ff;
  --accent-ink: #0b1a2e;
  --ok: #5fd68f;
  --warn: #f2b84b;
  --bad: #ff6b5e;
  --f-ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --r: 10px;
  --side: 236px;
}
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100% }
#app { min-height: 100% }
body {
  margin: 0; background: var(--ink); color: var(--white);
  font: 15px/1.55 var(--f-ui); -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block }
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--accent) }
.mono { font-family: var(--f-mono); letter-spacing: .02em }
.boot { padding: 40px; color: var(--ash) }
::selection { background: var(--accent); color: var(--accent-ink) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--white);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.btn:hover { border-color: var(--fog); background: rgba(245, 245, 242, .05) }
.btn:active { transform: scale(.97) }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none }
.btn.solid { background: var(--white); color: var(--ink); border-color: var(--white) }
.btn.solid:hover { background: #fff }
.btn.blue { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.btn.danger { color: var(--bad); border-color: rgba(255, 107, 94, .4) }
.btn.danger:hover { border-color: var(--bad); background: rgba(255, 107, 94, .08) }
.btn.ghost { border-color: transparent }
.btn.ghost:hover { border-color: var(--line-2) }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 13px }
.btn.icon { width: 34px; min-height: 34px; padding: 0 }
.btn svg { width: 16px; height: 16px; flex: none }

/* ------------------------------------------------------------ login */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 64px,
    var(--ink);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--carbon); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 28px; display: flex; flex-direction: column; gap: 18px;
}
.auth-card img { height: 30px; width: auto; align-self: flex-start }
.auth-card h1 { margin: 6px 0 0; font-size: 22px; font-weight: 700; text-wrap: balance }
.auth-card p { margin: 0; color: var(--ash); font-size: 14px }

/* ------------------------------------------------------------ fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.field > span, .lbl {
  font: 500 11.5px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ash);
}
.field small { color: var(--dim); font-size: 12.5px; line-height: 1.45 }
.in, .field input, .field select, .field textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 8px;
  background: var(--ink); border: 1px solid var(--line-2); color: var(--white);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea { min-height: 96px; max-height: 360px; resize: vertical; line-height: 1.5; field-sizing: content }
.in:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106, 168, 255, .18);
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim) }
.field .en { position: relative }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.pair .field > span .tag { color: var(--dim) }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--fog) }
.check input { width: 18px; height: 18px; accent-color: var(--accent) }
.err { color: var(--bad); font-size: 14px; margin: 0 }
.note { color: var(--ash); font-size: 13.5px; margin: 0 }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100% }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--carbon);
  padding: max(20px, env(safe-area-inset-top, 0px)) 14px 16px max(14px, env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; text-decoration: none }
.brand img { height: 24px; width: auto }
.brand span { font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ash) }
.nav { display: flex; flex-direction: column; gap: 2px }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--fog); text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: background-color 140ms ease, color 140ms ease;
}
.nav a:hover { background: rgba(245, 245, 242, .05); color: var(--white) }
.nav a.on { background: var(--raise); color: var(--white) }
.nav a .n { margin-left: auto; font: 12px var(--f-mono); color: var(--dim) }
.nav a.on .n { color: var(--ash) }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .8 }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px }
.who { font-size: 13.5px; color: var(--fog) }
.who b { display: block; color: var(--white); font-weight: 600 }

.main { min-width: 0; display: flex; flex-direction: column }
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(28px, env(safe-area-inset-right, 0px)) 14px 28px;
  background: rgba(11, 12, 13, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar h2 { margin: 0; font-size: 18px; font-weight: 700; min-width: 0; overflow-wrap: anywhere }
.bar .crumb { color: var(--ash); font-weight: 500 }
.bar .crumb a { color: var(--ash); text-decoration: none }
.bar .crumb a:hover { color: var(--white) }
.bar .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--f-mono); letter-spacing: .04em;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ash); white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none }
.pill.ok i { background: var(--ok) }
.pill.warn i { background: var(--warn) }
.pill.bad { color: var(--bad) } .pill.bad i { background: var(--bad) }
.pill.busy i { background: var(--accent); animation: blink 1s infinite }
@keyframes blink { 50% { opacity: .25 } }
.content { padding: 28px max(28px, env(safe-area-inset-right, 0px)) 80px 28px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; width: 100% }

/* ------------------------------------------------------------ cards / panels */
.panel { background: var(--carbon); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 18px; min-width: 0 }
.panel > h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.panel > h3 .sub { font: 500 12px var(--f-mono); color: var(--dim); letter-spacing: .04em }
.panel > h3 .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap }
.panel-note { margin: -8px 0 0; color: var(--ash); font-size: 13.5px; max-width: 68ch }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0 }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.stat { background: var(--carbon); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px }
.stat b { display: block; font: 600 28px/1.1 var(--f-mono); letter-spacing: -.02em }
.stat span { font-size: 13px; color: var(--ash) }

.status { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap }
.status .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--ok); box-shadow: 0 0 0 4px rgba(95, 214, 143, .14) }
.status .dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(242, 184, 75, .14) }
.status h4 { margin: 0 0 2px; font-size: 16px }
.status p { margin: 0; color: var(--ash); font-size: 14px }
.status .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap }

.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: s }
.steps li { counter-increment: s; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--fog) }
.steps li::before { content: "0" counter(s); display: block; font: 500 12px var(--f-mono); color: var(--accent); margin-bottom: 6px }
.steps b { color: var(--white) }

/* ------------------------------------------------------------ lists */
.rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; min-width: 0; background: var(--carbon) }
.rows > * + * { border-top: 1px solid var(--line) }
.row.off { opacity: .5 }
.row .thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--raise); flex: none; overflow: hidden; display: grid; place-items: center; color: var(--dim) }
.row .thumb img { width: 100%; height: 100%; object-fit: cover }
.row .thumb.contain img { object-fit: contain; padding: 6px }
.row .thumb.logo { background: #26292c }
.row .thumb.logo img { object-fit: contain; padding: 8px 10px; filter: brightness(0) invert(1); opacity: .85 }
.row .txt { min-width: 0; flex: 1 }
.row .txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.row .txt span { display: block; color: var(--ash); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.row .tools { display: flex; gap: 4px; flex: none; align-items: center }
.row a.txt { color: inherit; text-decoration: none }
.row a.txt:hover b { color: var(--accent) }
.row .idx { font: 12px var(--f-mono); color: var(--dim); width: 22px; text-align: right; flex: none }
.badge { font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: var(--raise); color: var(--ash); white-space: nowrap }
.badge.warn { color: var(--warn) }
.empty { padding: 26px; text-align: center; color: var(--ash); font-size: 14px; border: 1px dashed var(--line-2); border-radius: 12px }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px }
.card { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--carbon); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color 160ms ease, transform 160ms var(--ease-out) }
.card:hover { border-color: var(--line-2) }
.card:active { transform: scale(.985) }
.card .ph { aspect-ratio: 16 / 9; background: var(--raise) }
.card .ph img { width: 100%; height: 100%; object-fit: cover }
.card .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.card .meta b { font-weight: 600; line-height: 1.35 }
.card .meta span { color: var(--ash); font-size: 13px }
.card .badge { position: absolute; top: 10px; left: 10px; background: rgba(11, 12, 13, .8) }
.card.off .ph { opacity: .4 }
.card.add { align-items: center; justify-content: center; min-height: 180px; border-style: dashed; color: var(--ash); gap: 8px; cursor: pointer; background: transparent }
.card.add:hover { color: var(--white) }

.chips { display: flex; gap: 6px; flex-wrap: wrap }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--fog); cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease }
.chip:hover { border-color: var(--line-2) }
.chip.on { background: var(--white); color: var(--ink); border-color: var(--white) }
.chip .n { font-family: var(--f-mono); opacity: .6; margin-left: 4px }

/* ------------------------------------------------------------ media slot */
.media { display: flex; flex-direction: column; gap: 10px }
.media .frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--raise); border: 1px solid var(--line) }
.media .frame video, .media .frame img { width: 100%; height: 100%; object-fit: cover; background: #000 }
.media .frame.photo { aspect-ratio: 4 / 3; background: repeating-conic-gradient(#1c1f21 0 25%, #222528 0 50%) 0 0 / 22px 22px }
.media .frame.photo img { object-fit: contain; background: transparent }
.media .frame .none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; text-align: center; padding: 16px }
.media .acts { display: flex; gap: 8px; flex-wrap: wrap }
.media .path { font: 11.5px var(--f-mono); color: var(--dim); overflow-wrap: anywhere }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px }
.shot { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--ink); display: flex; flex-direction: column }
.shot .ph { aspect-ratio: 16 / 9; background: var(--raise); position: relative }
.shot .ph img, .shot .ph video { width: 100%; height: 100%; object-fit: cover }
.shot .ph .n { position: absolute; top: 6px; left: 6px; font: 11px var(--f-mono); background: rgba(11, 12, 13, .75); padding: 2px 6px; border-radius: 4px }
.shot .bot { display: flex; gap: 4px; padding: 8px; align-items: center }
.shot .bot input { flex: 1; min-width: 0; min-height: 30px; padding: 4px 8px; font-size: 13px; border-radius: 6px; background: transparent; border: 1px solid transparent; color: var(--white) }
.shot .bot input:hover { border-color: var(--line) }
.shot .bot input:focus { outline: none; border-color: var(--accent) }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px }
.credit-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center }

/* ------------------------------------------------------------ kéo thả */
.dz { position: relative }
.dz-over {
  position: absolute; inset: 0; z-index: 5; border-radius: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(11, 26, 46, .86); border: 2px dashed var(--accent); color: var(--white); font-weight: 600; font-size: 15px; pointer-events: none;
  animation: fade 120ms ease-out; text-align: center; padding: 12px;
}
.dz-over svg { width: 30px; height: 30px; color: var(--accent) }
.panel.dz, .media .frame.dz { border-radius: 14px }
.dropline {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 12px;
  color: var(--ash); font-size: 14px; text-align: center; transition: border-color 160ms ease, color 160ms ease;
}
.dropline:hover { border-color: var(--fog); color: var(--fog) }
.dropline svg { width: 20px; height: 20px }
.frame-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ash); font-size: 14px; text-align: center; padding: 16px; cursor: pointer; background: transparent; border: 0; width: 100% }
.frame-cta:hover { color: var(--white) }
.frame-cta svg { width: 30px; height: 30px }
.frame-cta b { color: var(--white); font-size: 15px }
.grip { width: 26px; height: 34px; display: grid; place-items: center; color: var(--dim); cursor: grab; touch-action: none; flex: none; border-radius: 6px }
.grip:hover { color: var(--fog); background: rgba(245, 245, 242, .05) }
.grip:active { cursor: grabbing }
.grip svg { width: 18px; height: 18px }
[data-drag="from"] { opacity: .45 }
[data-drag="before"] { box-shadow: inset 0 3px 0 var(--accent) }
[data-drag="after"] { box-shadow: inset 0 -3px 0 var(--accent) }
.shots [data-drag="before"] { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px var(--accent) }
.shots [data-drag="after"] { box-shadow: inset -3px 0 0 var(--accent), 0 0 0 1px var(--accent) }
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: 12px; border: 1px solid rgba(242, 184, 75, .35); background: rgba(242, 184, 75, .07); font-size: 14.5px }
.banner b { color: var(--warn) }
.banner .acts { margin-left: auto; display: flex; gap: 8px }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.quick a, .quick button {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left; padding: 16px 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--carbon); color: var(--white); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: border-color 160ms ease, transform 140ms var(--ease-out);
}
.quick a:hover, .quick button:hover { border-color: var(--line-2) }
.quick a:active, .quick button:active { transform: scale(.98) }
.quick svg { width: 22px; height: 22px; color: var(--accent) }
.quick span { font-weight: 400; font-size: 13px; color: var(--ash) }
.filelist { display: flex; flex-direction: column; gap: 6px }

/* ------------------------------------------------------------ modal */
.scrim {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .66); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: fade 180ms ease-out;
}
@keyframes fade { from { opacity: 0 } }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--carbon); border: 1px solid var(--line-2); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px; animation: pop 200ms var(--ease-out);
}
.modal.wide { max-width: 980px }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px) } }
.modal h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px }
.modal h3 .x { margin-left: auto }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px }
.modal p { margin: 0; color: var(--fog) }

.drop {
  border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 40px 20px; text-align: center; color: var(--ash);
  display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(106, 168, 255, .05); color: var(--white) }
.drop b { color: var(--white); font-size: 16px }
.drop svg { width: 34px; height: 34px; opacity: .7 }

.vt { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start }
.vt video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; object-fit: contain }
.vt .info { font: 12.5px/1.6 var(--f-mono); color: var(--ash); overflow-wrap: anywhere }
.vt .side-c { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.tline { position: relative; height: 34px; border-radius: 8px; background: var(--ink); border: 1px solid var(--line); overflow: hidden; cursor: pointer; touch-action: none }
.tline .seg { position: absolute; top: 0; bottom: 0; background: rgba(106, 168, 255, .22); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent) }
.tline .seg.saved { background: rgba(245, 245, 242, .1); border-color: var(--line-2) }
.tline .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--white); pointer-events: none }
.tline .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); pointer-events: none }
.timebox { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center }
.timebox .t { font: 500 14px var(--f-mono) }
.seglist { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow: auto }
.seg-i { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px }
.seg-i .t { font: 12px var(--f-mono); color: var(--ash) }
.seg-i input { min-width: 0; min-height: 28px; padding: 2px 8px; border-radius: 6px; background: var(--ink); border: 1px solid var(--line); color: var(--white); font-size: 13px }
.posterbox { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center }
.posterbox img, .posterbox .ph { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--raise) }

.jobs { display: flex; flex-direction: column; gap: 10px }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px }
.job .t { color: var(--fog); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.job .p { font: 12px var(--f-mono); color: var(--ash) }
.job .track { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--raise); overflow: hidden }
.job .track i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transition: transform 200ms linear }
.job.done .track i { background: var(--ok) }
.job.fail .track i { background: var(--bad) }
.job.fail .t { color: var(--bad) }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 200;
  background: var(--white); color: var(--ink); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: up 220ms var(--ease-out); max-width: calc(100vw - 32px); text-align: center;
}
.toast.bad { background: var(--bad); color: #fff }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px) } }

.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--ink); border: 1px dashed var(--line-2); font: 500 15px var(--f-mono); overflow-wrap: anywhere }
.secret span { flex: 1; min-width: 0 }

.hist .row .txt b { white-space: normal }

@media (max-width: 1080px) {
  .cols { grid-template-columns: minmax(0, 1fr) }
  .cols > .stack:last-child { order: -1 }
  .vt { grid-template-columns: minmax(0, 1fr) }
  .stats, .quick { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr) }
  .side {
    position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto;
    padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
    border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none }
  .brand { padding: 0 6px 0 2px }
  .brand span { display: none }
  .nav { flex-direction: row; gap: 2px }
  .nav a { padding: 7px 10px; white-space: nowrap; font-size: 14px }
  .nav a .n, .nav svg { display: none }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center }
  .who { display: none }
  .bar { position: static; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)) }
  .content { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px)) }
  .grid2, .grid3, .pair, .kv, .steps { grid-template-columns: minmax(0, 1fr) }
  .panel { padding: 16px }
  .row .thumb { width: 72px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important }
}
