/* ============================================================
   Garage Manager — stylesheet
   Identity: a clean steel-and-paper "shop logbook".
   - Green primary action is spec-required (SRS 4.4).
   - Signature: the mono "data-plate" for vehicle identity (VIN/plate),
     echoing the metal data plate in a door jamb.
   - Maintenance status carries semantic color (overdue/due/upcoming).
   ============================================================ */

:root {
  color-scheme: light;

  --ink:        #16191D;
  --ink-2:      #353B42;
  --steel:      #5C656F;
  --steel-2:    #8A929B;
  --line:       #DEE2E7;
  --line-strong:#C4CAD2;
  --paper:      #FFFFFF;
  --bg:         #EBEEF2;
  --bg-2:       #F5F7F9;
  --on-ink:     #FFFFFF;   /* text placed on --ink surfaces (toast, chips, tags) */
  --appbar-bg:  #202124;   /* top banner: dark neutral grey */

  --go:         #2E7D46;   /* primary action (add record / save) */
  --go-press:   #246439;
  --go-soft:    #EAF4ED;
  --go-fg:      #FFFFFF;   /* text/icon placed on a --go surface */
  /* The accent is legible as a filled surface at any lightness, but a theme whose
     accent is light (Industrial's safety yellow) loses it when the same color is drawn
     as a hairline or as text on paper. These two carry the accent into those roles;
     a theme only overrides them if its --go is too light to survive there. */
  --go-line:    var(--go); /* accent as decorative reinforcement: tab underline, spinner arc, bar fill */
  --go-ink:     var(--go); /* accent where it must stay legible on a light surface: text, and focus rings */

  --appbar-fg:      #FFFFFF;            /* text/icon on --appbar-bg */
  --appbar-hover:   rgba(255,255,255,.12);

  --amber:      #97620A;   /* due soon */
  --amber-bg:   #FAEFD7;
  --red:        #BB3322;   /* overdue */
  --red-bg:     #F8E1DC;
  --blue:       #2C6E9B;   /* upcoming / info */
  --blue-bg:    #E1ECF4;
  --note-border:#E9D199;   /* inline amber note */
  --note-ink:   #7A5206;

  /* data plate (vehicle ID box, invite code box) — light metal in light theme */
  --plate-bg-1:   #F7F9FB;
  --plate-bg-2:   #EDF0F4;
  --plate-border: #C4CAD2;
  --plate-inset:  rgba(255,255,255,.65);
  --plate-ink:    #16191D;
  --plate-label:  #6B7480;
  --plate-key:    #5C656F;
  --plate-divider:rgba(22,25,29,.14);

  /* Chart series palette (fixed order; CVD-validated against --paper). */
  --series-1: #2E7D46;
  --series-2: #2467B8;
  --series-3: #B5760C;
  --series-4: #BB3322;
  --series-5: #6B4FA0;
  --series-6: #C05A8E;

  --shadow-sm:  0 1px 2px rgba(16,19,23,.07);
  --shadow:     0 1px 2px rgba(16,19,23,.06), 0 6px 18px rgba(16,19,23,.08);
  /* Tile hover shadow: same shape, 10% darker. */
  --shadow-hover: 0 1px 2px rgba(16,19,23,.066), 0 6px 18px rgba(16,19,23,.088);

  --radius:     11px;
  --radius-sm:  7px;
  --border-width: 1px;  /* component/box border weight (themeable) */
  --rule-width:   1px;  /* thin row/rule divider weight (themeable) */
  --rule-style: solid;  /* set to "double" for Classical's signature rules */

  --font-display: "Archivo", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "Roboto Mono", ui-monospace, monospace;
  --font-label:   var(--font-display);  /* small uppercase kickers (VIN/plate, section titles...); mono in Nocturne/Industrial */

  /* Text-case per role, themeable independently (mockups vary these per theme). */
  --heading-case: none;
  --label-case:   uppercase;
  --tab-case:     none;
  --brand-case:   uppercase;
  --btn-case:     none;

  /* The rule under the app bar: a plain accent line by default, but each named
     theme defines its own color/weight/pattern here (incl. Industrial's hazard stripe). */
  --appbar-rule:    var(--go);
  --appbar-rule-h:  3px;

  --maxw: 1120px;
}

/* ---------- Named design themes (Garage Manager Theme Expansion) ---------- */
/* The palette on :root above holds the defaults every theme starts from; it is no
   longer a theme of its own. Each theme is drawn in a light and a dark version,
   chosen by data-mode ("light" or "dark", System already resolved by app.js).
   A theme's first block is its own version; the [data-mode] block after it is
   the other one, and overrides colors and shadows only, so fonts, radii, border
   weights, and text case carry over from the first. */
/* ---------- modernist ---------- */
:root[data-theme="modernist"] {
  color-scheme: light;
  --ink: #0a0a0a; --ink-2: #767676; --steel: #767676; --steel-2: #767676;
  --line: #ececec; --line-strong: #dcdcdc; --border-width: 1px; --rule-width: 1px;
  --paper: #ffffff; --bg: #ffffff; --bg-2: #f2f2f2; --on-ink: #ffffff; --appbar-bg: #ffffff;
  --go: #d9042b; --go-press: #ae0322; --go-soft: #fce9ed; --go-fg: #ffffff;
  --appbar-fg: #0a0a0a; --appbar-hover: rgba(10,10,10,.06);
  --amber: #846800; --amber-bg: #f1ede0; --red: #d9042b; --red-bg: #fbeaed; --blue: #d9042b; --blue-bg: #fbeaed;
  --note-border: #dad0ad; --note-ink: #614c00;
  --plate-bg-1: #ffffff; --plate-bg-2: #ffffff; --plate-border: #ececec; --plate-inset: transparent;
  --plate-ink: #0a0a0a; --plate-label: #767676; --plate-key: #767676; --plate-divider: rgba(10,10,10,.14);
  --series-1: #d9042b; --series-2: #0a0a0a; --series-3: #8f8f8f; --series-4: #a30320; --series-5: #080808; --series-6: #767676;
  --shadow-sm: none; --shadow: none; --shadow-hover: none;
  --radius: 0px; --radius-sm: 0px;
  --font-display: Inter, system-ui, sans-serif; --font-body: Inter, system-ui, sans-serif; --font-mono: "Roboto Mono", ui-monospace, monospace;
  --tab-case: uppercase;
  --appbar-rule: #dcdcdc; --appbar-rule-h: 1px;
}

:root[data-theme="modernist"] .section-title { color: var(--ink); }

:root[data-theme="modernist"][data-mode="dark"] {
  color-scheme: dark;
  --ink: #f5f5f5; --ink-2: #9a9a9a; --steel: #9a9a9a; --steel-2: #9a9a9a;
  --line: #1f1f1f; --line-strong: #333333;
  --paper: #0a0a0a; --bg: #0a0a0a; --bg-2: #171717; --on-ink: #0a0a0a; --appbar-bg: #0a0a0a;
  /* The red fill keeps its white text; red as text is lifted to read on black. */
  --go: #d9042b; --go-press: #b8031f; --go-soft: #2b0b12; --go-fg: #ffffff; --go-line: #d9042b; --go-ink: #ff3b5c;
  --appbar-fg: #f5f5f5; --appbar-hover: rgba(255,255,255,.08);
  --amber: #d6b13a; --amber-bg: #211d0d; --red: #ff3b5c; --red-bg: #2b0b12; --blue: #ff3b5c; --blue-bg: #2b0b12;
  --note-border: #4a3f17; --note-ink: #e0c25a;
  --plate-bg-1: #0a0a0a; --plate-bg-2: #0a0a0a; --plate-border: #1f1f1f; --plate-inset: transparent;
  --plate-ink: #f5f5f5; --plate-label: #9a9a9a; --plate-key: #9a9a9a; --plate-divider: rgba(255,255,255,.12);
  --series-1: #ff3b5c; --series-2: #f5f5f5; --series-3: #8f8f8f; --series-4: #d9042b; --series-5: #cfcfcf; --series-6: #9a9a9a;
  --appbar-rule: #333333;
}

/* ---------- classical ---------- */
:root[data-theme="classical"] {
  color-scheme: light;
  --ink: #241d16; --ink-2: #7a6a52; --steel: #7a6a52; --steel-2: #7a6a52;
  --line: #e6d9bd; --line-strong: #d9c9a8; --border-width: 1px; --rule-width: 3px;
  --paper: #fbf6ea; --bg: #f3e8d3; --bg-2: #f0e6d2; --on-ink: #fbf6ea; --appbar-bg: #2a231a;
  --go: #2f4a2a; --go-press: #263b22; --go-soft: #dcdccd; --go-fg: #fdf9ef;
  --appbar-fg: #f2e7d2; --appbar-hover: rgba(255,255,255,.10);
  --amber: #83631f; --amber-bg: #efe7d2; --red: #7c2d2d; --red-bg: #ecded3; --blue: #7c2d2d; --blue-bg: #ecded3;
  --note-border: #dccdab; --note-ink: #6c5219;
  --plate-bg-1: #f0e6d2; --plate-bg-2: #f0e6d2; --plate-border: #e6d9bd; --plate-inset: transparent;
  --plate-ink: #241d16; --plate-label: #7a6a52; --plate-key: #7a6a52; --plate-divider: rgba(36,29,22,.14);
  --series-1: #7c2d2d; --series-2: #2f4a2a; --series-3: #b08d3f; --series-4: #5d2222; --series-5: #233820; --series-6: #7a6a52;
  --shadow-sm: 0 1px 2px rgba(36,29,22,.08); --shadow: 0 1px 2px rgba(36,29,22,.07), 0 6px 18px rgba(36,29,22,.09); --shadow-hover: 0 1px 2px rgba(36,29,22,.08), 0 6px 18px rgba(36,29,22,.10);
  --radius: 3px; --radius-sm: 2px;
  --font-display: Archivo, sans-serif; --font-body: Inter, system-ui, sans-serif; --font-mono: "Roboto Mono", ui-monospace, monospace;
  --tab-case: uppercase; --rule-style: double;
  --appbar-rule: #b08d3f; --appbar-rule-h: 4px;
}

:root[data-theme="classical"][data-mode="dark"] {
  color-scheme: dark;
  --ink: #efe4cf; --ink-2: #b3a284; --steel: #b3a284; --steel-2: #b3a284;
  --line: #3a3126; --line-strong: #4d4232;
  --paper: #1f1a14; --bg: #17130e; --bg-2: #2a231a; --on-ink: #17130e; --appbar-bg: #0f0c08;
  /* The forest green is lifted so a filled button still stands off the walnut page. */
  --go: #4c7044; --go-press: #5a8250; --go-soft: #243022; --go-fg: #fdf9ef; --go-line: #8fb684; --go-ink: #8fb684;
  --appbar-fg: #f2e7d2; --appbar-hover: rgba(255,255,255,.10);
  --amber: #d9b26a; --amber-bg: #33291a; --red: #e09080; --red-bg: #3a201c; --blue: #e09080; --blue-bg: #3a201c;
  --note-border: #5a4a2c; --note-ink: #e3c98d;
  --plate-bg-1: #2a231a; --plate-bg-2: #2a231a; --plate-border: #3a3126; --plate-inset: transparent;
  --plate-ink: #efe4cf; --plate-label: #b3a284; --plate-key: #b3a284; --plate-divider: rgba(239,228,207,.12);
  --series-1: #e09080; --series-2: #8fb684; --series-3: #c9a457; --series-4: #c0605a; --series-5: #6f9a65; --series-6: #b3a284;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.4); --shadow-hover: 0 1px 2px rgba(0,0,0,.33), 0 6px 18px rgba(0,0,0,.44);
}

/* ---------- nocturne ---------- */
:root[data-theme="nocturne"] {
  color-scheme: dark;
  --ink: #e9eeee; --ink-2: #8c9799; --steel: #8c9799; --steel-2: #8c9799;
  --line: rgba(255,255,255,.07); --line-strong: rgba(255,255,255,.10); --border-width: 1px; --rule-width: 1px;
  --paper: #14181a; --bg: #0a0c0d; --bg-2: #1b2022; --on-ink: #0a0c0d; --appbar-bg: #101415;
  --go: #FF4B00; --go-press: #ff6a2b; --go-soft: #3d1d11; --go-fg: #1d0d07;
  --appbar-fg: #e9eeee; --appbar-hover: rgba(255,255,255,.10);
  --amber: #ffa726; --amber-bg: #30291b; --red: #f07a63; --red-bg: #2e2423; --blue: #FF4B00; --blue-bg: #301e17;
  --note-border: #5f461e; --note-ink: #ffbc5a;
  --plate-bg-1: #1b2022; --plate-bg-2: #1b2022; --plate-border: rgba(255,255,255,.07); --plate-inset: transparent;
  --plate-ink: #e9eeee; --plate-label: #8c9799; --plate-key: #8c9799; --plate-divider: rgba(255,255,255,.08);
  --series-1: #FF4B00; --series-2: #ffa726; --series-3: #7f8b8d; --series-4: #bf3800; --series-5: #bf7d1c; --series-6: #8c9799;
  --shadow-sm: inset 0 1px 0 rgba(255,255,255,.05), 0 1px 3px rgba(0,0,0,.4); --shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 20px rgba(0,0,0,.35); --shadow-hover: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.4);
  --radius: 12px; --radius-sm: 8px;
  --font-display: Inter, system-ui, sans-serif; --font-body: Inter, system-ui, sans-serif; --font-mono: "Roboto Mono", ui-monospace, monospace;
  --font-label: "Roboto Mono", ui-monospace, monospace;
  --appbar-rule: rgba(255,255,255,.07); --appbar-rule-h: 1px;
}

/* Nocturne is dark by nature, so its other version is the light one. */
:root[data-theme="nocturne"][data-mode="light"] {
  color-scheme: light;
  --ink: #101415; --ink-2: #5b6669; --steel: #5b6669; --steel-2: #5b6669;
  --line: rgba(10,12,13,.08); --line-strong: rgba(10,12,13,.14);
  --paper: #ffffff; --bg: #eef1f1; --bg-2: #f3f5f5; --on-ink: #ffffff; --appbar-bg: #ffffff;
  /* The orange fill keeps its near-black text; orange as text is deepened to read on white. */
  --go: #ff4b00; --go-press: #e64400; --go-soft: #ffe9df; --go-fg: #1d0d07; --go-line: #ff4b00; --go-ink: #b83500;
  --appbar-fg: #101415; --appbar-hover: rgba(10,12,13,.06);
  /* Overdue leans crimson so it stays apart from the orange of Upcoming. */
  --amber: #875400; --amber-bg: #fbefd9; --red: #b01b2e; --red-bg: #fbe4e6; --blue: #b83500; --blue-bg: #ffece3;
  --note-border: #f0d3a3; --note-ink: #7a4f00;
  --plate-bg-1: #f3f5f5; --plate-bg-2: #f3f5f5; --plate-border: rgba(10,12,13,.08); --plate-inset: transparent;
  --plate-ink: #101415; --plate-label: #5b6669; --plate-key: #5b6669; --plate-divider: rgba(10,12,13,.10);
  --series-1: #e64400; --series-2: #c27a00; --series-3: #7f8b8d; --series-4: #8f2a00; --series-5: #8a5a12; --series-6: #5b6669;
  --shadow-sm: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 3px rgba(16,20,21,.08); --shadow: 0 1px 2px rgba(16,20,21,.06), 0 6px 20px rgba(16,20,21,.08); --shadow-hover: 0 1px 2px rgba(16,20,21,.07), 0 8px 24px rgba(16,20,21,.10);
  --appbar-rule: rgba(10,12,13,.08);
}

/* ---------- organic ---------- */
:root[data-theme="organic"] {
  color-scheme: light;
  --ink: #23261f; --ink-2: #6e7367; --steel: #6e7367; --steel-2: #6e7367;
  --line: #e2e0d5; --line-strong: #dcd9cd; --border-width: 0px; --rule-width: 1px;
  --paper: #f6f4ee; --bg: #e9e7dd; --bg-2: #eceae1; --on-ink: #f6f4ee; --appbar-bg: #4e6b47;
  --go: #4e6b47; --go-press: #3e5639; --go-soft: #dfe1d7; --go-fg: #ffffff;
  --appbar-fg: #ffffff; --appbar-hover: rgba(255,255,255,.15);
  --amber: #866025; --amber-bg: #ede5d7; --red: #a44b35; --red-bg: #eee1d8; --blue: #a44b35; --blue-bg: #eee1d8;
  --note-border: #ddcdb1; --note-ink: #765521;
  --plate-bg-1: #eceae1; --plate-bg-2: #eceae1; --plate-border: #e2e0d5; --plate-inset: transparent;
  --plate-ink: #23261f; --plate-label: #6e7367; --plate-key: #6e7367; --plate-divider: rgba(35,38,31,.14);
  --series-1: #4e6b47; --series-2: #b4523a; --series-3: #8b9082; --series-4: #3a5035; --series-5: #873e2c; --series-6: #6e7367;
  --shadow-sm: 0 1px 6px rgba(35,38,31,.06); --shadow: 0 2px 10px rgba(35,38,31,.07); --shadow-hover: 0 4px 14px rgba(35,38,31,.10);
  --radius: 22px; --radius-sm: 13px;
  --font-display: Inter, system-ui, sans-serif; --font-body: Inter, system-ui, sans-serif; --font-mono: "Roboto Mono", ui-monospace, monospace;
  --label-case: none; --brand-case: none;
  --appbar-rule: transparent; --appbar-rule-h: 0px;
}

:root[data-theme="organic"][data-mode="dark"] {
  color-scheme: dark;
  --ink: #e8e9e1; --ink-2: #a5ab9c; --steel: #a5ab9c; --steel-2: #a5ab9c;
  --line: #30352b; --line-strong: #3b4135;
  --paper: #1f221c; --bg: #161813; --bg-2: #282c24; --on-ink: #161813; --appbar-bg: #2f402b;
  --go: #587850; --go-press: #658a5c; --go-soft: #263123; --go-fg: #ffffff; --go-line: #9cc191; --go-ink: #9cc191;
  --appbar-fg: #ffffff; --appbar-hover: rgba(255,255,255,.15);
  --amber: #d6ae6e; --amber-bg: #332a1b; --red: #e3907a; --red-bg: #3a2420; --blue: #e3907a; --blue-bg: #3a2420;
  --note-border: #4d4026; --note-ink: #e0c08a;
  --plate-bg-1: #282c24; --plate-bg-2: #282c24; --plate-border: #30352b; --plate-inset: transparent;
  --plate-ink: #e8e9e1; --plate-label: #a5ab9c; --plate-key: #a5ab9c; --plate-divider: rgba(232,233,225,.10);
  --series-1: #9cc191; --series-2: #e3907a; --series-3: #8b9082; --series-4: #6f9a65; --series-5: #c0604a; --series-6: #a5ab9c;
  --shadow-sm: 0 1px 6px rgba(0,0,0,.35); --shadow: 0 2px 10px rgba(0,0,0,.4); --shadow-hover: 0 4px 14px rgba(0,0,0,.45);
}

/* ---------- broadsheet ---------- */
:root[data-theme="broadsheet"] {
  color-scheme: light;
  --ink: #0a0a0a; --ink-2: #5b5b58; --steel: #5b5b58; --steel-2: #5b5b58;
  --line: #d7d3ca; --line-strong: #0a0a0a; --border-width: 1px; --rule-width: 2px;
  --paper: #faf8f3; --bg: #f1eee8; --bg-2: #eae7df; --on-ink: #faf8f3; --appbar-bg: #0d0d0d;
  --go: #1f4d2e; --go-press: #193e25; --go-soft: #d9ded5; --go-fg: #ffffff;
  --appbar-fg: #ffffff; --appbar-hover: rgba(255,255,255,.10);
  --amber: #7f6500; --amber-bg: #ede7d6; --red: #c0271b; --red-bg: #f3dfd9; --blue: #c0271b; --blue-bg: #f3dfd9;
  --note-border: #d6cca5; --note-ink: #614c00;
  --plate-bg-1: #eae7df; --plate-bg-2: #eae7df; --plate-border: #d7d3ca; --plate-inset: transparent;
  --plate-ink: #0a0a0a; --plate-label: #5b5b58; --plate-key: #5b5b58; --plate-divider: rgba(10,10,10,.14);
  --series-1: #c0271b; --series-2: #0a0a0a; --series-3: #1f4d2e; --series-4: #901d14; --series-5: #080808; --series-6: #5b5b58;
  --shadow-sm: none; --shadow: none; --shadow-hover: none;
  --radius: 0px; --radius-sm: 0px;
  --font-display: Archivo, sans-serif; --font-body: Inter, system-ui, sans-serif; --font-mono: "Roboto Mono", ui-monospace, monospace;
  --heading-case: uppercase; --tab-case: uppercase; --btn-case: uppercase;
  --appbar-rule: #0d0d0d; --appbar-rule-h: 3px;
}

:root[data-theme="broadsheet"][data-mode="dark"] {
  color-scheme: dark;
  --ink: #f1eee8; --ink-2: #a8a59e; --steel: #a8a59e; --steel-2: #a8a59e;
  /* The strong rules turn newsprint-light, as the light page's are black. */
  --line: #33322f; --line-strong: #f1eee8;
  --paper: #191918; --bg: #121211; --bg-2: #222220; --on-ink: #121211; --appbar-bg: #050505;
  --go: #3f7a52; --go-press: #4a8a5e; --go-soft: #1d2b21; --go-fg: #ffffff; --go-line: #7fbf92; --go-ink: #7fbf92;
  --appbar-fg: #f1eee8; --appbar-hover: rgba(255,255,255,.10);
  --amber: #d8b84a; --amber-bg: #2e2812; --red: #ff7a6b; --red-bg: #3a1d1a; --blue: #ff7a6b; --blue-bg: #3a1d1a;
  --note-border: #4d4220; --note-ink: #e6cc6e;
  --plate-bg-1: #222220; --plate-bg-2: #222220; --plate-border: #33322f; --plate-inset: transparent;
  --plate-ink: #f1eee8; --plate-label: #a8a59e; --plate-key: #a8a59e; --plate-divider: rgba(241,238,232,.12);
  --series-1: #ff7a6b; --series-2: #f1eee8; --series-3: #7fbf92; --series-4: #d6493b; --series-5: #cfccc4; --series-6: #a8a59e;
  --appbar-rule: #f1eee8;
}

/* ---------- industrial ---------- */
:root[data-theme="industrial"] {
  color-scheme: light;
  --ink: #15181a; --ink-2: #5d6669; --steel: #5d6669; --steel-2: #5d6669;
  --line: #c9d0d3; --line-strong: #15181a; --border-width: 2px; --rule-width: 2px;
  --paper: #ffffff; --bg: #dfe3e5; --bg-2: #eceff0; --on-ink: #ffffff;
  /* Safety yellow is the accent, so the whole yellow ramp is spelled out: a bright
     fill that only ever carries dark text, a deeper gold for hairlines and rings
     that would otherwise vanish on these light neutrals, and a dark gold for text. */
  --go: #f2c200; --go-press: #d9a400; --go-soft: #fcf3d0; --go-fg: #15181a;
  --go-line: #d9a400; --go-ink: #7a6100;
  /* The banner is the page ground; the hazard stripe under it is the only divider. */
  --appbar-bg: #dfe3e5; --appbar-fg: #15181a; --appbar-hover: rgba(21,24,26,.08);
  /* Caution reads as a pale wash, not a second yellow fill — a saturated amber band
     sat between --go-soft and the --go buttons and muddied both. */
  --amber: #7a5f00; --amber-bg: #f7ecc6; --red: #c02b1d; --red-bg: #f7e6e4; --blue: #197439; --blue-bg: #e4efe8;
  --note-border: #e0cf8a; --note-ink: #6b5400;
  --plate-bg-1: #eceff0; --plate-bg-2: #eceff0; --plate-border: #c9d0d3; --plate-inset: transparent;
  --plate-ink: #15181a; --plate-label: #5d6669; --plate-key: #5d6669; --plate-divider: rgba(21,24,26,.14);
  --series-1: #c8a000; --series-2: #1a7a3c; --series-3: #15181a; --series-4: #967800; --series-5: #145c2d; --series-6: #5d6669;
  --shadow-sm: none; --shadow: none; --shadow-hover: none;
  --radius: 3px; --radius-sm: 2px;
  --font-display: Archivo, sans-serif; --font-body: Inter, system-ui, sans-serif; --font-mono: "Roboto Mono", ui-monospace, monospace;
  --heading-case: uppercase; --tab-case: uppercase; --btn-case: uppercase;
  --appbar-rule: repeating-linear-gradient(135deg, var(--go) 0 10px, var(--ink) 10px 20px); --appbar-rule-h: 8px;
}

:root[data-theme="industrial"][data-mode="dark"] {
  color-scheme: dark;
  --ink: #eef0f1; --ink-2: #a3acb0; --steel: #a3acb0; --steel-2: #a3acb0;
  /* The heavy outlines turn light grey, as the light page's are black. */
  --line: #3a4145; --line-strong: #c9d0d3;
  --paper: #24282a; --bg: #1a1d1f; --bg-2: #2d3235; --on-ink: #15181a;
  /* On dark steel, safety yellow reads as fill, line, and text alike. */
  --go: #f2c200; --go-press: #ffd21a; --go-soft: #3a3210; --go-fg: #15181a; --go-line: #f2c200; --go-ink: #f2c200;
  --appbar-bg: #1a1d1f; --appbar-fg: #eef0f1; --appbar-hover: rgba(255,255,255,.08);
  --amber: #e8c35a; --amber-bg: #3a3114; --red: #ff8a7a; --red-bg: #3d211e; --blue: #6fd396; --blue-bg: #1b3526;
  --note-border: #5a4c1c; --note-ink: #f0d27a;
  --plate-bg-1: #2d3235; --plate-bg-2: #2d3235; --plate-border: #3a4145; --plate-inset: transparent;
  --plate-ink: #eef0f1; --plate-label: #a3acb0; --plate-key: #a3acb0; --plate-divider: rgba(255,255,255,.12);
  --series-1: #f2c200; --series-2: #4cc27a; --series-3: #eef0f1; --series-4: #b38f00; --series-5: #2f8f52; --series-6: #a3acb0;
  /* The hazard stripe stays yellow and black rather than yellow and --ink. */
  --appbar-rule: repeating-linear-gradient(135deg, var(--go) 0 10px, var(--on-ink) 10px 20px);
}


* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.12; letter-spacing: -0.01em; text-transform: var(--heading-case); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--steel); }
.eyebrow {
  font-family: var(--font-label);
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: var(--label-case); color: var(--steel-2);
}

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--appbar-bg);
  color: var(--appbar-fg);
}
.appbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--appbar-rule-h); background: var(--appbar-rule);
}
.appbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand .glyph {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--go); color: var(--go-fg); display: grid; place-items: center; flex: none;
}
.brand .glyph svg { width: 18px; height: 18px; }
.brand .name {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: .04em; font-size: 15px; text-transform: var(--brand-case);
}
.appbar-spacer { flex: 1; }
.appbar-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--appbar-fg); position: relative; }
.appbar-user .who {
  font-family: var(--font-mono); color: var(--appbar-fg); font-size: 13.5px;
  background: none; border: none; cursor: pointer;
  padding: 6px 9px; border-radius: var(--radius-sm);
}
.appbar-user .who:hover { background: var(--appbar-hover); }

/* Small account popover under the username (settings entry point) */
.user-pop {
  position: absolute; top: calc(100% + 10px); right: 0; display: none;
  min-width: 210px; background: var(--paper); color: var(--ink);
  border: var(--rule-width) solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; z-index: 60; text-align: left;
}
.user-pop.open { display: block; animation: pop .14s ease; }
.user-pop .pop-head { padding: 8px 10px 9px; border-bottom: var(--rule-width) var(--rule-style) var(--line); margin-bottom: 6px; }
.user-pop .pop-name { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); }
.user-pop .pop-mail { font-size: 12px; color: var(--steel); word-break: break-all; }
.pop-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 6px; padding: 8px 10px;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.pop-item:hover { background: var(--bg-2); }
.pop-item svg { width: 15px; height: 15px; color: var(--steel); flex: none; }

/* Profile settings: theme picker */
.theme-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-opt {
  display: flex; align-items: center; gap: 8px; padding: 10px 11px;
  border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer;
}
.theme-opt:hover { border-color: var(--steel-2); }
.theme-opt.active { border-color: var(--go-ink); outline: 2px solid var(--go-ink); outline-offset: 0; }
.theme-opt .swatch { width: 20px; height: 20px; border-radius: 6px; border: var(--border-width) solid var(--line-strong); background-clip: padding-box; flex: none; }
/* Each swatch shows the version the current mode draws: page color, then accent. */
/* Longhand backgrounds preserve clipping, keeping gradients out of translucent borders. */
.swatch-modernist { background-image: linear-gradient(135deg, #ffffff 50%, #d9042b 50%); }
.swatch-classical { background-image: linear-gradient(135deg, #f3e8d3 50%, #2f4a2a 50%); }
.swatch-nocturne { background-image: linear-gradient(135deg, #eef1f1 50%, #ff4b00 50%); }
.swatch-organic { background-image: linear-gradient(135deg, #e9e7dd 50%, #4e6b47 50%); }
.swatch-broadsheet { background-image: linear-gradient(135deg, #f1eee8 50%, #1f4d2e 50%); }
.swatch-industrial { background-image: linear-gradient(135deg, #dfe3e5 50%, #f2c200 50%); }
:root[data-mode="dark"] .swatch-modernist { background-image: linear-gradient(135deg, #0a0a0a 50%, #d9042b 50%); }
:root[data-mode="dark"] .swatch-classical { background-image: linear-gradient(135deg, #17130e 50%, #4c7044 50%); }
:root[data-mode="dark"] .swatch-nocturne { background-image: linear-gradient(135deg, #0a0c0d 50%, #ff4b00 50%); }
:root[data-mode="dark"] .swatch-organic { background-image: linear-gradient(135deg, #161813 50%, #587850 50%); }
:root[data-mode="dark"] .swatch-broadsheet { background-image: linear-gradient(135deg, #121211 50%, #3f7a52 50%); }
:root[data-mode="dark"] .swatch-industrial { background-image: linear-gradient(135deg, #1a1d1f 50%, #f2c200 50%); }

/* Light / Dark / System, above the themes: small and icon-only. Its corners,
   border weight, and accent come from the theme, like everything else here. */
.appearance { display: flex; flex-direction: column; gap: 12px; }
.mode-toggle {
  display: inline-flex; align-self: flex-start; gap: 2px; padding: 2px;
  background: var(--bg-2); border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
}
.mode-opt {
  width: 30px; height: 26px; padding: 0; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--steel); display: grid; place-items: center; cursor: pointer;
}
.mode-opt:hover { color: var(--ink); }
.mode-opt.active { background: var(--go); color: var(--go-fg); }
.mode-opt svg { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .theme-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 26px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.crumbs { font-size: 13px; color: var(--steel); margin-bottom: 6px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--steel); }
.crumbs .sep { color: var(--line-strong); }

/* ---------- Buttons ---------- */
.btn, .btn-go, .btn-ghost, .btn-danger {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  border: var(--border-width) solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform .04s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
  text-transform: var(--btn-case);
}
.btn:hover { border-color: var(--steel-2); }
.btn:active, .btn-go:active, .btn-ghost:active, .btn-danger:active { transform: translateY(1px); }
.btn-go { background: var(--go); border-color: var(--go); color: var(--go-fg); }
.btn-go:hover { background: var(--go-press); border-color: var(--go-press); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--steel); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: var(--paper); border-color: var(--line-strong); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg, .btn-go svg, .btn-ghost svg, .btn-danger svg { width: 15px; height: 15px; }

/* The spec's "add record": small green rectangle with a plus. */
.add-record-btn { background: var(--go); border-color: var(--go); color: var(--go-fg); padding: 8px 13px; font-weight: 700; text-transform: var(--btn-case); }
.add-record-btn:hover { background: var(--go-press); border-color: var(--go-press); }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: var(--rule-width) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }

/* ---------- Garages list ---------- */
.garage-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.garage-card {
  background: var(--paper); border: var(--rule-width) solid var(--line); border-radius: var(--radius);
  padding: 18px 19px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column; gap: 12px; min-height: 132px;
}
.garage-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.garage-card h3 { font-size: 19px; font-weight: 700; }
.garage-card .meta { display: flex; gap: 8px; align-items: center; margin-top: auto; }

.tag {
  font-family: var(--font-label); font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: var(--label-case); padding: 3px 8px; border-radius: 100px;
}
.tag-owner { background: var(--ink); color: var(--on-ink); }
.tag-member { background: var(--bg); color: var(--steel); border: var(--border-width) solid var(--line-strong); }

/* ---------- Search ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.searchbar {
  flex: 1; min-width: 220px; position: relative;
}
.searchbar input {
  width: 100%; padding: 11px 12px 11px 38px;
  border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-size: 14.5px; font-family: var(--font-body);
}
.searchbar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--steel-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--go-ink); outline-offset: 0; border-color: var(--go-ink); }

/* ---------- Vehicle tiles ---------- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.vehicle-tile {
  background: var(--paper); border: var(--rule-width) solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); position: relative;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column;
  /* Keep the tile on its own compositing layer at all times. Otherwise the
     hover transform promotes it mid-interaction and subpixel re-snapping makes
     the absolutely-positioned gear icon shift ~1px on tiles at fractional x. */
  will-change: transform;
}
.vehicle-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.tile-img {
  aspect-ratio: 16 / 10; background: var(--bg-2) center/cover no-repeat;
  display: grid; place-items: center; cursor: pointer; border-bottom: var(--rule-width) var(--rule-style) var(--line);
}
.tile-img .placeholder { color: var(--steel-2); display: grid; place-items: center; gap: 6px; font-size: 12px; }
.tile-img .placeholder svg { width: 34px; height: 34px; opacity: .55; }
.tile-body { padding: 13px 15px 15px; cursor: pointer; }
.tile-year { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--steel); letter-spacing: .02em; }
.tile-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; margin-top: 2px; }
.tile-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.tile-mileage { font-family: var(--font-mono); font-size: 12px; color: var(--steel); }
.tile-gear {
  position: absolute; top: 9px; right: 9px; width: 30px; height: 30px;
  border-radius: 7px; background: color-mix(in srgb, var(--paper) 92%, transparent);
  border: var(--rule-width) solid var(--line);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, border-color .15s ease;
}
/* Same hover treatment as regular buttons: the outline darkens. */
.tile-gear:hover { background: var(--paper); color: var(--ink); border-color: var(--steel-2); }
.tile-gear svg { width: 16px; height: 16px; }

/* ---------- Vehicle detail layout ---------- */
.detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
.veh-photo { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); border: var(--rule-width) solid var(--line); background: var(--bg-2); }
/* No-photo placeholder: cap the car icon (an unsized SVG fills the box and its
   square aspect used to overflow the bottom of the 16:10 frame). */
.veh-photo.placeholder { overflow: hidden; }
.veh-photo.placeholder svg { width: 60%; height: 60%; opacity: .55; }

/* Signature: data-plate. Follows the active theme (light metal / dark metal). */
.plate {
  background: linear-gradient(180deg, var(--plate-bg-1), var(--plate-bg-2));
  color: var(--plate-ink); border-radius: var(--radius-sm); padding: 18px 20px;
  border: var(--rule-width) solid var(--plate-border);
  box-shadow: inset 0 0 0 1px var(--plate-inset);
  position: relative;
}
.plate .plate-label { font-family: var(--font-label); font-size: 10px; letter-spacing: .16em; color: var(--plate-label); text-transform: var(--label-case); }
.plate .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: var(--rule-width) var(--rule-style) var(--line); }
.plate .row:last-child { border-bottom: 0; }
.plate .k { font-family: var(--font-label); font-size: 10.5px; letter-spacing: .1em; text-transform: var(--label-case); color: var(--plate-key); }
.plate .v { font-family: var(--font-mono); font-size: 13px; color: var(--plate-ink); text-align: right; word-break: break-all; }

/* Compact centered variant for the invite-code box */
.invite-plate { max-width: 260px; margin: 16px auto 0; text-align: center; padding: 13px 18px 14px; }
.invite-plate .plate-label { font-size: 13px; }
.invite-plate .invite-code {
  font-family: var(--font-mono); font-size: 20px; letter-spacing: .14em;
  color: var(--plate-ink); margin-top: 4px;
}

.info-list { display: flex; flex-direction: column; }
.info-list .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: var(--rule-width) solid var(--line); }
.info-list .row:last-child { border-bottom: 0; }
.info-list .k { color: var(--steel); font-size: 13px; }
.info-list .v { font-weight: 500; text-align: right; }
.section-title { font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: var(--label-case); color: var(--ink-2); margin-bottom: 10px; }

.files-list { display: flex; flex-direction: column; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: var(--rule-width) solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.file-row svg { width: 16px; height: 16px; color: var(--steel); flex: none; }
.file-row a { flex: 1; font-size: 13.5px; word-break: break-all; }
.file-row .x { color: var(--steel-2); cursor: pointer; }
.file-row .x:hover { color: var(--red); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: var(--rule-width) var(--rule-style) var(--line); margin-bottom: 0; position: relative; }
.tab {
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px; letter-spacing: .02em;
  padding: 11px 15px; cursor: pointer; color: var(--steel); border-bottom: 3px solid transparent;
  margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px;
  text-transform: var(--tab-case);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
/* Sliding underline shared by all tabs; JS sets its width and translateX. */
.tab-ink {
  position: absolute; left: 0; bottom: -1px; height: 3px; width: 0;
  background: var(--go-line); border-radius: 2px 2px 0 0; pointer-events: none;
}
.tab-ink.ready { transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1); }
.tab .count { font-family: var(--font-mono); font-size: 11px; background: var(--bg); border: var(--border-width) solid var(--line-strong); border-radius: 100px; padding: 0 6px; color: var(--steel); }
.tab.alert .count { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.tab-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: var(--rule-width) solid var(--line); border-radius: var(--radius); background: var(--paper); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 540px; }
table.tbl thead th {
  text-align: left; font-family: var(--font-label); font-weight: 700; font-size: 11px;
  letter-spacing: .08em; text-transform: var(--label-case); color: var(--steel);
  padding: 12px 14px; border-bottom: var(--rule-width) var(--rule-style) var(--line); background: var(--bg-2);
  white-space: nowrap; cursor: default;
}
table.tbl thead th.sortable { cursor: pointer; }
table.tbl thead th.sortable:hover { color: var(--ink); }
table.tbl thead th .arrow { color: var(--go-ink); }
table.tbl tbody td { padding: 12px 14px; border-bottom: var(--rule-width) var(--rule-style) var(--line); font-size: 14px; vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: var(--bg-2); }
.num { font-family: var(--font-mono); }
.cost { font-family: var(--font-mono); font-weight: 500; }

/* ---------- Pills (status / category) ---------- */
.pill { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 100px; display: inline-block; white-space: nowrap; }
.pill-overdue { background: var(--red-bg); color: var(--red); }
.pill-due_now { background: var(--amber-bg); color: var(--amber); }
.pill-upcoming { background: var(--blue-bg); color: var(--blue); }
.cat { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 100px; background: var(--bg); border: var(--border-width) solid var(--line-strong); color: var(--ink-2); }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 100px; border: var(--border-width) solid var(--line-strong); background: var(--paper); cursor: pointer; font-weight: 500; }
.chip:hover { border-color: var(--steel-2); }
.chip.active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--steel); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 12px; }
.empty h3 { font-size: 17px; color: var(--ink-2); margin-bottom: 6px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  padding: 10px 11px; border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: var(--font-body); background: var(--paper); color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; min-height: 78px; }
.field input:disabled, .field select:disabled { opacity: .55; cursor: not-allowed; background: var(--bg-2); }
.field .hint { font-size: 12px; color: var(--steel); }
.field.mono input { font-family: var(--font-mono); }

/* Price inputs: fixed $ prefix inside the box */
.money-wrap { position: relative; }
.money-wrap .cur {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--steel); font-size: 14px; pointer-events: none;
}
.money-wrap input { padding-left: 26px; }

/* ---------- Parts editor ---------- */
.part-rows { display: flex; flex-direction: column; gap: 8px; }
.part-chip {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  border: var(--rule-width) solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--bg-2);
}
.part-chip .pname { font-weight: 600; }
.part-chip .pmeta { font-family: var(--font-mono); font-size: 12px; color: var(--steel); }
.cost-summary { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; padding-top: 4px; }
.cost-summary .big { font-family: var(--font-mono); font-size: 22px; font-weight: 500; }
.cost-summary .lbl { font-size: 12px; color: var(--steel); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,19,23,.46);
  display: grid; place-items: start center; z-index: 100; padding: 28px 16px; overflow-y: auto;
  animation: fade .12s ease;
}
.modal {
  background: var(--paper); border-radius: var(--radius); width: 100%; max-width: 640px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .14s ease; margin: auto 0;
}
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: var(--rule-width) var(--rule-style) var(--line); }
.modal-head h2 { font-size: 20px; font-weight: 800; }
.modal-head .x { cursor: pointer; color: var(--steel); border: none; background: none; padding: 4px; }
.modal-head .x:hover { color: var(--ink); }
.modal-head .x svg { width: 20px; height: 20px; display: block; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 16px 22px; border-top: var(--rule-width) var(--rule-style) var(--line); display: flex; justify-content: flex-end; gap: 10px; }
/* Button row inside the footer: one baseline for every button, even spacing. */
.modal-foot > div { display: flex; align-items: center; justify-content: flex-end; gap: 13px; flex: 1; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } 
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ---------- Reports ---------- */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--paper); border: var(--rule-width) solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .lbl { font-family: var(--font-label); font-size: 11px; letter-spacing: .1em; text-transform: var(--label-case); color: var(--steel); }
.stat .val { font-family: var(--font-mono); font-size: 26px; font-weight: 500; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; }
.bar-row .bl { font-size: 13.5px; }
.bar-track { height: 12px; background: var(--bg); border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--go-line); border-radius: 100px; }
.bar-row .bv { font-family: var(--font-mono); font-size: 13px; text-align: right; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, var(--bg-2), var(--bg)); }
.auth-card { width: 100%; max-width: 400px; background: var(--paper); border: var(--rule-width) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 28px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.auth-brand .glyph { width: 34px; height: 34px; border-radius: 7px; background: var(--go); color: var(--go-fg); display: grid; place-items: center; }
.auth-brand .glyph svg { width: 20px; height: 20px; }
.auth-brand .name { font-family: var(--font-display); font-weight: 800; text-transform: var(--brand-case); letter-spacing: .04em; font-size: 16px; }
.auth-card h1 { font-size: 22px; font-weight: 800; margin: 18px 0 4px; }
.auth-card .sub { color: var(--steel); font-size: 14px; margin-bottom: 20px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-go { width: 100%; justify-content: center; padding: 11px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--steel); }
.remember-row { display: flex; align-items: center; gap: 9px; margin: 2px 0 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.remember-row input { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--go); }
.auth-switch button { background: none; border: none; color: var(--go-ink); font-weight: 600; cursor: pointer; font-size: 14px; }

/* ---------- File picker (drag & drop) ---------- */
.picker-overlay {
  position: fixed; inset: 0; background: rgba(16,19,23,.46);
  display: grid; place-items: center; z-index: 150; padding: 24px;
  animation: fade .12s ease;
}
.picker {
  background: var(--paper); border-radius: var(--radius); width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .14s ease; padding: 18px 20px 20px;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.picker-head h2 { font-size: 18px; font-weight: 800; }
.picker-head .x { cursor: pointer; color: var(--steel); border: none; background: none; padding: 4px; }
.picker-head .x:hover { color: var(--ink); }
.picker-head .x svg { width: 20px; height: 20px; display: block; }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 38px 20px; text-align: center; color: var(--steel);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.drag { border-color: var(--go-line); background: var(--go-soft); }
.dropzone svg { width: 44px; height: 44px; opacity: .5; margin-bottom: 10px; }
.dropzone .dz-title { font-size: 17px; color: var(--steel); }
.dropzone .dz-or { font-size: 13px; color: var(--steel-2); margin: 10px 0; }
/* The names of the files going up, so the wrong photo is obvious before the
   reader answers (v1.2.1). Long selections wrap rather than widen the box. */
.dropzone .dz-files {
  font-size: 12.5px; color: var(--steel-2); margin-top: 8px; max-width: 100%;
  overflow-wrap: anywhere; line-height: 1.45;
}
.picker .hint { font-size: 12px; color: var(--steel); margin-top: 10px; text-align: center; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--on-ink); padding: 11px 16px; border-radius: var(--radius-sm); font-size: 14px; box-shadow: var(--shadow); animation: pop .14s ease; max-width: 90vw; }
.toast.err { background: var(--red); color: var(--on-ink); }
.toast.ok { background: var(--go); color: var(--go-fg); }

/* ---------- Misc ---------- */
.version-tag {
  position: fixed; bottom: 10px; right: 14px; z-index: 40;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--steel-2);
  pointer-events: none;
}
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.inline-note { background: var(--amber-bg); border: 1px solid var(--note-border); color: var(--note-ink); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.inline-note svg { width: 18px; height: 18px; flex: none; }
.inline-note button { margin-left: auto; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--go-line); border-radius: 50%; animation: spin .7s linear infinite; margin: 50px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: var(--rule-width) solid var(--line); background: var(--bg-2); }

/* ---------- Password reveal (login) ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 5px; cursor: pointer; color: var(--steel-2);
  display: grid; place-items: center; border-radius: 6px;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle svg { width: 17px; height: 17px; }

/* ---------- Inline auth error ---------- */
.auth-err {
  background: var(--red-bg); color: var(--red); border: 1px solid var(--red);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; font-weight: 500;
  margin-bottom: 14px;
}

/* ---------- Avatar (profile picture) ---------- */
.avatar {
  width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--go); color: var(--go-fg); display: inline-grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 58px; height: 58px; font-size: 23px; }
.appbar-user .who { display: inline-flex; align-items: center; gap: 8px; }
.pfp-row { display: flex; align-items: center; gap: 14px; }

/* ---------- Inline rename pencil ---------- */
.name-row { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: none; border: none; padding: 6px; border-radius: 7px; cursor: pointer;
  color: var(--steel); display: inline-grid; place-items: center;
}
.icon-btn:hover { color: var(--ink); background: var(--bg-2); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- Locked dropdown (vehicle form) ---------- */
.field .dd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 11px; border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: var(--font-body); background: var(--paper); color: var(--ink);
  width: 100%; cursor: pointer; text-align: left;
}
.field .dd:disabled { opacity: .55; cursor: not-allowed; background: var(--bg-2); }
.field .dd.open, .field .dd:focus-visible { outline: 2px solid var(--go-ink); outline-offset: 0; border-color: var(--go-ink); }
.field .dd .dd-label { flex: 1; min-height: 1.4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field .dd svg { width: 15px; height: 15px; color: var(--steel); flex: none; }
.dd-menu {
  position: fixed; z-index: 300; overflow-y: auto;
  background: var(--paper); border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 5px; animation: pop .12s ease;
}
.dd-opt { padding: 8px 11px; border-radius: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.dd-opt:hover { background: var(--bg-2); }
.dd-opt.sel { background: var(--go-soft); color: var(--go-ink); font-weight: 600; }
.dd-opt.kbd { background: var(--bg-2); outline: var(--border-width) solid var(--line-strong); }

/* Type-to-search make box: a text input wearing the dropdown's chevron. */
.search-select { position: relative; }
.field .search-select input { padding-right: 34px; }
.search-select svg {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--steel); pointer-events: none;
}
.search-select.disabled svg { opacity: .55; }

/* ---------- VIN decode row ---------- */
.vin-row { display: flex; gap: 8px; align-items: stretch; }
.vin-row input { flex: 1; min-width: 0; }
.vin-row .btn { flex: none; }

/* ---------- Recalls tab ---------- */
.recall-item { margin-bottom: 12px; }
.recall-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.recall-component { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.recall-meta { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--steel); }
.recall-campaign { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg); border: var(--border-width) solid var(--line-strong); border-radius: 100px; padding: 1px 8px; }
.recall-text { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }

/* ---------- Charts ---------- */
.chart-controls { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 14px 16px; }
.chart-wrap { position: relative; margin-top: 6px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .cg { stroke: var(--line); stroke-width: 1; }
.chart-svg .ca { stroke: var(--line-strong); stroke-width: 1; }
.chart-svg .ct { fill: var(--steel); font-family: var(--font-mono); font-size: 11px; }
.chart-svg [data-s] { cursor: pointer; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 2px 0 8px; font-size: 13px; color: var(--ink-2); }
.leg-item { display: inline-flex; align-items: center; gap: 7px; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 5;
  background: var(--ink); color: var(--on-ink); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap;
}
.chart-tip .tip-name { font-weight: 600; margin-bottom: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .page-head h1 { font-size: 25px; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .page { padding: 18px 14px 70px; }
  .form-grid { grid-template-columns: 1fr; }
  .chart-controls { grid-template-columns: 1fr; }
  .appbar-inner { padding: 11px 14px; }
  .vehicle-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile-name { font-size: 15px; }
  .bar-row { grid-template-columns: 92px 1fr 70px; }
}
@media (max-width: 390px) {
  .vehicle-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- garage cards: fleet widgets, drag & drop (v1.0.6) ---------- */
/* The whole card is the hit area for opening the garage (v1.2.1), so the
   pointer belongs on the card rather than only on its heading. */
.garage-card { cursor: pointer; }
.garage-card .fleet-count { font-size: 12px; color: var(--steel); }
.fleet { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.fleet-empty { font-size: 12.5px; color: var(--steel-2); padding: 6px 2px; }
.fleet-hint { font-size: 11.5px; color: var(--steel-2); margin-top: auto; }
/* Collapsible cards: the chevron sits beside the name; a closed card keeps its
   head and drops the fleet, so it no longer needs the open card's height. */
.garage-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.garage-card-title h3 { min-width: 0; overflow-wrap: anywhere; }
.garage-card.collapsed { min-height: 0; }
.collapse-btn { flex: none; margin: -4px -6px 0 0; }
.collapse-btn:hover { color: var(--ink); background: var(--bg-2); }
.veh-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  border: var(--rule-width) solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); cursor: grab; user-select: none;
}
.veh-chip:hover { border-color: var(--line-strong); background: var(--paper); }
.veh-chip:active { cursor: grabbing; }
.veh-chip.dragging { opacity: .45; }
.veh-chip .grip { color: var(--steel-2); display: flex; flex: none; }
.veh-chip .grip svg { width: 14px; height: 14px; }
.veh-chip-img {
  width: 28px; height: 22px; border-radius: 4px; object-fit: cover; flex: none;
  background: var(--bg); border: var(--rule-width) solid var(--line);
}
.veh-chip-img.placeholder { display: grid; place-items: center; color: var(--steel-2); }
.veh-chip-img.placeholder svg { width: 15px; height: 15px; }
.veh-chip-name {
  font-size: 13.5px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.garage-card.drop-target {
  border-color: var(--go-line); outline: 2px solid var(--go-line); outline-offset: -1px;
  background: var(--go-soft);
}
.garage-card.drop-target .fleet-hint { color: var(--go-ink); font-weight: 600; }

/* ---------- per-tab action row: the Add button, first on the left ---------- */
.tab-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.tab-actions:empty { display: none; }

/* ---------- Upcoming / Notifications filters ---------- */
/* v1.3: the panel opens from a Filters button; the button carries a count of
   the filters that are on and a line beside it says what they narrow to. */
.filter-wrap { margin-bottom: 16px; }
.filter-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-toggle.open { border-color: var(--ink-2); background: var(--bg-2); }
.filter-count {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.5; min-width: 18px;
  padding: 0 6px; border-radius: 100px; background: var(--ink); color: var(--on-ink);
  text-align: center;
}
/* Body ink rather than a muted tone (several themes make --ink-2 the same
   as --steel): this says the list is not the whole list, so it has to be
   readable in every theme. */
.filter-summary { font-size: 13px; color: var(--ink); }
.filter-bar {
  display: flex; flex-direction: column; gap: 10px; margin-top: 10px;
  padding: 12px 14px; border: var(--rule-width) solid var(--line); border-radius: var(--radius);
  background: var(--paper);
}
.filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-label); font-size: 11px; letter-spacing: .1em;
  text-transform: var(--label-case); color: var(--steel);
}
.filter-label svg { width: 14px; height: 14px; }
.filter-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-range input {
  padding: 6px 9px; border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 13px;
}
.filter-dash { font-size: 12.5px; color: var(--steel); }
.filter-clear { align-self: flex-start; }

/* Tables that gained columns in v1.0.6 scroll rather than wrap their labels. */
table.tbl.tbl-wide { min-width: 720px; }

/* ---------- row-level actions in tables ---------- */
.tbl th.col-action, .tbl td.col-action { width: 1%; white-space: nowrap; text-align: right; }
.row-trash {
  border: none; background: none; padding: 5px; border-radius: 6px;
  color: var(--steel-2); cursor: pointer; display: inline-flex;
}
.row-trash:hover { color: var(--red); background: var(--red-bg); }
.row-trash svg { width: 16px; height: 16px; }
.btn-done { white-space: nowrap; }

/* ---------- recalls: unseen campaigns ---------- */
/* The tab fades to red and back while a campaign the user hasn't read is on
   file; opening the tab records them as seen and the pulse stops. */
.tab.unseen { color: var(--red); animation: recall-pulse 2.2s ease-in-out infinite; }
.recall-item.recall-new { border-color: var(--red); box-shadow: 0 0 0 1px var(--red-bg); }
.recall-badge {
  font-family: var(--font-label); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: var(--label-case); padding: 2px 8px;
  border-radius: 100px; background: var(--red-bg); color: var(--red);
}
@keyframes recall-pulse {
  0%, 100% { color: var(--ink-2); }
  50%      { color: var(--red); }
}
@media (prefers-reduced-motion: reduce) {
  .tab.unseen { animation: none; color: var(--red); font-weight: 700; }
}

/* ---------- documents: folders and preview ---------- */
/* v1.3: folders are made by the user (New folder) and can sit empty; each
   carries a pencil for renaming or deleting it beside its open/close toggle. */
.docs-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.docs-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* A card title that opens and closes its card (Details, Documents). */
.section-toggle {
  display: flex; align-items: center; gap: 6px; padding: 0; margin-bottom: 10px;
  background: none; border: none; cursor: pointer; font: inherit; text-align: left;
}
.section-toggle .section-title { margin: 0; }
.section-toggle .folder-chev { color: var(--steel); }
.section-toggle:hover .section-title,
.section-toggle:hover .folder-chev { color: var(--ink); }
.section-toggle[aria-expanded="false"] { margin-bottom: 0; }
.docs-head .section-toggle { margin-bottom: 0; }
.docs-head:has(.section-toggle[aria-expanded="false"]) { margin-bottom: 0; }
.folder-group { margin-bottom: 8px; }
.folder-head { display: flex; align-items: center; gap: 2px; }
.folder-toggle {
  display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; padding: 6px 4px;
  background: none; border: none; cursor: pointer; color: var(--ink-2);
  font: inherit; font-size: 13px; text-align: left;
}
.folder-toggle:hover { color: var(--ink); }
.folder-toggle svg { width: 15px; height: 15px; color: var(--steel); flex: none; }
.folder-chev { display: flex; transition: transform .18s ease; }
.folder-chev svg { width: 14px; height: 14px; }
.folder-chev.open { transform: rotate(180deg); }
.folder-name { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.folder-edit { padding: 5px; }
.folder-edit svg { width: 14px; height: 14px; }
.folder-empty { font-size: 12.5px; color: var(--steel); padding: 2px 10px 6px 28px; }
.picker-folder { display: grid; gap: 12px; }
.folder-count {
  font-family: var(--font-mono); font-size: 11px; color: var(--steel);
  background: var(--bg); border: var(--border-width) solid var(--line-strong);
  border-radius: 100px; padding: 0 6px;
}
.file-row .file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.file-name {
  background: none; border: none; padding: 0; text-align: left; cursor: pointer;
  color: var(--go-ink); font: inherit; font-size: 13.5px; word-break: break-all;
}
.file-name:hover { text-decoration: underline; }
.file-meta { font-size: 11.5px; color: var(--steel-2); }
.doc-preview {
  border: var(--rule-width) solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden; display: grid; place-items: center;
  min-height: 260px;
}
.doc-preview-img { max-width: 100%; max-height: 60vh; display: block; }
.doc-preview-frame { width: 100%; height: 60vh; border: 0; background: var(--paper); }
.doc-preview-none { text-align: center; padding: 40px 20px; color: var(--steel); }
.doc-preview-none svg { width: 36px; height: 36px; opacity: .45; margin-bottom: 10px; }
.doc-organize {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end;
  margin-top: 16px; padding-top: 16px; border-top: var(--rule-width) var(--rule-style) var(--line);
}
.doc-organize-btn { display: flex; align-items: flex-end; }
.picker-extra { margin-bottom: 14px; }

/* ---------- inspections: the upcoming work a pass covers (v1.3) ---------- */
.cover-section {
  margin-top: 18px; padding-top: 16px; border-top: var(--rule-width) var(--rule-style) var(--line);
}
.cover-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.cover-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 6px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px;
}
.cover-item:hover { background: var(--bg-2); }
.cover-item input { width: 17px; height: 17px; margin: 1px 0 0; flex: none; accent-color: var(--go); }
.cover-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cover-interval { font-size: 12px; color: var(--steel); }
.cover-names { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-2); }
/* A second, quieter line inside a table cell. */
.cell-note { font-size: 11.5px; font-weight: 400; color: var(--steel); margin-top: 3px; }

/* ---------- receipt reading ---------- */
.receipt-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.receipt-row .hint { margin: 0; }
/* What the reader made of the receipt, shown until the record is saved. */
.receipt-note { align-items: flex-start; }

/* ---------- CSV import ---------- */
.import-result { margin-top: 16px; }
.import-head {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  margin-bottom: 4px;
}
.import-head.ok { color: var(--go-ink); }
.import-rows {
  margin-top: 10px; max-height: 300px; overflow-y: auto;
  border: var(--rule-width) solid var(--line); border-radius: var(--radius-sm);
}
.import-row {
  display: grid; grid-template-columns: 62px 1fr 1fr; gap: 10px;
  padding: 7px 10px; font-size: 12.5px; border-bottom: var(--rule-width) var(--rule-style) var(--line);
}
.import-row:last-child { border-bottom: 0; }
.import-row.bad { background: var(--red-bg); }
.import-line { font-family: var(--font-mono); color: var(--steel); }
.import-summary { overflow: hidden; text-overflow: ellipsis; }
.import-problem { color: var(--red); }
.import-ok { color: var(--go-ink); }

/* ---------- trash bin ---------- */
.trash-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.trash-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: var(--rule-width) solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2);
}
.trash-main { flex: 1; min-width: 0; }
.trash-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.trash-detail { font-size: 12px; color: var(--steel); margin-top: 3px; }

/* ---------- v1.0.6 responsive tweaks ---------- */
@media (max-width: 560px) {
  .doc-organize { grid-template-columns: 1fr; }
  .import-row { grid-template-columns: 52px 1fr; }
  .import-problem, .import-ok { grid-column: 2; }
  .filter-range { width: 100%; }
  .trash-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .trash-row .row-actions { justify-content: flex-start; }
}

/* ---------- server-version skew warning ---------- */
.skew-banner {
  max-width: var(--maxw); margin: 14px auto 0; padding: 11px 14px;
  display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px;
  background: var(--red-bg); border: 1px solid var(--red); color: var(--red);
  border-radius: var(--radius-sm);
}
.skew-banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
@media (max-width: 560px) { .skew-banner { margin: 10px 14px 0; } }
