/* app.geardox.com/dashboard: the Geardox look (spec 6) on a wide screen.
   Light background, Archivo, 14 px corners, yellow for the main action, outlined for the others,
   a red outline for anything that cancels, declines or deletes. */
:root {
  --bg: #f4f5f6;
  --panel: #ffffff;
  --text: #0e1116;
  --muted: #56606b;
  --line: #dfe2e6;
  --soft: #eceef1;
  --acc: #ffc629;
  --ok: #0b6b3a;
  --okbg: #e9f5ee;
  --danger: #b3261e;
  --dangerbg: #fde7e5;
  --warnbg: #fff3cf;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.05), 0 8px 24px rgba(14, 17, 22, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.45; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.error { color: var(--danger); font-weight: 700; min-height: 1em; margin: 0 0 8px; }
.error:empty { display: none; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 8px; }
h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
a { color: var(--text); font-weight: 700; }
p { margin: 0 0 10px; }
.icon { flex: none; }

/* Sign in */
.center-page { max-width: 420px; margin: 0 auto; padding: 56px 20px; display: flex; flex-direction: column; gap: 12px; }
.center-page h1 { text-align: center; font-size: 28px; }
.logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 8px; }
/* The loading page, like the app's loading animation (src/components/launch-curtain.tsx): yellow, the full Geardox
   logo still in the middle, and four scanner corners that pulse round it, out a little and back in, until the page is
   ready (Mahmood, 2026-11-29; they don't come in from the window edges). Reduce Motion: the logo alone. */
.loading-page { position: fixed; inset: 0; z-index: 1000; max-width: none; margin: 0; padding: 0; background: #FFC629; display: flex; align-items: center; justify-content: center; }
.loading-page.hidden { display: none; }
.loading-logo { height: 76px; width: auto; display: block; }
.loading-frame { position: absolute; left: 50%; top: 50%; width: 336px; height: 184px; transform: translate(-50%, -50%); opacity: 0;
  animation: loading-corners 0.2s linear forwards, loading-breathe 0.8s ease-in-out 0.2s infinite alternate; }
.loading-frame i { position: absolute; width: 30px; height: 30px; border: 0 solid #141414; }
.loading-frame i:nth-child(1) { left: 0; top: 0; border-top-width: 5px; border-left-width: 5px; border-top-left-radius: 12px; }
.loading-frame i:nth-child(2) { right: 0; top: 0; border-top-width: 5px; border-right-width: 5px; border-top-right-radius: 12px; }
.loading-frame i:nth-child(3) { left: 0; bottom: 0; border-bottom-width: 5px; border-left-width: 5px; border-bottom-left-radius: 12px; }
.loading-frame i:nth-child(4) { right: 0; bottom: 0; border-bottom-width: 5px; border-right-width: 5px; border-bottom-right-radius: 12px; }
@keyframes loading-corners { to { opacity: 1; } }
/* Starts further out and zooms in to the logo first, then out and in again. */
@keyframes loading-breathe { from { width: 336px; height: 184px; } to { width: 272px; height: 116px; } }
@media (prefers-reduced-motion: reduce) { .loading-frame { display: none; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* Controls */
label { font-weight: 700; font-size: 13.5px; }
input[type='email'], input[type='text'], input[type='search'], input[type='number'], input[type='date'], select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid #9aa2ab; border-radius: 12px; padding: 10px 12px; min-height: 44px; max-width: 100%;
}
textarea { min-height: 76px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, button:focus-visible, a:focus-visible, tr:focus-visible, rect:focus-visible { outline: 3px solid var(--acc); outline-offset: 1px; }
.btn { font: inherit; font-weight: 800; border-radius: var(--radius); padding: 12px 18px; border: 2px solid transparent; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--acc); }
.btn.primary:hover { background: #f5bb14; }
.btn.secondary { background: var(--panel); border-color: var(--text); }
.btn.secondary:hover { background: var(--soft); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { background: var(--panel); border-color: var(--danger); color: var(--danger); }
.btn.danger-outline:hover { background: var(--dangerbg); }
.btn.link { background: none; text-decoration: underline; padding: 8px; font-weight: 700; }
.btn:disabled { background: #e3e6ea; color: #8a929b; border-color: transparent; cursor: default; }
.small-btn { padding: 8px 14px; border-radius: 12px; }
.icon-btn { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--text); display: inline-flex; }
.icon-btn:hover { background: var(--soft); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.actions.end { justify-content: flex-end; margin-bottom: 0; }

/* Shell: the menu on the left, the pages on the right */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.top-logo { width: 38px; height: 38px; border-radius: 10px; }
.top-names { min-width: 0; }
.company { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#company-pick { width: 100%; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 10px 12px; border-radius: 12px; font-weight: 700; color: var(--muted); }
.nav a:hover { background: var(--soft); color: var(--text); }
.nav a.on { background: var(--text); color: #fff; }
.badge { margin-left: auto; background: var(--acc); color: var(--text); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 8px; }
.badge:empty { display: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; }
#refresh.busy { opacity: 0.5; pointer-events: none; }
.main { padding: 24px 28px 64px; min-width: 0; max-width: 1320px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .actions { margin: 0; }
.page > h2 { margin-top: 22px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; }

/* Number tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { font: inherit; text-align: left; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--text); }
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.stat.danger { background: var(--dangerbg); border-color: #f3b8b2; }
.stat.danger b { color: var(--danger); }
.stat.warn { background: var(--warnbg); border-color: #f0d98a; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols > .report { margin-bottom: 0; }
.report { margin-bottom: 16px; }
.report-filter { margin-bottom: 10px; }
.report .page-head { align-items: flex-start; margin-bottom: 10px; }
.report .page-head h2, .report .page-head p { margin: 0; }
.report .table-wrap { border: none; border-radius: 0; margin: 0 -18px -18px; border-top: 1px solid var(--line); }

/* Lists of short lines (activity, needs attention, a person's tools) */
.feed { display: flex; flex-direction: column; }
.feed-row { font: inherit; color: var(--text); text-align: left; background: none; border: none; border-top: 1px solid var(--line); padding: 10px 2px; display: flex; gap: 10px; align-items: center; justify-content: space-between; width: 100%; }
.feed-row:first-child { border-top: none; }
.feed-row > div { flex: 1; min-width: 0; }
.feed-row.click { cursor: pointer; border-radius: 8px; }
.feed-row.click:hover { background: var(--soft); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.danger { background: var(--danger); }
.dot.warn { background: #d99a00; }

/* Tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.toolbar input[type='search'] { flex: 1; min-width: 240px; }
.count { margin: 4px 2px 8px; }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--text); color: #fff; border-radius: var(--radius); padding: 8px 14px; margin-bottom: 8px; }
.bulk .btn.link { color: #fff; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfb; }
th.sortable { padding: 0; }
th button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 11px 14px; width: 100%; text-align: left; white-space: nowrap; }
th button:hover, th[aria-sort] button { color: var(--text); }
td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:first-child td { border-top: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafbfb; }
td.name { font-weight: 700; min-width: 170px; }
td.mono { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
td.num, th.num, th.num button { text-align: right; font-variant-numeric: tabular-nums; }
td.pick, th.pick { width: 36px; padding: 10px 0 10px 14px; }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--text); cursor: pointer; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; white-space: nowrap; background: var(--panel); }
.tag.ok { color: var(--ok); border-color: #b9dcc8; background: var(--okbg); }
.tag.danger { color: var(--danger); border-color: #f3b8b2; background: var(--dangerbg); }
.tag.warn { background: var(--warnbg); border-color: #f0d98a; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.barcell { position: relative; min-width: 120px; padding: 2px 8px; }
.barcell i { position: absolute; left: 0; top: 0; bottom: 0; background: #dbe7fb; border-radius: 4px; }
.barcell span { position: relative; font-variant-numeric: tabular-nums; }

/* Chart */
.chart-box { margin-top: 4px; }
.legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--soft); stroke-width: 1; }
.chart .axis { stroke: #c5cad0; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart rect:hover, .chart rect:focus { fill: rgba(14, 17, 22, 0.05); outline: none; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--text); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px; pointer-events: none; white-space: nowrap; }

/* People: requests and invites */
.asks { padding: 4px 18px; margin-bottom: 8px; }
.export-head { margin-top: 28px; }
.ask { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.ask:first-child { border-top: none; }
.ask .actions { margin: 0; }

/* Locations */
.loc-card { padding: 16px 10px 10px; }
.loc-card h2 { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.loc-card p { padding: 0 8px; }
.loc-row { font: inherit; color: var(--text); background: none; border: none; border-top: 1px solid var(--line); width: 100%; text-align: left; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 9px 8px; }
.loc-row:hover { background: var(--soft); }
.loc-row.d0 { font-weight: 700; }
.loc-row.d1 { padding-left: 30px; }
.loc-row.d2 { padding-left: 52px; }

/* The side panel (a tool, a person, a location) */
.shade { position: fixed; inset: 0; background: rgba(14, 17, 22, 0.35); z-index: 20; }
.shade.top { z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.panel-side { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); z-index: 30; box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; transition: transform 0.16s ease, opacity 0.16s ease; }
.panel-side.on { transform: none; opacity: 1; }
.panel-side header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.panel-side header h2 { font-size: 21px; margin: 0; }
.panel-body { padding: 14px 20px 32px; overflow-y: auto; }
.details { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.details dt, .details dd { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); }
.details dt:first-of-type, .details dd:first-of-type { border-top: none; }
.details dt { color: var(--muted); }
.details dd { font-weight: 700; text-align: right; }

/* Pop-up forms */
.modal { background: var(--panel); border-radius: 18px; padding: 22px; width: min(540px, 100%); box-shadow: var(--shadow); }
.modal h2 { font-size: 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .field, .form-grid .wide { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-grid .field.half { grid-column: auto; }
.form-grid .wide { margin: 0; }
.req { color: var(--danger); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--text); color: #fff; font-weight: 700; padding: 12px 18px; border-radius: var(--radius); z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; max-width: min(560px, 92vw); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.danger { background: var(--danger); }

/* Bulk upload */
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.drop { display: block; border: 2px dashed var(--muted); border-radius: var(--radius); background: var(--panel); padding: 28px 16px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--text); background: var(--warnbg); }
.drop input { display: none; }
.notice { border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); padding: 14px 16px; margin: 14px 0; }
.notice.ok { border-color: #b9dcc8; background: var(--okbg); }
.notice.danger { border-color: #f3b8b2; background: var(--dangerbg); }
.notice.warn { border-color: #f0d98a; background: var(--warnbg); }
.notice h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--text); }
.notice ul { margin: 0; padding-left: 20px; }
.seg { display: inline-flex; background: #e6e9ed; border-radius: 12px; padding: 4px; gap: 4px; margin: 6px 0 4px; }
.seg button { font: inherit; font-weight: 700; border: none; background: none; padding: 9px 18px; border-radius: 9px; cursor: pointer; color: var(--text); }
.seg button.on { background: var(--text); color: #fff; }
.paste { margin: 12px 0; }
.paste summary { cursor: pointer; font-weight: 700; }
.paste textarea { display: block; width: 100%; margin: 8px 0; font: 14px/1.4 ui-monospace, Consolas, monospace; }

/* Narrow screens: the menu becomes a row on top */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 12px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .side-foot { flex-direction: row; margin-top: 0; }
  .main { padding: 16px 14px 48px; }
  .cols, .cols.three { grid-template-columns: minmax(0, 1fr); }
  th, td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel-side, .toast { transition: none; }
}

/* Print labels */
.print-frame { position: fixed; width: 0; height: 0; border: 0; left: -9999px; }
.label-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.label-row .l { border: 1px dashed var(--line); border-radius: 6px; }
.toolbar .seg { margin: 0; }

/* Buttons at the end of a table row */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* A tool's photo in its side panel */
.tool-photo, .item-photo { margin-bottom: 12px; }
.tool-photo img, .item-photo img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: var(--soft); border-radius: var(--radius); }

/* Settings: one switch per row (the same ones as Settings > Features in the app). */
.settings { padding: 4px 18px; margin-bottom: 8px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.setting:first-child { border-top: none; }
.setting.indent { padding-left: 28px; }
.setting-text { display: flex; flex-direction: column; gap: 2px; }
.setting input[type='checkbox'] { width: 22px; height: 22px; flex: none; accent-color: #0b6b3a; cursor: pointer; }

/* The location tree, drawn like the app's (loc-tree.mjs): carets, lines, counts. */
.loc-card { overflow: hidden; }
.loc-card .tree { margin: 12px -10px -10px; border-top: 1px solid var(--line); }
.tree-card { padding: 0; overflow: hidden; }
.tree-row { position: relative; display: flex; align-items: center; gap: 6px; min-height: 54px; padding: 8px 14px 8px 0; cursor: pointer; }
.tree-row.sub { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }
.tree-row:hover { background: var(--soft); }
.tree-row.on, .tree-row.on:hover { background: var(--warnbg); }
.tree-row:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.tree-div { position: absolute; top: 0; right: 0; height: 1px; background: var(--line); }
.tree-slot { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; position: relative; }
.tree-caret { width: 22px; height: 22px; padding: 0; border: none; background: none; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.tree-caret .icon { stroke-width: 2.6; }
.tree-caret:hover { background: var(--line); }
.tree-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tree-name { font-weight: 600; overflow-wrap: anywhere; }
.tree-row:not(.sub) .tree-name { font-weight: 700; }
.tree-go { color: var(--muted); display: flex; flex: none; }
.tl { position: absolute; pointer-events: none; }
.tl-v { top: 0; bottom: 0; width: 2px; background: var(--muted); }
.tl-b { top: 50%; height: 2px; margin-top: -1px; background: var(--muted); }
.tl-e { top: 0; height: 50%; }
.tl-es { position: absolute; left: 0; top: 0; bottom: 10px; width: 2px; background: var(--muted); }
.tl-ec { position: absolute; left: 0; right: 0; bottom: -1px; height: 12px; box-sizing: border-box; border-left: 2px solid var(--muted); border-bottom: 2px solid var(--muted); border-bottom-left-radius: 9px; }
.tl-d { top: 50%; bottom: 0; margin-top: 13px; width: 2px; background: var(--muted); }

/* Scan (phones and tablets): the camera in a pop-up. */
#scan-btn { justify-content: center; }
.scan-box { display: flex; flex-direction: column; gap: 12px; }
.scan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scan-head h2 { margin: 0; }
.scan-frame { position: relative; background: #0e1116; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-aim { position: absolute; inset: 18%; border: 3px solid var(--acc); border-radius: var(--radius); pointer-events: none; }
.scan-note { margin: 0; font-weight: 700; }
.scan-note.warn { background: var(--warnbg); border-radius: 10px; padding: 10px 12px; }

/* Locations, laid out like the app's screen: search, three tabs, one tree in one card. */
.loc-page { max-width: none; }
.loc-body { display: flex; flex-direction: column; gap: 14px; margin: 14px 0; }
.loc-body p { margin: 0; }
.search-field { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1.5px solid var(--muted); border-radius: var(--radius); padding: 10px 16px; color: var(--muted); cursor: text; }
.search-field:focus-within { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.search-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.search-field input[type='search'] { border: none; outline: none; box-shadow: none; background: none; padding: 0; margin: 0; width: 100%; font: inherit; font-size: 17px; font-weight: 600; color: var(--text); border-radius: 0; }
.search-field input[type='search']::placeholder { color: var(--muted); }
.seg { display: flex; gap: 4px; background: #e2e5e9; border-radius: var(--radius); padding: 4px; }
.seg-btn { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; color: var(--text); background: none; border: none; border-radius: 11px; padding: 11px 8px; cursor: pointer; white-space: nowrap; }
.seg-btn:hover { background: rgba(14, 17, 22, 0.06); }
.seg-btn.on, .seg-btn.on:hover { background: var(--text); color: #fff; }
.seg-btn.dim { opacity: 0.4; }
.seg-count { background: var(--acc); color: var(--text); font-size: 12px; font-weight: 800; border-radius: 999px; min-width: 20px; padding: 1px 6px; text-align: center; }
.loc-page .tree-row { padding-right: 16px; gap: 8px; }
.loc-page .tree-row:not(.sub) { min-height: 58px; }
.loc-page .tree-row:not(.sub) .tree-name { font-size: 16.5px; }
.loc-page .tree-row.sub { min-height: 40px; }

/* A filter that takes several choices (ui.mjs multiPick): a button that opens a list of tick boxes. */
.mp { position: relative; }
.mp-btn { font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid #9aa2ab; border-radius: 12px; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; max-width: 280px; }
.mp-btn.on { border-color: var(--text); background: var(--warnbg); }
.mp-label { color: var(--muted); }
.mp-btn.on .mp-label::after { content: ':'; }
.mp-val { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.mp-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 15; min-width: 240px; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(14, 17, 22, 0.14); padding: 6px; }
.mp-find { width: 100%; margin-bottom: 4px; }
.mp-list { max-height: 300px; overflow-y: auto; }
.mp-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 400; font-size: inherit; }
.mp-opt:hover { background: var(--soft); }
.mp-opt-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mp-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-none { padding: 10px 8px; color: var(--muted); }
.mp-caret { position: relative; width: 20px; height: 20px; flex: none; padding: 0; margin-right: -4px; border: none; background: none; color: var(--muted); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
button.mp-caret { cursor: pointer; }
button.mp-caret:hover { background: var(--line); color: var(--text); }
.mp-caret.has::after { content: ''; position: absolute; top: 1px; right: 1px; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); border: 1px solid var(--text); }
.mp-group { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 3px; }
.mp-group:first-child { padding-top: 4px; }
.mp-foot:empty { display: none; }
.mp-foot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 2px; }

/* Import / Export: the Items / Locations switch stays as wide as its words. */
#page-upload .seg { display: inline-flex; }

/* A page's search box and filters (ui.mjs filterBar), and a switch in front of them (Routines). */
.toolbar > .toolbar { margin: 0; flex: 1; }
.toolbar > #routines-seg { display: flex; }

/* Item photos: the small picture in a list row, and the photos at the top of the item's side panel. */
.with-thumb { display: flex; align-items: center; gap: 10px; }
.thumb { flex: none; width: 32px; height: 32px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.item-photos { margin-bottom: 14px; }
.item-photos.busy { opacity: .5; pointer-events: none; }
.item-photos .item-photo { display: block; min-height: 120px; margin-bottom: 8px; background: var(--soft); border-radius: var(--radius); }
.photo-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.photo-pick { width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--soft); overflow: hidden; cursor: pointer; }
.photo-pick.on { border-color: var(--text); }
.photo-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Items shown as cards with a large picture (the Pictures choice on Items). */
#item-view { margin: 0 0 0 auto; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; align-content: start; }
.item-grid-empty { padding: 24px 0; }
.item-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.item-card:hover { border-color: #b9c0c8; }
.item-card:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.item-card.picked { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.item-card .card-pic { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; }
.item-card .card-pick { position: absolute; top: 10px; left: 10px; width: 18px; height: 18px; margin: 0; }
.card-text { padding: 10px 12px 12px; }
.card-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 22px; }
.card-foot > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* An item's routines in its side panel. */
.routine-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.item-routines h3 + .routine-row { border-top: none; }
.routine-what { min-width: 0; }
.routine-row .row-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.item-routines .actions { margin-top: 8px; }

/* Settings: the Account row (who is signed in, and Sign out). */
.setting.account { cursor: default; }

/* People's photos and suppliers' logos (photos.mjs). */
.pic { flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--soft); color: var(--muted); font-weight: 700; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic-person { border-radius: 50%; }
.pic-logo { border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.pic-logo img { object-fit: contain; }
.link-cell { font: inherit; font-weight: 700; color: var(--text); background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
.link-cell:hover span:last-child { text-decoration: underline; }
.supplier-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.sub-head { margin-top: 18px; }
.setting .actions { display: flex; align-items: center; gap: 6px; margin: 0; }
