/* Plus One MotorSport — design system */
:root {
  --brand: #e10600;
  --brand-600: #c00500;
  --brand-50: #fff1f0;
  --ink: #0e1116;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;
  --text: #151a21;
  --text-2: #4b5563;
  --muted: #8a93a2;
  --ok: #0f9d58;
  --ok-bg: #e7f6ee;
  --warn: #c77700;
  --warn-bg: #fff4e0;
  --danger: #d92d20;
  --danger-bg: #fdecea;
  --info: #2563eb;
  --info-bg: #eaf1ff;
  --violet: #7c3aed;
  --violet-bg: #f1eafe;
  --teal: #0d9488;
  --teal-bg: #e3f6f4;
  --sidebar: #0e1116;
  --sidebar-2: #171b22;
  --sidebar-text: #a9b1bd;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18);
  --font: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0d11;
  --surface: #13161c;
  --surface-2: #181c23;
  --border: #242a33;
  --border-strong: #2f3642;
  --text: #e8ebf0;
  --text-2: #b4bcc8;
  --muted: #7c8696;
  --brand-50: #2a1212;
  --ok-bg: #0f2a1d;
  --warn-bg: #2d220d;
  --danger-bg: #2e1513;
  --info-bg: #111d35;
  --violet-bg: #1f1634;
  --teal-bg: #0d2624;
  --sidebar: #080a0d;
  --sidebar-2: #12151b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.bold { font-weight: 700; }
.ok { color: var(--ok); } .danger { color: var(--danger); } .warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hide { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #ff5a36); color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 18px -6px rgba(225, 6, 0, .7); direction: ltr; unicode-bidi: isolate;
}
.brand b { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { color: #6b7483; font-size: 11.5px; }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5d6574; padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; margin: 1px 0;
  color: var(--sidebar-text); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(225, 6, 0, .22), rgba(225, 6, 0, .06)); color: #fff; }
[dir="rtl"] .nav a.active { background: linear-gradient(-90deg, rgba(225, 6, 0, .22), rgba(225, 6, 0, .06)); }
.nav a.active svg { color: #ff4d3d; }
.nav .count { margin-inline-start: auto; background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #1d222a; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: #262c36; color: #fff; flex-shrink: 0;
}
.me b { color: #fff; font-size: 13px; display: block; }
.me small { font-size: 11.5px; color: #6b7483; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.search-trigger {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--muted); cursor: pointer;
}
.search-trigger kbd { margin-inline-start: auto; font-family: inherit; font-size: 11px; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.top-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a:hover { color: var(--text); }

/* ---------- grid helpers */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; }
.g-main-l { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.end { margin-inline-start: auto; }

/* ---------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .end { display: flex; gap: 8px; align-items: center; }
.card-b { padding: 18px; }
.card-b.tight { padding: 0; }
.card-f { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.stat { padding: 18px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; }
.stat .delta { font-size: 12px; margin-top: 4px; }
.stat .ico {
  position: absolute; inset-inline-end: 16px; top: 16px; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
}
.tone-red { background: var(--brand-50); color: var(--brand); }
.tone-green { background: var(--ok-bg); color: var(--ok); }
.tone-amber { background: var(--warn-bg); color: var(--warn); }
.tone-blue { background: var(--info-bg); color: var(--info); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-teal { background: var(--teal-bg); color: var(--teal); }
.tone-gray { background: var(--surface-2); color: var(--text-2); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  font-size: 13.5px; cursor: pointer; transition: border-color .15s, background-color .15s, opacity .15s; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px -6px rgba(225, 6, 0, .6); }
.btn.primary:hover { background: var(--brand-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
:root[data-theme="dark"] .btn.dark { background: #e8ebf0; color: #0b0d11; border-color: #e8ebf0; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-t { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.inline { display: inline; }

/* ---------- forms */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; font-weight: 400;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px rgba(100, 116, 139, .16); outline: none; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
input[type="file"] { padding: 7px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; cursor: pointer; color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.fieldset { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 14px; }
.fieldset legend { padding: 0 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.input-group { display: flex; }
.input-group > *:not(:last-child) { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group > *:not(:first-child) { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); border: 0; background: none; cursor: pointer; font-family: inherit; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th {
  text-align: start; font-weight: 600; color: var(--muted); font-size: 12px; padding: 11px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.t td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .1s; }
.t tbody tr.link:hover { background: var(--surface-2); cursor: pointer; }
.t .r { text-align: end; }
.t tfoot td { font-weight: 700; background: var(--surface-2); }
.t .sub-row td { color: var(--muted); font-size: 12.5px; }

/* ---------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.b-received { background: var(--info-bg); color: var(--info); }
.b-diagnosing { background: var(--violet-bg); color: var(--violet); }
.b-awaiting_approval { background: var(--warn-bg); color: var(--warn); }
.b-awaiting_parts { background: #fdf2e9; color: #b45309; }
:root[data-theme="dark"] .b-awaiting_parts { background: #2b1d0f; }
.b-in_progress { background: var(--brand-50); color: var(--brand); }
.b-quality_check { background: var(--teal-bg); color: var(--teal); }
.b-ready { background: var(--ok-bg); color: var(--ok); }
.b-delivered { background: var(--surface-2); color: var(--muted); }
.b-draft { background: var(--surface-2); color: var(--muted); }
.b-issued { background: var(--info-bg); color: var(--info); }
.b-partial { background: var(--warn-bg); color: var(--warn); }
.b-paid { background: var(--ok-bg); color: var(--ok); }
.b-void { background: var(--danger-bg); color: var(--danger); text-decoration: line-through; }
.b-pending { background: var(--warn-bg); color: var(--warn); }
.b-approved { background: var(--ok-bg); color: var(--ok); }
.b-declined { background: var(--danger-bg); color: var(--danger); }
.b-received-po { background: var(--ok-bg); color: var(--ok); }
.b-urgent { background: var(--danger); color: #fff; }
.b-high { background: var(--warn-bg); color: var(--warn); }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }

/* ---------- UAE plate */
.plate {
  display: inline-flex; align-items: stretch; border: 2px solid #111; border-radius: 7px; background: #fff; color: #111;
  font-weight: 800; font-family: "Arial Narrow", Arial, sans-serif; line-height: 1; direction: ltr; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .1); font-size: 14px; height: 30px;
}
.plate .em { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 6px; font-size: 8.5px; font-weight: 700; border-inline-end: 1.5px solid #111; min-width: 34px; }
.plate .em i { font-style: normal; font-size: 12.5px; font-weight: 900; }
.plate .no { display: flex; align-items: center; padding: 0 9px; letter-spacing: .06em; font-size: 17px; }
.plate.DXB .em { color: #b8000a; } .plate.AUH .em { background: #c8102e; color: #fff; } .plate.SHJ .em { background: #f47a20; color: #fff; }
.plate.AJM .em { color: #0a5; } .plate.RAK .em { color: #c8102e; } .plate.FUJ .em { color: #1d4ed8; } .plate.UAQ .em { color: #6d28d9; }
.plate.lg { height: 42px; } .plate.lg .no { font-size: 24px; padding: 0 14px; } .plate.lg .em { min-width: 44px; font-size: 10px; } .plate.lg .em i { font-size: 16px; }

/* ---------- kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 200px; display: flex; flex-direction: column; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 13.5px; position: sticky; top: 0; }
.col-h .n { margin-inline-start: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; font-size: 11.5px; padding: 1px 9px; }
.col-h .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.col-body { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 60px; border-radius: 0 0 var(--radius) var(--radius); transition: background .15s; }
.col-body.over { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.jcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: var(--shadow);
  cursor: grab; transition: transform .12s, box-shadow .12s; display: block; position: relative;
}
.jcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.jcard.dragging { opacity: .5; }
.jcard .top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.jcard .car { font-weight: 700; margin-top: 8px; font-size: 14px; }
.jcard .cust { color: var(--muted); font-size: 12.5px; }
.jcard .meta { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.jcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.jcard .late { color: var(--danger); font-weight: 600; }
.jcard.p-urgent { border-inline-start: 3px solid var(--danger); }
.jcard.p-high { border-inline-start: 3px solid var(--warn); }

/* ---------- timeline */
.timeline { position: relative; display: flex; flex-direction: column; gap: 16px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { display: flex; gap: 12px; position: relative; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface); border: 2px solid var(--border); z-index: 1; }
.tl-dot svg { width: 15px; height: 15px; }
.tl-body { flex: 1; min-width: 0; padding-top: 4px; }
.tl-body .when { font-size: 12px; color: var(--muted); }
.tl-body .photo { margin-top: 8px; border-radius: 10px; max-height: 220px; border: 1px solid var(--border); }

/* ---------- alerts list */
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: 0; }
.alert-item .ai { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.alert-item.danger .ai { background: var(--danger-bg); color: var(--danger); }
.alert-item.warn .ai { background: var(--warn-bg); color: var(--warn); }
.alert-item.info .ai { background: var(--info-bg); color: var(--info); }
.alert-item b { font-size: 13.5px; display: block; }
.alert-item .t2 { font-size: 12.5px; color: var(--muted); }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.flash.success { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.flash.info { background: var(--info-bg); color: var(--info); }
.toast-wrap { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
[dir="rtl"] .toast-wrap { transform: translateX(50%); }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .25s ease; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- misc */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.totals { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.totals .line { display: flex; justify-content: space-between; gap: 20px; }
.totals .grand { font-size: 18px; font-weight: 800; padding-top: 8px; border-top: 2px solid var(--text); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ff6a3d); border-radius: 99px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--text); border-color: var(--brand); }
.pill-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; max-width: 100%; overflow: hidden; }
.pill-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.stars { display: inline-flex; gap: 2px; color: #f5a623; }
.insp { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.insp-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.insp-row .nm { flex: 1; font-size: 13px; font-weight: 500; }
.insp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.insp-dot.ok { background: var(--ok); } .insp-dot.warn { background: #f5a623; } .insp-dot.bad { background: var(--danger); }
.insp-pick { display: inline-flex; gap: 3px; }
.insp-pick label { cursor: pointer; }
.insp-pick input { display: none; }
.insp-pick span { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; border: 1px solid var(--border); }
.insp-pick input:checked + span.ok { background: var(--ok); border-color: var(--ok); }
.insp-pick input:checked + span.warn { background: #f5a623; border-color: #f5a623; }
.insp-pick input:checked + span.bad { background: var(--danger); border-color: var(--danger); }
.insp-pick span i { width: 8px; height: 8px; border-radius: 50%; }
.insp-pick span.ok i { background: var(--ok); } .insp-pick span.warn i { background: #f5a623; } .insp-pick span.bad i { background: var(--danger); }
.insp-pick input:checked + span i { background: #fff; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--brand); opacity: .85; transition: opacity .15s; }
.chart .bar:hover { opacity: 1; }
.chart .grid-l { stroke: var(--border); stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.hbar { display: flex; flex-direction: column; gap: 10px; }
.hbar .r { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; }

/* dialog */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 12, 16, .5); backdrop-filter: blur(3px); }
dialog .dh { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
dialog .dh h2 { font-size: 16px; }
dialog .db { padding: 20px; }
dialog .df { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

/* command palette */
#palette { width: min(640px, calc(100vw - 32px)); margin-top: 10vh; }
#palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 18px 20px; font-size: 16px; box-shadow: none; }
#palette .res { max-height: 55vh; overflow-y: auto; padding: 6px; }
#palette .res a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; }
#palette .res a:hover, #palette .res a.sel { background: var(--surface-2); }
#palette .res .k { font-size: 11px; color: var(--muted); margin-inline-start: auto; }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  background: radial-gradient(1200px 600px at 20% 10%, rgba(225, 6, 0, .35), transparent 60%), radial-gradient(800px 500px at 90% 90%, rgba(255, 106, 61, .18), transparent 60%), #0b0d11;
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 22px);
}
.auth-art h1 { font-size: 40px; line-height: 1.15; max-width: 480px; position: relative; z-index: 1; }
.auth-art p { color: #a9b1bd; max-width: 440px; margin-top: 14px; position: relative; z-index: 1; font-size: 15px; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; z-index: 1; max-width: 520px; }
.auth-feats div { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); padding: 14px; border-radius: 14px; font-size: 13px; color: #d5dae2; display: flex; gap: 10px; align-items: center; }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 380px; }

@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-inline-start: 0; z-index: 50; width: 270px; transform: translateX(-110%); transition: transform .2s; }
  [dir="rtl"] .sidebar { transform: translateX(110%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 10px 16px; }
  .g2, .g3, .g-main-l { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .search-trigger kbd { display: none; }
}
@media (max-width: 640px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .stat .value { font-size: 20px; }
  .stat .ico { display: none; }
  h1 { font-size: 20px; }
  .t th, .t td { padding: 10px 10px; }
  .hide-sm { display: none; }
}

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* part picker */
.picker-list { position: absolute; z-index: 30; inset-inline: 0; top: 64px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; padding: 4px; }
.picker-list a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.picker-list a:hover { background: var(--surface-2); }
@media (max-width: 760px) { form[data-part-picker] .form-grid { grid-template-columns: 1fr 1fr !important; } form[data-part-picker] .form-grid > div { grid-column: 1 / -1; } }

/* ---------- car file: action bar */
.actbar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); font: inherit; font-weight: 600; font-size: 13px; color: var(--text);
  transition: transform .1s, box-shadow .15s, border-color .15s; text-align: center; line-height: 1.3;
}
.act:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.act:active { transform: scale(.97); }
.act-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; }
@media (max-width: 1100px) { .actbar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .actbar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .act { padding: 12px 4px; font-size: 12px; } .act-ic { width: 40px; height: 40px; font-size: 20px; } }

/* bottom-sheet dialogs on phones */
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; max-height: 92vh; }
  dialog.sheet[open] { animation: sheet-up .22s ease; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
.trade-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.trade-pick input { display: none; }
.trade-pick span { display: inline-block; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 600; background: var(--surface-2); }
.trade-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.hint-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hint-chips .chip { cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text-2); }
.hint-chips .chip:hover { border-color: var(--brand); color: var(--brand); }
.upload { display: flex; align-items: center; gap: 10px; padding: 14px; border: 2px dashed var(--border-strong); border-radius: 14px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.upload.big { flex-direction: column; justify-content: center; padding: 26px; }
.upload:hover { border-color: var(--brand); color: var(--brand); }
.upload input { display: none; }
.upload.has { border-style: solid; border-color: var(--ok); color: var(--ok); }
.previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.previews:empty { display: none; }
.previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.previews .pdf { aspect-ratio: 1; display: grid; place-items: center; background: var(--surface-2); border-radius: 10px; font-weight: 700; font-size: 12px; }

/* ---------- car file: thread */
.thread { display: flex; flex-direction: column; gap: 14px; }
.sys { text-align: center; }
.sys-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.sys-note { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.sys .when, .msg .when { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg.mine { flex-direction: row-reverse; margin-inline-start: auto; }
.msg-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), #ff5a36); }
.msg.cust .msg-av { background: #2563eb; }
.bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; border-end-start-radius: 4px; padding: 10px 12px; min-width: 160px; }
.msg.mine .bubble { border-end-start-radius: 16px; border-end-end-radius: 4px; background: var(--surface); }
.msg.cust .bubble { background: var(--info-bg); border-color: transparent; }
.msg.internal .bubble { border-style: dashed; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); }
.msg-h { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.msg-h span { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.msg-t { white-space: pre-line; font-size: 14px; }
.item-ev { display: flex; align-items: center; gap: 10px; }
.item-ev.declined { opacity: .45; text-decoration: line-through; }
.ie-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); flex-shrink: 0; }
.gallery { display: grid; gap: 4px; margin-top: 8px; border-radius: 12px; overflow: hidden; }
.gallery.g1 { grid-template-columns: 1fr; } .gallery.g2 { grid-template-columns: 1fr 1fr; } .gallery.g3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery img { width: 100%; height: 100%; max-height: 260px; object-fit: cover; display: block; aspect-ratio: 4/3; }
.gallery.g1 img { aspect-ratio: auto; max-height: 320px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 12.5px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; height: 44px; resize: none; border-radius: 22px; padding: 11px 16px; }
.composer .icon-btn { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.composer .send { background: var(--brand); color: #fff; border-color: var(--brand); }

/* running bill */
.bill { display: flex; flex-direction: column; gap: 7px; }
.bill .line { display: flex; justify-content: space-between; gap: 16px; }
.bill .grand { font-size: 20px; font-weight: 800; padding-top: 8px; border-top: 2px solid var(--text); margin-top: 2px; }
.bill .grand small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* worker view */
.wk-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wk-status { display: flex; gap: 8px; flex-wrap: wrap; }
.wk-status select { width: auto; }
.msg.wide { width: min(100%, 560px); max-width: 100%; }
.msg.wide .bubble { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .search-trigger span { display: none; }
  .search-trigger { flex: 0 0 auto; }
  .msg { max-width: 100%; }
}

.brand-logo { width: auto; max-width: 160px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }

/* ---- v1.6 polish: nothing may push the page sideways on phones ---- */
.grid > *, .stack > *, .row > *, .card, .card-b { min-width: 0; }
.card-h, .card-f { flex-wrap: wrap; }
.card-h h2, .card-h h3 { min-width: 0; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.seg a, .seg button { white-space: nowrap; flex: none; }
.tabs { scrollbar-width: none; }
.page-head { flex-wrap: wrap; }
.page-head .actions { flex-wrap: wrap; }
img, svg, video { max-width: 100%; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
  .card-h, .card-f { padding-inline: 14px; }
  .card-h form, .card-h input[type=date] { max-width: 100%; }
  .card-h input[type=date] { flex: 1 1 130px; min-width: 0; }
  .kv { grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
  .kv dd, .kv span { overflow-wrap: anywhere; }
  .mono { overflow-wrap: anywhere; }
}

/* ---- v1.6 polish round 1 ---- */
/* the garage's own black logo turns white on dark surfaces */
.brand-logo { width: auto; object-fit: contain; }
.sidebar .brand-logo.def, .auth-art .brand-logo.def, .st-nav .brand-logo.def, .st-foot .brand-logo.def,
.trk-hero .brand-logo.def, .lock-body .brand-logo.def, :root[data-theme="dark"] .brand-logo.def { filter: invert(1); }
/* sidebar: user box + clock-in always visible, even on short laptop screens */
.sidebar { overflow: hidden; }
.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a303a transparent; margin-inline: -4px; padding-inline: 4px; }
.sidebar .brand-logo { max-height: 30px; max-width: 80px; }
.brand b { white-space: nowrap; }
.nav a { padding: 8px 10px; }
.nav-group { margin-top: 10px; }
/* tables: ids/numbers never break mid-word, numbers never wrap */
.t .mono, .t .num, .t .nowrap { white-space: nowrap; overflow-wrap: normal; }
td.ltr { display: table-cell; }
/* icons inside field labels sit inline with the text */
label.f > .lbl { display: inline-flex; align-items: center; gap: 6px; }
/* horizontal scrollers show a soft fade so people know there is more */
.has-more { -webkit-mask-image: linear-gradient(to var(--fade-to, left), #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to var(--fade-to, left), #000 calc(100% - 36px), transparent); }
[dir="ltr"] .has-more { --fade-to: right; }
.has-more.at-end { -webkit-mask-image: none; mask-image: none; }
/* status stepper: one scrollable row on phones */
.stepper { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) {
  .stepper { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stepper::-webkit-scrollbar { display: none; }
  .stepper .btn { white-space: nowrap; }
  .insp-pick span { width: 32px !important; height: 32px !important; }
  .insp-pick { gap: 6px; }
  .g3.compact-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .g3.compact-sm .stat { padding: 12px; }
  .g3.compact-sm .stat .value { font-size: 17px; }
  .g3.compact-sm .stat .label { font-size: 11.5px; }
}
.show-sm { display: none; }
@media (max-width: 640px) { .show-sm { display: block; } span.show-sm { display: inline; } .t td:first-child { min-width: 120px; } }
@media (max-width: 960px) { .side-first > .stack:last-child { order: -1; } }
.save-bar { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@media (max-width: 640px) {
  .board.agenda { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .board.agenda .col.empty-day .col-body { display: none; }
  .board.agenda .col.empty-day { opacity: .6; }
}
@media (min-width: 641px) { .only-sm { display: none !important; } }
[dir="rtl"] .composer .send svg { transform: scaleX(-1); }
.pay-main { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; white-space: normal; }
.pay-part { margin-top: 8px; }
.pay-part summary { cursor: pointer; color: var(--info); font-weight: 600; padding: 8px 0; text-align: center; list-style: none; }
.pay-part summary::after { content: ' ▾'; }
.pay-part[open] summary::after { content: ' ▴'; }
.pay-part[open] { border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px 10px; }
/* login on phones: keep the brand visible */
.auth-mobile-head { display: none; }
@media (max-width: 960px) {
  .auth-mobile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--sidebar); color: #fff; padding: 14px 18px; }
  .auth-mobile-head .brand-logo.def { filter: invert(1); }
  .auth-mobile-head a { color: #c3cad5; font-size: 13px; }
  .auth { display: block; }
  .auth-form { padding: 28px 20px; }
}

/* ---- v1.6 polish round 2 ---- */
.alert-item .t2 bdi, .alert-item b bdi { white-space: nowrap; }
[dir="rtl"] input[dir="ltr"][placeholder]:placeholder-shown { text-align: right; }
input[dir="ltr"]:not(:placeholder-shown) { text-align: left; }
@media (max-width: 640px) {
  .empty-sm-hide:has(.empty) { display: none; }
  .col { min-height: 0; }
  .col-body:empty { display: none; }
  .g3.compact-sm > .stat:first-child { grid-column: 1 / -1; }
  .g3.compact-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t td .nm-clip { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.save-bar { grid-column: 1 / -1; }
.empty.one-line { flex-direction: row; padding: 16px; gap: 8px; min-height: 0; }
@media (max-width: 640px) { details.insp-card > summary { flex-wrap: wrap; } details.insp-card > summary .end { width: 100%; margin-inline-start: 0; justify-content: flex-start; } }
.auth-form { min-height: calc(100dvh - 58px); }
@media (min-width: 961px) { .auth-form { min-height: 0; } }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar .brand .brand-logo { max-width: 110px; max-height: 32px; }
@media (max-width: 640px) { .trk .msg-av { display: none; } .trk .msg { max-width: 100%; } }
@media (max-width: 960px) { body:has(.auth) { background: var(--surface); } }

/* ---- v1.8 website content ---- */
.sm-sec { scroll-margin-top: 80px; }
.sm-up { display: grid; gap: 12px; margin-bottom: 18px; }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sm-item { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.sm-item.off { opacity: .55; }
.sm-img { position: relative; display: block; aspect-ratio: 16/10; background: var(--surface-2); }
.sm-grid.team .sm-img { aspect-ratio: 1/1; }
.sm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-live { position: absolute; top: 8px; inset-inline-start: 8px; }
.sm-f { display: grid; gap: 6px; padding: 10px; }
.sm-f input, .sm-f select { width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.sm-f select { width: auto; flex: 1; }
.sm-empty { display: flex; align-items: center; gap: 10px; padding: 18px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.pk-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.pk-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--brand); color: #fff; }
.dl-fee { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.dl-fee.need { background: var(--warn-bg, rgba(199,119,0,.08)); border: 1px solid rgba(199,119,0,.35); border-radius: 12px; padding: 10px; }

/* ---- v2.0 user guide ---- */
.gd-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: end; padding: 28px; border-radius: 20px; margin-bottom: 22px;
  background: radial-gradient(600px 300px at 100% 0%, rgba(225, 6, 0, .10), transparent 70%), var(--surface); border: 1px solid var(--border); }
.gd-eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.gd-hero h1 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; margin: 8px 0 6px; }
.gd-hero p { color: var(--text-2); margin: 0; }
.gd-tools { display: grid; gap: 10px; }
.gd-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.gd-roles button { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gd-roles button.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.gd-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); }
.gd-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(225, 6, 0, .1); }
.gd-search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; font: inherit; color: var(--text); outline: none; }

.gd-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.gd-toc { position: sticky; top: 76px; display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); max-height: calc(100vh - 100px); overflow-y: auto; }
.gd-toc-h { font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 8px 8px; }
.gd-toc a { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.gd-toc a .n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 11.5px; font-weight: 700; }
.gd-toc a:hover { background: var(--surface-2); }
.gd-toc a.on { background: rgba(225, 6, 0, .07); color: var(--brand); font-weight: 700; }
.gd-toc a.on .n { background: var(--brand); color: #fff; }
.gd-toc a[hidden] { display: none; }
.gd-print { margin-top: 10px; }

.gd-main { display: grid; gap: 18px; min-width: 0; }
.gd-sec { scroll-margin-top: 80px; padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 16px; }
.gd-sec[hidden] { display: none; }
.gd-sec-h { display: flex; gap: 14px; align-items: flex-start; }
.gd-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--text); color: var(--surface); font-weight: 700; }
.gd-sec-h h2 { font-size: 20px; margin: 0 0 6px; line-height: 1.3; }
.gd-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.gd-meta > span:first-child { display: inline-flex; gap: 4px; align-items: center; margin-inline-end: 4px; }
.gd-pill { padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; color: var(--text-2); }
.gd-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(225, 6, 0, .08); color: var(--brand); }
.gd-intro { margin: 0; font-size: 15px; line-height: 1.75; color: var(--text-2); }

.ui-k { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: .92em; color: var(--text); line-height: 1.6; white-space: nowrap; }

.gd-body { display: grid; gap: 20px; }
.gd-body.has-shot { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.gd-body.has-shot:not(.phone) { grid-template-columns: minmax(0, 1fr) 380px; }
.gd-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: grid; gap: 10px; }
.gd-steps li { counter-increment: st; position: relative; padding-inline-start: 42px; min-height: 30px; line-height: 1.75; font-size: 14.5px; }
.gd-steps li::before { content: counter(st); position: absolute; inset-inline-start: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(225, 6, 0, .09); color: var(--brand); font-weight: 700; font-size: 13px; }
.gd-steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 13.5px; top: 32px; bottom: -8px; width: 1px; background: var(--border); }
.gd-shot { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--shadow); cursor: zoom-in; }
.gd-body.phone .gd-shot { border-radius: 26px; border: 5px solid #16181d; max-width: 300px; justify-self: center; }
.gd-shot img { display: block; width: 100%; height: auto; }

.gd-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; counter-reset: fl; }
.gd-flow li { counter-increment: fl; position: relative; padding: 14px 12px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 3px; }
.gd-flow li::before { content: counter(fl); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.gd-flow li b { font-size: 14px; }
.gd-flow li span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.gd-lamps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gd-lamp { padding: 14px; border-radius: 14px; border: 1px solid var(--border); display: grid; gap: 4px; background: var(--surface-2); }
.gd-lamp i { width: 18px; height: 18px; border-radius: 50%; margin-bottom: 4px; }
.gd-lamp.ok i { background: #16a34a; } .gd-lamp.warn i { background: #f59e0b; } .gd-lamp.bad i { background: #e10600; }
.gd-lamp span { font-size: 13px; color: var(--text-2); line-height: 1.6; }

.gd-tips { display: grid; gap: 10px; }
.gd-tips.two { grid-template-columns: 1fr 1fr; }
.gd-tip { padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 14px; }
.gd-tip b { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.gd-tip ul { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; line-height: 1.65; }
.gd-tip.do { background: var(--ok-bg, #ecfdf3); border-color: rgba(22, 163, 74, .25); } .gd-tip.do b { color: var(--ok); }
.gd-tip.dont { background: var(--warn-bg); border-color: rgba(199, 119, 0, .3); } .gd-tip.dont b { color: var(--warn); }

.gd-faq { display: grid; gap: 8px; }
.gd-faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.gd-faq summary { padding: 12px 14px; cursor: pointer; font-weight: 700; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.gd-faq summary::-webkit-details-marker { display: none; }
.gd-faq summary::after { content: "+"; font-size: 18px; line-height: 1; color: var(--muted); }
.gd-faq details[open] summary::after { content: "−"; }
.gd-faq details p { margin: 0; padding: 0 14px 14px; color: var(--text-2); line-height: 1.7; font-size: 14px; }
.gd-links { display: flex; gap: 8px; flex-wrap: wrap; }
.gd-empty { padding: 30px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 16px; }
.gd-end { display: flex; gap: 10px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-size: 13.5px; }

@media (max-width: 1100px) {
  .gd-body.has-shot, .gd-body.has-shot:not(.phone) { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .gd-hero { grid-template-columns: 1fr; padding: 20px; }
  .gd-layout { grid-template-columns: 1fr; }
  .gd-toc { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; max-height: none; scrollbar-width: none; }
  .gd-toc::-webkit-scrollbar { display: none; }
  .gd-toc-h, .gd-print { display: none; }
  .gd-toc a { flex: none; white-space: nowrap; }
  .gd-body.has-shot, .gd-body.has-shot:not(.phone) { grid-template-columns: 1fr; }
  .gd-flow { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .gd-lamps, .gd-tips.two { grid-template-columns: 1fr; }
  .gd-sec { padding: 18px; }
}
@media print {
  .sidebar, .topbar, .gd-tools, .gd-toc, .gd-links, .gd-end { display: none !important; }
  .gd-layout { display: block; } .gd-sec { break-inside: avoid; border: 0; padding: 12px 0; }
  .gd-sec[hidden] { display: grid !important; } .gd-faq details { display: block; } .gd-faq details p { display: block; }
}
@media (max-width: 900px) {
  .gd-toc { position: sticky; top: 58px; z-index: 6; box-shadow: var(--shadow); }
  .gd-lamp { grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px; }
  .gd-lamp i { margin: 0; grid-row: span 2; }
}
.gd-count { font-size: 12.5px; color: var(--muted); font-weight: 600; }
