
/* Order Assistant pilot. Layout: app shell — left nav rail (top bar on phones) + one working column. The request workspace uses a step rail. */
:root {
  --bg: #f3f4f7; --surface: #ffffff; --sunk: #eceef3; --ink: #15172b; --muted: #5b5f76; --line: #dde0e8;
  --accent: #c8215f; --accent-ink: #ffffff; --accent-soft: #fbe6ee;
  --nav: #15172b; --nav-ink: #e9eaf3; --nav-muted: #9a9db5; --nav-hi: #262945;
  --ok: #16774c; --ok-soft: #e3f3eb; --warn: #965800; --warn-soft: #fff2db; --bad: #b42318; --bad-soft: #fde7e5; --info: #2f4ab0; --info-soft: #e7ecfb;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif; --body: "Public Sans", "Segoe UI", Arial, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f101b; --surface: #181a29; --sunk: #12131f; --ink: #eceef7; --muted: #a4a8bf; --line: #2c2f45;
  --accent: #ff5c98; --accent-ink: #1a0b12; --accent-soft: #3a1726; --nav: #0b0c15; --nav-ink: #e9eaf3; --nav-muted: #8e91a8; --nav-hi: #1e2036;
  --ok: #5fd39c; --ok-soft: #11301f; --warn: #f3b44d; --warn-soft: #33260c; --bad: #ff8a7a; --bad-soft: #3a1714; --info: #9fb3ff; --info-soft: #1a2244; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f101b; --surface: #181a29; --sunk: #12131f; --ink: #eceef7; --muted: #a4a8bf; --line: #2c2f45;
  --accent: #ff5c98; --accent-ink: #1a0b12; --accent-soft: #3a1726; --nav: #0b0c15; --nav-ink: #e9eaf3; --nav-muted: #8e91a8; --nav-hi: #1e2036;
  --ok: #5fd39c; --ok-soft: #11301f; --warn: #f3b44d; --warn-soft: #33260c; --bad: #ff8a7a; --bad-soft: #3a1714; --info: #9fb3ff; --info-soft: #1a2244; color-scheme: dark }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--display); font-stretch: 85%; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(26px, 3.6vw, 34px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 750; }
h3 { font-size: 16.5px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.eyebrow { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
button, .btn { font: 600 14px var(--body); border-radius: 8px; padding: 9px 15px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=email], input[type=number], input[type=date], select, textarea { font: 14px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; width: 100%; }
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.5; min-height: 220px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.info { background: var(--info-soft); color: var(--info); } .chip.pink { background: var(--accent-soft); color: var(--accent); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 7px 9px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
td { padding: 8px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--sunk); }
tr.moved td { background: var(--warn-soft); }
.mv { color: var(--warn); font-weight: 700; }

/* shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.nav { background: var(--nav); color: var(--nav-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.navsec { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--nav-muted); padding: 12px 10px 4px; font-weight: 700; }
.logo { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 19px; letter-spacing: .02em; padding: 0 10px 2px; }
.logo span { color: #ff5c98; }
.logo-sub { font-size: 11.5px; color: var(--nav-muted); padding: 0 10px 18px; }
.nav button { background: transparent; border: 0; color: var(--nav-ink); justify-content: flex-start; width: 100%; padding: 7px 10px; font-weight: 500; flex-shrink: 0; }
.nav button.on { background: var(--nav-hi); font-weight: 700; box-shadow: inset 3px 0 0 #ff5c98; }
.nav button .cnt { margin-left: auto; font-size: 11.5px; background: #ff5c98; color: #1a0b12; border-radius: 999px; padding: 0 7px; font-weight: 700; }
.nav .sep { border-top: 1px solid var(--nav-hi); margin: 10px 0; }
.nav .grow { flex: 1; }
.conn { font-size: 12.5px; color: var(--nav-muted); padding: 10px; border: 1px solid var(--nav-hi); border-radius: 8px; }
.conn b { color: var(--nav-ink); font-weight: 600; display: block; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5fd39c; margin-right: 6px; }
.dot.off { background: #f3b44d; }
.topbar { display: none; }
main.page { padding-inline: 28px; padding-block: 26px 60px; max-width: 1180px; width: 100%; }
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-align: left; cursor: pointer; display: block; width: 100%; font: inherit; color: inherit; }
.kpi span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi b { display: block; font-family: var(--display); font-stretch: 85%; font-size: 28px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi.hot { border-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filters button { border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.filters button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* workspace */
.wshead { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.wsmeta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
ol.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0 0 16px; }
ol.steps button { width: 100%; border: 0; border-top: 3px solid var(--line); border-radius: 0; background: transparent; padding: 8px 0 0; flex-direction: column; align-items: flex-start; gap: 0; font-weight: 500; font-size: 12.5px; color: var(--muted); text-align: left; }
ol.steps button b { font-family: var(--display); font-stretch: 85%; font-size: 15px; color: var(--muted); }
ol.steps button.on { border-color: var(--accent); color: var(--ink); } ol.steps button.on b { color: var(--ink); }
ol.steps button.done { border-color: var(--ink); } ol.steps button.done b { color: var(--ink); }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.sizes label { display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 4px 4px 9px; font-family: var(--mono); font-size: 12.5px; }
.sizes input { width: 58px; padding: 5px 6px; }
.flag { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 14px; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 14px; border-radius: 0 8px 8px 0; font-size: 14px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
label.opt { display: block; border: 2px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; min-width: 0; background: var(--surface); }
label.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.opt input { position: absolute; opacity: 0; pointer-events: none; }
label.opt:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.thumbs img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.days { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0 10px; font-size: 13px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tot { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.tot span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tot b { font-family: var(--display); font-stretch: 85%; font-size: 23px; font-variant-numeric: tabular-nums; }
.tot.big { border-color: var(--accent); }
.log { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.log li::before { content: "✓ "; color: var(--ok); }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.timeline li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
.timeline li span { color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.prod { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; }
.prod img { width: 76px; height: 76px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.stockgrid { display: grid; grid-template-columns: repeat(8, minmax(44px, 1fr)); gap: 4px; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; min-width: 380px; }
.stockgrid div { padding: 4px 2px; border-radius: 5px; background: var(--sunk); }
.stockgrid .h { background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.stockgrid .z { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.stockgrid .lo { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.stockgrid .arr { display: block; font-size: 10px; font-weight: 600; color: var(--ok, #16774c); line-height: 1.1; }

/* auth + proposal (no shell) */
.solo { min-height: 100vh; display: grid; place-items: center; padding-inline: 16px; padding-block: 32px; }
.solo .panel { width: 100%; max-width: 480px; }
.perm { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.perm li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.perm li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.perm li.no::before { content: "✕"; color: var(--bad); }
.proposal { max-width: 960px; margin: 0 auto; padding-inline: 20px; padding-block: 0 60px; }
.pbar { background: var(--nav); color: var(--nav-ink); padding: 10px 20px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* modal + toast */
.scrim { position: fixed; inset: 0; background: rgba(10, 11, 20, .55); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { background: var(--surface); color: var(--ink); border-radius: 12px; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; padding: 22px; }
.modal.wide { max-width: 860px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); }
.doc { background: #fff; color: #1c1c28; border: 1px solid #ddd; border-radius: 6px; padding: 26px; font-size: 13px; }
.doc table td, .doc table th { border-color: #e3e3ea; color: #1c1c28; } .doc th { border-bottom-color: #12122b; color: #6b6b7b; }
.doc h3 { color: #12122b; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; position: fixed; inset: 0; height: auto; z-index: 15; overflow: auto; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .nav.open { display: flex; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--nav); color: var(--nav-ink); padding: 10px 16px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; }
  .topbar button { background: transparent; border-color: var(--nav-hi); color: var(--nav-ink); }
  main.page { padding-inline: 16px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  ol.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html, body { margin: 0; }
.spin { display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation: sp .8s linear infinite; vertical-align:-2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.empty { text-align:center; padding:28px 12px; color: var(--muted); }
.codebox { letter-spacing: .4em; font-family: var(--mono); font-size: 20px; text-align:center; }
@media print { .noprint { display:none !important; } body { background:#fff; } }

/* item details window */
.pi-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; }
.pi-main { background: #fff; border: 1px solid var(--line); border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; max-width: 100%; }
.pi-main img { width: 100%; height: 100%; object-fit: contain; }
.pi-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pi-thumbs button { padding: 0; width: 58px; height: 58px; border: 2px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; }
.pi-thumbs button.on { border-color: var(--accent); }
.pi-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pi-det { width: 100%; font-size: 13px; } .pi-det th { text-align: left; font-weight: 500; color: var(--muted); width: 40%; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); text-transform: none; letter-spacing: 0; } .pi-det td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.pi-thumb { padding: 0; border: 0; background: none; cursor: zoom-in; }
.pi-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; } .pi-link:hover { text-decoration-color: currentColor; }
.pi-media, .pi-info { min-width: 0; }
@media (max-width: 720px) { .pi-body { grid-template-columns: minmax(0, 1fr); } .modal { padding: 16px; } }

/* assistant */
.choose { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.jhome { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.javatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; font-family: var(--display, inherit); }
.javatar.sm { width: 30px; height: 30px; font-size: 14px; }
.jack .jchat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.jlog { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 320px; max-height: calc(100vh - 330px); overflow-y: auto; }
.jhello { display: flex; gap: 12px; align-items: flex-start; max-width: 62ch; }
.jsugg { display: flex; flex-wrap: wrap; gap: 8px; } .jsugg .chip { cursor: pointer; border: 1px solid var(--line); background: var(--surface); padding: 6px 10px; font-size: 13px; }
.jsugg .chip:hover { border-color: var(--accent); }
.jmsg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; } .jmsg.me { justify-content: flex-end; }
.jbody { min-width: 0; flex: 1; max-width: 760px; }
.jbub { background: var(--sunk); border-radius: 12px; padding: 10px 13px; line-height: 1.5; max-width: 70ch; overflow-wrap: anywhere; display: inline-block; }
.jbub p { margin: 0 0 6px; } .jbub p:last-child { margin: 0; } .jbub ul { margin: 4px 0 6px; padding-left: 18px; } .jbub li { margin: 2px 0; }
.jmsg.me .jbub { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.jmsg:not(.me) .jbub { border-top-left-radius: 4px; }
.jcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 42%), 1fr)); gap: 10px; margin-top: 8px; }
.jcard { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; cursor: pointer; color: inherit; }
.jcard:hover { border-color: var(--accent); }
.jimg { background: #fff; aspect-ratio: 1; display: grid; place-items: center; border-bottom: 1px solid var(--line); } .jimg img { width: 100%; height: 100%; object-fit: contain; }
.jtxt { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; gap: 2px; padding: 8px 10px 10px; font-size: 13px; line-height: 1.3; } .jtxt b { text-transform: capitalize; font-weight: 600; } .jtxt .chip { align-self: flex-start; margin-top: 4px; }
.jinput { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.jinput textarea { flex: 1; min-height: 46px; max-height: 180px; resize: vertical; font: inherit; }
@media (max-width: 860px) { .choose { grid-template-columns: minmax(0, 1fr); } .jlog { max-height: none; min-height: 260px; } }

/* Jack docked beside the app */
.jdock { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100%; z-index: 14; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: -8px 0 24px rgba(10, 11, 20, .08); }
body.jack-open .shell { margin-right: 400px; }
body.jack-open main.page { max-width: 1000px; }
.jhead { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.jhead button { padding: 6px 10px; }
.jdock .jlog { flex: 1; min-height: 0; max-height: none; overflow-y: auto; padding: 16px; }
.jdock .jbub { max-width: 100%; }
.jdock .jcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jdock .jinput { border-top: 1px solid var(--line); }
.jshowpage { display: none; }
.jlaunch { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 14; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--ink); color: var(--surface); border: 0; box-shadow: 0 6px 20px rgba(10, 11, 20, .25); font-weight: 600; cursor: pointer; }
.jlaunch .javatar { background: var(--accent); }
.jemail { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.jemail-body { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: var(--sunk); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; }
.jemail .btn { display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 1180px) { body.jack-open .shell { margin-right: 360px; } .jdock { width: 360px; } }
@media (max-width: 900px) { body.jack-open .shell { margin-right: 0; } .jdock { width: 100%; border-left: 0; } .jshowpage { display: inline-flex; } }

/* Jack's face and voice */
.jstage { border-bottom: 1px solid var(--line); background: var(--surface); }
.jstage-face:empty { display: none; }
.jface { position: relative; margin: 12px 12px 0; aspect-ratio: 4 / 3; max-height: 34vh; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, var(--nav, #15172b), #2a1830); display: grid; place-items: center; }
.jface video { width: 100%; height: 100%; object-fit: cover; display: block; }
.jface-ph { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; }
.javatar.xl { width: 92px; height: 92px; font-size: 40px; box-shadow: 0 0 0 0 rgba(200, 33, 95, .5); }
.jface-ph.speaking .javatar.xl { animation: jtalk 0.9s ease-in-out infinite; }
.jface-ph.listening .javatar.xl { animation: jlisten 1.6s ease-in-out infinite; }
.jface-ph.thinking .javatar.xl { animation: jthink 1.2s ease-in-out infinite; }
@keyframes jtalk { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(255, 92, 152, .35); } 50% { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(255, 92, 152, .12); } }
@keyframes jlisten { 0%, 100% { box-shadow: 0 0 0 0 rgba(120, 220, 170, .5); } 50% { box-shadow: 0 0 0 18px rgba(120, 220, 170, 0); } }
@keyframes jthink { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .jface-ph .javatar.xl { animation: none !important; } }
.jface-tag { position: absolute; left: 10px; bottom: 10px; background: rgba(10, 11, 20, .62); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.jface-tag:empty { display: none; }
.jctl { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.jctl button { padding: 7px 12px; font-size: 13px; }
.jctl button:first-child { flex: 1; justify-content: center; }
.facegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; max-height: 420px; overflow: auto; }
.faceopt { flex-direction: column; padding: 6px; gap: 6px; align-items: stretch; }
.faceopt video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--sunk); }
.faceopt span { font-size: 12px; text-align: center; }
.faceopt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* product cards in Jack's panel: keep photos inside their box */
.jcard { min-width: 0; }
.jimg { display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; }
.jimg img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; display: block; }
/* camera */
.jcamwrap { position: relative; margin: 12px 12px 0; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; max-height: 26vh; }
.jstage.withcam .jface { aspect-ratio: 16 / 9; max-height: 22vh; }
.jcamwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.jcamwrap span { position: absolute; left: 10px; bottom: 8px; background: rgba(10, 11, 20, .62); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.jcamwrap.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: jflash .45s ease-out forwards; }
@keyframes jflash { from { opacity: .9; } to { opacity: 0; } }
.jcamrow { display: flex; align-items: center; gap: 10px; padding: 0 12px 10px; flex-wrap: wrap; }
.jattach { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--sunk); }
.jattach img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.jattach span { flex: 1; min-width: 0; }
.jclip { padding: 9px 11px; align-self: flex-end; cursor: pointer; }
.jthumb { display: block; max-width: 180px; width: 100%; border-radius: 8px; margin-bottom: 6px; }

.jface video[hidden], .jcamwrap[hidden] { display: none !important; }
.jface { max-height: 30vh; }
.jstage.withcam { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.jstage.withcam .jstage-ctl, .jstage.withcam audio { grid-column: 1 / -1; }
.jstage.withcam .jface { margin: 12px 6px 0 12px; aspect-ratio: 1; max-height: none; }
.jstage.withcam .jcamwrap { margin: 12px 12px 0 6px; aspect-ratio: 1; max-height: none; }
.jstage.withcam .javatar.xl { width: 64px; height: 64px; font-size: 28px; }
.jctl button { white-space: nowrap; }
.jctl { flex-wrap: nowrap; }
.jctl button { padding: 7px 10px; }
.jctl button:first-child { flex: 1 1 auto; min-width: 0; }

/* Jack's avatar: his face, not a letter */
.javatar { overflow: hidden; padding: 0; }
.javatar.face { background: var(--sunk); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent-soft); }
.javatar.face img, .javatar.face video { width: 100%; height: 100%; object-fit: cover; display: block; }
.javatar.mark { background: linear-gradient(140deg, var(--accent), #6b2bd1); color: #fff; }
.javatar.mark svg { width: 56%; height: 56%; }
.jface-ph .javatar.xl { width: 120px; height: 120px; }
.jface-ph .javatar.xl.face { box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
/* live video chat button on Home */
.jlive-row { gap: 10px; align-items: center; flex-wrap: wrap; }
.jlive { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.jlive:hover { filter: brightness(1.15); }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 0 rgba(255,77,109,.6); animation: jlivepulse 1.6s ease-out infinite; }
@keyframes jlivepulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,109,.6); } 100% { box-shadow: 0 0 0 9px rgba(255,77,109,0); } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

/* ===== business features ===== */
ol.steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
input[type=search], input[type=tel], input[type=datetime-local] { font: 14px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; width: 100%; }
.thumbph { display: inline-block; background: var(--sunk); border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.callout.okc { border-left-color: var(--ok); background: var(--ok-soft); }

/* direct order lines + size inputs */
.dline { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dline:last-of-type { border-bottom: 0; }
.dline-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.szrow { display: flex; flex-wrap: wrap; gap: 6px; }
.szcell { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 62px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.szcell span { font-weight: 600; color: var(--ink); }
.szcell input { width: 100%; text-align: center; padding: 6px 2px; font-variant-numeric: tabular-nums; }
.szcell small { font-family: var(--body); font-size: 10.5px; min-height: 14px; white-space: nowrap; }
.szcell.short input { border-color: var(--bad); background: var(--bad-soft); }
.szcell.short small { color: var(--bad); font-weight: 600; }
.szcell.out { opacity: .55; }
.szcell.out small { color: var(--bad); }

/* item picker */
.pklist { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pkrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pkrow:last-child { border-bottom: 0; }
.pkrow:hover { background: var(--sunk); }
.pkrow input { width: auto; flex-shrink: 0; }
.pkrow:has(input:checked) { background: var(--accent-soft); }

/* linesheet editor */
.lsgrid { display: flex; flex-direction: column; }
.lsitem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lsitem:last-child { border-bottom: 0; }
.lsctl { display: flex; flex-direction: column; gap: 2px; }
.lsctl button { padding: 2px 8px; }

/* printable linesheet */
.lsdoc { max-width: 960px; margin: 0 auto 40px; }
.lsprint { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 18px; }
.lscard { border: 1px solid #e3e3ea; border-radius: 6px; padding: 10px; break-inside: avoid; }
.lscard img, .lscard .noimg { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fafafa; border-radius: 4px; display: block; }
.lsname { font-weight: 700; margin-top: 8px; text-transform: capitalize; }
.lsmeta { color: #6b6b7b; font-size: 11.5px; }
.lsprice { font-weight: 700; font-size: 15px; margin-top: 4px; }
.lsprice span { font-weight: 400; color: #6b6b7b; font-size: 11.5px; margin-left: 6px; }
@media print { .lsdoc { border: 0; padding: 0; } .lsprint { grid-template-columns: repeat(4, 1fr); } }

/* public linesheet + team pages */
.lspub { padding-bottom: 90px; }
.lspubgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.lspubitem { display: flex; flex-direction: column; gap: 12px; }
.lspubimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); max-width: 100%; display: block; }
.lsbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--nav); color: var(--nav-ink); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; z-index: 12; font-variant-numeric: tabular-nums; }
.ptitem { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.ptitem img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); flex-shrink: 0; }
.sizepick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sizepick button { padding: 7px 11px; font-family: var(--mono); font-size: 13px; min-width: 48px; justify-content: center; }
.sizepick button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.teamlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.teamlist li:last-child { border-bottom: 0; }
.glance li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.glance button { padding: 0; }

/* calendar */
.calwrap { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 4px; min-width: 660px; }
.calhd { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 2px 6px; }
.calday { min-height: 96px; border: 1px solid var(--line); border-radius: 7px; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); min-width: 0; }
.calday.blank { background: transparent; border-color: transparent; }
.calday.past { background: var(--sunk); }
.calday.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dnum { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 2px; font-variant-numeric: tabular-nums; }
.calday.today .dnum { color: var(--accent); }
.calev { display: block; width: 100%; text-align: left; font: 600 11.5px/1.25 var(--body); padding: 3px 6px; border-radius: 5px; border: 0; background: var(--sunk); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--muted); }
.calev.pink { background: var(--accent-soft); border-left-color: var(--accent); } .calev.warn { background: var(--warn-soft); border-left-color: var(--warn); } .calev.info { background: var(--info-soft); border-left-color: var(--info); } .calev.ok { background: var(--ok-soft); border-left-color: var(--ok); } .calev.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.calev.late { box-shadow: inset 0 0 0 1px var(--bad); }
.calev.done { opacity: .5; text-decoration: line-through; }
.calev .calk { font-weight: 700; margin-right: 6px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .05em; }
.calmore { font-size: 11px; padding: 0 4px; border: 0; background: none; color: var(--muted); justify-content: flex-start; }
ul.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ul.agenda li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.adate { font-family: var(--display); font-stretch: 85%; font-weight: 700; font-size: 15px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adate small { display: block; font-family: var(--body); font-size: 11px; color: var(--muted); font-weight: 500; }
ul.agenda .calev { white-space: normal; }
@media (max-width: 960px) { .calwrap { grid-template-columns: minmax(0, 1fr); } }

/* invoices */
.invlayout { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.invdoc { max-width: 820px; }
@media (max-width: 860px) { .invlayout { grid-template-columns: minmax(0, 1fr); } }

/* reports */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 70px minmax(0, 1fr) 84px; gap: 10px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.bl { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.bt { background: var(--sunk); border-radius: 4px; height: 16px; overflow: hidden; }
.bf { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bv { text-align: right; font-weight: 600; }

/* stock alerts + tracking */
.risk { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.track { border-top: 1px solid var(--line); padding-top: 12px; }
.calev.legend { display: inline-block; width: auto; cursor: default; }
.calday.has { cursor: pointer; }
@media (max-width: 640px) {
  .calgrid { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .calhd { padding: 2px; font-size: 10px; text-align: center; }
  .calday { min-height: 52px; padding: 3px; gap: 2px; }
  .calday .calev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; pointer-events: none; }
  .calday .calev.pink { background: var(--accent); } .calday .calev.warn { background: var(--warn); } .calday .calev.info { background: var(--info); } .calday .calev.ok { background: var(--ok); } .calday .calev.bad { background: var(--bad); }
  .calmore { font-size: 10px; padding: 0; pointer-events: none; }
}

/* ===== public demo (/demo): tour bar, spotlight, welcome ===== */
html.demo body { padding-top: 48px; }
html.demo [data-act=signout], html.demo .jlive-row, html.demo [data-act=v-face] { display: none !important; }
html.demo.live [data-act=v-face] { display: inline-flex !important; }
.dwelcome .dlive { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line, #DEDFE8); border-radius: 12px; }
.dwelcome .dlive img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.dwelcome .dlive .spin { margin-right: 6px; }
#dtour .dtour-hint { font-size: 12px; opacity: .72; margin-left: 10px; white-space: nowrap; }
@media (max-width: 1180px) { #dtour .dtour-hint { display: none; } }
html.demo .nav { top: 48px; height: calc(100vh - 48px); }
html.demo .jdock { top: 48px; height: calc(100vh - 48px); z-index: 75; }
html.demo .scrim { z-index: 85; }
#dtour { position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 80; background: #12122B; color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.25); font-family: inherit; }
#dtour .dtour-in { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 14px; }
#dtour .dtour-l { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
#dtour .dtour-tag { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #ff5c98; white-space: nowrap; }
#dtour .dtour-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dtour .dtour-c { flex: 1; max-width: 260px; }
#dtour .dtour-prog { height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
#dtour .dtour-prog i { display: block; height: 100%; background: #ff5c98; border-radius: 3px; transition: width .35s; }
#dtour .dtour-r { display: flex; align-items: center; gap: 6px; }
#dtour button, #dtour select { height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 13px; padding: 0 10px; cursor: pointer; }
#dtour button[disabled] { opacity: .4; cursor: default; }
#dtour button.primary { background: #ff5c98; border-color: #ff5c98; color: #1a0b12; font-weight: 700; padding: 0 16px; }
#dtour button[aria-pressed="false"] { opacity: .75; }
#dtour select { max-width: 190px; background: #1F2042; }
#dspot { position: fixed; z-index: 70; pointer-events: none; border: 2px solid #ff5c98; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10,10,30,.42), 0 0 0 6px rgba(255,92,152,.25); transition: left .3s, top .3s, width .3s, height .3s; }
#dspot[hidden] { display: none; }
.dwelcome .eyebrow { color: var(--accent); }
@media (max-width: 900px) {
  html.demo body { padding-top: 92px; }
  #dtour { height: auto; }
  #dtour .dtour-in { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 8px; }
  #dtour .dtour-c { display: none; }
  #dtour select { display: none; }
  html.demo .nav, html.demo .jdock { top: auto; height: auto; }
  #dtour .dtour-say { padding: 0 12px 10px; font-size: 13px; line-height: 1.45; color: #e9eaf3; max-height: 7.3em; overflow: auto; }
  html.demo body { padding-top: 0; }
  #dtour { position: sticky; }
}

.callout.badc { background: var(--bad-soft); color: var(--bad); }
