/* Inter (SIL Open Font License 1.1), self-hosted. One font for all Amuulai apps; covers Mongolian Cyrillic (Ө ө Ү ү) and ₮. */
@font-face{font-family:"Inter";font-style:normal;font-weight:100 900;font-display:swap;src:url("/fonts/inter-cyrillic-ext.woff2") format("woff2");unicode-range:U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;}
@font-face{font-family:"Inter";font-style:normal;font-weight:100 900;font-display:swap;src:url("/fonts/inter-cyrillic.woff2") format("woff2");unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:"Inter";font-style:normal;font-weight:100 900;font-display:swap;src:url("/fonts/inter-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:"Inter";font-style:normal;font-weight:100 900;font-display:swap;src:url("/fonts/inter-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}

/* Colours. The page always carries data-theme="light" or "dark" (Auto picks
   the device's setting in app.js), and data-contrast="high" when someone
   turns on high contrast. Text colours meet WCAG AA (4.5:1) on their
   backgrounds in every mode; high contrast goes to AAA (7:1) for body text. */
:root {
  --bg: #f2f5f4;
  --panel: #ffffff;
  --panel-2: #f5f8f7;
  --line: #d9e1df;
  --line-2: #7d8a87;
  --text: #111b19;
  --muted: #4e5b58;
  --brand: #0b6b63;
  --brand-ink: #ffffff;
  --brand-soft: #dff1ee;
  --side: #0f3d3a;
  --side-2: #14504c;
  --side-text: #e3f1ee;
  --side-muted: #a9cbc5;
  --good: #166534;
  --good-soft: #dcfce7;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --violet: #6d28d9;
  --violet-soft: #ede9fe;
  --shadow: 0 1px 2px rgba(16, 24, 22, .07), 0 4px 16px rgba(16, 24, 22, .07);
  --radius: 12px;
  --focus: #0b6b63;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1413;
  --panel: #141e1c;
  --panel-2: #18231f;
  --line: #2a3a36;
  --line-2: #66837d;
  --text: #e8f0ee;
  --muted: #a3b3af;
  --brand: #2dd4bf;
  --brand-ink: #062b27;
  --brand-soft: #123a35;
  --side: #0a1a18;
  --side-2: #12302c;
  --side-text: #e3f1ee;
  --side-muted: #9cbab5;
  --good: #4ade80; --good-soft: #143322;
  --warn: #fbbf24; --warn-soft: #3a2c0c;
  --bad: #fca5a5; --bad-soft: #3d1717;
  --info: #93c5fd; --info-soft: #172a4a;
  --violet: #c4b5fd; --violet-soft: #2a2148;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --focus: #5eead4;
  color-scheme: dark;
}
/* High contrast: plain backgrounds, near-black / near-white text, strong borders. */
:root[data-contrast="high"] {
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f1f4f3;
  --line: #6b7774; --line-2: #3f4a47;
  --text: #000000; --muted: #263230;
  --brand: #00524a; --brand-ink: #ffffff; --brand-soft: #d4ece8;
  --side: #04201d; --side-2: #0b3b36; --side-text: #ffffff; --side-muted: #d7ece8;
  --good: #0b4d27; --good-soft: #d1f5dd; --warn: #6b2b04; --warn-soft: #fdeec0;
  --bad: #8a0f0f; --bad-soft: #fde0e0; --info: #1239a6; --info-soft: #d9e6fd;
  --violet: #4c1d95; --violet-soft: #e7e1fd;
  --focus: #000000;
}
:root[data-theme="dark"][data-contrast="high"] {
  --bg: #000000; --panel: #0a0f0e; --panel-2: #121917;
  --line: #64746f; --line-2: #9aaaa6;
  --text: #ffffff; --muted: #d3dfdc;
  --brand: #5eead4; --brand-ink: #00201c; --brand-soft: #0e3b35;
  --side: #000000; --side-2: #10302c; --side-text: #ffffff; --side-muted: #d3e6e2;
  --good: #86efac; --good-soft: #0f2c1b; --warn: #fcd34d; --warn-soft: #33270a;
  --bad: #fecaca; --bad-soft: #3a1414; --info: #bfdbfe; --info-soft: #13254a;
  --violet: #ddd6fe; --violet-soft: #251c45;
  --focus: #ffffff;
}
:root[data-contrast="high"] :focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; }
:root[data-contrast="high"] .view a:not(.btn):not(.ch):not(.tile):not(.need):not(.snap-row):not(.search-hit):not(.seg a) { text-decoration: underline; }
:root[data-contrast="high"] .btn, :root[data-contrast="high"] input, :root[data-contrast="high"] select, :root[data-contrast="high"] textarea { border-width: 2px; }
:root:not([data-contrast="high"]) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
/* The page keeps its size on a phone: scrolling only, no pinch or double-tap zoom, no text resizing when turned sideways. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.late { color: var(--bad); }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ic.big { width: 36px; height: 36px; opacity: .35; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); font-weight: 600; letter-spacing: 2px; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); cursor: pointer;
  font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; height: 40px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; cursor: pointer; color: inherit; position: relative;
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.xs .ic { width: 15px; height: 15px; }
.icon-btn.primary { background: var(--brand); color: var(--brand-ink); }
.link-btn { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 4px 0; display: inline-flex; gap: 6px; align-items: center; }

label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]), select, textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); font-size: 14px; font-weight: 400; color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 0; border-color: var(--brand); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 14px; }
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 2px 14px; }

/* Chips */
.chip {
  display: inline-block; vertical-align: middle; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap; max-width: min(220px, 100%); overflow: hidden; text-overflow: ellipsis;
}
.chip .ic { width: 12px; height: 12px; vertical-align: -2px; margin-right: 2px; }
.chip.soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.st-live, .st-doing { background: var(--good-soft); color: var(--good); border-color: transparent; }
.st-planning, .st-todo { background: var(--info-soft); color: var(--info); border-color: transparent; }
.st-review { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.st-done { background: var(--panel-2); color: var(--muted); }
.st-cancelled { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pr-urgent { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pr-high { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pr-low { opacity: .8; }
.co-mild { background: #fde7f0; color: #be185d; border-color: transparent; }
.co-genki { background: #e0f2fe; color: #075985; border-color: transparent; }
.co-distribution { background: #fef3c7; color: #854d0e; border-color: transparent; }
.co-group { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
:root[data-theme="dark"] .co-mild { background: #3b1426; color: #f9a8d4; }
:root[data-theme="dark"] .co-genki { background: #0c2a3d; color: #7dd3fc; }
:root[data-theme="dark"] .co-distribution { background: #3a2c0c; color: #fcd34d; }

/* Avatars */
.av {
  --h: 170; position: relative; display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; font-size: 13px; font-weight: 700;
  background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 60% 28%);
}
:root[data-theme="dark"] .av { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 70% 82%); }
.av.xs { width: 22px; height: 22px; font-size: 9.5px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 44px; height: 44px; font-size: 16px; }
.av .on { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; border: 2px solid var(--panel); }
.av.xs .on { width: 7px; height: 7px; }
.team { display: inline-flex; }
.team .av { margin-left: -6px; border: 2px solid var(--panel); }
.team .av:first-child { margin-left: 0; }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: min(380px, 100%); display: grid; gap: 14px; background: var(--panel); padding: 28px; border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.auth-card.in-modal { box-shadow: none; border: 0; padding: 4px; width: 100%; }
.auth-foot { display: flex; justify-content: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 16px; letter-spacing: .3px; }
.brand small { display: block; font-size: 11px; opacity: .7; letter-spacing: 1.5px; text-transform: uppercase; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #5eead4; color: #0f3d3a; }
.logo svg { width: 26px; height: 26px; }
.brand.big .logo { width: 44px; height: 44px; border-radius: 12px; }
.brand.big b { font-size: 20px; }

/* Layout */
.app { display: grid; grid-template-columns: 260px 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; min-height: 0; }
.side .brand { padding: 16px 16px 12px; color: #fff; }
.nav { display: grid; gap: 2px; padding: 4px 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.nav a, .ch {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--side-text);
  text-decoration: none; font-size: 14px; min-width: 0;
}
.nav a:hover, .ch:hover { background: var(--side-2); text-decoration: none; }
.nav a.active, .ch.active { background: rgba(94, 234, 212, .16); color: #fff; }
.nav a > span, .ch > span:not(.av) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { background: #5eead4; color: #0f3d3a; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; font-weight: 700; }
.count:empty { display: none; }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.side-group { margin-top: 10px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--side-muted); font-weight: 700; }
.side-head .icon-btn { color: var(--side-muted); }
.side-head .icon-btn:hover { background: var(--side-2); color: #fff; }
.ch { padding: 5px 10px; font-size: 13.5px; }
.ch .ic { width: 15px; height: 15px; opacity: .7; }
.ch.unread { color: #fff; font-weight: 700; }
.ch .av { border: 0; }
.ch .av .on { border-color: var(--side); }
.side-empty { padding: 4px 10px; font-size: 12.5px; color: var(--side-muted); }
.side-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 10px; background: transparent; color: var(--side-text); cursor: pointer; text-align: left; }
.me:hover { background: var(--side-2); }
.me b { display: block; color: #fff; font-size: 13.5px; }
.me small { display: block; color: var(--side-muted); font-size: 12px; }
.me .av .on { border-color: var(--side); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.top h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.bell .dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10px; line-height: 17px; text-align: center; padding: 0 4px; }
.bell .dot:empty { display: none; }
.view { flex: 1; overflow-y: auto; padding: 22px 24px 40px; min-height: 0; }
/* The Mild dashboard page: the dashboard fills the whole area and scrolls itself. */
.view.flush { padding: 0; overflow: hidden; display: flex; }
.view[hidden], #dash-host[hidden], #loyalty-host[hidden], .app-host[hidden], .dates[hidden] { display: none !important; }
.app-host { display: flex; flex-direction: column; }
.app-host-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line, #ddd); flex-wrap: wrap; }
.app-host-bar .grow { flex: 1; }
.dash-frame { flex: 1; width: 100%; height: 100%; border: 0; display: block; background: var(--bg, #fff); }
.mobile-only { display: none; }
.scrim { display: none; }

/* Home and panels */
.hello { margin-bottom: 16px; }
.hello h2 { font-size: 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile {
  display: grid; gap: 2px; align-content: start; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); min-width: 0;
}
a.tile:hover { text-decoration: none; border-color: var(--brand); }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 24px; font-weight: 750; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12.5px; color: var(--muted); }
.tile-foot { font-size: 12px; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.tile.good .tile-sub b, .tile.good .tile-sub { color: var(--good); }
.tile.warn .tile-sub { color: var(--warn); }
.tile.bad .tile-sub { color: var(--bad); }
.tile.accent .tile-value { color: var(--brand); }
.tile .bar { margin-top: 8px; }
/* A company's figures: the big one twice as wide, the rest share the row,
   so there is never one small tile left alone on a line. */
.kpis { display: flex; flex-wrap: wrap; }
.kpis > .tile { flex: 1 1 170px; }
.kpis > .tile.big { flex: 2 1 340px; }
.kpis .tile.big .tile-value { font-size: 30px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.cols .panel { margin-bottom: 0; }
.panel.narrow { max-width: 860px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head.sub { margin: 18px 0 8px; }
.panel-head h3 { display: flex; align-items: center; gap: 8px; }
.prose { white-space: normal; word-wrap: break-word; }
.empty { display: grid; place-items: center; gap: 6px; padding: 28px 10px; color: var(--muted); text-align: center; }

.task-list { display: grid; }
.task-line { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.task-line:last-child { border-bottom: 0; }
.task-line.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.task-meta { display: flex; align-items: center; gap: 6px; flex: none; }
.check {
  width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--line-2); background: transparent;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; cursor: pointer; padding: 0;
}
.check:hover { border-color: var(--brand); }
.check.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.due .ic { width: 13px; height: 13px; }
.due.late { color: var(--bad); font-weight: 600; }

.bar { position: relative; height: 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: visible; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); max-width: 100%; }
.bar.good > span { background: var(--good); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.bar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .55; border-radius: 2px; }

.camp-mini { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; color: var(--text); }
.camp-mini:hover { border-color: var(--brand); text-decoration: none; }
.camp-mini-head, .camp-mini-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.camp-mini-row.muted { font-size: 12px; }

/* Toolbar, segmented control */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input[type=search] { width: auto; min-width: 180px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }

/* Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.col.over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.col-head b { color: var(--muted); font-weight: 600; }
.col-head .icon-btn { margin-left: auto; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; padding: 0; border: 0; }
.dot.st-todo { background: var(--info); } .dot.st-doing { background: var(--good); } .dot.st-review { background: var(--violet); } .dot.st-done { background: var(--muted); }
.col-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 10px 12px; align-content: start; flex: 1; }
.col-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 20px 0; border: 1px dashed var(--line-2); border-radius: 8px; }
.card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 9px; cursor: grab; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.card:hover { border-color: var(--line-2); }
.card.dragging { opacity: .5; }
.card.pr-edge-urgent { border-left-color: var(--bad); }
.card.pr-edge-high { border-left-color: var(--warn); }
.card.pr-edge-normal { border-left-color: var(--brand); }
.card-title { color: var(--text); font-weight: 600; line-height: 1.35; word-wrap: break-word; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.card-meta:empty { display: none; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.card-right { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.card-right .ic { width: 13px; height: 13px; margin-right: 2px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.done td { color: var(--muted); }
.table .r, .table.num td:not(:first-child):not(.l), .table.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.table .av { margin-right: 4px; vertical-align: middle; }

/* Campaigns */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.camp-card { display: grid; gap: 8px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); align-content: start; }
.camp-card:hover { border-color: var(--brand); text-decoration: none; }
.camp-card h3 { font-size: 16px; }
.camp-top { display: flex; flex-wrap: wrap; gap: 5px; }
.kv { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; font-size: 13px; margin-top: 4px; }
.kv span { color: var(--muted); }
.kv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.kv em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--muted); }
.camp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.camp-foot .ic { width: 14px; height: 14px; margin-right: 3px; }
.camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.camp-head p { margin-top: 8px; }
.camp-head .ic { width: 15px; height: 15px; }
.camp-actions { display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.hbar { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.inline-form .wide { grid-column: span 2; }
.inline-form .check-label { min-height: 36px; }
.mild-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mild-row div { display: grid; gap: 2px; }
.mild-row b { font-size: 17px; font-variant-numeric: tabular-nums; }
.room-embed { height: calc(100vh - 290px); min-height: 380px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }

/* Chat */
.chat-page { height: 100%; margin: -22px -24px -40px; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex: none; }
.chat-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-head .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages { flex: 1; overflow-y: auto; padding: 10px 0 14px; min-height: 0; }
.more { display: block; margin: 4px auto 10px; }
.msg { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 6px 18px 2px; }
.msg:hover { background: var(--panel-2); }
.msg.grouped { padding-top: 1px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head b { font-size: 14px; }
.msg-head time, .side-time, .msg time { font-size: 11.5px; color: var(--muted); }
.side-time { opacity: 0; text-align: right; padding-top: 3px; font-size: 10.5px; }
.msg:hover .side-time { opacity: 1; }
.msg-text { word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.5; }
.msg-tools { position: absolute; right: 14px; top: -10px; display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); }
.msg:hover .msg-tools { display: flex; }
.msg.sys { display: flex; gap: 8px; align-items: baseline; justify-content: center; flex-wrap: wrap; padding: 6px 18px; color: var(--muted); font-size: 12.5px; text-align: center; }
.msg.sys:hover { background: transparent; }
.mention { background: var(--brand-soft); color: var(--brand); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.self { background: var(--warn-soft); color: var(--warn); }
.day-sep { display: flex; align-items: center; gap: 10px; margin: 14px 18px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.composer { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 14px; flex: none; }
.composer textarea { min-height: 42px; max-height: 200px; resize: none; padding: 10px 12px; border-radius: 10px; }
.composer .icon-btn { width: 42px; height: 42px; border-radius: 10px; }
.composer.small { padding: 10px 0 0; }
.mention-box { position: absolute; bottom: calc(100% - 6px); left: 14px; width: 280px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; z-index: 30; }
.mention-box button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.mention-box button small { color: var(--muted); }
.mention-box button.sel, .mention-box button:hover { background: var(--brand-soft); }

/* Task modal thread */
.thread { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.thread-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.thread-list { display: grid; gap: 10px; max-height: 300px; overflow-y: auto; }
.cmt { display: grid; grid-template-columns: 28px 1fr; gap: 8px; }
.cmt.sys { display: block; font-size: 12px; color: var(--muted); padding-left: 36px; }
.cmt.sys b { color: var(--text); font-weight: 600; }
.cmt time { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* People */
.group-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.person.inactive { opacity: .5; }
.person-info { display: grid; flex: 1; min-width: 0; }
.person-info span { font-size: 13px; color: var(--muted); }
.person-info small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.team-search { margin-bottom: 6px; }
.team-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; max-height: 210px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.team-pick.tall { max-height: 50vh; grid-template-columns: 1fr; margin-top: 8px; }
.person-pick { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--text); font-size: 13px; border: 0; background: transparent; text-align: left; width: 100%; }
.person-pick:hover { background: var(--panel-2); }
.person-pick span { display: grid; min-width: 0; }
.person-pick small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.secret { display: grid; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 14px 0; }
.secret div { display: grid; gap: 2px; }
.secret b { font-size: 16px; }
.sync-state { font-size: 12.5px; color: var(--muted); }

/* Modal, popover, toasts */
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 18, .45); display: grid; place-items: start center; padding: 6vh 16px 16px; overflow-y: auto; z-index: 50; animation: fade .12s ease-out; }
.modal { width: min(520px, 100%); background: var(--panel); border-radius: 16px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { flex: 1; font-size: 18px; }
.title-input { font-size: 18px !important; font-weight: 700 !important; border-color: transparent !important; padding-left: 4px !important; background: transparent !important; }
.title-input:focus { border-color: var(--brand) !important; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.popover { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 16px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); padding: 6px; animation: fade .1s ease-out; }
.pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
.pop-list { max-height: 60vh; overflow-y: auto; }
.pop-item, .pop-ask { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
.pop-item:hover, .pop-ask:hover { background: var(--panel-2); }
.pop-ask { color: var(--brand); font-weight: 600; }
.note { display: grid; gap: 2px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
.note:hover { background: var(--panel-2); }
.note.unread { background: var(--brand-soft); }
.note span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note time { font-size: 11px; color: var(--muted); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 70; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; animation: slide .18s ease-out; transition: opacity .4s, transform .4s; }
.toast.clickable { cursor: pointer; }
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

/* Channel colours, shared by chips, charts and legends */
:root { --c-mild: #db2777; --c-genki: #0284c7; --c-distribution: #d97706; }
:root[data-theme="dark"] { --c-mild: #f472b6; --c-genki: #38bdf8; --c-distribution: #fbbf24; }
.s-mild { fill: var(--c-mild); background: var(--c-mild); }
.s-genki { fill: var(--c-genki); background: var(--c-genki); }
.s-distribution { fill: var(--c-distribution); background: var(--c-distribution); }

/* Sales */
.seg a { padding: 5px 12px; border-radius: 6px; font-weight: 600; color: var(--muted); font-size: 13px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--brand); color: var(--brand-ink); }
.dates { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dates input { width: 150px; min-height: 34px; padding: 4px 8px; }
.sales-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.sales-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sales-grid.n1 { grid-template-columns: minmax(0, 1fr); }
.sales-grid .hero { grid-column: 1 / -1; }
.tile.hero .tile-value { font-size: 34px; }
.tile.hero .bar { max-width: 640px; }
.ch-tile { gap: 4px; border-top: 3px solid var(--line-2); }
.ch-tile .chip { max-width: none; }
.ch-tile:has(.co-mild) { border-top-color: var(--c-mild); }
.ch-tile:has(.co-genki) { border-top-color: var(--c-genki); }
.ch-tile:has(.co-distribution) { border-top-color: var(--c-distribution); }
.ch-tile.off { align-content: start; gap: 10px; }
.ch-tile-head { display: flex; align-items: center; gap: 8px; }
.ch-tile-head .icon-btn { margin-left: auto; color: var(--muted); }
.ch-tile-head a.chip:hover { text-decoration: none; filter: brightness(.95); }
.tile-value.plain { color: var(--text); }
.tile-value.plain:hover { text-decoration: none; color: var(--brand); }
.tile .tile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tile.good .tile-sub, .tile.warn .tile-sub, .tile.bad .tile-sub { font-weight: 600; }
.tile-foot small { color: var(--muted); font-weight: 400; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.pct { font-weight: 700; }
.pct.good { color: var(--good); } .pct.warn { color: var(--warn); } .pct.bad { color: var(--bad); }
.note-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.note-bar.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.note-bar.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.note-bar small { opacity: .8; }
.note-bar .ic { width: 15px; height: 15px; }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; max-height: 300px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; }
.chart .hit { fill: transparent; }
.chart g:hover .hit { fill: var(--text); opacity: .05; }
.chart .l-target { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 6 4; opacity: .7; vector-effect: non-scaling-stroke; }
.chart .l-prev { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw.l-target { height: 0; width: 16px; border-top: 2px dashed var(--text); border-radius: 0; opacity: .7; }
.sw.l-prev { height: 0; width: 16px; border-top: 2px dotted var(--muted); border-radius: 0; }
.tile-foot .sw { margin-right: 4px; vertical-align: 0; width: 8px; height: 8px; }

.find { width: 200px !important; min-height: 32px !important; padding: 5px 10px !important; }
.rank-wrap { max-height: 560px; overflow-y: auto; }
.table.rank td { padding: 7px 8px; }
.table.rank th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.table td.l { text-align: left !important; }
.table td small { font-weight: 400; }
.more-row { display: none; }
.show-all .more-row, .filtering .more-row { display: table-row; }
.filtering .more-row[hidden] { display: none; }
.filtering .more-toggle { display: none; }
.share { display: inline-block; width: 46px; height: 6px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); margin-right: 6px; vertical-align: middle; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--brand); opacity: .7; }

.snap-rows { display: grid; gap: 2px; }
.snap-row { display: grid; grid-template-columns: 120px 130px minmax(80px, 1fr) minmax(150px, auto); align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; color: var(--text); }
a.snap-row:hover { background: var(--panel-2); text-decoration: none; }
.snap-row b { font-size: 16px; font-variant-numeric: tabular-nums; }
.snap-row .chip { justify-self: start; }
.snap-row.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-weight: 600; }
.snap-row.off { grid-template-columns: 120px 1fr; }
.snap-bar .bar { margin: 0; }

.msg-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--panel); }
.msg-link:hover { text-decoration: none; border-color: var(--brand); }
.msg-link .ic { width: 15px; height: 15px; }

.brand-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 10px; max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.brand-pick label { font-size: 13px; font-weight: 500; padding: 3px 0; align-items: flex-start; }
.brand-pick label input { margin-top: 2px; }
.brand-pick label.from-mild span { color: var(--brand); }
.brand-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.sub-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 12px 0 0; }
.feed-card { display: grid; gap: 10px; align-content: start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.facts { display: grid; gap: 4px; margin: 0; font-size: 13px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.link-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.wrap { word-break: break-all; }
.ch.ext .ic { opacity: .55; }
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Phones and small tablets */
/* Files and photos */
.composer { flex-wrap: wrap; }
.composer textarea { flex: 1; min-width: 0; }
.att-pending { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.att-pending[hidden] { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 4px 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 12.5px; }
.att-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att-chip small { color: var(--muted); white-space: nowrap; }
.att-chip.busy { opacity: .7; padding-right: 8px; }
.att { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: 4px; }
.att-wrap { position: relative; display: inline-flex; max-width: 100%; }
.att-img img { display: block; max-width: min(280px, 64vw); max-height: 220px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.att-file { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: inherit; text-decoration: none; font-size: 13px; }
.att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att-file small { color: var(--muted); white-space: nowrap; }
.att-file:hover { border-color: var(--brand); }
.att-x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); }
.att-x .ic { width: 12px; height: 12px; }
.att-field { display: grid; gap: 8px; justify-items: start; }
.inline-form .att-pending { grid-column: 1 / -1; }
.receipts { white-space: nowrap; }
.receipts .att-wrap { margin-right: 6px; vertical-align: middle; }
.receipt { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel-2); color: var(--muted); }
.receipt img { width: 100%; height: 100%; object-fit: cover; }

/* The office PC and the links that open only in the office */
.office-pc { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); margin: 12px 0 8px; }
.office-pc .agent-row { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.office-pc .agent-row .btn { justify-self: start; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; }
.office-pc code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; word-break: break-all; }
.path-more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.path-more[open] { display: grid; gap: 8px; }
.path-more .btn { justify-self: start; }
.side-sub { display: flex; align-items: center; gap: 6px; padding: 8px 10px 2px; font-size: 11px; color: var(--side-muted); }
.side-sub .ic { width: 13px; height: 13px; }
.secret .btn { justify-self: start; margin-top: 2px; }
.version { text-align: center; margin: 4px 0 20px; }

/* Admin */
.people-table td { vertical-align: top; }
.people-table .av { vertical-align: middle; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.role-card { display: grid; gap: 8px; align-content: start; margin: 0; }
.role-card.off { opacity: .65; }
.role-card .modal-actions { margin-top: auto; }
/* Admin › Data import */
.import-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.import-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); }
.import-row:last-child { border-bottom: 0; }
.warn-text { color: var(--warn); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chips .chip { max-width: none; white-space: normal; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.plan-steps { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 13px; }
.steps-edit { display: grid; gap: 6px; margin: 6px 0; }
.step-row { display: grid; grid-template-columns: minmax(0, 1.5fr) 58px minmax(0, 1.1fr) minmax(0, .9fr) 28px; gap: 6px; align-items: center; }
.cols-hint { display: flex; flex-wrap: wrap; gap: 4px; }
.bulk-preview { min-height: 18px; margin-top: 6px; }
.checks.col { flex-direction: column; gap: 6px; }
.team-pick.short { max-height: 170px; }
.cal-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal-link input { flex: 1 1 260px; font-size: 12px; }
.cal-link small { flex-basis: 100%; }
.kd { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.kd.kd-retail { background: var(--violet); }
.print-only { display: none; }

/* Tasks: followers and checklist */
.watchers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.watchers select { width: auto; min-width: 160px; }
.person-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); font-size: 12.5px; }
.person-chip small { color: var(--muted); }
.person-chip.r-yes { border-color: var(--good); }
.person-chip.r-no { opacity: .6; text-decoration: line-through; }
.person-chip.r-maybe { border-style: dashed; }
.check-items { display: grid; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 6px; }
.check-row:hover { background: var(--panel-2); }
.check-row span { flex: 1; }
.check-row.done span { text-decoration: line-through; color: var(--muted); }
.check-row input { width: auto; }
.check-new { display: flex; gap: 6px; }
.card-right .ok { color: var(--good); }

/* Calendar */
.cal-toolbar .cal-title { margin: 0 6px; font-size: 17px; min-width: 150px; }
.cal-toolbar select { width: auto; max-width: 240px; }
.cal-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.kind-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.kind-toggle i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.kind-toggle.k-campaign i { background: var(--c-mild); }
.kind-toggle.k-task i { background: var(--info); }
.kind-toggle.k-stock i { background: var(--warn); }
.kind-toggle.k-keydate i { background: var(--bad); }
.kind-toggle.off { opacity: .45; }
.kind-toggle.off i { background: var(--line-2); }
.cal-month { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-week-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week-head span { padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.cal-day { position: relative; min-height: 112px; padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--panel-2); }
.cal-day.other .cal-num { color: var(--muted); }
.cal-day.today .cal-num { background: var(--brand); color: var(--brand-ink); }
.cal-day.kd-holiday { background: color-mix(in srgb, var(--bad-soft) 45%, transparent); }
.cal-day.kd-retail { background: color-mix(in srgb, var(--violet-soft) 45%, transparent); }
.cal-day-head { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-num { border: 0; background: transparent; font-weight: 700; font-size: 12.5px; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--text); flex: none; }
.cal-hol { font-size: 10.5px; color: var(--bad); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-retail .cal-hol { color: var(--violet); }
.cal-item { display: block; width: 100%; text-align: left; border: 0; font: inherit; font-size: 11.5px; line-height: 1.35; padding: 1px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--text); background: var(--panel-2); }
a.cal-item:hover, button.cal-item:hover { text-decoration: none; filter: brightness(.96); }
.cal-item.t-campaign { background: var(--brand-soft); color: var(--brand); font-weight: 600; border-radius: 0; margin: 0 -4px; width: calc(100% + 8px); padding-left: 9px; }
.cal-item.t-campaign.co-mild { background: color-mix(in srgb, var(--c-mild) 18%, var(--panel)); color: color-mix(in srgb, var(--c-mild) 75%, var(--text)); }
.cal-item.t-campaign.co-genki { background: color-mix(in srgb, var(--c-genki) 18%, var(--panel)); color: color-mix(in srgb, var(--c-genki) 75%, var(--text)); }
.cal-item.t-campaign.co-distribution { background: color-mix(in srgb, var(--c-distribution) 18%, var(--panel)); color: color-mix(in srgb, var(--c-distribution) 75%, var(--text)); }
.cal-item.t-event { background: var(--brand); color: var(--brand-ink); }
.cal-item.t-event.pending { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-item.t-task { background: var(--info-soft); color: var(--info); }
.cal-item.t-task.late { background: var(--bad-soft); color: var(--bad); }
.cal-item.done { text-decoration: line-through; opacity: .6; }
.cal-item.t-stock { background: var(--warn-soft); color: var(--warn); }
.cal-item.t-keydate { background: var(--bad-soft); color: var(--bad); cursor: default; }
.cal-item.t-keydate.k-retail { background: var(--violet-soft); color: var(--violet); }
.cal-more { border: 0; background: transparent; color: var(--muted); font-size: 11.5px; text-align: left; cursor: pointer; padding: 0 5px; }
.cal-add { position: absolute; right: 3px; top: 3px; opacity: 0; border: 0; background: var(--panel); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.cal-add .ic { width: 14px; height: 14px; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-list { display: grid; gap: 10px; }
.cal-list-day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.cal-list-day.today { border-color: var(--brand); }
.cal-list-day h4 { margin: 0 0 6px; }
.cal-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; min-width: 0; }
.cal-row .cal-item { width: auto; flex: 0 1 auto; margin: 0; font-size: 13px; padding: 2px 8px; }
.cal-row .cal-item.t-campaign { width: auto; margin: 0; border-radius: 4px; }
.cal-time { width: 92px; flex: none; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.week-list { display: grid; gap: 2px; }
.cal-day-list { display: grid; gap: 4px; }
.facts.big { font-size: 14px; gap: 8px; }
.facts.big dd { text-align: left; }
.event-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.hidden-time { display: none; }

/* Warehouse */
.seg.wrap { flex-wrap: wrap; }
.seg .count { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.seg button.on .count { background: #fff; color: var(--brand); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
.chip.wh-submitted { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.wh-approved { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.wh-sent { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.chip.wh-received { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.wh-rejected, .chip.wh-cancelled { background: var(--panel-2); color: var(--muted); }
.wh-facts { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); display: grid; gap: 6px 18px; margin-bottom: 12px; }
.wh-facts div { display: grid; gap: 1px; justify-content: start; }
.wh-facts dd { text-align: left; }
.wh-lines input.qty { width: 90px; text-align: right; }
.wh-lines th.edit-col, .wh-lines td.edit-col { background: var(--brand-soft); }
.product-search { position: relative; margin-bottom: 8px; }
.product-results { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.product-results:not(:empty) { border: 1px solid var(--line); border-radius: 8px; padding: 4px; margin-top: 4px; }
.product-hit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); font: inherit; }
.product-hit:hover { background: var(--panel-2); }
.product-hit small { grid-column: 1; }
.product-hit .stock-hint { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 12px; color: var(--good); font-weight: 600; }
.product-hit .stock-hint.zero { color: var(--bad); }
#print-root { display: none; }

/* First days: the "Start here" list on Home. */
.start-card { border-color: var(--brand); }
.start-card .panel-head { justify-content: flex-start; flex-wrap: nowrap; }
.start-card .panel-head .muted { flex: 1; min-width: 0; }
.start-card .panel-head .btn { flex: none; }
.start-step { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.start-step:first-child { border-top: 0; padding-top: 0; }
.start-step > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.start-step small { font-size: 13px; line-height: 1.35; }
.start-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.start-step.done .start-ic { background: var(--good-soft); color: var(--good); }
.start-step.done b { color: var(--muted); font-weight: 500; text-decoration: line-through; }
.start-step.done small { display: none; }
.start-step .btn { flex: none; }

/* Sign-in slips: picked in a list, printed as cut-out cards. */
.slip-pick { display: grid; gap: 4px; max-height: 46vh; overflow-y: auto; margin: 8px 0; }
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; }
.slip { border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; }
.slip-name { font-size: 15px; }
.slip-row { display: flex; justify-content: space-between; gap: 10px; }
.slip ol { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }

@media print {
  body > #root, body > #modal-root, body > #toasts { display: none !important; }
  #print-root { display: block; }
  .print-sheet .print-only { display: block; }
  .print-sheet { font: 12px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; color: #000; }
  .print-sheet h1 { font-size: 18px; margin: 0 0 8px; }
  .print-sheet table { width: 100%; border-collapse: collapse; margin: 10px 0; }
  .print-sheet th, .print-sheet td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
  .print-sheet .signs { display: flex; justify-content: space-between; margin-top: 40px; }
  .print-sheet .slip { display: inline-grid; width: 46%; margin: 0 1.5% 12px; vertical-align: top; border: 1px dashed #555; border-radius: 0; break-inside: avoid; }
  .print-sheet .slip ol { color: #000; }
}

/* Sales access in the person form */
.sales-access { display: grid; gap: 8px; }
.sales-access select { max-width: 320px; }
.limits summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.limits[open] { display: grid; gap: 6px; }
.limit-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.limit-cols > div { display: grid; gap: 6px; align-content: start; }
.modal:has(form[data-form=import-accounts]) { max-width: min(1080px, 96vw); width: 1080px; }
.import-panel { margin: 0; padding: 10px; }
.import-panel .table-wrap { max-height: 52vh; overflow-y: auto; }
.import-panel select { width: auto; min-width: 120px; }
/* Chat: replies, reactions, pins, edits, "seen", the new-messages line */
.chat-head-tools { display: flex; align-items: center; gap: 6px; }
.chat-head-tools .btn.on { color: var(--warn); }
.status-bar { padding: 6px 18px; font-size: 13px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.status-bar.away { background: var(--warn-soft); color: var(--warn); }
.new-line { display: flex; align-items: center; gap: 8px; margin: 8px 18px; color: var(--bad); font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.new-line::before, .new-line::after { content: ""; flex: 1; height: 1px; background: var(--bad); opacity: .5; }
.msg.found { animation: found 2.4s ease; }
@keyframes found { 0%, 40% { background: var(--warn-soft); } 100% { background: transparent; } }
.msg.pinned { box-shadow: inset 3px 0 0 var(--warn); }
.pin-mark .ic { width: 13px; height: 13px; color: var(--warn); margin-left: 6px; vertical-align: -2px; }
.msg.deleted .msg-text i { font-size: 13px; }
.reply-quote { display: flex; align-items: center; gap: 6px; max-width: 100%; border: 0; border-left: 3px solid var(--line-2); background: var(--panel-2); color: var(--muted); padding: 3px 8px; margin: 2px 0 4px; border-radius: 0 6px 6px 0; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.reply-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-quote b { color: var(--text); white-space: nowrap; }
.reply-quote .ic { width: 13px; height: 13px; flex: none; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 1px 8px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.reaction.mine { border-color: var(--brand); background: var(--brand-soft); }
.react-pick { display: flex; gap: 2px; padding: 2px; }
.react-pick button { border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 8px; padding: 4px 6px; }
.react-pick button:hover { background: var(--panel-2); }
.seen { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.seen .ic { width: 12px; height: 12px; color: var(--brand); vertical-align: -2px; }
.reply-bar { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); background: var(--panel-2); border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0; padding: 4px 6px 4px 10px; }
.reply-bar[hidden] { display: none; }
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-box { display: grid; gap: 6px; margin: 4px 0; }
.edit-box textarea { min-height: 60px; }
.edit-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.edit-actions small { margin-right: auto; }
.jump-latest { position: sticky; bottom: 10px; margin: 8px auto; display: flex; }
.pin-list { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.pin-item { display: flex; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--text); font: inherit; }
.mention.all { background: var(--bad-soft); color: var(--bad); }
.ch.muted { opacity: .55; }
.ch .mute-ic { width: 13px; height: 13px; margin-left: auto; opacity: .7; }
.av .st { position: absolute; left: -4px; bottom: -4px; font-style: normal; font-size: 10px; line-height: 1; background: var(--panel); border-radius: 50%; padding: 1px; }
.av.xs .st { display: none; }
.person-info small.late { color: var(--warn); }
.st-emoji { width: 18px; display: inline-block; text-align: center; }

/* Search */
.search-btn kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; color: var(--muted); margin-left: 4px; }
.search-box { display: grid; gap: 10px; }
.search-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; background: var(--panel); }
.search-input input { border: 0; box-shadow: none; padding: 12px 0; font-size: 16px; background: transparent; }
.search-input input:focus { outline: none; box-shadow: none; }
.search-results { max-height: 62vh; overflow-y: auto; display: grid; gap: 10px; }
.search-group h4 { margin: 4px 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.search-hit { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.search-hit:hover, .search-hit:focus { background: var(--panel-2); text-decoration: none; }
.search-hit > .ic { margin-top: 2px; color: var(--muted); }
.search-hit mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.done-text { text-decoration: line-through; color: var(--muted); }

/* Status */
.status-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* Notifications on this device */
.push-box p { margin: 0 0 8px; line-height: 1.45; }
.push-box .ic { width: 15px; height: 15px; vertical-align: -3px; }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); font-style: normal; }
.push-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.push-actions:empty { display: none; }
.push-devices { display: grid; gap: 4px; margin-top: 10px; }
.push-device { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel-2); border-radius: 8px; font-size: 13px; }
.push-device > .ic { width: 14px; height: 14px; color: var(--muted); flex: none; }
.push-device span { flex: 1; min-width: 0; }
.push-device .icon-btn { width: 28px; height: 28px; }
.push-nudge { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 12px; font-size: 13.5px; }
.push-nudge > .ic { color: var(--brand); flex: none; }
.push-nudge span { flex: 1 1 220px; }

/* Home: what waits on me */
.needs { border-color: var(--warn); }
.need-list { display: grid; gap: 4px; }
.need { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 0; color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.need:hover { text-decoration: none; filter: brightness(.97); }
.need span { flex: 1; min-width: 0; }
.need b { color: var(--brand); font-size: 12.5px; white-space: nowrap; }
.need.late .ic, .need.late b { color: var(--bad); }

@media (max-width: 860px) {
  .step-row { grid-template-columns: 1fr 70px; }
  .step-row select { grid-column: span 2; }
  .cal-day { min-height: 74px; padding: 2px; }
  .cal-item { font-size: 10px; padding: 0 3px; }
  .cal-hol { display: none; }
  .cal-time { width: 70px; }
  .limit-cols { grid-template-columns: 1fr; }
  .msg:hover .msg-tools { display: none; }
  .msg.tools-open .msg-tools { display: flex; }
  .search-btn kbd { display: none; }
  .toolbar.cal-toolbar select { flex: 1 1 150px; max-width: none; min-width: 140px; }
  .cal-toolbar .cal-title { min-width: 0; font-size: 15px; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .side.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .mobile-only { display: inline-grid; }
  .top { padding: 0 10px; gap: 6px; }
  .view { padding: 16px 16px 32px; }
  .chat-page { margin: -16px -16px -32px; }
  .hide-sm { display: none; }
  .kpis > .tile.big { flex-basis: 100%; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-form .wide { grid-column: auto; }
  .hbar { grid-template-columns: 90px 1fr 80px; }
  .toolbar select, .toolbar input[type=search] { min-width: 0; flex: 1; }
  .person-actions { flex-direction: row; flex-wrap: wrap; }
  .people { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .msg { padding-left: 12px; padding-right: 12px; }
  .room-embed { height: calc(100dvh - 260px); }
  .sales-grid, .sales-grid.n2 { grid-template-columns: minmax(0, 1fr); }
  .chart { overflow-x: auto; }
  .chart svg { min-width: 600px; }
  .dates { width: 100%; }
  .dates input { flex: 1; width: auto; }
  .snap-row { grid-template-columns: 90px 1fr; }
  .snap-row .snap-bar, .snap-row > .small { grid-column: 1 / -1; }
  .find { width: 100% !important; }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row input[name=linkUrl] { grid-column: 1; }
}

/* ── Supply Base (Warehouse → Japan orders) ── */
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.supply-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-soft); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.supply-banner .ic { color: var(--brand); flex: none; margin-top: 2px; }
.supply-banner div { display: flex; flex-direction: column; gap: 2px; }
.supply-banner span { color: var(--muted); font-size: 13px; }
.supply-banner.stale { background: var(--warn-soft); }
.supply-banner.stale .ic { color: var(--warn); }
.supply-table td { vertical-align: top; }
.supply-ship { min-width: 190px; }
.supply-ship small, .supply-err small { display: block; margin-top: 4px; }
.supply-err { min-width: 140px; }
.supply-note { min-width: 220px; max-width: 420px; white-space: normal; }
tr.sel > td { background: var(--panel-2); }
tr.supply-detail > td { background: var(--panel-2); padding: 4px 8px 12px; }
.supply-lines td { vertical-align: top; }
.center { text-align: center; }
.supply-lines td:first-child { min-width: 230px; }
.supply-lines { font-size: 12.5px; }

/* ── Chat windows (Messenger style, computers only) ── */
#chat-dock { position: fixed; right: 16px; bottom: 0; z-index: 60; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px; pointer-events: none; }
#chat-dock[hidden] { display: none; }
.dock-win { pointer-events: auto; width: 328px; height: 440px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2, var(--line)); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 8px 28px rgba(0,0,0,.28); overflow: hidden; }
.dock-win.min { height: auto; width: 230px; }
.dock-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 46px; background: var(--panel); }
.dock-win.min .dock-head { border-bottom: 0; }
.dock-win.has-unread .dock-head { background: var(--brand-soft); }
.dock-head .count { margin-left: auto; }
.dock-head .count + .icon-btn, .dock-title + .icon-btn { margin-left: auto; }
.dock-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dock-title b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-title small { font-size: 11px; color: var(--muted); }
.dock-ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--brand); flex: none; }
.dock-ic .ic { width: 15px; height: 15px; }
.dock-body { flex: 1; overflow-y: auto; padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 3px; }
.dock-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.dock-msg.mine { justify-content: flex-end; }
.dock-msg:not(.grouped) { margin-top: 6px; }
.dock-msg .av-gap { width: 22px; flex: none; }
.dock-bubble { background: var(--panel-2); border-radius: 16px; padding: 6px 11px; font-size: 13.5px; line-height: 1.4; max-width: 78%; overflow-wrap: anywhere; position: relative; }
.dock-msg.mine .dock-bubble { background: var(--brand); color: var(--brand-ink); }
.dock-msg.mine .dock-bubble a { color: inherit; text-decoration: underline; }
.dock-name { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
.dock-react { position: absolute; right: -4px; bottom: -10px; font-size: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 0 4px; }
.dock-bubble img { max-width: 100%; border-radius: 10px; margin-top: 4px; }
.dock-day, .dock-sys { text-align: center; font-size: 11px; color: var(--muted); margin: 8px 0 2px; }
.dock-more { align-self: center; font-size: 12px; margin-bottom: 4px; }
.dock-composer { border-top: 1px solid var(--line); padding: 8px; display: flex; gap: 6px; align-items: flex-end; margin: 0; }
.dock-composer textarea { flex: 1; min-height: 36px; max-height: 110px; border-radius: 18px; padding: 8px 12px; resize: none; }
@media (max-width: 860px) { #chat-dock { display: none !important; } }
/* With chat windows open, notices appear at the top so they do not cover them. */
body:has(#chat-dock:not([hidden])) #toasts { bottom: auto; top: 70px; }

/* ── Stores as blocks + insight pop-up ── */
.store-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.store-block { position: relative; display: flex; flex-direction: column; gap: 5px; text-align: left; padding: 11px 12px 10px; border: 1px solid var(--line); border-top: 4px solid var(--line-2, var(--line)); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; transition: transform .12s, box-shadow .12s; min-width: 0; }
.store-block:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.store-block:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.store-block.good { border-top-color: var(--good); background: linear-gradient(var(--good-soft), var(--panel) 46%); }
.store-block.warn { border-top-color: var(--warn); background: linear-gradient(var(--warn-soft), var(--panel) 46%); }
.store-block.bad { border-top-color: var(--bad); background: linear-gradient(var(--bad-soft), var(--panel) 46%); }
.store-block[hidden] { display: none; }
.sb-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-amount { font-size: 19px; font-variant-numeric: tabular-nums; }
.sb-size { height: 4px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.sb-size i { display: block; height: 100%; background: var(--brand); opacity: .7; }
.sb-row { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; align-items: baseline; }
.sb-foot { font-size: 11px; }
.store-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: -4px 0 10px; }
.store-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2, var(--line)); }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.insight .modal-head h2 small { font-weight: 500; font-size: 13px; margin-left: 6px; }
.insight-tabs { display: flex; align-items: center; margin-bottom: 14px; width: 100%; }
.insight-tabs button .ic { width: 14px; height: 14px; vertical-align: -2px; }
.insight-body { min-height: 260px; }
.insight-body .tiles { margin-bottom: 10px; }

/* ── Sales map ── */
.store-map { height: 520px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); position: relative; }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 6px; }
.map-bar .store-legend { margin: 0; }
.map-tip .maplibregl-popup-content { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow); }
.map-tip .maplibregl-popup-tip { display: none; }
.map-pin { background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: grab; white-space: nowrap; position: relative; }
.map-pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--brand); }
.map-pin.unplaced { background: var(--warn); color: #1a1205; }
.map-pin.unplaced::after { border-top-color: var(--warn); }
@media (max-width: 860px) { .store-map { height: 380px; } }
/* Distribution shop pop-up: month by month */
.month-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 6px 2px 0; border-bottom: 1px solid var(--line); }
.month-bars .mb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.month-bars .mb span { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; }
.month-bars .mb small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.map-paste { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.map-paste select { max-width: 240px; }
.map-paste input { flex: 1; min-width: 220px; }

/* ── Stores as little shops on the map ── */
.house { position: relative; display: flex; flex-direction: column; align-items: center; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: var(--text); filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); transition: transform .12s; }
.house:hover { transform: translateY(-3px) scale(1.04); z-index: 5; }
.house .roof { width: 0; height: 0; border-left: 62px solid transparent; border-right: 62px solid transparent; border-bottom: 26px solid var(--line-2, #94a3b8); }
.house.good .roof { border-bottom-color: #22c55e; } .house.warn .roof { border-bottom-color: #f59e0b; } .house.bad .roof { border-bottom-color: #ef4444; }
.house-body { width: 112px; background: var(--panel); border: 2px solid var(--line-2, #94a3b8); border-top: 0; border-radius: 0 0 8px 8px; padding: 4px 7px 6px; display: flex; flex-direction: column; gap: 1px; text-align: left; }
.house.good .house-body { border-color: #22c55e; } .house.warn .house-body { border-color: #f59e0b; } .house.bad .house-body { border-color: #ef4444; }
.h-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sales { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.h-row { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.h-row .bad { color: var(--bad); font-weight: 700; } .h-row .warn { color: var(--warn); font-weight: 700; }
/* zoom levels: far = dots only, mid = small house with sales, near = full card */
.store-map.z-far .house { display: none; }
.store-map.z-mid .house .roof { border-left-width: 34px; border-right-width: 34px; border-bottom-width: 14px; }
.store-map.z-mid .house-body { width: 62px; padding: 2px 4px 3px; }
.store-map.z-mid .h-more, .store-map.z-mid .h-name { display: none; }
.store-map.z-mid .h-sales { font-size: 11px; text-align: center; }
.store-map:not(.z-far) .maplibregl-canvas { cursor: grab; }
/* Team tab */
.team-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.team-row .grow { display: flex; flex-direction: column; }
.instruction-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.instruction-form h4 { display: flex; align-items: center; gap: 6px; }
.instruction-form .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Appearance menu */
.theme-menu { display: flex; flex-direction: column; gap: 2px; min-width: 240px; padding: 4px; }
.theme-menu > b { font-size: 12px; color: var(--muted); padding: 4px 8px 6px; text-transform: uppercase; letter-spacing: .4px; }
.theme-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.theme-opt:hover { background: var(--panel-2); }
.theme-opt.on { background: var(--brand-soft); font-weight: 600; }
.theme-opt span { display: flex; flex-direction: column; flex: 1; }
.theme-opt small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.theme-opt .tick { color: var(--brand); }

/* Inventory: stock over time */
.inv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .inv-grid { grid-template-columns: minmax(0, 1fr); } }
.inv-grid .panel { margin-bottom: 0; }
.inv-grid select { width: 100%; margin-bottom: 10px; }
.inv-grid h4 { margin: 14px 0 6px; font-size: 13px; }
.inv-readings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.inv-item-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 12px 0 8px; }
.inv-item-head > div:first-child { display: grid; gap: 2px; min-width: 0; }
.inv-total { text-align: right; display: grid; }
.inv-total b { font-size: 22px; }
.inv-chart svg { width: 100%; height: auto; display: block; }
.inv-chart text { font-size: 10px; fill: var(--muted); }
.inv-chart .grid { stroke: var(--line); stroke-width: 1; }
.inv-chart .legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.inv-chart .legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.inv-scroll { max-height: 340px; overflow-y: auto; }
.table td.up { color: var(--green, #16a34a); }
.inv-empty td { opacity: .75; }

/* Each company's part of the group's sales. */
.share-bar { display: flex; gap: 2px; height: 10px; max-width: 640px; margin-top: 12px; border-radius: 999px; overflow: hidden; background: var(--line); }
.share-bar span { display: block; min-width: 3px; }
.share-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12.5px; }
.share-legend a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.share-legend a b { color: var(--text); font-variant-numeric: tabular-nums; }
.share-legend a:hover { text-decoration: none; color: var(--text); }
.tile-share { margin-top: 4px; }
/* A searched list: no "show all" while searching, and a line when nothing matches. */
.filtering .more-toggle { display: none; }
.no-match { margin: 0; padding: 18px 8px; text-align: center; }
/* Sales: the old figures stay, dimmed, while new dates or a company load. */
#sales-body { transition: opacity .15s; }
#sales-body.is-loading { opacity: .5; pointer-events: none; }
/* Segmented choices never break a word over lines or push the page sideways
   on a phone: a long row scrolls within itself. */
.seg:not(.wrap) { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg:not(.wrap)::-webkit-scrollbar { display: none; }
.seg button, .seg a { white-space: nowrap; flex: none; }

/* ── Side menu: conversations kept short, with a find box ─────────────── */
.side-find { display: flex; align-items: center; gap: 6px; margin: 8px 8px 0; padding: 0 8px; border-radius: 8px; background: var(--side-2); color: var(--side-muted); }
.side-find .ic { width: 14px; height: 14px; flex: none; }
.side-find input { flex: 1; min-width: 0; min-height: 30px; padding: 4px 0; border: 0; background: transparent; color: var(--side-text); font-size: 13px; box-shadow: none; outline: none; }
.side-find input::placeholder { color: var(--side-muted); }
.side-find:focus-within { outline: 2px solid rgba(94, 234, 212, .5); }
.side-fold { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.side-fold:hover { color: #fff; }
.side-fold .ic { width: 12px; height: 12px; transition: transform .15s; }
.side-group.folded .side-fold .ic { transform: rotate(-90deg); }
.side-fold .count { margin-left: 4px; }
.side-more { display: block; width: 100%; padding: 4px 10px 4px 34px; border: 0; background: none; color: var(--side-muted); font-size: 12.5px; text-align: left; cursor: pointer; border-radius: 6px; }
.side-more:hover { color: #fff; background: var(--side-2); }

/* ── Home search ───────────────────────────────────────────────────────── */
.home-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 720px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--muted); font: inherit; font-size: 14px; text-align: left; cursor: text; box-shadow: var(--shadow); }
.home-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-search:hover { border-color: var(--brand); }
.home-search kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; }

/* ── Figures that open their breakdown ─────────────────────────────────── */
button.tile { font: inherit; text-align: left; width: 100%; }
.peek { cursor: pointer; transition: border-color .12s, transform .12s; }
.peek:hover { border-color: var(--brand); }
.peek:active { transform: scale(.995); }
.peek .tile-value { text-decoration: underline dotted transparent; text-underline-offset: 4px; }
.peek:hover .tile-value { text-decoration-color: var(--muted); }
button.snap-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
button.snap-row:hover { background: var(--panel-2); }
.share-legend button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.share-legend button b { color: var(--text); font-variant-numeric: tabular-nums; }
.share-legend button:hover { color: var(--text); }
tr.peek-row { cursor: pointer; }
tr.peek-row:hover td { background: var(--panel-2); }
.peek-list { display: grid; gap: 2px; }
.peek-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.peek-item:hover { background: var(--panel-2); text-decoration: none; }
.peek-item span { flex: 1; min-width: 0; }
.peek-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.peek-rank { display: grid; gap: 2px; }
.peek-rank-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(50px, 1fr) auto 64px; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; }
button.peek-rank-row { cursor: pointer; }
button.peek-rank-row:hover { background: var(--panel-2); }
.peek-rank-row .pr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-rank-row b { font-variant-numeric: tabular-nums; text-align: right; }
.peek-rank-row .pr-extra { text-align: right; }
.peek-rank-row .share { width: 100%; margin: 0; }
.peek-rank-row .share i.s-mild { background: var(--c-mild); }
.peek-rank-row .share i.s-genki { background: var(--c-genki); }
.peek-rank-row .share i.s-distribution { background: var(--c-distribution); }
.peek-bar { display: grid; gap: 6px; margin: 4px 0 12px; }
.up-text { color: var(--good); }
.down-text { color: var(--bad); }
.mh-title { flex: 1; min-width: 0; } .mh-title p { margin: 2px 0 0; }
.peek-block { min-width: 0; }

/* ── Requests and online orders ───────────────────────────────────────── */
.chip.tone-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.tone-bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.chip.tone-good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.chip.tone-info { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.ask-kind { margin-bottom: 12px; }
.ask-kind button { display: inline-flex; align-items: center; gap: 6px; }
.ask-tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tile.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.ask-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.ask-steps .done { color: var(--good); font-weight: 600; }
.ask-steps .now { color: var(--text); font-weight: 700; }
.kv-row { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 12px; }
.kv-row > div { display: grid; gap: 2px; min-width: 0; }
.kv-row b { font-size: 14px; overflow-wrap: anywhere; }
.ask-details { padding: 10px 12px; border-radius: 8px; background: var(--panel-2); }
.ask-log { display: grid; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.ask-log p { margin: 4px 0 0; padding-left: 10px; border-left: 2px solid var(--line-2); white-space: pre-wrap; }
.ask-ev.head_rejected b, .ask-ev.finance_rejected b, .ask-ev.wrong_scan b, .ask-ev.problem b { color: var(--bad); }
.ask-act textarea { width: 100%; }
#online-hits:not(:empty) { margin: 6px 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
#online-draft { margin-top: 10px; }
#online-draft input[type=number] { width: 72px; }

/* ── Store orders and the delivery calendar ───────────────────────────── */
.ao-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
.ao-cal-h { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.ao-cal-day { display: grid; align-content: start; gap: 2px; min-height: 86px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.ao-cal-day:hover { border-color: var(--brand); }
.ao-cal-day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.ao-cal-day.past { opacity: .55; }
.ao-cal-day b { font-size: 13px; }
.ao-cal-day small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ao-cal-n { font-size: 12px; color: var(--muted); }
.ao-day-list { max-height: 52vh; overflow-y: auto; margin-top: 8px; }
.ao-wd { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.ao-sheet { max-height: 58vh; overflow-y: auto; }
.ao-sheet .ao-qty { width: 76px; text-align: right; }
.ao-params label small { display: block; margin-top: 2px; }
.ao-branch-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-height: 220px; overflow-y: auto; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 860px) {
  .ao-cal { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; }
  .ao-cal-day { min-height: 64px; padding: 5px; }
  .ao-cal-day small { display: none; }
}
.modal.wide:has(.ao-sheet) { width: min(1240px, 97vw); max-width: 97vw; }
.ao-sheet td.l { min-width: 260px; }
/* Order sheets: the branch's and the office's numbers, each with its reason. */
.ao-sheet thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.ao-sheet td.ao-edit { min-width: 230px; white-space: nowrap; }
.ao-sheet td.ao-edit .ao-qty { width: 64px; margin-right: 6px; }
.ao-sheet td.ao-edit .ao-why { width: 150px; font-size: 13px; }
.ao-sheet td.ao-changed, .ao-sheet tr.ao-changed td.ao-edit { background: var(--warn-soft); }
.ao-sheet td.ao-changed small { color: var(--warn); }
.ao-sheet tr.saving { opacity: .6; }
.ao-add { position: relative; margin: 8px 0; }
.ao-add input { width: 100%; }
.ao-find-hits { display: grid; gap: 2px; margin-top: 4px; max-height: 220px; overflow-y: auto; }
.ao-find-hits:empty { display: none; }
.ao-hit { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.ao-hit:hover { border-color: var(--brand); }
.ao-branch-note { margin: 6px 0 10px; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 6px; }
.ao-note { width: 100%; margin-top: 10px; }
.ao-waiting .panel-head .chip { margin-left: 6px; }
@media (max-width: 860px) {
  .ao-sheet td.ao-edit { min-width: 0; white-space: normal; }
  .ao-sheet td.ao-edit .ao-why { width: 100%; margin-top: 4px; }
}

/* ── Tickets and the system report ─────────────────────────────────────── */
.ticket-kind { margin-bottom: 12px; flex-wrap: wrap; }
.ticket-kind button { display: inline-flex; align-items: center; gap: 6px; }
.ticket-att { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; flex-wrap: wrap; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.ticket-meta a.chip { color: var(--muted); }
.ticket-manage { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin: 0 0 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.ticket-manage label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ticket-manage small { flex-basis: 100%; overflow-wrap: anywhere; }
.ticket-btn .ic { color: var(--warn); }
.report-h { margin: 22px 0 10px; font-size: 15px; }
.report-h:first-of-type { margin-top: 6px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.report-grid > .panel { margin-bottom: 0; }
.report-grid + .report-h { margin-top: 26px; }
.col-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; }
.col-chart .dcol { flex: 1; min-width: 3px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col-chart .dcol span { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--brand); }
.col-chart .dcol.we span { opacity: .45; }
.col-chart .dcol b { position: absolute; font-size: 10px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.report-weeks td, .report-weeks th { white-space: nowrap; }
.report-print { display: none; }
@media print {
  .report-print { display: block; font: 11px/1.4 "Inter", system-ui, sans-serif; color: #000; }
  .report-print h1 { font-size: 18px; margin: 0 0 6px; }
  .report-print .toolbar, .report-print .note-bar { display: none; }
  .report-print .panel, .report-print .tile { box-shadow: none; break-inside: avoid; }
  .report-print .report-h { break-after: avoid; }
}

/* Small chat window: files and emoji like the full chat. */
.dock-composer { flex-wrap: wrap; }
.dock-composer .att-pending { flex-basis: 100%; }
.dock-composer .icon-btn { flex: none; }
.emoji-pick { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px; max-height: 240px; overflow-y: auto; }
.emoji-pick button { width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; font-size: 20px; line-height: 1; cursor: pointer; }
.emoji-pick button:hover { background: var(--hover, rgba(127,127,127,.15)); }
/* Sidebar: find people, and quiet chats folded away. */
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; padding: 8px 12px 4px; }
button.ch.side-person { width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.side-person span { display: flex; flex-direction: column; min-width: 0; }
.side-person small { opacity: .6; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-stale { opacity: .7; }
.side-stale-list .ch { opacity: .75; }

/* ── Side menu: the "More" fold (pages a person has not used yet wait here) ── */
.nav-more { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--side-muted); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.nav-more:hover { background: var(--side-2); color: var(--side-text); }
.nav-more span { flex: 1; }
.nav-more small { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--side-2); }
.nav-more .ic { transition: transform .15s ease; transform: rotate(-90deg); }
.nav-more[aria-expanded=true] .ic { transform: none; }
.nav-extra { display: grid; gap: 2px; }
.nav-extra[hidden] { display: none; }
.phone-only { display: none !important; }

/* ── Phones ─────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .phone-only { display: flex !important; }
  /* Top bar: the page name stays readable. One "+" starts a task, a request or a problem report;
     light/dark moved to the profile menu. */
  .top-actions { gap: 2px; }
  .top-actions [data-action=new-ask], .top-actions [data-action=new-ticket], .top-actions [data-action=theme-menu] { display: none; }
  .top-actions .search-btn { border-color: transparent; padding: 0 9px; }
  .top-actions .btn.primary { width: 40px; padding: 0; justify-content: center; }
  .top h1 { font-size: 17px; }
  /* Fingers need bigger targets than a mouse pointer. */
  .btn { height: 40px; }
  .btn.sm { height: 36px; padding: 0 12px; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn.xs { width: 34px; height: 34px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg a, .seg button { padding: 9px 13px; }
  .nav a, .ch, .nav-more { padding-top: 11px; padding-bottom: 11px; font-size: 15px; }
  .pop-item, .pop-ask { padding: 13px 12px; }
  input[type=checkbox] { width: 20px; height: 20px; }
  /* 16px text keeps iPhones from zooming in when a field is tapped. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: 16px; }
  /* Home: two tiles side by side, so the page is half as long. */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 22px; }
  /* People: the buttons go under the name; they used to cover it. */
  .person { flex-wrap: wrap; }
  .person-actions { flex-basis: 100%; justify-content: flex-start; align-items: center; }
  .table { font-size: 13px; }
}
@media (max-width: 860px) {
  /* A chat's name keeps its line; its buttons drop to the next one when they do not fit. */
  .chat-head { flex-wrap: wrap; padding: 8px 12px; }
  .chat-head > div:first-child { flex: 1 1 160px; }
  .chat-head-tools { flex: none; margin-left: auto; }
  /* Small text buttons get a finger-sized height. */
  .link-btn, .kind-toggle, .share-legend button { min-height: 34px; }
  .kind-toggle { padding: 6px 12px; }
}

/* Company structure (Admin): a tree of who reports to whom. */
.org-company { margin: 0 0 26px; }
.org-company h3 { margin: 0 0 10px; font-size: 15px; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 17px; padding-left: 16px; border-left: 2px solid var(--line); }
.org-tree li { position: relative; padding: 4px 0; }
.org-tree ul > li::before { content: ""; position: absolute; left: -16px; top: 26px; width: 14px; border-top: 2px solid var(--line); }
.org-node { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-width: 720px; }
.org-node.dim { opacity: .3; }
.org-who { flex: 1 1 auto; min-width: 0; display: grid; }
.org-who b, .org-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-who span { color: var(--muted); font-size: 12px; }
.org-pick { flex: 0 1 190px; width: auto; min-width: 0; max-width: 190px; font-size: 12px; padding: 5px 8px; }
.org-loose-title { margin: 14px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.org-loose { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
@media (max-width: 640px) {
  .org-tree ul { margin-left: 8px; padding-left: 10px; }
  .org-tree ul > li::before { left: -10px; width: 8px; }
  .org-node { flex-wrap: wrap; gap: 8px; }
  .org-pick { flex: 1 1 100%; max-width: none; order: 5; }
  .org-loose { grid-template-columns: minmax(0, 1fr); }
}

/* Asking to see more sales, and the admin's answers. */
.access-none .ic { width: 28px; height: 28px; }
.access-none .btn { margin-top: 8px; }
.access-asks { margin-bottom: 16px; }
.access-ask { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--line); }
.access-ask-what { min-width: 0; }
.access-ask-what p { margin: 3px 0 0; }
.access-ask-acts { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.access-ask-acts input { width: 190px; }
.access-done { padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.access-done p, .access-answers p { margin: 6px 0 0; }
.access-answers { margin-top: 10px; }
@media (max-width: 640px) {
  .access-ask { flex-direction: column; }
  .access-ask-acts { width: 100%; flex-wrap: wrap; }
  .access-ask-acts input { flex: 1 1 100%; width: auto; }
  .access-ask-acts .btn { flex: 1 1 0; }
}

/* Back: in the top bar for pages, at the top of a popup opened from another popup. */
.top-back { flex: 0 0 auto; padding: 6px 10px; }
.top-back[hidden] { display: none; }
.modal-up { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 10px -6px; padding: 5px 10px 5px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--brand); font-weight: 600; font-size: 13px; cursor: pointer; }
.modal-up:hover { background: var(--panel-2); }
.modal-up .ic { width: 16px; height: 16px; }
/* The company dashboards belong to Sales: one step in, right under it. */
.nav a.sub { padding-left: 30px; font-size: 13px; }
.nav a.sub .ic { width: 15px; height: 15px; opacity: .85; }
.home-dash { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.home-dash .btn { font-weight: 600; }
@media (max-width: 860px) {
  .top-back { padding: 6px 8px; }
  .home-dash .btn { flex: 1 1 100%; justify-content: center; min-height: 44px; }
}
