/* Needle & Needs: one stylesheet. Colours, fonts and sizes are variables so a person's chosen theme changes the whole application.
   The page carries no inline styles (the content policy forbids them); everything is a class here. */
@font-face { font-family: "Outfit"; src: url(/static/fonts/outfit.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url(/static/fonts/playfair.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url(/static/fonts/noto-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url(/static/fonts/noto-400i.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url(/static/fonts/noto-700.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }

/* ---- Themes. The names --violet and --violet-d are kept from the first palette: accent and link. ---- */
:root, html[data-theme="atelier"] {
  --navy: #05113b; --violet: #0b3df5; --violet-d: #0a2fb8; --btn: #0a2fb8; --btn-ink: #fff; --tint: #eef3ff; --ink: #1c1b2e; --ink2: #5a5873; --rule: #d5ddf0;
  --bg: #f5f7fc; --card: #fff; --field: #fff; --field-line: #c3cbe0; --zebra: #f8faff; --thead: #05113b; --thead-ink: #fff; --mute-bg: #eeedf3;
  --side: #05113b; --side-2: #0a1c5c; --side-ink: #e6ebff; --side-mute: #9fb0ea; --side-on: #35e3ff; --glow: #35e3ff;
  --good: #2e7d32; --good-bg: #eaf5ec; --bad: #b3261e; --bad-bg: #fbeceb; --warn: #8a5a00; --warn-bg: #fff3d6; --info-bg: #e7f1fb; --info: #1b5a96;
  --hl: #ffe45c; --hl-pink: #ffc2dd; --hl-green: #b9f0c2; --hl-blue: #bfe3ff; --shadow: 0 1px 2px rgba(5, 17, 59, .06), 0 8px 24px -12px rgba(5, 17, 59, .18);
  --note-y: #fff3a8; --note-p: #ffd3e4; --note-b: #cfe8ff; --note-g: #d3f3d3; --note-ink: #2b2a22; color-scheme: light;
}
html[data-theme="midnight"] {
  --navy: #e3e9ff; --violet: #6f8cff; --violet-d: #9db2ff; --btn: #3355f0; --btn-ink: #fff; --tint: #1b2547; --ink: #e8ecfa; --ink2: #a3acc9; --rule: #27314f;
  --bg: #0b1020; --card: #141b33; --field: #0f1630; --field-line: #34406a; --zebra: #121934; --thead: #1b2547; --thead-ink: #e3e9ff; --mute-bg: #222a45;
  --side: #070b18; --side-2: #101a3d; --side-ink: #e6ebff; --side-mute: #8f9cc8; --side-on: #35e3ff; --glow: #35e3ff;
  --good: #7bd88f; --good-bg: #12301c; --bad: #ff8a80; --bad-bg: #3a1614; --warn: #ffcc66; --warn-bg: #3a2c08; --info-bg: #10273f; --info: #8ec5ff;
  --hl: #6b5a00; --hl-pink: #6b2147; --hl-green: #1c5a2b; --hl-blue: #1b4a73; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --navy: #e3e9ff; --violet: #6f8cff; --violet-d: #9db2ff; --btn: #3355f0; --btn-ink: #fff; --tint: #1b2547; --ink: #e8ecfa; --ink2: #a3acc9; --rule: #27314f;
    --bg: #0b1020; --card: #141b33; --field: #0f1630; --field-line: #34406a; --zebra: #121934; --thead: #1b2547; --thead-ink: #e3e9ff; --mute-bg: #222a45;
    --side: #070b18; --side-2: #101a3d; --side-ink: #e6ebff; --side-mute: #8f9cc8; --side-on: #35e3ff; --glow: #35e3ff;
    --good: #7bd88f; --good-bg: #12301c; --bad: #ff8a80; --bad-bg: #3a1614; --warn: #ffcc66; --warn-bg: #3a2c08; --info-bg: #10273f; --info: #8ec5ff;
    --hl: #6b5a00; --hl-pink: #6b2147; --hl-green: #1c5a2b; --hl-blue: #1b4a73; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8); color-scheme: dark;
  }
}
html[data-theme="silk"] {
  --navy: #4a1535; --violet: #b0306a; --violet-d: #8e2255; --btn: #8e2255; --btn-ink: #fff; --tint: #fbeaf1; --ink: #2a1a22; --ink2: #6d5560; --rule: #ecd9dc;
  --bg: #fbf6f3; --card: #fff; --field: #fff; --field-line: #dcc3c9; --zebra: #fdf8f6; --thead: #4a1535; --thead-ink: #fff; --mute-bg: #f1e8ea;
  --side: #3b1029; --side-2: #5e1a41; --side-ink: #ffe9f2; --side-mute: #d9a5bd; --side-on: #ffc27a; --glow: #ffc27a;
  --info-bg: #f3e9f8; --info: #6a2c8a; --shadow: 0 1px 2px rgba(74, 21, 53, .06), 0 8px 24px -12px rgba(74, 21, 53, .2);
}
html[data-theme="khadi"] {
  --navy: #1f3d2b; --violet: #2f7d4f; --violet-d: #1f6a40; --btn: #1f6a40; --btn-ink: #fff; --tint: #e9f3e6; --ink: #23291f; --ink2: #5c6353; --rule: #ddd9c4;
  --bg: #f6f3ea; --card: #fffdf7; --field: #fffdf7; --field-line: #c9c5ad; --zebra: #faf8ef; --thead: #1f3d2b; --thead-ink: #fff; --mute-bg: #ece9db;
  --side: #1f3d2b; --side-2: #2c5a3e; --side-ink: #eef6e9; --side-mute: #a9c4ae; --side-on: #f2b56b; --glow: #f2b56b;
  --info-bg: #e6efe9; --info: #24583a; --shadow: 0 1px 2px rgba(31, 61, 43, .06), 0 8px 24px -12px rgba(31, 61, 43, .2);
}
html { --head: "Outfit", system-ui, sans-serif; --body: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
html[data-font="editorial"] { --head: "Playfair Display", Georgia, serif; }
html[data-font="rounded"] { --body: "Outfit", system-ui, sans-serif; }
html[data-text="compact"] { font-size: 13.5px; } html[data-text="large"] { font-size: 17px; }

* { box-sizing: border-box; }
html { font-family: var(--body); color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; line-height: 1.45; }
a { color: var(--violet-d); }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 600; margin: 0 0 1rem; color: var(--navy); }
h2 { font-size: 1.1rem; font-weight: 600; margin: 1.3rem 0 .6rem; color: var(--navy); }
.card h2:first-child { margin-top: 0; }
small, .muted { color: var(--ink2); }
main { padding: 1.4rem 1.6rem 3rem; max-width: 1240px; min-width: 0; width: 100%; }
::selection { background: var(--hl); color: #1c1b2e; }

/* ---- Shell: a dark side menu, a light top bar ---- */
body.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.shell { min-width: 0; display: flex; flex-direction: column; }
nav.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--side), var(--side-2)); color: var(--side-ink); display: flex; flex-direction: column; padding-bottom: .6rem; scrollbar-width: thin; }
nav.side .brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem .9rem; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 1.08rem; white-space: nowrap; }
nav.side .brand img { width: 63px; height: 26px; }
nav.side a.nl { display: flex; align-items: center; gap: .6rem; padding: .42rem 1.1rem .42rem 1.55rem; color: var(--side-ink); text-decoration: none; font-size: .93rem; border-left: 3px solid transparent; position: relative; }
nav.side a.nl.home { padding-left: 1.1rem; font-weight: 600; }
nav.side a.nl:hover { background: rgba(255, 255, 255, .08); }
nav.side a.nl.on { border-left-color: var(--side-on); background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
nav.side details { border-top: 1px solid rgba(255, 255, 255, .07); }
nav.side summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .6rem 1.1rem; font-family: var(--head); font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--side-mute); user-select: none; }
nav.side summary::-webkit-details-marker { display: none; }
nav.side summary::after { content: ""; margin-left: auto; width: .42rem; height: .42rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
nav.side details[open] > summary::after { transform: rotate(45deg); }
nav.side details[open] > summary { color: #fff; }
nav.side details[open] { padding-bottom: .35rem; }
.ico { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.side .side-foot { margin-top: auto; padding: .8rem 1.1rem .4rem; font-size: .8rem; color: var(--side-mute); }
nav.side .side-foot a { color: var(--side-ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
nav.side .side-foot b { color: var(--side-on); }

header.top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: .9rem; padding: .6rem 1.6rem; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
header.top .brand { display: none; }
header.top form.search { flex: 1 1 12rem; max-width: 26rem; margin: 0; position: relative; }
header.top form.search input { padding-left: 2.1rem; border-radius: 999px; background: var(--card); }
header.top form.search .ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink2); pointer-events: none; }
header.top .who { margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
header.top .who small { color: var(--ink2); display: block; line-height: 1.2; }
header.top .who a { color: var(--ink); text-decoration: none; }
header.top a.tool, header.top a.alerts { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border-radius: 999px; border: 1px solid transparent; }
header.top a.tool:hover, header.top a.alerts:hover { background: var(--tint); border-color: var(--rule); }
header.top a.alerts.has b { background: #ffb020; color: #1c1b2e; border-radius: 999px; padding: 0 .45rem; font-size: .8rem; animation: pulse 2.2s ease-in-out infinite; }
header.top a.acct { display: flex; align-items: center; gap: .55rem; padding: .2rem .6rem .2rem .2rem; border-radius: 999px; }
header.top a.acct:hover { background: var(--tint); }
.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--glow)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 600; font-size: .85rem; flex: 0 0 auto; }
header.top button.link { color: var(--ink2); text-decoration: none; padding: .35rem .5rem; }
header.top button.link:hover { color: var(--bad); }
button.menu { display: none; }
.scrim { display: none; }

body.plain { background: radial-gradient(1200px 600px at 15% 110%, #0b3df5 0%, transparent 60%), radial-gradient(900px 500px at 100% -10%, #1a8fd0 0%, transparent 55%), #05113b; color: #fff; }
body.plain h1 { color: #fff; } body.plain .card { color: var(--ink); } body.plain .card h1 { color: var(--navy); }
body.plain main, body.public main { max-width: 760px; margin: 0 auto; }
header.pubhead { background: linear-gradient(90deg, var(--side), var(--side-2)); color: #fff; padding: .8rem 1.2rem; display: flex; gap: 1rem; align-items: center; }
header.pubhead img { height: 34px; width: auto; border-radius: 4px; background: #fff; }
header.pubhead button { margin-left: auto; background: none; border-color: #ffffff66; color: #fff; }
header.pubhead span { color: var(--side-mute); font-size: .9rem; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

/* ---- Blocks ---- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.narrowform { max-width: 440px; display: flex; flex-direction: column; gap: .7rem; }
.card.narrow { max-width: 400px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: .7rem; padding: 1.6rem; border: none; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
.card.wide { max-width: 760px; display: flex; flex-direction: column; gap: .8rem; } .card.wide h2, .card.wide p { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .7rem 1rem; align-items: start; }
.cols .span, .span { grid-column: 1 / -1; }
.cols.five { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem .6rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: center; margin-bottom: 1rem; }
.toolbar form { margin: 0; }
.stage { font-weight: 700; color: var(--navy); background: var(--tint); border: 1px solid var(--rule); border-radius: 999px; padding: .2rem .8rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .85rem 1rem .8rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .15rem; position: relative; overflow: hidden; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--violet); opacity: .55; }
a.stat:hover { transform: translateY(-3px); border-color: var(--violet); }
.stat b { font-family: var(--head); font-weight: 600; font-size: 1.85rem; line-height: 1.15; color: var(--navy); font-variant-numeric: tabular-nums; align-self: flex-start; }
.stat.small b { font-size: 1.3rem; }
.stat.zero b { color: var(--ink2); opacity: .55; } .stat.zero::before { background: var(--rule); opacity: 1; }
.stat.bad::before { background: var(--bad); opacity: 1; } .stat.warn::before { background: #e0a100; opacity: 1; }
.stat.bad b { color: var(--bad); background: linear-gradient(transparent 58%, var(--hl-pink) 58%); padding: 0 .2rem; margin-left: -.2rem; }
.stat.warn b { color: var(--warn); background: linear-gradient(transparent 58%, var(--hl) 58%); padding: 0 .2rem; margin-left: -.2rem; }
.stat span { font-size: .85rem; color: var(--ink2); }
.empty { color: var(--ink2); font-style: italic; }
.flash { padding: .7rem 1rem; border-radius: 10px; margin: 0 0 1rem; border: 1px solid transparent; animation: drop .35s ease both; }
ul.flash { padding-left: 1.8rem; }
.flash.ok { background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.flash.err { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge { display: inline-block; font-size: .76rem; font-weight: 600; border-radius: 999px; padding: .12rem .6rem; white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.mute { background: var(--mute-bg); color: var(--ink2); }

/* Highlighter: a marker stroke under the words */
mark, .hl { background: linear-gradient(transparent 52%, var(--hl) 52%); color: inherit; padding: 0 .15em; border-radius: 2px; }
.hl.pink { background: linear-gradient(transparent 52%, var(--hl-pink) 52%); } .hl.green { background: linear-gradient(transparent 52%, var(--hl-green) 52%); } .hl.blue { background: linear-gradient(transparent 52%, var(--hl-blue) 52%); }

/* ---- Tables ---- */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card .tablewrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th { text-align: left; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; color: var(--thead-ink); background: var(--thead); padding: .55rem .7rem; white-space: nowrap; font-weight: 600; }
td { padding: .55rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--zebra); }
tbody tr:hover td { background: var(--tint); }
table.lines input, table.lines select { width: 100%; min-width: 4.5rem; }
table.lines td { padding: .25rem; }

/* ---- Forms ---- */
label.field { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--ink2); }
label.check { display: flex; gap: .5rem; align-items: center; margin: .3rem 0; }
input, select, textarea, button, .button { font: inherit; }
input, select, textarea { border: 1px solid var(--field-line); border-radius: 9px; padding: .48rem .65rem; background: var(--field); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio], input[type=range] { width: auto; accent-color: var(--violet); } input[type=range] { padding: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 22%, transparent); }
button, .button { border: 1px solid var(--field-line); background: var(--card); color: var(--ink); border-radius: 9px; padding: .48rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; transition: transform .1s, box-shadow .15s, background .15s; }
button:hover, .button:hover { border-color: var(--violet); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 600; box-shadow: 0 6px 16px -8px var(--btn); }
button.primary:hover, .button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: none; background: none; padding: 0; color: var(--violet-d); text-decoration: underline; box-shadow: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
form.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
form.inline input, form.inline select { width: auto; flex: 1 1 9rem; }
form.inline.big input, form.inline.big select, form.inline.big button { padding: .7rem .8rem; font-size: 1.05rem; }
fieldset { border: 1px solid var(--rule); border-radius: 10px; padding: .6rem .8rem; margin: 0; }
legend { font-size: .85rem; color: var(--ink2); padding: 0 .3rem; }
form.respond { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
form.respond button { padding: .8rem; font-size: 1.05rem; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 .8rem; }
dt { color: var(--ink2); font-size: .85rem; } dd { margin: 0; }
dl.totals, .totals dl { max-width: 320px; margin-left: auto; } dl.totals dd, .totals dd { text-align: right; }

/* ---- Gates and timeline ---- */
ol.gates { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; }
ol.gates li { border: 1px solid var(--rule); border-top: 4px solid var(--field-line); border-radius: 10px; padding: .55rem .75rem; background: var(--card); display: flex; flex-direction: column; }
ol.gates li span { font-size: .82rem; color: var(--ink2); }
ol.gates li.done { border-top-color: var(--good); } ol.gates li.now { border-top-color: var(--violet); background: var(--tint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 14%, transparent); } ol.gates li.bad { border-top-color: var(--bad); }
ul.timeline { list-style: none; padding: 0; margin: .6rem 0 0; }
ul.timeline li { border-left: 3px solid var(--rule); padding: .1rem 0 .6rem .8rem; }
ul.timeline li.customer, ul.timeline li.in { border-left-color: var(--good); } ul.timeline li.out { border-left-color: var(--violet); }
ul.timeline p { margin: .15rem 0 0; } ul.timeline em { color: var(--ink2); font-size: .82rem; }

.mockup svg { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.mockup.small { max-width: 420px; }
.qr { display: flex; align-items: center; gap: .8rem; } .qr svg { width: 120px; height: 120px; background: #fff; border-radius: 6px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.product img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.product h2 { margin: .5rem 0 .1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Dashboard ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; }
.hello { border-radius: 16px; padding: 1.3rem 1.5rem; color: #fff; background: radial-gradient(700px 300px at 0% 120%, var(--violet) 0%, transparent 65%), linear-gradient(120deg, var(--side), var(--side-2)); position: relative; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; min-height: 9.5rem; }
.hello h1 { color: #fff; font-size: 1.75rem; margin: 0 0 .25rem; }
.hello p { margin: 0; color: var(--side-ink); max-width: 34rem; }
.hello .hl { background: rgba(255, 228, 92, .26); color: #fff; padding: .08em .4em; border-radius: 5px; font-weight: 600; }
.hello .thread { position: absolute; right: -10px; top: -6px; width: 210px; height: 190px; opacity: .5; color: var(--glow); pointer-events: none; }
.hello .thread path { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 6 7; stroke-linecap: round; animation: stitch 14s linear infinite; }
.prog { display: flex; gap: 1rem; align-items: center; margin: 0; }
.prog .ring { width: 5.6rem; height: 5.6rem; flex: 0 0 auto; }
.prog .ring circle { fill: none; stroke-width: 9; } .prog .ring .track { stroke: var(--tint); } .prog .ring .fill { stroke: var(--violet); stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.prog .ring text { font-family: var(--head); font-weight: 600; font-size: 26px; fill: var(--navy); }
.prog .ring .cap { font-family: var(--body); font-weight: 400; font-size: 9px; fill: var(--ink2); letter-spacing: .08em; }
.prog h2 { margin: 0 0 .2rem; }
.prog p { margin: 0 0 .4rem; color: var(--ink2); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: .82rem; font-weight: 600; border: 1px solid var(--rule); }
.chip.fire { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; list-style: none; padding: 0; margin: 0; }
.medal { display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--card); }
.medal i { width: 2.2rem; height: 2.2rem; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ffd766, #f0a000); color: #5a3a00; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 3px 8px -3px #f0a000; font-style: normal; }
.medal b { display: block; font-size: .88rem; color: var(--navy); } .medal small { font-size: .76rem; line-height: 1.25; display: block; }
.medal.locked { opacity: .62; } .medal.locked i { background: var(--mute-bg); color: var(--ink2); box-shadow: none; }
.medal.new { border-color: #f0a000; animation: pop .6s ease both; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: .5rem; border: none; border-radius: 999px; background: var(--tint); overflow: hidden; vertical-align: middle; }
progress::-webkit-progress-bar { background: var(--tint); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--violet), var(--glow)); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--violet); border-radius: 999px; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.bars li { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr max-content; gap: .8rem; align-items: center; font-size: .92rem; }
.bars li small { white-space: nowrap; }
.board { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .5rem; }
.board li { display: grid; grid-template-columns: 1.6rem 1fr max-content; gap: .6rem; align-items: center; padding: .35rem .2rem; border-bottom: 1px dashed var(--rule); }
.board li:last-child { border-bottom: none; } .board li b { color: var(--navy); } .board .rank { font-family: var(--head); font-weight: 600; color: var(--ink2); text-align: center; }
.board li:first-child .rank { color: #f0a000; }

/* Sticky notes */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; list-style: none; padding: .4rem .2rem 0; margin: 0 0 1rem; }
.note { position: relative; min-height: 8.5rem; padding: 1.2rem .85rem .7rem; color: var(--note-ink); background: var(--note-y); box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 10px 14px -8px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: .5rem; border-bottom-right-radius: 16px 4px; transition: transform .18s ease; }
.note::before { content: ""; position: absolute; top: -.45rem; left: 50%; width: 4.4rem; height: 1.05rem; margin-left: -2.2rem; background: rgba(255, 255, 255, .55); border: 1px solid rgba(0, 0, 0, .07); transform: rotate(-2deg); }
.note:nth-child(3n+1) { transform: rotate(-1.4deg); } .note:nth-child(3n+2) { transform: rotate(1deg); } .note:nth-child(3n) { transform: rotate(-.5deg); }
.note:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.note.pink { background: var(--note-p); } .note.blue { background: var(--note-b); } .note.green { background: var(--note-g); }
.note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.35; flex: 1; }
.note mark { background: linear-gradient(transparent 45%, rgba(255, 150, 0, .45) 45%); }
.note footer { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: rgba(0, 0, 0, .55); }
.note footer button { border: none; background: none; padding: 0; color: rgba(0, 0, 0, .6); text-decoration: underline; font-size: .76rem; box-shadow: none; }
.note footer form { display: inline; margin-left: .5rem; }
.note.pinned::after { content: ""; position: absolute; top: -.5rem; right: .7rem; width: .85rem; height: .85rem; border-radius: 50%; background: #d7263d; box-shadow: 0 2px 3px rgba(0, 0, 0, .4); }
.note.add { background: none; box-shadow: none; border: 2px dashed var(--rule); border-radius: 12px; color: var(--ink); transform: none; padding: .7rem; }
.note.add::before { display: none; } .note.add:hover { transform: none; }
.note.add textarea { flex: 1; min-height: 4.2rem; resize: none; border: none; background: none; padding: .2rem; box-shadow: none; }
.note.add .row { display: flex; gap: .4rem; align-items: center; justify-content: space-between; }
.swatches { display: inline-flex; gap: .3rem; }
.swatches label { cursor: pointer; display: inline-flex; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches span { width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.swatches input:checked + span { border-color: var(--ink); } .swatches input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.sw-yellow { background: var(--note-y); } .sw-pink { background: var(--note-p); } .sw-blue { background: var(--note-b); } .sw-green { background: var(--note-g); }

/* Appearance: theme cards */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .7rem; }
.pick { cursor: pointer; display: block; position: relative; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick .sw { display: block; border-radius: 12px; border: 2px solid var(--rule); padding: .5rem; transition: border-color .15s, transform .15s; background: var(--card); }
.pick:hover .sw { transform: translateY(-2px); }
.pick input:checked + .sw { border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 20%, transparent); }
.pick input:focus-visible + .sw { outline: 2px solid var(--violet); outline-offset: 2px; }
.pick .demo { display: grid; grid-template-columns: 26% 1fr; height: 3.6rem; border-radius: 8px; overflow: hidden; margin-bottom: .4rem; border: 1px solid rgba(0, 0, 0, .12); }
.pick .demo i { display: block; } .pick .demo b { display: block; margin: .5rem .45rem 0; height: .5rem; border-radius: 3px; width: 60%; } .pick .demo u { display: block; margin: .35rem .45rem 0; height: 1.1rem; border-radius: 4px; }
.pick .name { font-weight: 600; font-size: .9rem; color: var(--navy); } .pick small { display: block; font-size: .76rem; }
.t-atelier i { background: #05113b; } .t-atelier .demo { background: #f5f7fc; } .t-atelier b { background: #0b3df5; } .t-atelier u { background: #fff; }
.t-midnight i { background: #070b18; } .t-midnight .demo { background: #0b1020; } .t-midnight b { background: #6f8cff; } .t-midnight u { background: #141b33; }
.t-silk i { background: #3b1029; } .t-silk .demo { background: #fbf6f3; } .t-silk b { background: #b0306a; } .t-silk u { background: #fff; }
.t-khadi i { background: #1f3d2b; } .t-khadi .demo { background: #f6f3ea; } .t-khadi b { background: #2f7d4f; } .t-khadi u { background: #fffdf7; }
.t-auto i { background: linear-gradient(180deg, #05113b 50%, #070b18 50%); } .t-auto .demo { background: linear-gradient(135deg, #f5f7fc 50%, #0b1020 50%); } .t-auto b { background: #0b3df5; } .t-auto u { background: linear-gradient(135deg, #fff 50%, #141b33 50%); }
.f-modern .name { font-family: "Outfit", sans-serif; } .f-editorial .name { font-family: "Playfair Display", serif; } .f-rounded .name, .f-rounded small { font-family: "Outfit", sans-serif; }
.s-compact .name { font-size: .8rem; } .s-large .name { font-size: 1.08rem; }

/* Celebration when a badge is earned */
.cheer { position: relative; overflow: hidden; border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: 1rem; background: linear-gradient(120deg, #fff3c4, #ffe08a); color: #4a3200; border: 1px solid #f0c040; display: flex; gap: .8rem; align-items: center; animation: pop .6s ease both; }
.cheer b { font-family: var(--head); font-size: 1.05rem; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 2.6s ease-in forwards; opacity: 0; }
.confetti i:nth-child(6n+1) { background: #0b3df5; } .confetti i:nth-child(6n+2) { background: #35e3ff; } .confetti i:nth-child(6n+3) { background: #d7263d; } .confetti i:nth-child(6n+4) { background: #2e7d32; } .confetti i:nth-child(6n+5) { background: #f0a000; } .confetti i:nth-child(6n) { background: #b0306a; }
.confetti i:nth-child(1) { left: 4%; animation-delay: .05s; } .confetti i:nth-child(2) { left: 11%; animation-delay: .4s; } .confetti i:nth-child(3) { left: 18%; animation-delay: .15s; } .confetti i:nth-child(4) { left: 25%; animation-delay: .6s; }
.confetti i:nth-child(5) { left: 32%; animation-delay: .25s; } .confetti i:nth-child(6) { left: 39%; animation-delay: .75s; } .confetti i:nth-child(7) { left: 46%; animation-delay: .1s; } .confetti i:nth-child(8) { left: 53%; animation-delay: .5s; }
.confetti i:nth-child(9) { left: 60%; animation-delay: .3s; } .confetti i:nth-child(10) { left: 67%; animation-delay: .85s; } .confetti i:nth-child(11) { left: 74%; animation-delay: .2s; } .confetti i:nth-child(12) { left: 81%; animation-delay: .65s; }
.confetti i:nth-child(13) { left: 88%; animation-delay: .35s; } .confetti i:nth-child(14) { left: 95%; animation-delay: .55s; }

@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(160px) rotate(540deg); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 60% { transform: scale(1.02); opacity: 1; } 100% { transform: scale(1); } }
@keyframes drop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .6); } 50% { box-shadow: 0 0 0 6px rgba(255, 176, 32, 0); } }
@keyframes stitch { to { stroke-dashoffset: -260; } }
body.app main > * { animation: rise .32s ease both; }
body.app main > *:nth-child(2) { animation-delay: .04s; } body.app main > *:nth-child(3) { animation-delay: .08s; } body.app main > *:nth-child(4) { animation-delay: .12s; } body.app main > *:nth-child(n+5) { animation-delay: .16s; }
html[data-motion="calm"] *, html[data-motion="calm"] *::before, html[data-motion="calm"] *::after { animation: none !important; transition: none !important; }
html[data-motion="calm"] .note { transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 900px) {
  body.app { display: block; }
  button.menu { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .6rem; }
  header.top { padding: .5rem .8rem; gap: .5rem; flex-wrap: wrap; }
  header.top form.search { order: 5; flex: 1 0 100%; max-width: none; }
  header.top button.link { white-space: nowrap; }
  .cards { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat b { font-size: 1.5rem; }
  header.top .who a.acct span.nm, header.top .who small, header.top a.tool span, header.top a.alerts .ico { display: none; }
  nav.side { position: fixed; z-index: 20; left: 0; top: 0; width: 272px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .5); }
  body.nav-open nav.side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(5, 10, 30, .5); border: none; border-radius: 0; padding: 0; }
  .grid2, .hero { grid-template-columns: 1fr; }
  main { padding: 1rem .8rem 2.5rem; }
  h1 { font-size: 1.4rem; }
  .bars li { grid-template-columns: 1fr max-content; } .bars li progress { grid-column: 1 / -1; grid-row: 2; }
}
@media print {
  html { --bg: #fff; --card: #fff; --ink: #000; --ink2: #333; --rule: #999; --navy: #000; --thead: #eee; --thead-ink: #000; --zebra: #fff; --tint: #fff; background: #fff; }
  header.top, nav.side, .toolbar, .noprint, .flash, form.respond, .scrim { display: none !important; }
  header.pubhead { background: #fff; color: #000; border-bottom: 1px solid #999; } header.pubhead span { color: #333; }
  body.app { display: block; } .card, .tablewrap { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  main { padding: 0; max-width: none; } body.app main > * { animation: none; }
}

/* Planning: capacity calendar */
table.capacity td, table.capacity th { text-align: center; white-space: nowrap; }
table.capacity td:first-child, table.capacity th:first-child { text-align: left; }
table.capacity td.over { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
table.capacity td.near { background: var(--warn-bg); color: var(--warn); }
form.inline label.check { flex: 0 0 auto; white-space: nowrap; margin: 0; }
.pre { white-space: pre-wrap; }

/* Printed labels with a QR code: always black on white, whatever the theme */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.label { background: #fff; color: #000; border: 1px solid #999; border-radius: 6px; padding: .7rem .8rem; display: flex; justify-content: space-between; gap: .6rem; align-items: center; break-inside: avoid; }
.label small { color: #333; }
.label > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.label .big { font-size: 1.25rem; } .label svg { width: 110px; height: 110px; flex: 0 0 auto; }
@media print { .labels { grid-template-columns: 1fr 1fr; gap: 4mm; } .label { border-radius: 0; } }
.tagline { color: var(--violet-d); font-weight: 600; margin: -.4rem 0 .8rem; }
h1.login-logo { margin: 0 0 .2rem; background: #05113b; border-radius: 12px; padding: .4rem; } h1.login-logo img { width: 100%; max-width: 250px; height: auto; display: block; margin: 0 auto; }
.right { text-align: right; } .invoice h2 { margin-top: 0; }
.sign { margin-top: 2.4rem; }

/* Floor capture (offline) */
.fl-wo { border-top: 1px solid var(--rule); padding: .55rem 0; }
.fl-wo summary { cursor: pointer; font-weight: 600; }
.fl-wo form { margin-top: .6rem; }
#fl-queue li, #fl-refused li { margin: .3rem 0; }
small.bad { color: var(--bad); }
[hidden] { display: none !important; }

/* Subscription */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .25rem 0; }
.checklist li.done { color: var(--good); }

/* API keys and reference */
pre { background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: .8rem; overflow-x: auto; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
code.wrap { word-break: break-all; font-size: 1rem; }

/* Catalogue for paper */
.cat-cover { text-align: center; padding: 3rem 1rem 2.5rem; border-bottom: 3px solid var(--violet); margin-bottom: 1.5rem; }
.cat-cover img { max-height: 90px; max-width: 240px; } .cat-cover h1 { font-size: 2.2rem; margin: .8rem 0 .2rem; } .cat-cover .big { font-family: var(--head); font-size: 1.3rem; color: var(--violet-d); margin: 0 0 1rem; } .cat-cover p { margin: .2rem 0; }
.cat-group h2 { border-bottom: 1px solid var(--rule); padding-bottom: .3rem; } .products.print { grid-template-columns: 1fr 1fr; } .product h3 { margin: .5rem 0 .2rem; color: var(--navy); }
.cat-foot { text-align: center; color: var(--ink2); font-size: .9rem; margin-top: 1.5rem; }
@media print { .cat-cover { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; break-after: page; } .cat-group h2 { break-after: avoid; } .product { break-inside: avoid; } }

/* Mockup options side by side */
.optgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.opt { display: block; cursor: pointer; margin: 0; } .opt h2 { margin-top: 0; } .opt.picked { border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.opt:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 22%, transparent); }
.opt .choose { display: flex; gap: .5rem; align-items: center; font-weight: 600; color: var(--navy); }
body.public main:has(.optgrid) { max-width: 1240px; }
.card.respond { display: flex; flex-direction: column; gap: .6rem; } .card.respond button { padding: .8rem; font-size: 1.05rem; }
/* The mockup preview stays in view while the form beside it scrolls */
@media (min-width: 901px) { .grid2 > div:has(> #preview) { position: sticky; top: 4.6rem; } }

/* Trace pages */
.tracehead { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.tracehead > svg { width: 110px; height: 110px; flex: none; background: #fff; padding: 4px; border-radius: 6px; }

/* Backup codes */
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .8rem; font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; }
.codes li { background: var(--tint, #eef1fb); border-radius: 8px; padding: .45rem .7rem; text-align: center; letter-spacing: .06em; }

/* Pages of a list */
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin: 1rem 0; }
.pager span { color: var(--ink2); font-size: .9rem; }
a.button.small { font-size: .72rem; padding: .15rem .55rem; vertical-align: middle; font-weight: 500; }
@media print { .pager { display: none; } }
/* A table of inputs becomes one card a row on a phone, each input under its own name */
@media (max-width: 760px) {
  table.lines.stack thead { display: none; }
  table.lines.stack, table.lines.stack tbody { display: block; }
  table.lines.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .6rem; padding: .7rem; border-bottom: 2px solid var(--rule); }
  table.lines.stack td { display: block; padding: 0; border: 0; }
  table.lines.stack td.wide { grid-column: 1 / -1; }
  table.lines.stack td::before { content: attr(data-th); display: block; font-size: .72rem; color: var(--ink2); margin-bottom: .15rem; }
}

table.lines td.grow input { min-width: 9.5rem; }
table.lines select { max-width: 15rem; }

/* A salesperson's running orders, one card each */
.ordercards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; align-items: start; }
.ordercard h2 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 0; }
.ordercard dl { margin: .4rem 0 .6rem; }
.stackform { display: grid; gap: .45rem; }
.stackform select, .stackform input { width: 100%; }

/* My desk: a phone screen for the sales team */
.desk { max-width: 46rem; }
.desklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.desklist .card { margin: 0; padding: .8rem .9rem; }
.desklist .card p { margin: .3rem 0; }
.desklist form.inline { display: flex; gap: .4rem; }
.desklist form.inline input { flex: 1; min-width: 0; }
@media (max-width: 760px) { .desk .toolbar .button { flex: 1; text-align: center; } }

/* Boutique job slip: one piece a page when printed */
.slip { max-width: 34rem; }
.sliphead { display: flex; justify-content: space-between; border-bottom: 2px solid var(--navy); padding-bottom: .3rem; margin-bottom: .5rem; }
.sliphead span { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--ink2); }
.measures { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem; }
.measures div { border: 1px solid var(--rule); border-radius: 8px; padding: .35rem .55rem; display: flex; flex-direction: column; }
.measures b { font-size: 1.15rem; }
.slipphoto { max-width: 100%; max-height: 16rem; margin-top: .7rem; border-radius: 8px; }
.slipfoot { color: var(--ink2); font-size: .8rem; margin-top: .8rem; }
@media print { .slip { break-after: page; box-shadow: none; border: 0; max-width: none; } .slip:last-child { break-after: auto; } }

/* ---------------------------------------------------------------- Icons, their colours and their movement
   Colour decision (23 November 2026). One brand palette, Atelier: navy #05113b, action blue #0b3df5, signal cyan
   #35e3ff on paper #f5f7fc. Midnight is its dark form; Auto follows the device. Silk and Khadi stay as personal
   choices. Each part of the application has one accent, used only for its icons: a bright tone on the dark menu
   (--gc) and a deep tone on the light page (--gcd). Green, amber and red are kept for good, warning and bad. */
[data-grp="home"] { --gc: #35e3ff; --gcd: #0b3df5; }
[data-grp="boutique"] { --gc: #ff9cc2; --gcd: #c2185b; }
[data-grp="sales"] { --gc: #8ab6ff; --gcd: #1f5fd6; }
[data-grp="production"] { --gc: #ffbe6b; --gcd: #b45f06; }
[data-grp="stores"] { --gc: #66e3cd; --gcd: #0f7a6a; }
[data-grp="finance"] { --gc: #8be696; --gcd: #2e7d32; }
[data-grp="marketing"] { --gc: #f3a6ff; --gcd: #9b2fae; }
[data-grp="service"] { --gc: #c2afff; --gcd: #5b3fd1; }
[data-grp="insight"] { --gc: #7fdcff; --gcd: #0b6fa8; }
[data-grp="setup"] { --gc: #cdd5ea; --gcd: #55607a; }
nav.side summary .ico { color: var(--gc, currentColor); }
nav.side details a.nl .ico { width: 1.02rem; height: 1.02rem; color: var(--gc, currentColor); opacity: .78; transition: opacity .16s ease, transform .2s ease, filter .2s ease; }
nav.side a.nl:hover .ico, nav.side a.nl.on .ico { opacity: 1; }
nav.side a.nl.on .ico { filter: drop-shadow(0 0 5px var(--gc, var(--glow))); }
nav.side a.nl.home .ico { color: var(--side-on); }
/* The page title carries the icon of its menu entry, on a chip in the colour of its part of the application. */
.h1ico { display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; margin-right: .65rem; vertical-align: -.5rem; border-radius: 12px; color: var(--gcd, var(--violet));
  background: color-mix(in srgb, var(--gcd, var(--violet)) 12%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gcd, var(--violet)) 22%, transparent); }
.h1ico .ico { width: 1.3rem; height: 1.3rem; stroke-width: 2; }
html[data-theme="midnight"] .h1ico { color: var(--gc, var(--violet)); background: color-mix(in srgb, var(--gc, var(--violet)) 16%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc, var(--violet)) 30%, transparent); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .h1ico { color: var(--gc, var(--violet)); background: color-mix(in srgb, var(--gc, var(--violet)) 16%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc, var(--violet)) 30%, transparent); } }
button.signout { display: inline-flex; align-items: center; gap: .35rem; }
button.signout .ico { width: 1rem; height: 1rem; }
/* Icons the stylesheet adds by what a thing is: print, download, PDF, phone, WhatsApp, map, and the three kinds of message. */
[data-print]::before, a[href$=".pdf"]::before, a[href*=".csv"]::before, a[href*="csv="]::before, a[href^="tel:"]::before, a[href^="https://wa.me"]::before, a[href^="https://www.google.com/maps"]::before,
.flash.ok::before, .flash.warn::before, .flash.err::before, p.empty::before {
  content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: .42em; vertical-align: -.16em; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
[data-print] { --i: url(/static/icons/printer.svg); }
a[href$=".pdf"] { --i: url(/static/icons/pdf.svg); }
a[href*=".csv"], a[href*="csv="] { --i: url(/static/icons/download.svg); }
a[href^="tel:"] { --i: url(/static/icons/phone.svg); }
a[href^="https://wa.me"] { --i: url(/static/icons/chat.svg); }
a[href^="https://www.google.com/maps"] { --i: url(/static/icons/map.svg); }
.flash.ok { --i: url(/static/icons/ok.svg); } .flash.warn { --i: url(/static/icons/warn.svg); } .flash.err { --i: url(/static/icons/err.svg); }
p.empty { --i: url(/static/icons/empty.svg); }
p.empty::before { width: 1.25em; height: 1.25em; opacity: .7; }
ul.flash::before { display: block; margin: 0 0 .3rem -1.1rem; }
.stat.bad::after, .stat.warn::after { content: ""; position: absolute; right: .7rem; top: .7rem; width: 1.05rem; height: 1.05rem; background: currentColor; opacity: .55;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.stat.bad::after { --i: url(/static/icons/warn.svg); color: var(--bad); } .stat.warn::after { --i: url(/static/icons/clock.svg); color: var(--warn); }
@media print { [data-print]::before, .h1ico { display: none; } }

/* Movement. Everything here stops for a person who chose Calm, and for a device set to reduce motion. */
@keyframes ico-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ico-pop { 0% { transform: scale(.6) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: none; } }
@keyframes ico-nudge { 0%, 100% { transform: none; } 30% { transform: translateY(-2px) rotate(-8deg); } 65% { transform: translateY(1px) rotate(6deg); } }
@keyframes ico-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }
@keyframes ico-in { from { transform: translateX(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ico-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
.ico.draw > * { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ico-draw .75s cubic-bezier(.4, 0, .2, 1) .12s forwards; }
.ico.draw > *:nth-child(2) { animation-delay: .22s; } .ico.draw > *:nth-child(3) { animation-delay: .32s; } .ico.draw > *:nth-child(n+4) { animation-delay: .42s; }
.h1ico { animation: ico-pop .5s cubic-bezier(.3, 1.4, .5, 1) both; }
nav.side a.nl:hover .ico, nav.side summary:hover .ico, header.top a.tool:hover .ico, button.signout:hover .ico { animation: ico-nudge .55s ease; }
nav.side details.just-open > a.nl { animation: ico-in .28s ease backwards; }
nav.side details.just-open > a.nl:nth-of-type(2) { animation-delay: .03s; } nav.side details.just-open > a.nl:nth-of-type(3) { animation-delay: .06s; } nav.side details.just-open > a.nl:nth-of-type(4) { animation-delay: .09s; }
nav.side details.just-open > a.nl:nth-of-type(5) { animation-delay: .12s; } nav.side details.just-open > a.nl:nth-of-type(6) { animation-delay: .15s; } nav.side details.just-open > a.nl:nth-of-type(n+7) { animation-delay: .18s; }
header.top a.alerts.has .ico { transform-origin: 50% 10%; animation: ico-ring 1.6s ease 1s 2; }
header.top a.alerts:hover .ico { transform-origin: 50% 10%; animation: ico-ring .9s ease; }
[data-print]:hover::before, a[href^="tel:"]:hover::before, a[href^="https://wa.me"]:hover::before { animation: ico-nudge .55s ease; }
a[href$=".pdf"]:hover::before, a[href*=".csv"]:hover::before, a[href*="csv="]:hover::before { animation: ico-bob .5s ease 2; }
.flash.ok::before, .flash.warn::before, .flash.err::before { animation: ico-pop .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.stat:hover::after { animation: ico-nudge .55s ease; }
html[data-motion="calm"] .ico.draw > * { stroke-dasharray: none; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .ico.draw > * { stroke-dasharray: none; stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------- The front page: what it does, with sign-in and sign-up */
body.landing main { max-width: 1160px; padding: 1.2rem 1.2rem 2rem; }
.land { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 2.4rem; align-items: start; padding-top: 3vh; }
.land-hero { color: #fff; }
.land-logo { width: 190px; height: auto; display: block; margin: 0 0 1.4rem -.4rem; }
body.landing .land-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.15; margin: 0 0 .8rem; color: #fff; display: block; letter-spacing: -.01em; }
.land-lead { font-size: 1.05rem; line-height: 1.6; color: #d7def5; max-width: 38rem; margin: 0 0 1.6rem; }
.land-points { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.4rem; }
.land-points li { display: flex; gap: .7rem; align-items: flex-start; }
.land-points .ico { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; padding: .45rem; border-radius: 10px; color: #35e3ff; background: rgba(53, 227, 255, .1); box-shadow: inset 0 0 0 1px rgba(53, 227, 255, .28); }
.land-points b { display: block; font-size: .95rem; color: #fff; } .land-points span { display: block; font-size: .85rem; line-height: 1.45; color: #b9c3e6; }
.land-editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.land-editions > div { border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: .8rem .95rem; background: rgba(255, 255, 255, .05); }
.land-editions b { display: flex; align-items: center; gap: .45rem; color: #fff; font-size: .95rem; margin-bottom: .25rem; } .land-editions .ico { width: 1.05rem; height: 1.05rem; color: #35e3ff; }
.land-editions span { font-size: .85rem; line-height: 1.45; color: #b9c3e6; display: block; }
.land-auth.card { padding: 1.4rem 1.5rem 1.5rem; border: none; border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); position: sticky; top: 1.2rem; }
.land-radio { position: absolute; opacity: 0; pointer-events: none; }
.land-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; background: var(--tint); border-radius: 10px; padding: .28rem; margin-bottom: 1rem; }
.land-tabs label { text-align: center; padding: .5rem .6rem; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--ink2); cursor: pointer; transition: background .15s ease, color .15s ease; }
#land-in:checked ~ .land-tabs label[for="land-in"], #land-up:checked ~ .land-tabs label[for="land-up"] { background: var(--card); color: var(--violet); box-shadow: 0 1px 4px rgba(5, 17, 59, .14); }
#land-in:focus-visible ~ .land-tabs label[for="land-in"], #land-up:focus-visible ~ .land-tabs label[for="land-up"] { outline: 2px solid var(--violet); outline-offset: 2px; }
.land-pane { display: none; flex-direction: column; gap: .7rem; }
#land-in:checked ~ .land-pane-in, #land-up:checked ~ .land-pane-up { display: flex; }
.land-pane h2 { margin: 0; font-size: 1.25rem; } .land-pane > p { margin: 0; } .land-pane .small { font-size: .82rem; }
.land-pane button.primary { margin-top: .3rem; padding: .7rem 1rem; font-size: 1rem; }
.land-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.land-foot { margin: 2.2rem 0 0; font-size: .82rem; color: #9aa6d1; text-align: center; } .land-foot a { color: #cfe9ff; }
/* Movement only: the page stays readable where animations do not run. */
@keyframes land-rise { from { transform: translateY(12px); } to { transform: none; } }
.land-hero > *, .land-auth { animation: land-rise .5s ease both; } .land-hero > :nth-child(2) { animation-delay: .05s; } .land-hero > :nth-child(3) { animation-delay: .1s; } .land-hero > :nth-child(4) { animation-delay: .15s; } .land-hero > :nth-child(5) { animation-delay: .2s; } .land-auth { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { .land-hero > *, .land-auth { animation: none; } }
@media (max-width: 880px) { .land { grid-template-columns: 1fr; gap: 1.4rem; padding-top: 0; } .land-auth.card { position: static; order: -1; } .land-logo { width: 150px; margin-bottom: 1rem; } .land-points, .land-editions { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Quick replies and the shop-floor wall display */
details.replies { margin: .6rem 0; }
details.replies .reply { border: 1px solid var(--rule); border-radius: 10px; padding: .55rem .75rem; margin: .45rem 0; background: var(--card); }
details.replies .reply p { margin: .25rem 0 .45rem; white-space: pre-wrap; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .8rem; }
.wallcard { border: 1px solid var(--rule); border-left: 6px solid var(--field-line); border-radius: 12px; padding: .8rem 1rem; background: var(--card); }
.wallcard.urgent { border-left-color: var(--warn); } .wallcard.late { border-left-color: var(--bad); }
.wallhead { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; }
.wallprod { color: var(--ink2); margin: .15rem 0 .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallstage { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.wallnum { font-size: 1.15rem; margin: .2rem 0 .4rem; } .wallnum b { font-size: 2rem; }
.wallfoot { font-size: .85rem; color: var(--ink2); }
html.wallmode nav.side, html.wallmode header.top, html.wallmode h1 { display: none; }
html.wallmode body { display: block; } html.wallmode main { max-width: none; padding: 1rem 1.2rem; }
html.wallmode .wall { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); } html.wallmode .wallstage { font-size: 1.9rem; } html.wallmode .wallnum b { font-size: 2.6rem; }

/* ---------------------------------------------------------------- Enquiry board: one column a stage */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: .7rem; overflow-x: auto; padding-bottom: .6rem; align-items: start; }
.bcol { background: var(--tint); border: 1px solid var(--rule); border-radius: 12px; padding: .55rem; min-height: 9rem; display: flex; flex-direction: column; gap: .5rem; transition: box-shadow .15s ease, background .15s ease; }
.bcol.over { box-shadow: 0 0 0 2px var(--violet); background: color-mix(in srgb, var(--violet) 8%, var(--tint)); }
.bcol h2 { font-size: .86rem; margin: .1rem .2rem .2rem; display: flex; justify-content: space-between; align-items: baseline; } .bcol h2 small { color: var(--ink2); font-weight: 600; }
.bcard { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: .5rem .6rem; display: flex; flex-direction: column; gap: .15rem; font-size: .88rem; }
.bcard[draggable="true"] { cursor: grab; } .bcard.dragging { opacity: .45; }
.bcard small { font-size: .78rem; } .bcard form { margin-top: .3rem; } .bcard select { width: 100%; font-size: .8rem; padding: .2rem .3rem; }
.bempty { margin: .2rem; font-size: .8rem; }
.toolbar a.on { font-weight: 700; text-decoration: underline; }

/* A voice note in the stage history */
audio { height: 2rem; max-width: 230px; vertical-align: middle; }
.voice small { color: var(--ink2); }

/* Style card (MU-17) */
.stylepick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-end; }
.stylepick > span { flex-basis: 100%; font-weight: 600; font-size: .85rem; }
.stylepick button { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .3rem .4rem; min-width: 4.6rem; background: var(--card, transparent); border: 1px solid var(--line, currentColor); border-radius: .5rem; color: inherit; cursor: pointer; }
.stylepick button.on { border-color: var(--accent, currentColor); box-shadow: 0 0 0 2px var(--accent, currentColor) inset; }
.stylepick svg, .stylecard svg { width: 3.2rem; height: 3.2rem; }
.sc-line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.sc-thin { fill: none; stroke: currentColor; stroke-width: 1.1; opacity: .7; }
.sc-fill { fill: currentColor; fill-opacity: .28; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.stylecard { display: flex; flex-wrap: wrap; gap: .8rem; margin: .4rem 0; }
.stylecard figure { margin: 0; text-align: center; font-size: .8rem; }

/* Inbox thread (CM-01): the customer's words on the left, the company's on the right. */
.thread { display: flex; flex-direction: column; gap: .6rem; max-height: 65vh; overflow-y: auto; }
.thread .msg { max-width: min(34rem, 85%); padding: .55rem .8rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--mute-bg); overflow-wrap: anywhere; }
.thread .msg.out { align-self: flex-end; background: var(--info-bg); }
.thread .msg p { margin: 0 0 .25rem; white-space: pre-wrap; }
.thread .msg a { display: block; margin-bottom: .25rem; }
.thread .msg small { color: var(--ink2); }

/* Pay by UPI on the customer's copy of an invoice (CM-04). */
.card.pay .qr { text-align: right; } .card.pay .qr svg { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; }
