/* Inkase AI Costing — design system. Brand: grey #565A5B, red #EF4136, Raleway display. */
:root {
  --ink-900: #363636; --ink-800: #454849; --ink-700: #565A5B; --ink-500: #8F8F8F; --ink-300: #C9C9C7;
  --ink-200: #E2E2E2; --ink-100: #F4F3F1; --ink-50: #FAF9F7; --paper: #FFFFFF;
  --accent: #EF4136; --accent-600: #D3352B; --accent-100: #FDE9E7;
  --ok: #2E9E5B; --ok-100: #E4F5EA; --warn: #D99A00; --warn-100: #FFF4D6; --bad: #EF4136; --bad-100: #FDE9E7;
  --font-display: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(54,54,54,.06), 0 8px 24px -12px rgba(54,54,54,.18);
  --sidebar-w: 248px; --ease: cubic-bezier(.2,.7,.2,1);
  --logo-bg: var(--ink-900);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; color: var(--ink-900); background: var(--ink-100); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
h2 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-700); }
.h-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; }
.h-small { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-500); margin: 1.1rem 0 .4rem; }
p { margin: 0 0 .6rem; }
code { font-family: var(--font-mono); font-size: .86em; background: var(--ink-100); padding: .1em .4em; border-radius: 4px; }
.mono { font-family: var(--font-mono); }
.small { font-size: .8rem; } .muted { color: var(--ink-500); } .strong { font-weight: 600; } .right { text-align: right; }
.text-bad { color: var(--bad); } .money { font-variant-numeric: tabular-nums; }
.link { color: var(--accent-600); font-weight: 500; } .link:hover { text-decoration: underline; }

/* ---- login ---- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #4a4d4e 0%, var(--ink-900) 60%); }
.auth-card { width: min(420px, 100%); background: var(--paper); border-radius: 18px; padding: 34px 32px 26px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); border-top: 5px solid var(--accent); }
.auth-logo { width: 165px; color: var(--ink-900); display: block; }
.auth-sub { font-family: var(--font-display); font-size: .68rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-500); margin: 6px 0 22px; }
.auth-form .lbl { margin-top: 14px; }
.auth-foot { margin: 20px 0 0; font-size: .78rem; color: var(--ink-500); line-height: 1.6; }
.auth-foot a { color: var(--ink-700); font-weight: 600; }
.user-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem;
  color: var(--ink-200); border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.user-chip form { margin: 0; }
.btn.link-out { background: none; border: 0; color: var(--ink-300); font-size: .78rem; padding: 4px 6px; cursor: pointer; font-weight: 600; }
.btn.link-out:hover { color: var(--accent); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink-900); color: #fff; padding: 28px 22px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; }
.sidebar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.brand { display: flex; flex-direction: column; gap: 8px; }
.brand-logo { width: 150px; color: #fff; }
.brand-sub { font-family: var(--font-display); font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-300); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-200); font-weight: 500; transition: background .2s var(--ease), color .2s, transform .2s var(--ease); }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav a.active { background: var(--accent); color: #fff; }
.nav .ico { width: 20px; text-align: center; opacity: .8; font-size: .95rem; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; color: var(--ink-300); }
.agent-chip { font-family: var(--font-display); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; background: rgba(239,65,54,.18); color: #ffb3ad; padding: 6px 10px; border-radius: 999px; width: fit-content; }
.credit { line-height: 1.5; color: var(--ink-500); }
.credit a { color: var(--ink-200); border-bottom: 1px solid rgba(255,255,255,.25); }
.credit a:hover { color: #fff; border-bottom-color: var(--accent); }
.app-foot { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--ink-200); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-500); }
.app-foot a { color: var(--ink-700); font-weight: 600; }
.app-foot a:hover { color: var(--accent-600); }
.main { padding: 36px 40px 64px; min-width: 0; }

/* ---- page head ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { font-family: var(--font-display); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-bottom: .35rem; font-weight: 700; }
.lead { color: var(--ink-500); max-width: 60ch; margin: .35rem 0 0; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- cards & layout ---- */
.card { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(54,54,54,.05); }
.card + .card, section + section { margin-top: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.span-2 { grid-column: span 2; }
.grid-2 > .card, .grid-3 > .card { margin-top: 0; }
/* grid items default to min-width:auto, which lets wide tables stretch the page on phones */
.grid-2 > *, .grid-3 > *, .result-grid > *, .kpis > * { min-width: 0; }
.card, .prose, .specs dd, .bullets li { overflow-wrap: anywhere; }
.row { display: flex; align-items: center; } .row.gap { gap: 10px; } .row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.row.gap + .row.gap { margin-top: 10px; }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--paper); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ink-300); }
.kpi.alert::before { background: var(--accent); }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-500); font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.money { font-size: 1.35rem; }
.kpi-sub { font-size: .78rem; color: var(--ink-500); }

/* ---- buttons / inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: transform .15s var(--ease), box-shadow .2s, background .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(239,65,54,.6); }
.btn.primary:hover { background: var(--accent-600); transform: translateY(-1px); }
.btn.ghost { background: var(--paper); border-color: var(--ink-200); color: var(--ink-800); }
.btn.ghost:hover { border-color: var(--ink-500); }
.btn.lg { padding: 13px 22px; font-size: 1rem; }
.btn.danger { background: var(--paper); border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.icon { padding: 6px 9px; font-size: .85rem; line-height: 1; }
.btn.icon.danger { border-color: var(--ink-200); color: var(--ink-500); }
.btn.icon.danger:hover { border-color: var(--bad); background: var(--bad); color: #fff; }
.input { font: inherit; padding: 10px 12px; border: 1px solid var(--ink-200); border-radius: 10px; background: var(--paper); color: inherit; min-width: 0; width: 100%; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--ink-700); box-shadow: 0 0 0 3px rgba(86,90,91,.15); }
select.input { width: auto; }
textarea.input { resize: vertical; }
input[type="file"].input { padding: 7px 10px; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; font-size: .82rem; border: 1px solid var(--ink-200); background: var(--ink-50); color: var(--ink-700); border-radius: 8px; padding: 5px 12px; margin-right: 10px; cursor: pointer; transition: border-color .2s, color .2s; }
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
.lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-500); font-weight: 600; margin: 10px 0 6px; }
.filters { display: flex; gap: 10px; align-items: center; padding: 14px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---- badges & pills ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--ink-100); color: var(--ink-700); white-space: nowrap; }
.badge.tiny { padding: 1px 6px; font-size: .66rem; }
.badge.ok { background: var(--ok-100); color: var(--ok); } .badge.warn { background: var(--warn-100); color: #9a6d00; } .badge.bad { background: var(--bad-100); color: var(--bad); }
.badge.float { position: absolute; top: 10px; left: 10px; }
.badge.status-queued { background: var(--ink-100); color: var(--ink-700); }
.badge.status-running { background: var(--accent-100); color: var(--accent-600); }
.badge.status-done { background: var(--ok-100); color: var(--ok); }
.badge.status-failed, .badge.status-cancelled { background: var(--bad-100); color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--ink-200); font-size: .8rem; font-weight: 500; }
.pill.ok .dot { background: var(--ok); } .pill.bad .dot { background: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,65,54,.5); } 50% { box-shadow: 0 0 0 6px rgba(239,65,54,0); } }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: var(--c); border: 1px solid rgba(0,0,0,.12); vertical-align: -3px; }
.swatch.big { width: 100%; height: 100%; border-radius: 0; }

/* ---- lists ---- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ink-100); }
.list li:first-child { border-top: 0; }
.list-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-main:hover strong { color: var(--accent-600); }
.list .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--ink-100); flex: none; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bars li { display: grid; grid-template-columns: 1fr 120px 40px; align-items: center; gap: 10px; font-size: .85rem; }
.bar { height: 8px; background: var(--ink-100); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--ink-700), var(--accent)); border-radius: 999px; animation: grow .8s var(--ease) both; }
@keyframes grow { from { width: 0; } }
.bar-val { text-align: right; color: var(--ink-500); }
.bullets { margin: 0; padding-left: 1.1rem; } .bullets li { margin: .2rem 0; } .bullets.warn li::marker { color: var(--warn); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; max-height: 260px; overflow: auto; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-500); padding: 8px 10px; border-bottom: 1px solid var(--ink-200); }
.table td { padding: 10px; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
.table tfoot td { border-top: 2px solid var(--ink-200); border-bottom: 0; }
.table .num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: var(--ink-50); }
.table.cost td { padding: 7px 4px; } .table.cost tr.strong td { font-weight: 700; } .table.cost tr.accent td { color: var(--accent-600); font-size: 1rem; }
.table.cost tr.muted td { color: var(--ink-500); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.bom tr.row-ok td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.bom tr.row-warn td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.bom tr.row-bad td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.bom tr.row-bad { background: linear-gradient(90deg, var(--bad-100) 0, transparent 40%); }
.bom tr.row-warn { background: linear-gradient(90deg, var(--warn-100) 0, transparent 40%); }
.bom tr.row-ok { background: linear-gradient(90deg, var(--ok-100) 0, transparent 30%); }
.bom tbody tr { animation: rowIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.table.correct td { padding: 6px 6px; }
.table.correct .input { padding: 6px 8px; font-size: .84rem; }
.table.correct td.num .input { text-align: right; }
.table.correct td.center { text-align: center; }
.table.correct th { white-space: nowrap; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gallery a { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--ink-200); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.gallery a:hover img { transform: scale(1.08); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }

/* ---- materials ---- */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mat-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .25s var(--ease), box-shadow .25s; animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.mat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(54,54,54,.35); }
.mat-img { position: relative; aspect-ratio: 16/10; background: var(--ink-100); overflow: hidden; }
.mat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.mat-card:hover .mat-img img { transform: scale(1.04); }
.mat-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.mat-body strong { line-height: 1.25; }
.mat-hero { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--ink-100); margin-bottom: 14px; }
.mat-hero img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .88rem; }
.specs dt { color: var(--ink-500); } .specs dd { margin: 0; }
.big-money { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.stock-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.stock-nums div { display: flex; flex-direction: column; } .stock-nums strong { font-size: 1.2rem; font-family: var(--font-display); }
.stock-val.ok { color: var(--ok); } .stock-val.warn { color: var(--warn); } .stock-val.bad { color: var(--bad); }
.stock-form { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 10px; }

/* ---- dropzone ---- */
.dropzone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; border: 2px dashed var(--ink-300); border-radius: var(--radius); background: var(--ink-50); cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.dropzone.tall { min-height: 380px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-100); transform: scale(1.005); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-inner { text-align: center; display: flex; flex-direction: column; gap: 4px; padding: 20px; pointer-events: none; }
.dz-icon { font-size: 2rem; color: var(--accent); }
.dz-preview { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; pointer-events: none; }
.dropzone.has-file .dz-preview { display: block; } .dropzone.has-file .dz-inner { display: none; }
.dropzone-form { display: flex; flex-direction: column; gap: 12px; }
.est-img { border-radius: 10px; overflow: hidden; background: var(--ink-100); margin-bottom: 14px; }
.est-img img { width: 100%; display: block; max-height: 360px; object-fit: contain; background: #fff; }

/* ---- stepper & log ---- */
.stepper { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.stepper li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .68rem; color: var(--ink-500); position: relative; }
.stepper li::before { content: ""; position: absolute; top: 14px; left: -50%; right: 50%; height: 3px; background: var(--ink-200); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.active::before { background: var(--accent); }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--ink-200); font-weight: 700; z-index: 1; transition: all .35s var(--ease); font-family: var(--font-display); }
.stepper li.active .step-n { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px rgba(239,65,54,.15); animation: pulse 1.4s ease-in-out infinite; }
.stepper li.done .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.active { color: var(--ink-900); font-weight: 600; }
.step-msg { font-size: .85rem; background: var(--accent-100); color: var(--accent-600); padding: 8px 12px; border-radius: 8px; margin: 0 0 12px; animation: fadeUp .35s var(--ease) both; }
.log-wrap { background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: 10px; padding: 12px 14px; max-height: 420px; overflow: auto; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--ink-800); }
.log-item { display: grid; grid-template-columns: 62px 78px 1fr; gap: 10px; align-items: start; animation: fadeUp .3s var(--ease) both; }
.log-time { color: var(--ink-500); font-size: .72rem; padding-top: 2px; }
.log-tag { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; padding: 2px 6px; border-radius: 4px; background: var(--ink-200); color: var(--ink-700); text-align: center; font-weight: 700; }
.log-tag.stage { background: var(--accent); color: #fff; }
.log-tag.tool { background: #dbe7f5; color: #2c5b8f; }
.log-tag.res { background: var(--ok-100); color: var(--ok); }
.log-tag.err { background: var(--bad); color: #fff; }
.log-tag.warn { background: var(--warn-100); color: #8a6100; }
.log-tag.ai { background: var(--ink-900); color: #fff; }
.log code { background: #eef2f6; color: #2c5b8f; }
.log-text { white-space: pre-wrap; color: var(--ink-900); }
.kind-stage { padding: 6px 0; border-top: 1px solid var(--ink-200); margin-top: 4px; }

/* ---- result ---- */
.result-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-bottom: 22px; }
.result-grid > .card { margin-top: 0; }
.cost-card { background: linear-gradient(160deg, #fff, var(--ink-50)); }
.stock-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: .85rem; margin-bottom: 12px; }
.alert.bad, .alert-card.bad { background: var(--bad-100); color: #9b2018; border-left: 4px solid var(--bad); }
.prose p { margin-bottom: .5rem; }
.prose h4 { font-family: var(--font-display); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-700); margin: .9rem 0 .3rem; }
.prose ul { margin: .2rem 0 .6rem; padding-left: 1.1rem; }
.prose li { margin: .15rem 0; }
.toasts { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink-900); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); animation: fadeUp .35s var(--ease) both, fadeOut .5s ease 6s both; font-size: .85rem; }
.toast.error { background: var(--bad); } .toast.success { background: var(--ok); }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-6px); visibility: hidden; } }

/* ---- skeleton ---- */
.skeleton-card { display: flex; flex-direction: column; gap: 12px; }
.sk-line, .sk-box { background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-200) 50%, var(--ink-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; }
.sk-line { height: 14px; } .w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; } .sk-box { height: 90px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- motion ---- */
.reveal { animation: fadeUp .55s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: 60ms; } .reveal:nth-child(3) { animation-delay: 120ms; } .reveal:nth-child(4) { animation-delay: 180ms; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.htmx-swapping { opacity: 0; transition: opacity .15s ease; }
.htmx-settling { animation: fadeUp .3s var(--ease); }
::view-transition-old(root) { animation: 160ms ease both vt-out; } ::view-transition-new(root) { animation: 260ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } } @keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ---- responsive ---- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } .result-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
  .sidebar-foot { display: none; } .nav { flex-direction: row; flex-wrap: wrap; } .brand-logo { width: 110px; }
  .main { padding: 20px 16px 48px; } .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; }
  .stepper { grid-template-columns: repeat(4, 1fr); row-gap: 14px; } .stepper li::before { display: none; }
  .log-item { grid-template-columns: 52px 1fr; } .log-item > :nth-child(2) { display: none; }
  .stock-nums { grid-template-columns: repeat(2, 1fr); } .kpis { grid-template-columns: 1fr; }
  .btn { white-space: normal; } .rerun-form .btn, #correct-form .btn { width: 100%; }
}
@media print { .sidebar, .head-actions, .toasts, #rerun, .app-foot { display: none !important; } .shell { display: block; } .main { padding: 0; } .card { box-shadow: none; } }
