/* Salto Office — v2 design system. Photos decorate; chrome stays quiet. */
:root {
  --ink: #0F1216; --ink-2: #1A1F26; --ink-3: #262C35;
  --paper: #F4F3EE; --paper-2: #ECEAE3; --card: #FFFFFF;
  --fog: #DBDFE6; --fog-2: #C9CED6; --mute: #6B7280; --text: #14181E;
  --blue: #2150C4; --blue-2: #1A41A0; --blue-soft: #E4EAFB;
  --sun: #FFC900; --sun-2: #E6B400; --sun-soft: #FFF3C2;
  --orange: #FF5326; --orange-soft: #FFE3DA;
  --green: #1F7A4D; --green-soft: #DDF3E6;
  --disp: 'Archivo Black', 'Archivo', sans-serif;
  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --sh-1: 0 1px 2px rgba(15,18,22,.06), 0 1px 1px rgba(15,18,22,.04);
  --sh-2: 0 10px 30px -12px rgba(15,18,22,.28), 0 2px 6px rgba(15,18,22,.06);
  --sh-3: 0 24px 60px -20px rgba(15,18,22,.45), 0 4px 12px rgba(15,18,22,.08);
  --rail: 236px; --rail-min: 64px; --top: 60px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font: 15px/1.5 var(--sans); background: var(--paper); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; transition: grid-template-columns .22s var(--ease); }
.shell.rail-min { grid-template-columns: var(--rail-min) 1fr; }

.rail { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); color: #E8EBF0; display: flex; flex-direction: column; overflow: hidden; }
.rail .brand { display: flex; align-items: center; gap: 12px; padding: 16px 14px; height: var(--top); }
.rail .brand img { width: 36px; height: 36px; border-radius: 999px; box-shadow: 0 0 0 2px rgba(255,255,255,.08); flex: none; }
.rail .brand b { font-family: var(--disp); font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.rail .brand small { display: block; font: 11px/1 var(--sans); color: #8B93A0; margin-top: 3px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; flex: 1; }
.rail nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #B9C0CB; text-decoration: none; white-space: nowrap; position: relative; transition: background .15s, color .15s; }
.rail nav a svg { width: 20px; height: 20px; flex: none; }
.rail nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.rail nav a.on::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--sun); }
.rail nav a .n { margin-left: auto; font: 500 11px var(--mono); color: #8B93A0; }
.rail .foot { padding: 10px 8px 14px; border-top: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 2px; }
.rail .collapse { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: #8B93A0; border-radius: 10px; cursor: pointer; }
.rail .collapse:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail .collapse svg { width: 18px; height: 18px; transition: transform .22s var(--ease); }
.rail-min .rail .brand b, .rail-min .rail nav a span, .rail-min .rail .collapse span, .rail-min .rail nav a .n { opacity: 0; width: 0; overflow: hidden; }
.rail-min .rail .collapse svg { transform: rotate(180deg); }
.rail-min .rail nav a { justify-content: center; padding: 11px 0; }
.rail-min .rail nav a.on::before { left: -6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: rgba(244,243,238,.82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid rgba(219,223,230,.7); }
.top h1 { font-family: var(--disp); font-size: 18px; letter-spacing: .01em; margin-right: 6px; white-space: nowrap; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--card); border: 1px solid var(--fog); border-radius: 10px; box-shadow: var(--sh-1); }
.search svg { width: 16px; height: 16px; color: var(--mute); flex: none; }
.search input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; }
.search kbd { font: 11px var(--mono); color: var(--mute); border: 1px solid var(--fog); border-radius: 5px; padding: 1px 5px; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.who i { width: 28px; height: 28px; border-radius: 999px; background: var(--blue); color: #fff; display: grid; place-items: center; font: 700 12px var(--sans); font-style: normal; }

.content { padding: 20px 20px 96px; max-width: 1360px; width: 100%; }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; background: var(--ink); color: #fff; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; box-shadow: var(--sh-1); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.sun:hover { background: var(--sun-2); }
.btn.blue { background: var(--blue); }
.btn.blue:hover { background: var(--blue-2); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--fog); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.quiet { background: transparent; box-shadow: none; color: var(--mute); }
.btn.quiet:hover { background: var(--paper-2); color: var(--text); }
.btn.danger { background: var(--card); color: var(--orange); border-color: var(--orange-soft); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--mute); }
.field input, .field select, .field textarea { height: 40px; padding: 0 12px; border: 1px solid var(--fog); border-radius: 10px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field .mono { font-family: var(--mono); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mute { color: var(--mute); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.money { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--orange); }
h2.sec { font-family: var(--disp); font-size: 15px; letter-spacing: .02em; margin: 26px 0 12px; }
h2.sec:first-child { margin-top: 0; }
.sub { color: var(--mute); font-size: 13.5px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--text); }
.chip.live { background: var(--blue-soft); color: var(--blue); }
.chip.draft { background: var(--paper-2); color: var(--mute); }
.chip.hold { background: var(--sun-soft); color: #7A5D00; }
.chip.sold { background: var(--ink); color: #fff; }
.chip.archived { background: var(--fog); color: var(--mute); }
.chip.warn { background: var(--orange-soft); color: #B23A15; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); border: 1px solid rgba(219,223,230,.6); }
.card.pad { padding: 16px; }
.card.click { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.card.click:active { transform: scale(.992); }

.stat { padding: 14px 16px; }
.stat span { font-size: 12.5px; color: var(--mute); }
.stat b { display: block; font: 700 22px/1.2 var(--mono); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat i { display: block; font-style: normal; font-size: 12px; color: var(--mute); margin-top: 3px; }

.empty { padding: 36px 20px; text-align: center; color: var(--mute); border: 1.5px dashed var(--fog-2); border-radius: var(--r); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.skel { background: linear-gradient(90deg, var(--paper-2), #fff, var(--paper-2)); background-size: 200% 100%; animation: sk 1.1s linear infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- floor (dashboard) ---------- */
.hero { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--ink); color: #fff; box-shadow: var(--sh-2); }
.hero .strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 2px; height: 220px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero .strip::-webkit-scrollbar { display: none; }
.hero .strip a { position: relative; scroll-snap-align: start; background: var(--ink-3); text-decoration: none; color: #fff; }
.hero .strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .strip .cap { position: absolute; inset: auto 0 0 0; padding: 40px 12px 10px; background: linear-gradient(180deg, transparent, rgba(15,18,22,.85)); font-size: 13px; font-weight: 600; }
.hero .strip .cap small { display: block; font: 500 11px var(--mono); color: #C9CED6; }
.hero .strip .nophoto { display: grid; place-items: center; height: 100%; color: #8B93A0; font-size: 13px; }
.hero .head { position: absolute; top: 14px; left: 16px; display: flex; align-items: baseline; gap: 10px; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.hero .head b { font: 26px var(--disp); }
.hero .head span { font-size: 13px; color: #E8EBF0; }
.makers { display: flex; gap: 8px; flex-wrap: wrap; }
.makers a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--fog); text-decoration: none; font-weight: 600; font-size: 13px; box-shadow: var(--sh-1); }
.makers a i { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font: 700 11px var(--sans); font-style: normal; background: var(--ink); color: #fff; }
.makers a .n { font: 600 12px var(--mono); color: var(--mute); }
.work { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.work .card { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-height: 108px; }
.work .card h3 { font-size: 13px; color: var(--mute); font-weight: 600; }
.work .card b { font: 700 24px/1.1 var(--mono); }
.work .card .sub { margin-top: auto; }
.work .card.attn { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun-soft), var(--sh-1); }

/* ---------- machines grid ---------- */
.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mcard { position: relative; border-radius: var(--r); overflow: hidden; background: var(--card); box-shadow: var(--sh-1); border: 1px solid rgba(219,223,230,.6); cursor: pointer; transition: transform .1s, box-shadow .2s; }
.mcard:active { transform: scale(.99); }
.mcard .ph { aspect-ratio: 4/3; background: var(--ink-3); position: relative; }
.mcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard .ph .nophoto { position: absolute; inset: 0; display: grid; place-items: center; color: #8B93A0; font-size: 12.5px; background: linear-gradient(135deg, var(--ink-2), var(--ink-3)); }
.mcard .ph .chip { position: absolute; top: 10px; left: 10px; box-shadow: var(--sh-1); }
.mcard .ph .price { position: absolute; right: 10px; bottom: 10px; background: rgba(15,18,22,.78); color: #fff; padding: 4px 9px; border-radius: 8px; font: 600 13px var(--mono); backdrop-filter: blur(6px); }
.mcard .body { padding: 12px 14px 14px; }
.mcard .body b { display: block; font-size: 15px; line-height: 1.25; }
.mcard .body .sub { margin-top: 3px; font-size: 12.5px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.lrow .av { width: 40px; height: 40px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; flex: none; }
.lrow .body { flex: 1; min-width: 0; }
.lrow .body b { display: block; }
.lrow .body .sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .right { text-align: right; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 10px; padding: 3px; }
.seg button { height: 32px; padding: 0 12px; border: 0; background: transparent; border-radius: 8px; color: var(--mute); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- deals kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.kcol { background: var(--paper-2); border-radius: var(--r); padding: 10px; min-height: 200px; scroll-snap-align: start; }
.kcol h3 { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; padding: 4px 6px 10px; text-transform: capitalize; }
.kcol h3 .n { font: 600 12px var(--mono); color: var(--mute); }
.dcard { background: var(--card); border-radius: 10px; box-shadow: var(--sh-1); padding: 12px; margin-bottom: 8px; }
.dcard b { display: block; }
.dcard .sub { font-size: 12.5px; margin: 2px 0 8px; }
.dcard .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15,18,22,.35); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--paper); box-shadow: var(--sh-3); transform: translateX(104%); transition: transform .26s var(--ease); z-index: 50; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer .dhead { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--fog); background: var(--card); position: sticky; top: 0; }
.drawer .dhead h2 { font-family: var(--disp); font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .dbody { padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.drawer .dfoot { padding: 12px 16px; border-top: 1px solid var(--fog); background: var(--card); display: flex; gap: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gallery .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--ink-3); }
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; }
.gallery .ph .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 999px; border: 0; background: rgba(15,18,22,.7); color: #fff; cursor: pointer; display: grid; place-items: center; }
.gallery .add { aspect-ratio: 1; border: 1.5px dashed var(--fog-2); border-radius: 10px; display: grid; place-items: center; color: var(--mute); cursor: pointer; background: var(--card); }
.gallery .add:hover { border-color: var(--blue); color: var(--blue); }
.gallery input[type=file] { display: none; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick a { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; font-size: 13.5px; }
.msg { border-left: 3px solid var(--fog); padding: 8px 12px; background: var(--card); border-radius: 0 10px 10px 0; font-size: 14px; }
.msg.out { border-color: var(--sun); }
.msg .who { font-size: 11.5px; color: var(--mute); margin-bottom: 2px; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--sun-soft); font-size: 13.5px; }
.note.warn { background: var(--orange-soft); color: #7A2B10; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; box-shadow: var(--sh-3); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s var(--ease); z-index: 60; font-size: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .shell, .shell.rail-min { grid-template-columns: 1fr; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; flex-direction: row; background: rgba(15,18,22,.96); backdrop-filter: blur(12px); border-top: 1px solid rgba(255,255,255,.06); padding-bottom: env(safe-area-inset-bottom); }
  .rail .brand, .rail .foot { display: none; }
  .rail nav { flex-direction: row; justify-content: space-around; padding: 6px 4px; width: 100%; }
  .rail nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 10.5px; border-radius: 8px; flex: 1; }
  .rail nav a .n { display: none; }
  .rail nav a.on::before { display: none; }
  .rail nav a.on { background: rgba(255,201,0,.12); color: var(--sun); }
  .top { padding: 0 14px; }
  .top h1 { display: none; }
  .content { padding: 14px 14px 110px; }
  .work { grid-template-columns: repeat(2, 1fr); }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero .strip { height: 170px; grid-auto-columns: minmax(150px, 1fr); }
  .kanban { grid-auto-columns: 82vw; }
  .drawer { width: 100vw; }
  .who span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- pass 2: fixes from screenshot review ---- */
.rail a, .work a, .hero a, .makers a { text-decoration: none; color: inherit; }
.work a.card { color: var(--text); }
.field input, .field select { min-width: 0; width: 100%; }
.row .field { min-width: 0; }
.gallery .add svg { width: 26px; height: 26px; }
.quick a svg, .msg svg, .dcard svg, .lrow svg { width: 16px; height: 16px; }
.hero .head b { font-size: 30px; }
@media (max-width: 860px) {
  .top { gap: 8px; }
  .search kbd { display: none; }
  #publish span { display: none; }
  #publish { width: 42px; padding: 0; }
  .who { display: none; }
  .machines { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .mcard .body { padding: 10px 12px 12px; }
  .mcard .body b { font-size: 13.5px; }
  .toolbar .btn { margin-left: auto; }
}
@media (max-width: 860px) { .work .card b { font-size: 20px; } }

/* ---- pass 3: pills, hero count tile, command palette, gallery-first drawer ---- */
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 -20px 12px; padding-left: 20px; padding-right: 20px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.pills::-webkit-scrollbar { display: none; }
.pills a, .pills button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--fog); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; box-shadow: var(--sh-1); cursor: pointer; scroll-snap-align: start; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.pills .on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pills .n { font: 600 12px var(--mono); color: var(--mute); }
.pills .on .n { color: #C9CED6; }
.pills i { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font: 700 11px var(--sans); font-style: normal; background: var(--ink); color: #fff; margin-left: -6px; }
.pills .on i { background: var(--sun); color: var(--ink); }
.pills .sep { flex: none; width: 1px; background: var(--fog); margin: 6px 4px; }
.makers { display: none; }
.hero .strip .count { display: grid; align-content: end; padding: 14px 16px; background: linear-gradient(160deg, var(--ink-2), var(--ink)); text-decoration: none; min-width: 168px; }
.hero .strip .count b { font: 44px/1 var(--disp); }
.hero .strip .count span { font-size: 13px; color: #C9CED6; margin-top: 6px; }
.hero .head { display: none; }
.drawer .gallery.lead { grid-template-columns: repeat(4, 1fr); }
.drawer .gallery.lead .ph:first-child { grid-column: span 4; aspect-ratio: 16/9; border-radius: 12px; }
/* command palette */
.pal-scrim { position: fixed; inset: 0; background: rgba(15,18,22,.4); backdrop-filter: blur(3px); z-index: 70; display: none; }
.pal { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); width: min(620px, 94vw); background: var(--card); border-radius: 16px; box-shadow: var(--sh-3); z-index: 71; display: none; overflow: hidden; }
.pal.open, .pal-scrim.open { display: block; }
.pal input { width: 100%; height: 56px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--fog); font-size: 17px; outline: 0; background: transparent; }
.pal ul { list-style: none; max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal li.on, .pal li:hover { background: var(--paper-2); }
.pal li svg { width: 18px; height: 18px; color: var(--mute); flex: none; }
.pal li img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.pal li b { font-weight: 600; }
.pal li .sub { font-size: 12.5px; }
.pal li .k { margin-left: auto; font: 11px var(--mono); color: var(--mute); }
.pal .hint { padding: 8px 14px 10px; border-top: 1px solid var(--fog); font: 11.5px var(--mono); color: var(--mute); display: flex; gap: 14px; }
@media (max-width: 860px) { .pills { margin: 0 -14px 12px; padding-left: 14px; padding-right: 14px; } .pal { top: 8vh; } }

/* ---- pass 4: deals, people, jacket ---- */
.dcard { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.dcard:active { transform: scale(.99); }
.dcard .th { width: 56px; height: 56px; border-radius: 10px; background: linear-gradient(135deg, var(--ink-2), var(--ink-3)); overflow: hidden; display: grid; place-items: center; color: #8B93A0; }
.dcard .th img { width: 100%; height: 100%; object-fit: cover; }
.dcard .th svg { width: 20px; height: 20px; }
.dcard .acts { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.dcard .acts .more { margin-left: auto; }
.dcard .hidden { display: none; }
.dcard .money { font-size: 13px; color: var(--mute); font-weight: 500; }
.kcol.hot { background: var(--sun-soft); }
.kcol.done { background: var(--paper-2); opacity: .85; }
.kcol.dead { background: #EEE; }
.av { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; flex: none; color: #fff; }
.lrow .av { background: var(--blue); }
.jsec { padding: 14px 16px; }
.jsec h3 { font-family: var(--disp); font-size: 13px; letter-spacing: .02em; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.jsec h3 .chip { font-family: var(--sans); }
.jhead { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.jhead .th { width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--ink-3); }
.jhead .th img { width: 100%; height: 100%; object-fit: cover; }
.jhead b { font-size: 16px; display: block; }
.jtot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 12px; background: var(--ink); color: #fff; border-radius: 10px; }
.jtot span { font-size: 11px; color: #8B93A0; display: block; }
.jtot .money { font-size: 14px; }
.jtot .fin .money { color: var(--sun); }
.jtot .pay { grid-column: span 2; border-top: 1px solid rgba(255,255,255,.12); padding-top: 8px; margin-top: 2px; }
.jtot .pay .money { font-size: 16px; }
details.fees > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13.5px; color: var(--mute); padding: 6px 0; }
details.fees > summary::-webkit-details-marker { display: none; }
details.fees > summary::after { content: "+"; font: 600 16px var(--mono); }
details.fees[open] > summary::after { content: "–"; }
details.fees .grid { margin-top: 8px; }
.forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.forms a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--fog); text-decoration: none; font-weight: 700; font-family: var(--mono); font-size: 13px; box-shadow: var(--sh-1); }
.forms a svg { width: 20px; height: 20px; color: var(--blue); }
.forms a small { font: 11px var(--sans); color: var(--mute); font-weight: 500; }
@media (max-width: 860px) { .jtot { grid-template-columns: repeat(2, 1fr); } }

/* ---- pass 5: drawer tabs, orders pipeline, parts ---- */
.dtabs { display: flex; gap: 6px; padding: 10px 16px 0; background: var(--card); border-bottom: 1px solid var(--fog); }
.dtabs button { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--mute); font-weight: 600; font-size: 13px; cursor: pointer; margin-bottom: 10px; }
.dtabs button.on { background: var(--ink); color: #fff; }
[data-pane] { display: none; flex-direction: column; gap: 14px; }
[data-pane].on { display: flex; }
body.staff .owner-only { display: none !important; }
.ocard { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; }
.ocard .av { background: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.ocard .items { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ocard .items span { font: 500 12px var(--mono); background: var(--paper-2); border-radius: 6px; padding: 3px 8px; }
.steps { display: flex; align-items: center; gap: 4px; margin-top: 10px; grid-column: 1 / -1; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--fog); font-style: normal; position: relative; }
.steps i.done { background: var(--blue); }
.steps i.now { background: var(--sun); }
.steps i::after { content: attr(data-l); position: absolute; top: 8px; left: 0; font-size: 10.5px; color: var(--mute); white-space: nowrap; }
.steps i.now::after { color: var(--text); font-weight: 600; }
.ocard .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pcard { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; align-items: center; }
.pcard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pcard .meta .chip { height: 22px; font-size: 11.5px; font-weight: 600; }
.pcard .right { text-align: right; }
.pcard .priv { font: 500 11.5px var(--mono); color: var(--mute); margin-top: 2px; }
.feedrow { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 14px; padding: 0 20px 4px; }
.feedrow::-webkit-scrollbar { display: none; }
.feedrow .card { flex: none; min-width: 200px; }
@media (max-width: 860px) { .feedrow { margin: 0 -14px 14px; padding: 0 14px 4px; } .ocard { grid-template-columns: 1fr auto; } .ocard .av { display: none; } .steps i::after { display: none; } }
.drawer .dtabs { position: sticky; top: 0; z-index: 5; }
.gallery .ph .x { z-index: 1; }
.gallery .ph .x svg { width: 12px; height: 12px; }
.gallery .ph .x { opacity: 0; transition: opacity .12s; }
.gallery .ph:hover .x, .gallery .ph:focus-within .x { opacity: 1; }
@media (hover: none) { .gallery .ph .x { opacity: 1; } }
.drawer .dbody:has(.dtabs) { padding-top: 0; }
.drawer .dtabs { margin-top: 0 !important; }

/* ---- pass 6: parts catalog ---- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pcard2 { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); border: 1px solid rgba(219,223,230,.6); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .1s; }
.pcard2:active { transform: scale(.99); }
.pcard2 .ph { aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 12px; border-bottom: 1px solid var(--paper-2); }
.pcard2 .ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pcard2 .ph .nophoto { color: var(--fog-2); font-size: 12px; }
.pcard2 .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard2 .body b { font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard2 .body .sub { font-size: 12px; }
.pcard2 .body .money { margin-top: auto; font-size: 14px; }
.pills.sub a, .pills.sub button { height: 30px; font-size: 12.5px; background: var(--paper-2); border-color: transparent; box-shadow: none; }
.pills.sub .on { background: var(--blue); border-color: var(--blue); }
.pdet .big { background: #fff; border-radius: 12px; padding: 16px; display: grid; place-items: center; aspect-ratio: 4/3; }
.pdet .big img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pdet .thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pdet .thumbs img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--fog); cursor: pointer; flex: none; }
.pdet dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.pdet dt { color: var(--mute); }
.pdet dd { margin: 0; }
.more { display: flex; justify-content: center; margin-top: 16px; }
@media (max-width: 860px) { .pgrid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } }

/* ---- pass 7: connections ---- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ccard { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; min-height: 132px; }
.ccard .row b { font-size: 15px; }
.ccard .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 13px var(--sans); color: #fff; background: var(--ink); flex: none; }
.ccard .how { font-size: 12.5px; color: var(--mute); line-height: 1.4; }
.ccard .flows { margin-top: auto; font: 500 11.5px var(--mono); color: var(--mute); }
.chip.connected { background: var(--green-soft); color: var(--green); }
.chip.ready { background: var(--blue-soft); color: var(--blue); }
.chip.keys_saved { background: var(--sun-soft); color: #7A5D00; }
.chip.partial { background: var(--sun-soft); color: #7A5D00; }
.chip.not_started { background: var(--paper-2); color: var(--mute); }
.urlbox { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--fog); border-radius: 10px; padding: 8px 10px; }
.urlbox code { flex: 1; font: 12px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.testres { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.testres.ok { background: var(--green-soft); color: var(--green); }
.testres.bad { background: var(--orange-soft); color: #7A2B10; }

/* ---- view-only guests ---- */
body.viewer #publish, body.viewer .dfoot, body.viewer .toolbar .btn, body.viewer .dcard .acts, body.viewer .gallery .add, body.viewer .gallery .x, body.viewer [data-adv], body.viewer #draft, body.viewer #dtext, body.viewer #ndeal { display: none !important; }
body.viewer .top::after { content: "View only"; font: 600 12px var(--sans); color: #7A5D00; background: var(--sun-soft); padding: 4px 10px; border-radius: 999px; }
body.viewer input, body.viewer textarea, body.viewer select { pointer-events: none; background: var(--paper-2); }

/* ---- buyer ↔ machine linking (Oct 8 2026) ---- */
.chip.buyer { background: var(--green-soft); color: var(--green); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 24px; }
.mcard .ph .chip.buyer { position: absolute; left: 10px; top: auto; bottom: 10px; }
.pal.pick { z-index: 90; } .pal-scrim#pick-scrim { z-index: 89; }
.pick-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 0 18px; }
.pick-head b { font-family: var(--disp); font-size: 15px; }
.pal li .pav { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.pal li.dim { opacity: .55; }
.pal li .chip { margin-left: auto; flex: none; }
.pal li > div { min-width: 0; } .pal li > div .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buyers { margin-bottom: 14px; }
.buyers .lrow { padding: 10px 0; border-top: 1px solid var(--fog); }
.buyers .lrow:first-of-type { border-top: 0; }
.drow .th { width: 44px; height: 44px; border-radius: 10px; background: var(--paper-2); overflow: hidden; display: grid; place-items: center; flex: none; color: var(--mute); }
.drow .th img { width: 100%; height: 100%; object-fit: cover; } .drow .th svg { width: 20px; height: 20px; }
.drow .right { display: flex; align-items: center; gap: 6px; }
.drow .right .btn.quiet.sm { width: 30px; padding: 0; } .drow .right .btn svg { width: 15px; height: 15px; }
.jwho { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jwho > span, .jwho > b { min-width: 0; }
.lnk { background: transparent; border: 0; color: var(--blue); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 6px; display: inline-flex; align-items: center; }
.lnk:hover { background: var(--blue-soft); } .lnk svg { width: 14px; height: 14px; }
.npa-row.done { opacity: .6; }
.npa-row .av { border-radius: 10px; font-weight: 700; }

/* ---- mobile floating pill nav (Oct 8 2026). Desktop never sees it; the bottom rail is retired on phones. ---- */
.pill, .pill-scrim { display: none; }
@media (max-width: 860px) {
  .rail { display: none; }
  .content { padding-bottom: 120px; }
  .pill-scrim { display: block; position: fixed; inset: 0; background: rgba(15,18,22,.45); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
  .pill-scrim.open { opacity: 1; pointer-events: auto; }
  .pill { display: block; position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 41; width: min(420px, calc(100vw - 24px)); }
  .pill .bar { display: flex; align-items: stretch; height: 60px; padding: 6px; border-radius: 999px; background: rgba(15,18,22,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 14px 34px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08); }
  .pill .bar a, .pill .bar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 999px; border: 0; background: transparent; color: #B9C0CB; text-decoration: none; font: 600 10.5px var(--sans); position: relative; cursor: pointer; transition: background .15s, color .15s; }
  .pill .bar svg { width: 20px; height: 20px; }
  .pill .bar a.on { background: rgba(255,201,0,.14); color: var(--sun); }
  .pill .bar .n { position: absolute; top: 6px; right: 10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--sun); color: var(--ink); font: 700 10px/16px var(--mono); text-align: center; }
  .pill .bar .n:empty { display: none; }
  .pill.open .bar #pill-more { background: var(--sun); color: var(--ink); }
  .pill #pill-more svg { transition: transform .25s var(--ease); }
  .pill.open #pill-more svg { transform: rotate(45deg); }
  .pill .fan { position: absolute; bottom: 70px; right: 0; display: flex; flex-direction: column-reverse; gap: 8px; align-items: flex-end; pointer-events: none; }
  .pill .fan a, .pill .fan button { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; border: 0; background: var(--card); color: var(--text); text-decoration: none; font: 600 14px var(--sans); box-shadow: var(--sh-2); cursor: pointer; opacity: 0; transform: translateY(14px) scale(.92); transition: opacity .18s, transform .22s var(--ease); position: relative; }
  .pill .fan svg { width: 18px; height: 18px; color: var(--mute); }
  .pill .fan a.on { background: var(--ink); color: #fff; } .pill .fan a.on svg { color: var(--sun); }
  .pill .fan #pill-publish { background: var(--sun); color: var(--ink); } .pill .fan #pill-publish svg { color: var(--ink); }
  .pill .fan .n { font: 600 12px var(--mono); color: var(--mute); margin-left: 2px; } .pill .fan .n:empty { display: none; }
  .pill.open .fan { pointer-events: auto; }
  .pill.open .fan a, .pill.open .fan button { opacity: 1; transform: none; }
  .pill.open .fan > :nth-child(1) { transition-delay: .02s } .pill.open .fan > :nth-child(2) { transition-delay: .05s } .pill.open .fan > :nth-child(3) { transition-delay: .08s } .pill.open .fan > :nth-child(4) { transition-delay: .11s } .pill.open .fan > :nth-child(5) { transition-delay: .14s } .pill.open .fan > :nth-child(6) { transition-delay: .17s } .pill.open .fan > :nth-child(7) { transition-delay: .2s } .pill.open .fan > :nth-child(8) { transition-delay: .23s }
  body.staff .pill [data-v="ledger"], body.staff .pill [data-v="settings"] { display: none; }
  .drawer.open ~ .pill, .drawer.open ~ .pill-scrim { display: none; }
}

#bell.on { background: var(--sun-soft); border-color: var(--sun); color: #7A5D00; }
.pill .fan #pill-bell.on { background: var(--sun-soft); } .pill .fan #pill-bell.on svg { color: #7A5D00; }
@media (max-width: 860px) { #bell { display: none; } }

.pick-scan { padding: 10px 14px 4px 18px; } .pick-scan .btn { width: 100%; justify-content: center; }
label.lnk input { display: none; } label.lnk svg { margin-right: 4px; }
