/* =========================================================
   Premium Floors Australia Inspection App — PASS 5 (refined polish)
   Typography-forward, restrained greyscale, sectional rhythm.
   Premium means calm, not ornamented.
   ========================================================= */

/* ----- Tokens ----- */

:root {
  /* Greyscale */
  --g-50:  #fafafb;
  --g-100: #f2f3f5;
  --g-150: #e8eaed;
  --g-200: #dcdfe4;
  --g-300: #c2c6cd;
  --g-400: #9ca1aa;
  --g-500: #6e737d;
  --g-600: #4b5058;
  --g-700: #33373e;
  --g-800: #22262c;
  --g-900: #15181d;

  /* Role aliases — inverted so fields (not cards) are the brightest surface.
     Stratification: page (darkest grey) → card (mid grey) → field (white, shadowed). */
  --page:      #c6c9cf;   /* rich ambient grey — noticeably grey, not off-white */
  --surface:   #e3e5ea;   /* card body, clearly mid-grey */
  --surface-2: #ebedf1;   /* subsidiary regions inside cards */
  --surface-3: #f1f2f5;   /* list item hover etc. */

  --field:     #ffffff;   /* brightest — where the rep types */
  --field-alt: var(--g-50); /* disabled/readonly fields */

  --border:        rgba(27, 31, 38, .10);
  --border-strong: rgba(27, 31, 38, .18);

  /* Stamped-in field shadow — subtle drop + thin top highlight */
  --field-shadow:
    0 1px 2px rgba(15, 18, 22, .08),
    0 1px 1px rgba(15, 18, 22, .05),
    inset 0 1px 0 rgba(255, 255, 255, .8);
  --field-shadow-focus:
    0 0 0 3px var(--focus),
    0 1px 2px rgba(15, 18, 22, .08),
    inset 0 1px 0 rgba(255, 255, 255, .8);

  --text:          var(--g-900);
  --text-2:        var(--g-800);    /* labels, secondary headings */
  --text-muted:    var(--g-700);    /* helper text, select options — bumped darker for outdoor readability */
  --text-faint:    var(--g-600);    /* micro captions — still readable on mobile in sunlight */

  --focus:  rgba(232, 119, 34, .22);   /* Premium Floors orange focus halo */

  /* Semantic — Premium Floors brand */
  --accent:       #e87722;   /* Premium Floors orange */
  --accent-hi:    #f2a05b;   /* warm amber highlight */
  --accent-deep:  #b5571c;   /* deep burnt orange */
  --accent-glow:  rgba(232, 119, 34, .45);

  --success: #166534;
  --warn:    #854d0e;
  --danger:  #991b1b;

  /* Radii */
  --r-1: 6px;
  --r-2: 8px;
  --r-3: 10px;
  --r-4: 12px;
  --r-5: 14px;

  /* Shadow ladder — subtle, layered */
  --shadow-1: 0 1px 2px rgba(15, 18, 22, .05);
  --shadow-2: 0 1px 2px rgba(15, 18, 22, .04),
              0 2px 6px rgba(15, 18, 22, .05);
  --shadow-3: 0 4px 12px rgba(15, 18, 22, .08),
              0 8px 24px rgba(15, 18, 22, .06);
  --shadow-pop: 0 16px 44px rgba(15, 18, 22, .14),
                0 4px 12px rgba(15, 18, 22, .06);

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 48px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter Variable", "Inter",
               "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Helvetica, Arial,
               "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Cascadia Code",
               Consolas, "Roboto Mono", monospace;

  /* Type scale */
  --fs-micro: 11px;
  --fs-small: 12px;
  --fs-body:  13.5px;
  --fs-md:    15px;
  --fs-lg:    17px;
  --fs-xl:    20px;
  --fs-2xl:   26px;

  /* Tracking */
  --tr-tight: -0.01em;
  --tr-wide:  0.02em;
  --tr-caps:  0.06em;
}

/* ----- Reset ----- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "kern";
}

h1, h2, h3, h4, p { margin: 0; }

button { font-family: inherit; }

/* ----- Inline icon convenience (set width/height/stroke via font-size+color) ----- */

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ----- Header ----- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: var(--sp-3) var(--sp-5);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
  transform: translateY(0);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

/* Auto-hide header when scrolling down on mobile — reclaims screen space.
   Scrolling back up brings it back. JS toggles .header-hidden. */
header.header-hidden {
  transform: translateY(-100%);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--r-3);
  background: var(--g-900);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0;
  flex-shrink: 0;
  user-select: none;
  box-shadow: var(--shadow-1),
              inset 0 0 0 1px rgba(255, 255, 255, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#brandTitle {
  font-weight: 900;
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
  transition: color .35s ease, filter .35s ease;
}

/* Premium Floors Australia (AU) — metallic deep-green aurora with LED glow.
   Applies only to the .brand-au span so the " Inspection Form" suffix stays
   in the default ink colour. */
/* Premium Floors Australia — brand name with a mode-aware LED aurora.
   Standard Mode = dark green text on light header, subtle halo.
   Professor Mode = bright green text on dark navy, brighter halo. */

/* --- Standard Mode (light header) --- */
body:not(.professor) #brandTitle:not(.is-floorscape) .brand-au {
  color: #0d4027;
  animation: pf-au-halo-light 4.2s ease-in-out infinite;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  will-change: filter;
}
@keyframes pf-au-halo-light {
  0%, 100% {
    filter:
      drop-shadow(0 0 1px rgba(30, 123, 79, .30))
      drop-shadow(0 0 4px rgba(76, 196, 136, .20));
  }
  50% {
    filter:
      drop-shadow(0 0 3px rgba(30, 123, 79, .55))
      drop-shadow(0 0 10px rgba(76, 196, 136, .35));
  }
}

/* --- Professor Mode (dark navy header) --- */
body.professor #brandTitle:not(.is-floorscape) .brand-au {
  color: #7de6a8;                          /* bright mint — reads on navy */
  animation: pf-au-halo-dark 4.2s ease-in-out infinite;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  will-change: filter;
}
@keyframes pf-au-halo-dark {
  0%, 100% {
    color: #7de6a8;
    filter:
      drop-shadow(0 0 3px rgba(125, 230, 168, .45))
      drop-shadow(0 0 10px rgba(76, 196, 136, .30));
  }
  50% {
    color: #a8f2c8;
    filter:
      drop-shadow(0 0 6px rgba(168, 242, 200, .75))
      drop-shadow(0 0 18px rgba(76, 196, 136, .55))
      drop-shadow(0 0 32px rgba(30, 123, 79, .35));
  }
}

/* Floorscape variant (NZ) — backlit gold LED aurora, scoped to the
   "Floorscape" word only. The " Inspection Form" suffix stays default ink. */
/* Floorscape (NZ) — mode-aware gold LED aurora. */

/* --- Standard Mode (light header) --- */
body:not(.professor) #brandTitle.is-floorscape .brand-nz {
  color: #754f00;
  animation: fs-nz-halo-light 4.2s ease-in-out infinite;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  will-change: filter;
}
@keyframes fs-nz-halo-light {
  0%, 100% {
    filter:
      drop-shadow(0 0 1px rgba(200, 152, 16, .30))
      drop-shadow(0 0 4px rgba(240, 199, 74, .20));
  }
  50% {
    filter:
      drop-shadow(0 0 3px rgba(200, 152, 16, .55))
      drop-shadow(0 0 10px rgba(240, 199, 74, .35));
  }
}

/* --- Professor Mode (dark navy header) --- */
body.professor #brandTitle.is-floorscape .brand-nz {
  color: #f0c74a;                          /* bright gold — reads on navy */
  animation: fs-nz-halo-dark 4.2s ease-in-out infinite;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  will-change: filter;
}
@keyframes fs-nz-halo-dark {
  0%, 100% {
    color: #f0c74a;
    filter:
      drop-shadow(0 0 3px rgba(240, 199, 74, .45))
      drop-shadow(0 0 10px rgba(200, 152, 16, .30));
  }
  50% {
    color: #ffdc80;
    filter:
      drop-shadow(0 0 6px rgba(255, 220, 128, .75))
      drop-shadow(0 0 18px rgba(240, 199, 74, .55))
      drop-shadow(0 0 32px rgba(138, 101, 8, .35));
  }
}

/* (Old background-position keyframes removed — aurora now drives colour + filter.) */

.badge-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 3px;
  flex-wrap: wrap;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  min-height: 22px;
  box-shadow: var(--shadow-1);
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.mode-pill:hover { background: var(--g-50); border-color: var(--border-strong); }
.mode-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus), var(--shadow-1); }

.mode-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--g-500);
  flex-shrink: 0;
  transition: background .18s, box-shadow .18s;
}
body.professor .mode-pill__dot,
body.developer .mode-pill__dot {
  background: var(--accent-hi);
  box-shadow: 0 0 6px var(--accent-glow), 0 0 10px var(--accent-2-glow);
}

#passLabel,
#buildStamp {
  font-size: var(--fs-micro);
  color: var(--text-faint);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ----- Buttons ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.5);
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .06s;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

.btn .icon { font-size: 14px; stroke-width: 1.75; }

.btn:hover:not(:disabled) {
  background: var(--g-50);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.7);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--shadow-1);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
  border-color: var(--g-600);
}

.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 60%, var(--accent-deep) 100%);
  color: #ffffff;
  border-color: var(--accent-deep);
  box-shadow: var(--shadow-1),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 1px rgba(120, 50, 0, 0.3);
  font-weight: 800;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #f6b273 0%, #eb8436 60%, #c46521 100%);
  box-shadow: var(--shadow-1),
              inset 0 1px 0 rgba(255, 255, 255, 0.55),
              0 0 10px var(--accent-glow);
}
.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--focus),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, .5);
  color: var(--text);
  box-shadow: none;
}

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}
.btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 6%, transparent);
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
}

.btn-sm {
  padding: 4px 9px;
  font-size: var(--fs-micro);
  border-radius: var(--r-1);
}

/* ----- Layout ----- */

main {
  padding: var(--sp-6) var(--sp-5);
  max-width: 1180px;
  margin: 0 auto;
}

main { max-width: 820px; }

.row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.row > .field {
  min-width: 220px;
  flex: 1 1 220px;
}

section.form-host { width: 100%; }

/* ----- Cards ----- */

.card {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 85%, white) 0%,
      var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  box-shadow:
    var(--shadow-2),
    inset 0 1px 0 rgba(255, 255, 255, .5);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  margin-top: var(--sp-4);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.card:first-child { margin-top: 0; }

.card h2 {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: var(--tr-tight);
  color: var(--text);
  margin: 0 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.15;
}

.card h2 .icon {
  font-size: 16px;
  color: var(--text-muted);
  stroke-width: 1.5;
}

/* Section-number chip (inline with title) */
.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--sp-4);
}

.card__step {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--r-1);
  background: var(--field);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tr-caps);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  line-height: 1.4;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}

.card__head h2 { margin: 0; }

/* Subtitles are intentionally absent — the heading carries its own weight.
   If a card genuinely needs a secondary line, use .card__note below the head. */
.card__note {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin: calc(var(--sp-4) * -1) 0 var(--sp-4) 0;
  line-height: 1.45;
}

/* ----- Form fields ----- */

.field { margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--g-500);
  opacity: 1;             /* kill Firefox's default 0.54 opacity washout */
}

label.req::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--danger);
  margin-left: 6px;
  vertical-align: 2px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.4;
  outline: none;
  box-shadow: var(--field-shadow);
  transition: border-color .12s, box-shadow .12s, background .12s;
}

input[type="number"] { font-variant-numeric: tabular-nums; }

/* Kill browser-native spinner arrows everywhere — they're too small to hit on
   mobile and add visual noise on desktop. inputmode + touch-friendly UI does
   the job better. */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

textarea { min-height: 64px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--g-700);
  box-shadow: var(--field-shadow-focus);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--field-alt);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 52%,
    calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

input[type="file"] {
  margin-top: 6px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.helper {
  display: block;
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.45;
}

.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }

/* ----- iOS-style toggle (2 options) ----- */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-2);
  user-select: none;
  -webkit-user-select: none;
  margin-top: 5px;
}

.toggle__off, .toggle__on {
  transition: color .18s ease;
  min-width: 28px;
}
.toggle__track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow: inset 0 1px 2px rgba(15, 18, 22, .08);
}
.toggle__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--field);
  box-shadow:
    0 2px 4px rgba(15, 18, 22, .22),
    0 0 0 1px rgba(15, 18, 22, .05),
    inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
.toggle[data-state="on"] .toggle__track {
  background: var(--g-900);
  border-color: var(--g-900);
}
.toggle[data-state="on"] .toggle__knob { transform: translateX(20px); }
.toggle[data-state="on"] .toggle__on  { color: var(--text); font-weight: 700; }
.toggle[data-state="off"] .toggle__off { color: var(--text); font-weight: 700; }

.toggle:focus-within .toggle__track {
  box-shadow: 0 0 0 3px var(--focus), inset 0 1px 2px rgba(15, 18, 22, .08);
}

/* Hide the underlying select for accessibility/fallback */
.toggle select, .segmented select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ----- iOS-style segmented control (3-5 options) ----- */

.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-top: 5px;
  box-shadow: inset 0 1px 2px rgba(15, 18, 22, .08);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.segmented__btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
  min-width: 52px;
}

.segmented__btn:hover { color: var(--text); }

.segmented__btn[aria-pressed="true"] {
  background: var(--field);
  color: var(--text);
  box-shadow:
    0 1px 2px rgba(15, 18, 22, .12),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

.segmented:focus-within {
  box-shadow:
    inset 0 1px 2px rgba(15, 18, 22, .08),
    0 0 0 3px var(--focus);
}

/* ----- Grouped address input ----- */

.address-group {
  display: grid;
  grid-template-columns: 1fr 110px 110px;
  grid-template-areas:
    "street street street"
    "suburb state  postcode";
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--field);
  overflow: hidden;
  margin-top: 5px;
  box-shadow: var(--field-shadow);
  transition: border-color .12s, box-shadow .12s;
}

.address-group:focus-within {
  border-color: var(--g-700);
  box-shadow: var(--field-shadow-focus);
}

.address-group input {
  border: none;
  border-radius: 0;
  margin: 0;
  background: transparent;
  box-shadow: none !important;
  padding: 9px 11px;
  min-width: 0;
}
.address-group input:focus { box-shadow: none; outline: none; }

.address-group .address-street   { grid-area: street;   border-bottom: 1px solid var(--border); }
.address-group .address-suburb   { grid-area: suburb;   border-right:  1px solid var(--border); }
.address-group .address-state    { grid-area: state;    border-right:  1px solid var(--border); text-align: center; font-variant: small-caps; }
.address-group .address-postcode { grid-area: postcode; font-variant-numeric: tabular-nums; }

@media (max-width: 540px) {
  .address-group {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "street   street"
      "suburb   suburb"
      "state    postcode";
  }
  .address-group .address-suburb { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ----- Compact mobile header — icon-only action bar ----- */

/* Brand text visibility by region (JS toggles #brandTitle.is-floorscape on country=NZ) */
.brand-au { display: inline; }
.brand-nz { display: none; }
#brandTitle.is-floorscape .brand-au { display: none; }
#brandTitle.is-floorscape .brand-nz { display: inline; }

/* Desktop: full "Premium Floors Australia". Mobile: drops the "Australia" word. */
.brand-au-aus { display: inline; }

@media (max-width: 640px) {
  header {
    padding: 8px 10px;
  }
  header .row {
    gap: 6px !important;
  }

  /* Mobile: brand name goes BIG on its own line, "Inspection Form" drops to a
     second smaller line below. */
  #brandTitle {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.05;
  }
  .brand-tail {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    margin-top: 3px;
    color: var(--text-2);
  }

  /* Build stamp adds noise on mobile */
  #buildStamp { display: none; }

  /* Mode pill: keep indicator visible but tighten */
  .mode-pill {
    padding: 2px 7px 2px 5px;
    font-size: 10px;
  }

  /* Action bar: icon-only, one tight row, justify-end */
  .actions {
    gap: 5px;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .actions .icon-btn {
    padding: 0;
    width: 38px;
    height: 38px;
    justify-content: center;
    flex-shrink: 0;
  }

  .actions .icon-btn .btn-label { display: none; }
  .actions .icon-btn .icon { font-size: 16px; }

  /* Submit stays the same size so it's clearly the primary CTA */
  .actions #submitBtn {
    width: auto;
    min-width: 38px;
    padding: 0 10px;
  }
  .actions #submitBtn:not(:disabled) .btn-label {
    display: inline;
    font-size: 11px;
    font-weight: 800;
  }
}

/* ----- GPS row ----- */

.gps-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ----- Sidebar: inspection list ----- */

aside .card h2 { margin-bottom: var(--sp-3); }

#inspectionsList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspection-empty {
  padding: var(--sp-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-small);
  background: var(--surface-2);
  border-radius: var(--r-2);
  border: 1px dashed var(--border-strong);
}

.inspection-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: var(--r-2);
  position: relative;
}

.inspection-item__body {
  flex: 1;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--field);
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-1);
  transition: border-color .12s, background .12s, box-shadow .12s;
  min-width: 0;
}

.inspection-item__body:hover {
  background: var(--field);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.inspection-item.selected .inspection-item__body {
  background: var(--surface);
  border-color: var(--g-900);
  box-shadow: 0 0 0 1px var(--g-900) inset;
}

.inspection-item__title {
  font-weight: 600;
  font-size: var(--fs-body);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-item__place {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-item__footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: var(--tr-caps);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.status-dot.on   { background: var(--success); }
.status-dot.near { background: var(--warn); }
.status-dot.off  { background: var(--danger); }

.inspection-item__del {
  flex-shrink: 0;
  width: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--field);
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: color .12s, border-color .12s, background .12s;
}
.inspection-item__del:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

/* ----- Floating progress gauge ----- */

.floating-gauge {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 200;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 30% 25%, #ffffff 0%, #f4f5f8 60%, #dadde3 100%);
  cursor: pointer;
  box-shadow:
    0 14px 28px rgba(15, 18, 22, .18),
    0 4px 10px rgba(15, 18, 22, .10),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s ease;
}

.floating-gauge:hover { transform: translateY(-2px); }
.floating-gauge:active { transform: translateY(0); }
.floating-gauge:focus-visible { outline: none; box-shadow:
  0 0 0 3px var(--focus),
  0 14px 28px rgba(15, 18, 22, .18),
  inset 0 1px 0 rgba(255, 255, 255, .9); }

.floating-gauge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#progressPercent {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

/* ----- Gauge popover ----- */

.gauge-popover {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 199;
  width: min(280px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: var(--sp-3);
  box-shadow:
    0 20px 44px rgba(15, 18, 22, .22),
    0 6px 14px rgba(15, 18, 22, .12);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.4,0,.2,1);
}

.gauge-popover[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.gauge-popover__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.gauge-popover__title {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tr-caps);
  font-weight: 700;
  margin-bottom: 2px;
}

.gauge-popover__id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.gauge-popover__status {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--field);
  box-shadow: var(--shadow-1);
}
.gauge-popover__status.locked {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  background: color-mix(in srgb, var(--success) 6%, var(--field));
}

.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-3);
  margin: 0;
}
.progress-stats > div { display: flex; flex-direction: column; gap: 2px; }
.progress-stats dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}
.progress-stats dd {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Reserve bottom padding on the form so the gauge doesn't cover the Submit button area */
section.form-host { padding-bottom: 100px; }

/* ----- Milestone Easter egg — full-presence slide-up ----- */

.milestone-toast {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
}

.milestone-content {
  position: absolute;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(120%);
  display: flex;
  align-items: center;
  gap: 22px;
  opacity: 0;
}

/* Constrain image size so the guy doesn't fill the whole screen */
.milestone-content img {
  height: 55vh;
  max-height: 420px;
  width: auto;
  display: block;
  filter: drop-shadow(0 12px 30px rgba(15, 18, 22, .35));
}

/* Brand-specific milestone artwork. AU shows the original; NZ/Floorscape swaps
   to the Quick-Step Floor Designers photo. Only one is visible at a time. */
.milestone-img--nz { display: none; }
body.is-floorscape .milestone-img--au { display: none; }
body.is-floorscape .milestone-img--nz { display: block; }

.milestone-text {
  font-size: clamp(24px, 4.2vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .5);
}

.milestone-toast.show .milestone-content {
  animation: milestoneSlideUp 3.2s ease-in-out forwards;
}

@keyframes milestoneSlideUp {
  0%   { transform: translateX(var(--mx, -50%)) translateY(120%); opacity: 0; }
  15%  { transform: translateX(var(--mx, -50%)) translateY(0%);   opacity: 1; }
  75%  { transform: translateX(var(--mx, -50%)) translateY(0%);   opacity: 1; }
  100% { transform: translateX(var(--mx, -50%)) translateY(120%); opacity: 0; }
}

@media (max-width: 600px) {
  .milestone-content { --mx: -50%; }
  .milestone-text {
    margin-left: 14px;
    transform: translateX(60px) translateY(-40px);
    white-space: normal;
    max-width: 200px;
    font-size: 22px;
  }
  .milestone-content img {
    height: 48vh;
    max-height: 360px;
  }
}

/* Professor Mode — glowing iridescent accent on the milestone text */
body.professor .milestone-text {
  background: linear-gradient(120deg, var(--accent-hi) 0%, #ffffff 50%, var(--accent-2-hi) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 18px var(--accent-glow)) drop-shadow(0 0 24px var(--accent-2-glow));
  text-shadow: none;
}

/* ----- Toast ----- */

#toast {
  font-family: var(--font-sans) !important;
  font-size: var(--fs-small) !important;
  font-weight: 500;
  letter-spacing: -0.005em;
  background: var(--g-900) !important;
  box-shadow: var(--shadow-pop) !important;
  border: 1px solid var(--g-800);
}

/* ----- GPS pill ----- */

.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-micro);
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text-muted);
  letter-spacing: 0;
  box-shadow: var(--shadow-1);
}
.gps-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}
.gps-pill.gps-on   { background: #f0faf3; color: var(--success); border-color: #c6e9d2; }
.gps-pill.gps-on::before   { background: var(--success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 20%, transparent); }
.gps-pill.gps-near { background: #fbf5e7; color: var(--warn);    border-color: #eadba2; }
.gps-pill.gps-near::before { background: var(--warn); }
.gps-pill.gps-off  { background: #fbeeee; color: var(--danger);  border-color: #e5bfbf; }
.gps-pill.gps-off::before  { background: var(--danger); }

/* ----- Weather blocks ----- */

.weather-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.weather-block {
  flex: 1 1 240px;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 10px 12px;
  background: var(--surface-2);
}

.weather-block.weather-empty { background: var(--surface); }

.weather-label {
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tr-caps);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.weather-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

.weather-table th,
.weather-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid var(--g-150);
}

.weather-table th { color: var(--text-muted); font-weight: 500; width: 44%; }

.weather-table tr:last-child th,
.weather-table tr:last-child td { border-bottom: none; }

/* ----- Factory width auto row ----- */

.factory-width {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
  margin-top: 5px;
}

.factory-width input {
  flex: 1;
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: var(--g-900);
  font-variant-numeric: tabular-nums;
}

.factory-width .btn { flex-shrink: 0; }

/* ----- Tumbler wheel (iOS-style scroll picker) ----- */

.tumbler {
  position: relative;
  height: 140px;                     /* shorter — 3 items visible, balanced */
  width: 100%;
  max-width: 120px;
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--g-900);
  box-shadow: var(--field-shadow);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  outline: none;
  margin-top: 5px;
  user-select: none;
  -webkit-user-select: none;
  /* Tighter mask — smaller blur band so items read cleanly */
  mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 68%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 68%, transparent 100%);
}

.tumbler::-webkit-scrollbar { display: none; }
.tumbler { scrollbar-width: none; }

.tumbler:focus-visible {
  box-shadow: var(--field-shadow-focus);
  border-color: var(--g-700);
}

/* Wider variant for "mm" readings — up to 6 chars (e.g. 15000 mm) */
.tumbler--wide { max-width: 150px; }

.tumbler__track {
  padding-top: 54px;    /* (140 - 32) / 2 */
  padding-bottom: 54px;
}

.tumbler__item {
  height: 32px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: var(--g-600);                /* darker than the old g-400 — readable surrounding values */
  letter-spacing: -0.01em;
  transition: color .15s, font-weight .15s, font-size .15s;
}

.tumbler__item.is-centred {
  color: var(--g-900);
  font-weight: 700;
  font-size: 19px;                   /* less extreme size jump — balanced */
}

/* Keep tumbler interior dark-on-light even in Professor Mode (the panel is white) */
body.professor .tumbler__item           { color: var(--g-600); }
body.professor .tumbler__item.is-centred { color: var(--g-900); }

.tumbler__selector {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(0, 212, 200, .05) 50%,
    rgba(255, 255, 255, 0) 100%);
  border-radius: 4px;
}

.tumbler__hint {
  padding: 60px var(--sp-4);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-style: italic;
}

/* ----- Stepper widget ----- */

.stepper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-3);
}

.stepper-cell label {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  display: block;
}

.stepper {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--field);
  box-shadow: var(--field-shadow);
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}

.stepper:focus-within {
  border-color: var(--g-700);
  box-shadow: var(--field-shadow-focus);
}

.stepper__btn {
  appearance: none;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  width: 52px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
  transition: background .12s;
}
.stepper__btn:hover { background: var(--surface-3); }
.stepper__btn:active { background: var(--g-200); }

.stepper input {
  flex: 1;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--field);
  color: var(--g-900);         /* dark text, always, because bg is always white */
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 10px 8px;
  margin: 0;
  box-shadow: none !important;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper input:focus { outline: none; }

/* ----- Board measurement block ----- */

.board-measure {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: var(--sp-4);
  margin-top: var(--sp-3);
}

.board-measure__head h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}
.board-measure__head p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 var(--sp-2);
}

.board-measure__result {
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  background: var(--field);
  box-shadow: var(--field-shadow);
  color: var(--g-900);        /* always dark on this light card, regardless of body mode */
}

.board-measure__result dt,
.board-measure__result dd,
.board-measure__result .board-measure__hint,
.board-measure__result .board-measure__headline { color: inherit; }

.board-measure__result dt { color: var(--g-500); }

.board-measure__hint {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.board-measure__headline {
  font-weight: 700;
  font-size: var(--fs-md);
  margin-bottom: var(--sp-2);
  color: var(--text);
}

.board-measure__result.tone-ok    .board-measure__headline { color: var(--success); }
.board-measure__result.tone-info  .board-measure__headline { color: var(--text); }
.board-measure__result.tone-warn  .board-measure__headline { color: var(--warn); }
.board-measure__result.tone-alarm .board-measure__headline { color: var(--danger); }

.board-measure__result.tone-ok    { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); background: color-mix(in srgb, var(--success) 5%, var(--field)); }
.board-measure__result.tone-warn  { border-color: color-mix(in srgb, var(--warn) 40%, var(--border));    background: color-mix(in srgb, var(--warn) 6%, var(--field)); }
.board-measure__result.tone-alarm {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: color-mix(in srgb, var(--danger) 7%, var(--field));
  box-shadow: var(--field-shadow), 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
  animation: alarm-pulse 1.4s ease-in-out 2;
}
@keyframes alarm-pulse {
  0%,100% { box-shadow: var(--field-shadow), 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
  50%     { box-shadow: var(--field-shadow), 0 0 0 6px color-mix(in srgb, var(--danger) 22%, transparent); }
}

.board-measure__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
  margin: 0;
}
.board-measure__stats > div { display: flex; flex-direction: column; gap: 2px; }
.board-measure__stats dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--g-500);           /* always medium grey on the light result card */
  margin: 0;
}
.board-measure__stats dd {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--g-900);           /* always dark on the light result card */
  font-variant-numeric: tabular-nums;
}

/* ----- Moisture rooms builder ----- */

.moisture-rooms__label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.moisture-rooms {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.moisture-rooms__empty {
  padding: var(--sp-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-small);
  background: var(--surface-2);
  border-radius: var(--r-2);
  border: 1px dashed var(--border-strong);
}

.moisture-row {
  display: grid;
  grid-template-columns: 180px 1fr 32px;
  grid-template-areas:
    "room    status    del"
    "note    note      note";
  gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  align-items: center;
}

.moisture-row__room   { grid-area: room; margin-top: 0; }
.moisture-row__status { grid-area: status; display: flex; flex-wrap: wrap; gap: 4px; }
.moisture-row__note   { grid-area: note; margin-top: 0; }
.moisture-row__del {
  grid-area: del;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  font-size: 16px;
  line-height: 1;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--text-faint);
  transition: color .12s, border-color .12s, background .12s;
}
.moisture-row__del:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: color-mix(in srgb, var(--danger) 5%, var(--field));
}

.moisture-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field);
  padding: 4px 10px;
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.moisture-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.moisture-chip.is-on.status-dry    { background: #e7f5ec; color: var(--success); border-color: #b7e1c6; }
.moisture-chip.is-on.status-slight { background: #fff8e1; color: #8a6400; border-color: #eadba2; }
.moisture-chip.is-on.status-damp   { background: #ffe5d3; color: #8a3e00; border-color: #f0c49b; }
.moisture-chip.is-on.status-wet    { background: #fdecec; color: var(--danger); border-color: #f0b5b5; }
.moisture-chip.is-on.status-pool   { background: #f1e2ff; color: #5d27a5; border-color: #d8bff7; }

@media (max-width: 540px) {
  .moisture-row {
    grid-template-columns: 1fr 32px;
    grid-template-areas:
      "room   del"
      "status status"
      "note   note";
  }
}

/* ----- Defect chips ----- */

.defect-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.defect-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-1);
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}

.defect-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }

.defect-chip:has(input:checked) {
  background: var(--g-900);
  color: #fff;
  border-color: var(--g-900);
}

.defect-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ----- Photos ----- */

.photo-actions-bar {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: 5px;
}

.hidden-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

#photoGrid {
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.photo-item {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 240px;
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 8px;
  background: var(--field);
  box-shadow: var(--shadow-1);
  transition: border-color .12s, box-shadow .12s;
}

.photo-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--r-1);
  background: var(--g-100);
  cursor: pointer;
}

.photo-thumb.small { width: 52px; height: 52px; aspect-ratio: 1/1; }

.photo-meta { margin-top: 6px; font-size: var(--fs-small); }

.photo-meta .tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--g-100);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-micro);
}

.photo-meta .note { margin-top: 3px; color: var(--text-muted); }

.photo-actions { display: flex; gap: 5px; margin-top: 8px; }

.photo-actions button {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  background: var(--surface);
  cursor: pointer;
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--text-2);
}

.photo-actions button.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

/* ----- Submit-gate modal ----- */

.bt-modal { display: none; }
.bt-modal[aria-hidden="false"] { display: block; }

.bt-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 22, .45);
  backdrop-filter: blur(3px);
  z-index: 999;
}

.bt-modal__panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  box-shadow: var(--shadow-pop);
  z-index: 1000;
  overflow: hidden;
}

.bt-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.bt-modal__title {
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: var(--tr-tight);
}

.bt-modal__sub {
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.bt-modal__close {
  padding: 6px 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-small);
}

.bt-modal__body { padding: 14px 16px 16px; }
.bt-modal__section { margin-top: var(--sp-4); }
.bt-modal__section:first-child { margin-top: 0; }

.bt-modal__label {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: var(--tr-caps);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.bt-modal__list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.bt-modal__list li { margin: 5px 0; font-size: var(--fs-body); }

/* ----- Photo modals ----- */

.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 22, .74);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 9998;
  padding: var(--sp-4);
  overflow: auto;
}

.photo-modal.open { display: block; }

.photo-modal__panel {
  max-width: 920px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-5);
  padding: var(--sp-4);
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--border);
}

.photo-modal--compact .photo-modal__panel { max-width: 520px; }

.photo-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-3);
}

.photo-modal__title {
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: var(--tr-tight);
}

.photo-modal__meta {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-top: 2px;
}

.photo-modal__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.photo-modal__image {
  width: 100%;
  height: auto;
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  background: var(--g-100);
}

.photo-modal__strip {
  margin-top: var(--sp-3);
  gap: var(--sp-2);
}

/* ----- Branch hidden ----- */

.branch-hidden { display: none !important; }

/* =========================================================
   PROFESSOR MODE — aurora iridescent LED reveal
   Triggered by long-pressing the brand title for 3s+.
   Deep navy canvas, electric-teal primary + hot-magenta
   counterpoint, pure-white fields with dark text. Feels
   like engaging Sport mode on a premium EV dash.
   ========================================================= */

/* Smooth transition when Professor Mode engages */
body,
.card,
.btn,
input, select, textarea,
.defect-chip,
.inspection-item__body,
.inspection-item__del,
.gps-pill,
.mode-pill,
.brand-mark,
.card__step,
.photo-item,
.weather-block {
  transition: background .4s ease, border-color .4s ease, color .4s ease,
              box-shadow .4s ease, filter .4s ease;
}

/* --- Aurora palette: electric teal + hot magenta on deep navy --- */
body.professor {
  --accent:       #00d4c8;           /* electric teal */
  --accent-hi:    #5df3ff;           /* bright cyan */
  --accent-deep:  #006a68;           /* deep teal */
  --accent-glow:     rgba(0, 212, 200, .55);
  --accent-glow-hi:  rgba(93, 243, 255, .85);

  --accent-2:        #ff4e9a;        /* hot magenta counterpoint */
  --accent-2-hi:     #ff86bc;        /* pink highlight */
  --accent-2-deep:   #9e1b57;        /* deep magenta */
  --accent-2-glow:   rgba(255, 78, 154, .55);
  --accent-2-glow-hi:rgba(255, 134, 188, .85);

  --page:        #0c1026;            /* deep navy-indigo */
  --surface:     #151a38;            /* card */
  --surface-2:   #1c2245;
  --surface-3:   #252c54;
  --field:       #ffffff;            /* pure white fields */
  --field-alt:   #edeff7;

  --text:        #eaeefb;
  --text-2:      #c0c7e4;
  --text-muted:  #8690bc;
  --text-faint:  #606a95;

  --border:        rgba(150, 180, 255, .16);
  --border-strong: rgba(0, 212, 200, .48);

  --focus:         rgba(0, 212, 200, .42);
  --field-shadow:
    0 1px 2px rgba(0, 0, 0, .45),
    0 6px 16px rgba(0, 212, 200, .08),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  --field-shadow-focus:
    0 0 0 3px var(--focus),
    0 0 22px var(--accent-glow),
    0 0 42px var(--accent-2-glow),
    inset 0 1px 0 rgba(255, 255, 255, .75);

  background:
    radial-gradient(ellipse at 15% 0%,  rgba(0, 212, 200, .14) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(255, 78, 154, .12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(120, 90, 255, .08) 0%, transparent 70%),
    var(--page);
  background-attachment: fixed;
}

/* Dark text on the white fields — the bug fix you flagged */
body.professor input,
body.professor select,
body.professor textarea,
body.professor .address-group input {
  color: #0c1026;
}
body.professor input::placeholder,
body.professor textarea::placeholder { color: #606a95; }

/* Card: deep navy surface with iridescent edge light */
body.professor .card {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 82%, black) 0%,
      var(--surface) 100%);
  border-color: var(--border);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .4),
    0 10px 30px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(150, 180, 255, .08);
  position: relative;
}
body.professor .card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent-2-glow) 30%,
    var(--accent-glow-hi) 50%,
    var(--accent-2-glow) 70%,
    transparent 100%);
  border-top-left-radius: var(--r-5);
  border-top-right-radius: var(--r-5);
  pointer-events: none;
}

/* Brand mark — aurora LED with colour-cycling glow */
body.professor .brand-mark,
body.developer .brand-mark {
  background:
    radial-gradient(circle at 30% 25%,
      #ffffff 0%,
      var(--accent-hi) 22%,
      var(--accent) 50%,
      var(--accent-2) 85%,
      var(--accent-2-deep) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .35),
    0 0 16px var(--accent-glow),
    0 0 32px var(--accent-2-glow),
    0 2px 6px rgba(0, 0, 0, .5);
  animation: led-pulse 4.4s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(0, 0, 0, .6);
}

@keyframes led-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .35),
      0 0 14px var(--accent-glow),
      0 0 28px var(--accent-2-glow),
      0 2px 6px rgba(0, 0, 0, .5);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .55),
      0 0 22px var(--accent-glow-hi),
      0 0 44px var(--accent-2-glow-hi),
      0 2px 6px rgba(0, 0, 0, .5);
  }
}

/* Mode pill — polished cyan-magenta leaf in Professor Mode */
body.professor .mode-pill,
body.developer .mode-pill {
  background: linear-gradient(105deg,
    var(--accent-hi) 0%,
    var(--accent) 45%,
    var(--accent-2) 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, .35);
  box-shadow:
    0 0 10px var(--accent-glow),
    0 0 18px var(--accent-2-glow),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .4);
}

/* Primary button — teal rail with magenta sheen */
body.professor .btn-primary {
  background: linear-gradient(180deg,
    var(--accent-hi) 0%,
    var(--accent) 55%,
    var(--accent-deep) 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, .3);
  box-shadow:
    0 0 16px var(--accent-glow),
    0 0 28px var(--accent-2-glow),
    0 1px 2px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
  position: relative;
  overflow: hidden;
}
body.professor .btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg,
    transparent 20%,
    var(--accent-2-glow-hi) 48%,
    rgba(255, 255, 255, .65) 52%,
    transparent 80%);
  transform: skewX(-20deg);
  animation: led-shimmer 4.8s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
body.professor .btn-primary:hover:not(:disabled) {
  box-shadow:
    0 0 22px var(--accent-glow-hi),
    0 0 40px var(--accent-2-glow-hi),
    0 1px 2px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(255, 255, 255, .55);
}
@keyframes led-shimmer {
  0%   { left: -120%; }
  38%  { left: 130%; }
  100% { left: 130%; }
}

/* Secondary buttons — light field surface over dark canvas */
body.professor .btn {
  background: var(--field);
  color: var(--g-900);
  border-color: rgba(0, 212, 200, .32);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .35),
    0 0 6px rgba(0, 212, 200, .14),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}
body.professor .btn:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .35),
    0 0 14px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}
body.professor .btn .icon { color: var(--accent-deep); }

body.professor .btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
  box-shadow: none;
}
body.professor .btn-ghost:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-hi);
  box-shadow: none;
}
body.professor .btn-ghost .icon { color: inherit; }

/* Card step number — teal chip */
body.professor .card__step {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  color: #002a29;
  border-color: rgba(255, 255, 255, .35);
  box-shadow:
    0 0 8px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

/* Card heading icons — cyan tint, text stays crisp */
body.professor .card h2 .icon { color: var(--accent-hi); filter: drop-shadow(0 0 4px var(--accent-glow)); }
body.professor .card h2 { color: var(--text); }

/* Labels stay readable on dark bg */
body.professor label { color: var(--text-2); }
body.professor label.req::after {
  background: var(--accent-2-hi);
  box-shadow: 0 0 5px var(--accent-2-glow);
}

/* Helper + muted copy remains readable */
body.professor .helper,
body.professor .muted,
body.professor #progressLabel,
body.professor .weather-label,
body.professor .progress-stats dt,
body.professor .inspection-item__place,
body.professor .inspection-item__footer {
  color: var(--text-muted);
}
body.professor .progress-stats dd { color: var(--text); }

/* Progress ring — teal→magenta gradient, glowing */
body.professor #progressRing {
  stroke: url(#progressGradient);
  filter: drop-shadow(0 0 8px var(--accent-glow)) drop-shadow(0 0 14px var(--accent-2-glow));
}
body.professor #progressPercent {
  color: var(--accent-hi);
  text-shadow: 0 0 8px var(--accent-glow);
}
body.professor .floating-gauge {
  background: radial-gradient(circle at 30% 25%, #1c2245 0%, #0c1026 70%, #060914 100%);
  border-color: var(--accent);
  box-shadow:
    0 0 22px var(--accent-glow),
    0 0 38px var(--accent-2-glow),
    0 14px 28px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(0, 212, 200, .2);
}
body.professor .gauge-popover {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, .5),
    0 0 26px var(--accent-glow),
    0 0 40px var(--accent-2-glow);
}
body.professor .gauge-popover__status {
  background: var(--field);
  color: var(--g-900);
}

/* Inspection list — keep white, glow when selected */
body.professor .inspection-item__body {
  background: var(--field);
  color: var(--g-900);
  border-color: rgba(255, 255, 255, .18);
}
body.professor .inspection-item__title { color: var(--g-900); }
body.professor .inspection-item.selected .inspection-item__body {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent) inset,
    0 0 16px var(--accent-glow),
    0 0 28px var(--accent-2-glow);
}
body.professor .inspection-empty {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

/* Defect chip (unchecked stays white, checked goes teal-magenta) */
body.professor .defect-chip:has(input:checked) {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: rgba(255, 255, 255, .4);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-glow), 0 0 18px var(--accent-2-glow);
}

/* Status dots */
body.professor .status-dot.on   { background: var(--accent-hi); box-shadow: 0 0 6px var(--accent-glow-hi); }
body.professor .status-dot.near { background: var(--accent-2-hi); box-shadow: 0 0 6px var(--accent-2-glow-hi); }

/* GPS pill — each state gets its own LED */
body.professor .gps-pill {
  background: var(--field);
  color: var(--g-900);
  border-color: rgba(255, 255, 255, .25);
}
body.professor .gps-pill.gps-on {
  background: linear-gradient(180deg, #c9fff5 0%, #76ebd3 100%);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 0 12px var(--accent-glow);
  color: #00423f;
}
body.professor .gps-pill.gps-near {
  background: linear-gradient(180deg, #ffe9a8 0%, #f5c869 100%);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 0 10px rgba(245, 200, 105, .55);
  color: #5a3e00;
}
body.professor .gps-pill.gps-off {
  background: linear-gradient(180deg, #ffc2d9 0%, #ff86bc 100%);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 0 12px var(--accent-2-glow);
  color: #5a0a2c;
}

/* Weather blocks */
body.professor .weather-block { background: var(--surface-2); border-color: var(--border); }
body.professor .weather-block.weather-empty { background: var(--surface); }
body.professor .weather-table th { color: var(--text-muted); }
body.professor .weather-table td { color: var(--text); }

/* Address group */
body.professor .address-group { border-color: rgba(150, 180, 255, .22); }

/* Photo tile */
body.professor .photo-item {
  background: var(--field);
  border-color: rgba(150, 180, 255, .22);
}
body.professor .photo-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Submit gate modal */
body.professor .bt-modal__panel,
body.developer .bt-modal__panel {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow:
    var(--shadow-pop),
    0 0 32px var(--accent-glow),
    0 0 52px var(--accent-2-glow),
    inset 0 0 0 1px rgba(0, 212, 200, .18);
}
body.professor .bt-modal__title,
body.developer .bt-modal__title { color: var(--accent-hi); }
body.professor .bt-modal__sub { color: var(--text-2); }
body.professor .bt-modal__close {
  background: var(--field);
  color: var(--g-900);
}
body.professor .bt-modal__list { color: var(--text); }

/* Photo modal */
body.professor .photo-modal__panel {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-pop), 0 0 32px var(--accent-glow), 0 0 48px var(--accent-2-glow);
}
body.professor .photo-modal__title { color: var(--accent-hi); }

/* Toast */
body.professor #toast {
  background: linear-gradient(180deg, #1b2350 0%, #0c1026 100%) !important;
  border: 1px solid var(--accent) !important;
  box-shadow:
    var(--shadow-pop),
    0 0 20px var(--accent-glow),
    0 0 36px var(--accent-2-glow) !important;
  color: #ffffff !important;
}

/* Build stamp + pass label — cyan micro copy */
body.professor #buildStamp,
body.professor #passLabel {
  color: var(--accent-hi);
  text-shadow: 0 0 6px var(--accent-glow);
}

/* Header */
body.professor header {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 94%, transparent) 0%,
    color-mix(in srgb, var(--surface) 70%, transparent) 100%);
  border-bottom-color: var(--border-strong);
  box-shadow:
    0 1px 0 var(--accent-glow),
    0 2px 24px rgba(0, 0, 0, .32);
}

/* Segmented controls + toggles — Professor tweaks */
body.professor .toggle__track { background: var(--surface-2); border-color: var(--border); }
body.professor .toggle[data-state="on"] .toggle__track {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
body.professor .segmented {
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
body.professor .segmented__btn { color: var(--text-muted); }
body.professor .segmented__btn:hover { color: var(--text); }
body.professor .segmented__btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  color: #002a29;
  box-shadow:
    0 0 10px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

/* Tumbler accents in Professor Mode — selector glows with dual-colour LED */
body.professor .tumbler__selector {
  border-top-color: var(--accent);
  border-bottom-color: var(--accent);
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    color-mix(in srgb, var(--accent) 20%, transparent) 50%,
    rgba(255, 255, 255, 0) 100%);
  box-shadow:
    0 0 12px var(--accent-glow) inset,
    0 0 20px var(--accent-2-glow);
}

body.professor .tumbler__item.is-centred {
  color: var(--g-900);      /* dark number on white tumbler surface stays dark */
  text-shadow: 0 0 0 transparent;
}

/* Replay glint on double-tap */
body.professor #glintArc { opacity: .8; }
body.glint-replay #glintArc { animation: glint-sweep 4s ease-out forwards; }
@keyframes glint-sweep {
  0%   { opacity: 0; stroke-dashoffset: 289; }
  15%  { opacity: 1; }
  70%  { opacity: .85; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

/* ----- Responsive ----- */

@media (max-width: 820px) {
  main { padding: var(--sp-4); }
  aside {
    position: static;
    max-width: 100%;
    width: 100%;
  }
  .card { padding: var(--sp-4); }
  header { padding: var(--sp-3) var(--sp-4); }
}

@media (max-width: 540px) {
  main.row > aside,
  main.row > section.form-host {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .row > .field {
    min-width: 100%;
    flex: 1 1 100%;
  }
  .actions { justify-content: flex-start; }
  .btn { padding: 8px 12px; font-size: var(--fs-small); }
}

/* ----- Reduced motion ----- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ----- Print ----- */

@media print {
  header, aside, .actions, #photoModal, #photoMetaModal, #submitGateModal, #toast {
    display: none !important;
  }
  .card { box-shadow: none; border-color: var(--border); page-break-inside: avoid; }
  body { background: #fff; }
}
