/* Field App design tokens.
 *
 * The blue is Command Center's existing accent language (#2563eb with its
 * #eff6ff / #bfdbfe supports), not a new blue, so the two applications read as
 * one Garage Raiders product. Status colors are reserved for status meaning:
 * surfaces stay neutral and only actions, navigation, and selection are blue.
 *
 * The documentation workflow must use these tokens when it ships. */
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;

  /* Brand / primary */
  --blue-700: #1d4ed8;   /* pressed */
  --blue-600: #2563eb;   /* primary */
  --blue-500: #3b82f6;   /* hover */
  --blue-100: #dbeafe;   /* selected surface */
  --blue-050: #eff6ff;   /* light blue background */
  --blue-border: #bfdbfe;

  /* Neutrals */
  --page-bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --ink: #111827;        /* primary text */
  --muted: #475569;      /* secondary text */
  --disabled-bg: #f1f5f9;
  --disabled-ink: #94a3b8;

  /* Status — used only for status meaning */
  --success: #0f766e;
  --success-soft: #f0fdfa;
  --warning: #a16207;
  --warning-soft: #fffbeb;
  --error: #b91c1c;
  --error-soft: #fef2f2;

  /* Compatibility aliases so no rule is left pointing at the old green. */
  --green-900: var(--blue-600);
  --green-700: var(--blue-700);
  --yellow-500: var(--warning);
  --red-600: var(--error);

  background: var(--page-bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 48px;
  border-radius: 6px;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.field-shell {
  min-height: 100vh;
}

.field-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--blue-700);
  background: var(--green-900);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  /* The logo file is a round badge on a white square; show only the badge. */
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
}

.logout-button {
  min-width: 88px;
  padding: 0 18px;
  border: 1px solid var(--blue-border);
  background: transparent;
  color: #ffffff;
  font-weight: 700;
}

.field-main {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 28px max(18px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

/* The hidden attribute must win over every layout rule below.
 *
 * Without this, any class setting `display` (the DEMO banner, the owner preview
 * banner, the nav) overrides the user-agent `[hidden] { display: none }`, because
 * an author rule always beats the UA sheet. That is how the DEMO — Training data
 * only banner appeared for an employee who is not a test account: the server
 * correctly reported demo_mode false and the client correctly set hidden, but
 * `.demo-banner { display: flex }` rendered it anyway. */
[hidden] {
  display: none !important;
}

.state-view[hidden] {
  display: none;
}

.loading-view {
  display: grid;
  min-height: 56vh;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  font-weight: 650;
}

.loading-mark {
  width: 42px;
  height: 42px;
  border: 4px solid var(--line);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.sign-in-view {
  display: grid;
  min-height: calc(100vh - 136px);
  place-items: center;
}

.sign-in-panel {
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--blue-600);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.eyebrow,
.role-label,
.card-status {
  margin: 0 0 8px;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
}

.supporting-copy {
  margin: 12px 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.primary-button,
.secondary-button {
  border: 0;
  font-weight: 800;
}

.primary-button {
  margin-top: 12px;
  background: var(--green-700);
  color: #ffffff;
}

.secondary-button {
  width: 100%;
  background: var(--green-900);
  color: #ffffff;
}

.error-message {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--red-600);
  background: var(--error-soft);
  color: var(--error);
  line-height: 1.45;
}

/* Password policy, mirrored from the provider configuration for readability. */
.password-rules-title {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
}

.password-rules {
  margin: 6px 0 4px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.password-rules li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: baseline;
}

.password-rules li::before {
  content: "\2022";
  font-weight: 800;
  color: var(--line);
}

.password-rules li.met {
  color: var(--green-700);
}

.password-rules li.met::before {
  content: "\2713";
  color: var(--green-700);
}

.home-heading {
  padding: 10px 0 26px;
}

.field-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field-card {
  display: flex;
  min-height: 300px;
  padding: 24px;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.field-card p:not(.card-status) {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.product-card {
  border-top: 6px solid var(--blue-600);
}

.visualizer-card {
  border-top: 6px solid var(--green-700);
}

.muted-card {
  border-top: 6px solid #8b9690;
}

.field-card > button:disabled {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #edf0ee;
  color: #4c5852;
  font-weight: 750;
}

.field-notice {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--yellow-500);
  background: #fff9e8;
  color: #55431d;
  line-height: 1.5;
}

.view-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 26px;
}

.text-button {
  align-self: flex-start;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--green-700);
  font-weight: 750;
}

.jobs-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job-list-item {
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  text-align: left;
}

.job-list-item .job-list-time {
  margin: 0 0 6px;
  color: var(--green-700);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.job-list-item .job-list-name {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
}

.job-list-item .job-list-meta {
  margin: 6px 0 0;
  color: var(--muted);
}

.job-detail-body {
  display: grid;
  gap: 18px;
  margin: 0;
}

.job-detail-body > div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.job-detail-body dt {
  margin: 0 0 6px;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.job-detail-body dd {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.job-detail-body a {
  color: var(--green-700);
  font-weight: 700;
}

.job-detail-body ul {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 800px) {
  .field-actions {
    grid-template-columns: 1fr;
  }

  .field-card {
    min-height: 230px;
  }
}

@media (max-width: 480px) {
  .field-header {
    min-height: 64px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .field-main {
    padding-top: 20px;
  }

  h1 {
    font-size: 30px;
  }

  .sign-in-panel {
    padding: 24px 20px;
  }

  .field-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-mark {
    animation: none;
  }
}

.forgot-button {
  margin-top: 14px;
}

.setup-link-button {
  display: block;
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
}

/* --- Demo Mode banner ------------------------------------------------- */
.demo-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--yellow-500);
  background: #fdf6e3;
  color: #6b5312;
  font-size: 14px;
  line-height: 1.45;
}

.demo-chip {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--yellow-500);
  color: #3a2c06;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* --- Product Demo ----------------------------------------------------- */
.product-job-context {
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 2px solid var(--green-700);
  border-radius: 10px;
  background: #edf7f0;
  color: var(--green-900, #174b2b);
  font-size: 17px;
  font-weight: 800;
}

.product-demo-safety,
.product-interest-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.job-product-demo-button {
  width: 100%;
  margin: 0 0 18px;
  min-height: 52px;
}
.detail-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.product-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}

.filter-chip {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.filter-chip-active {
  border-color: var(--green-700);
  background: var(--green-700);
  color: #ffffff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.product-tile {
  display: grid;
  gap: 6px;
  min-height: 200px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.product-interest-badge {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dff3e5;
  color: #165c31;
  font-size: 13px;
  font-weight: 800;
}

.product-interest-active {
  background: #176b37;
}

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 8px;
  /* White so see-through product photos never show a dark backing. */
  background: #fff;
  overflow: hidden;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .product-tile {
    min-height: 330px;
    padding: 16px;
  }

  .product-detail-body {
    max-width: 860px;
    margin-inline: auto;
    font-size: 18px;
  }
}

/* Product cut-outs show whole in the 4:3 card; cropping cut off square and tall
   photos (owner 2026-10-27). Real photos, like the epoxy floor, still fill it.
   The image is pinned to the card box: as a grid item its 100% height did not
   resolve, so square and tall photos kept their own height and lost the bottom
   (wall shelves, Seville tall cabinet; owner 2026-10-29). */
.product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-media-photo img {
  object-fit: cover;
}

.product-media-placeholder::after {
  content: "Photo coming soon";
  color: var(--muted);
  font-size: 13px;
}

.product-tile h2 {
  font-size: 18px;
  line-height: 1.25;
}

.product-price {
  color: var(--green-700);
  font-weight: 800;
}

.product-price-missing {
  color: var(--muted);
  font-weight: 600;
}

.product-install {
  color: var(--muted);
  font-size: 13px;
}

.product-detail-body {
  display: grid;
  gap: 16px;
}

.product-detail-row h3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.product-detail-row p {
  padding-top: 4px;
  font-size: 17px;
  line-height: 1.5;
}

.product-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 22px;
}

.product-nav button {
  min-height: 52px;
}

/* --- Schedule-first Field App ----------------------------------------- */
.field-nav {
  display: flex;
  gap: 6px;
  padding: 8px 0 14px;
  overflow-x: auto;
}

.nav-tab {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.nav-tab-active {
  border-color: var(--green-900);
  background: var(--green-900);
  color: #ffffff;
}

.nav-tab:disabled { color: var(--muted); }

.schedule-heading { padding: 4px 0 12px; }

.range-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 10px;
}

.range-tab {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.range-tab-active {
  border-color: var(--green-700);
  background: var(--green-700);
  color: #ffffff;
}

.schedule-window {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.schedule-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.schedule-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-700);
  border-radius: 10px;
  background: var(--surface);
}

.schedule-time {
  color: var(--green-700);
  font-weight: 800;
}

.schedule-card h2 {
  font-size: 19px;
  line-height: 1.25;
}

.schedule-line {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.schedule-status {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.schedule-card button { margin-top: 8px; }

/* --- Owner preview banner --------------------------------------------- */
.preview-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--green-900);
  background: var(--blue-050);
  color: var(--green-900);
  font-size: 14px;
  line-height: 1.45;
}

.preview-chip {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--green-900);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.preview-state {
  color: var(--muted);
  font-size: 13px;
}

.preview-banner button { margin-left: auto; }

.preview-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.preview-mode-switch button {
  margin-left: 0;
  border: 1px solid var(--green-900);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 4px 10px;
}

.preview-mode-switch button[aria-pressed="true"] {
  background: var(--green-900);
  color: #ffffff;
}

/* --- Owner state view (never the employee sign-in card) ---------------- */
.owner-state-view {
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.owner-state-panel {
  width: 100%;
  max-width: 520px;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-900);
  border-radius: 10px;
  background: #ffffff;
}

.owner-state-panel h1 { margin: 6px 0 12px; font-size: 22px; line-height: 1.25; }
.owner-state-panel .supporting-copy { margin: 0 0 10px; }
.owner-state-panel button { margin-top: 8px; }

/* Actual-state mode is visually distinct from workspace preview. */
.preview-banner[data-mode="owner_actual_state"] {
  border-left-color: #8a6d00;
  background: #fbf4e0;
  color: #6b5400;
}

.preview-banner[data-mode="owner_actual_state"] .preview-chip { background: #8a6d00; }


/* --- Blue system application ------------------------------------------ */

.field-header { background: var(--blue-600); border-bottom: 1px solid var(--blue-700); }

.nav-tab {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  min-height: 48px;
}
.nav-tab:hover:not(:disabled) { border-color: var(--blue-border); color: var(--blue-700); }
.nav-tab-active {
  background: var(--blue-050);
  border-color: var(--blue-600);
  color: var(--blue-700);
  font-weight: 700;
}
.nav-tab:disabled { background: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }

.range-tab {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  min-height: 48px;
}
.range-tab-active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #ffffff;
  font-weight: 700;
}

.primary-button {
  background: var(--blue-600);
  border: 1px solid var(--blue-600);
  color: #ffffff;
  font-weight: 700;
}
.primary-button:hover:not(:disabled) { background: var(--blue-500); border-color: var(--blue-500); }
.primary-button:active:not(:disabled) { background: var(--blue-700); border-color: var(--blue-700); }
.primary-button:disabled { background: var(--disabled-bg); border-color: var(--line); color: var(--disabled-ink); }

.secondary-button {
  background: var(--surface);
  border: 1px solid var(--blue-border);
  color: var(--blue-700);
  font-weight: 600;
}
.secondary-button:hover:not(:disabled) { background: var(--blue-050); border-color: var(--blue-600); }

.text-button { color: var(--blue-700); }

button:focus-visible,
a:focus-visible,
input:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }

/* Strong card boundaries on a neutral page. */
.schedule-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.schedule-card h2 { color: var(--ink); }
.schedule-time { color: var(--blue-700); font-weight: 700; }

.sign-in-panel,
.owner-state-panel,
.job-detail-body { background: var(--surface); border-color: var(--line-strong); }

/* Status chips — color carries status meaning only. */
.status-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.status-in_progress { background: var(--blue-050); color: var(--blue-700); }
.status-scheduled { background: var(--blue-050); color: var(--blue-700); }
.status-completed { background: var(--success-soft); color: var(--success); }
.status-canceled { background: var(--surface-muted); color: var(--muted); }
.status-needs_attention { background: var(--warning-soft); color: var(--warning); }
.status-rescheduled { background: var(--warning-soft); color: var(--warning); }

/* Instructions and notes. */
.instruction-list { display: flex; flex-direction: column; gap: 10px; }
.instruction-block {
  padding: 10px 12px;
  border-left: 3px solid var(--blue-600);
  background: var(--blue-050);
  border-radius: 0 8px 8px 0;
}
.instruction-source {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-700);
  margin-bottom: 4px;
}
/* Line breaks the owner or customer typed are preserved. */
.instruction-text { margin: 0; white-space: pre-wrap; color: var(--ink); }

/* Comfortable tablet touch targets. */
@media (pointer: coarse) {
  button, .nav-tab, .range-tab { min-height: 52px; }
  .schedule-card button { width: 100%; }
}

/* --- Calendar views ---------------------------------------------------- */

.view-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.view-tabs .range-tab { flex: 1 1 auto; min-width: 96px; }

.schedule-time { white-space: pre-line; }
.schedule-category {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.schedule-meta { color: var(--muted); margin: 6px 0; }
.schedule-crew {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}
.schedule-instruction-preview {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 4px solid var(--blue-600);
  border-radius: 0 8px 8px 0;
  background: var(--blue-050);
}
.schedule-instruction-preview span {
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}
.schedule-instruction-preview p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.4;
}
.schedule-products {
  justify-self: start;
  margin: 6px 0 0;
  padding: 3px 9px;
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
}

.day-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
/* The scheduled hour between jobs, shown as a real gap. */
.timeline-buffer {
  padding: 8px 12px;
  border-left: 3px dashed var(--blue-border);
  color: var(--muted);
  font-size: 13px;
  background: var(--blue-050);
  border-radius: 0 8px 8px 0;
}
.schedule-card-next { border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-100); }

.week-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;           /* horizontal scrolling on narrower tablets */
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.week-column { scroll-snap-align: start; min-width: 220px; }
.week-column-head {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blue-border);
  color: var(--blue-700);
  font-size: 14px;
}
.week-column-list, .agenda-day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.schedule-card-compact { padding: 10px 12px; }
.schedule-card-compact h2 { font-size: 16px; margin: 4px 0; }
.schedule-project-chip {
  display: inline-block;
  margin: 6px 6px 6px 0;
  padding: 4px 8px;
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
}

.agenda-list { display: flex; flex-direction: column; gap: 18px; }
.agenda-day-head {
  margin: 0 0 8px;
  color: var(--blue-700);
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

/* --- Travel and navigation --------------------------------------------- */

.travel-estimate {
  margin: 10px 0;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-radius: 8px;
}
.travel-origin { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.travel-line { margin: 4px 0 0; font-size: 13px; color: var(--ink); }

.nav-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.nav-action { flex: 1 1 140px; text-align: center; text-decoration: none; padding: 12px; border-radius: 6px; }

/* --- Instructions: internal vs customer -------------------------------- */

/* Crew instructions are operationally primary and read as ours. */
.instruction-block-crew {
  border-left-color: var(--blue-600);
  background: var(--blue-050);
}
.instruction-block-crew .instruction-source { color: var(--blue-700); }

/* Customer comments stay clearly secondary and clearly the customer's words. */
.instruction-block-customer {
  border-left-color: var(--line-strong);
  background: var(--surface-muted);
}
.instruction-block-customer .instruction-source { color: var(--muted); }

/* --- Operational job detail ------------------------------------------- */

.job-detail-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.job-detail-navigation button { margin-top: 0; min-height: 56px; padding: 10px 12px; }
.job-sequence-button { white-space: pre-line; line-height: 1.35; }
.field-project-context { margin: 0; }
.field-project-context h3 { margin: 0 0 4px; color: var(--blue-700); }
.field-project-current { margin: 0 0 10px; font-weight: 700; }
.field-project-instructions { padding: 10px; background: var(--blue-050); border-left: 4px solid var(--blue-600); }
.field-project-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.field-project-timeline li { display: grid; gap: 2px; padding: 8px 10px; border-left: 4px solid var(--line-strong); background: var(--surface-muted); }
.field-project-timeline li[data-current="true"] { border-left-color: var(--blue-600); background: var(--blue-050); }
.field-project-timeline span { color: var(--muted); font-size: 13px; }

@media (min-width: 700px) {
  .job-detail-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-detail-field[data-field="address"],
  .job-detail-field[data-field="crew-instructions"],
  .job-detail-field[data-field="customer-comments"],
  .job-detail-field[data-field="products-already-ordered"],
  .job-detail-field[data-field="project-context"],
  .job-detail-field[data-field="product-review"] { grid-column: 1 / -1; }
}

/* --- Review and delay panels ------------------------------------------- */

.schedule-review, .delay-risk-panel {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--warning);
  background: var(--warning-soft);
  border-radius: 0 8px 8px 0;
  color: var(--warning);
}
.schedule-review-line { margin: 2px 0; font-weight: 600; }
.delay-risk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.delay-risk-row button:disabled { background: var(--disabled-bg); color: var(--disabled-ink); border-color: var(--line); cursor: not-allowed; }

@media (max-width: 640px) {
  .week-grid { grid-auto-columns: minmax(180px, 80%); }
  .job-detail-navigation { grid-template-columns: 1fr; }
}

/* --- Phase 3A job documentation --------------------------------------- */

.documentation-panel {
  margin-top: 18px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.06);
}

.documentation-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.documentation-heading h2 { margin: 2px 0 0; font-size: clamp(22px, 3vw, 30px); }
.documentation-heading .eyebrow { margin: 0; }

.documentation-status,
.documentation-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 750;
}

.documentation-status[data-state="reviewed"] { border-color: #99f6e4; background: var(--success-soft); color: var(--success); }
.documentation-status[data-state="needs_correction"],
.documentation-status[data-late="true"] { border-color: #fde68a; background: var(--warning-soft); color: var(--warning); }

.documentation-correction {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--warning);
  border-radius: 0 8px 8px 0;
  background: var(--warning-soft);
  color: #713f12;
  white-space: pre-wrap;
}

.documentation-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 16px 0 22px;
  padding: 0;
  list-style: none;
}

.documentation-checklist li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.documentation-checklist li[data-complete="true"] {
  border-color: #99f6e4;
  background: var(--success-soft);
  color: var(--success);
}

.documentation-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.documentation-evidence-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.documentation-evidence-card[data-evidence-section="supplemental"] { grid-column: 1 / -1; }
.documentation-evidence-card h3 { margin: 0 0 4px; }
.documentation-evidence-card > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.photo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
/* A form's "every input is full width" rule must not reach the hidden file
   input: at width 100% it sat off the right edge and made the page scroll
   sideways. */
.incident-report-form input.photo-file-input,
.equipment-requirement-card input.photo-file-input,
.signoff-step input.photo-file-input {
  width: 1px;
  min-width: 0;
  min-height: 0;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
}

.photo-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--blue-600);
  border-radius: 6px;
  background: var(--blue-600);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.secondary-photo-button { background: var(--surface); color: var(--blue-700); }
.photo-upload-button:focus-within { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.photo-upload-button[aria-disabled="true"] { border-color: var(--line); background: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }

.documentation-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.documentation-photo {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.documentation-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--line);
}

.documentation-photo-name,
.documentation-upload-state { margin: 7px 0 0; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
/* Photo date flag (queue 61): amber when not taken on the job day, gray when the photo has no date. A flag only. */
.documentation-photo-date { margin: 7px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 800; line-height: 1.3; color: var(--muted); }
.documentation-photo-date[data-check="before_job_day"],
.documentation-photo-date[data-check="after_job_day"] { color: var(--warning); }
.documentation-upload-state[data-state="failed"],
.documentation-upload-state[data-state="refused"],
.documentation-upload-state[data-state="unsaved"] { color: var(--error); font-weight: 700; }
.documentation-upload-state[data-state="succeeded"] { color: var(--success); font-weight: 700; }

/* The line that says photos are uploading or waiting. One look everywhere:
   calm blue while a photo uploads, amber only when a photo waits on the lead.
   The second selector outranks the grey ".documentation-evidence-card > p". */
.kept-photo-banner,
.documentation-evidence-card > p.kept-photo-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--blue-600);
  border-radius: 8px;
  background: var(--blue-050);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}
.kept-photo-banner[data-state="waiting"],
.documentation-evidence-card > p.kept-photo-banner[data-state="waiting"] {
  border-left-color: var(--warning);
  background: var(--warning-soft);
  color: #713f12;
}
.kept-photo-banner[hidden],
.documentation-evidence-card > p.kept-photo-banner[hidden] { display: none; }
.incident-equipment-panel > .kept-photo-banner { margin: 16px 0 0; }
.incident-equipment-panel > .operational-local-list { margin-top: 16px; }

/* Photo card buttons: short words on one line, a full 44 px to tap. */
.documentation-photo button,
.signoff-step .documentation-photo button {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 8px 0 0;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
}
.documentation-photo .photo-card-remove,
.documentation-photo .photo-remove-no { border: 1px solid transparent; background: transparent; }
.photo-remove-confirm { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.photo-remove-question { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.3; }
.documentation-photo .photo-remove-yes { border-color: var(--error); color: var(--error); }

.documentation-products {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-050);
}

.documentation-products h3 { margin-top: 0; }
.ordered-context { margin-bottom: 14px; }
.ordered-context h4 { margin: 0 0 8px; }
.ordered-context-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.ordered-context-row span { flex: 1 1 220px; }
.ordered-context-row button, .ordered-context-row input[type="number"] { min-height: 42px; }
.ordered-context-row input[type="number"] { width: 4.5rem; }
.booked-extra-note { flex: 1 1 100%; margin: 0; }

.documentation-product-editor {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(180px, 2fr) minmax(90px, 0.7fr);
  gap: 10px;
  align-items: end;
}

.documentation-product-editor label,
.documentation-note-label { display: grid; gap: 6px; font-size: 13px; font-weight: 750; color: var(--muted); }
.documentation-product-editor select,
.documentation-product-editor input,
.documentation-panel textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.documentation-panel textarea { min-height: 112px; resize: vertical; }

.checkbox-row {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
  min-height: 48px;
  color: var(--ink) !important;
  font-weight: 650 !important;
}
.checkbox-row input { width: 22px; height: 22px; flex: 0 0 auto; }
.documentation-product-editor > button { margin: 0; }

.documentation-product-list { display: grid; gap: 8px; margin: 14px 0; }
.documentation-product-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--blue-border);
  border-radius: 8px;
  background: var(--surface);
  max-width: 100%;
  min-width: 0;
}
.documentation-product-row .product-line-copy { min-width: 0; max-width: 100%; }
.documentation-product-row .product-line-copy strong,
.documentation-product-row .product-line-copy small { display: block; max-width: 100%; overflow-wrap: break-word; word-break: normal; }
.documentation-product-row .product-line-copy small { color: var(--muted); }
.documentation-product-row .product-line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
.documentation-product-row .quantity-stepper { gap: 4px; flex: 0 0 auto; }
.documentation-product-row .quantity-stepper input { width: 2.5rem; min-width: 2.5rem; min-height: 40px; padding: 0; }
.documentation-product-row .quantity-step-button { min-width: 40px; width: 40px; min-height: 40px; font-size: 22px; padding: 0; flex: 0 0 auto; }
.documentation-product-row .product-remove { flex: 0 0 auto; padding: 0 4px; white-space: nowrap; }
.documentation-product-row button { min-height: 40px; }
.no-products-row { border-top: 1px solid var(--blue-border); padding-top: 12px; }

.documentation-note-label { margin-top: 20px; }
.documentation-confirmation { margin-top: 12px; }
.documentation-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.documentation-actions button { flex: 1 1 220px; }

.documentation-history { margin-top: 20px; }
.documentation-history h3 { margin-bottom: 8px; }
.documentation-history article { padding: 10px 0; border-top: 1px solid var(--line); }
.documentation-history p { margin: 4px 0; color: var(--muted); white-space: pre-wrap; }

.schedule-documentation { display: block; margin-top: 8px; width: fit-content; }
.schedule-documentation[data-action="true"] { border-color: #fde68a; background: var(--warning-soft); color: var(--warning); }

/* --- Phase 3B incident and equipment accountability ------------------ */
.incident-equipment-panel {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.incident-equipment-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.incident-equipment-heading h2 { margin: 2px 0 0; font-size: clamp(22px, 3vw, 30px); }
.incident-equipment-heading .eyebrow { margin: 0; }
.danger-outline-button {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  background: #fff;
  color: var(--error);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.incident-report-form,
.equipment-requirement-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-soft);
}
.incident-report-form h3,
.incident-report-form p,
.equipment-requirement-card h4,
.equipment-requirement-card p { margin: 0; }
.incident-report-form label,
.equipment-evidence-components { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
/* "Add incident photos" is a button, not a field label: white on blue, the
   same size and shape as the other photo buttons. */
.incident-report-form label.photo-upload-button,
.equipment-requirement-card label.photo-upload-button {
  display: inline-flex;
  justify-self: start;
  width: auto;
  color: #fff;
  font-size: 16px;
  font-weight: 750;
}
.incident-report-form .documentation-photo-list,
.equipment-requirement-card .documentation-photo-list { margin-top: 0; }
.incident-report-form .documentation-photo p,
.equipment-requirement-card .documentation-photo p { margin: 7px 0 0; }
.incident-report-form .documentation-photo-list:empty,
.equipment-requirement-card .documentation-photo-list:empty { display: none; }
.incident-report-form select,
.incident-report-form input:not(.photo-file-input),
.incident-report-form textarea,
.equipment-component-row select,
.equipment-requirement-card textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.incident-report-form textarea,
.equipment-requirement-card textarea { resize: vertical; }
.incident-form-actions,
.equipment-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.incident-form-actions button,
.equipment-actions button { flex: 1 1 180px; }
.incident-list,
.equipment-requirements,
#equipmentRequirementList { display: grid; gap: 12px; margin-top: 18px; }
.incident-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warning);
  border-radius: 12px;
  background: #fff;
}
.incident-card[data-state="resolved"] { border-left-color: var(--success); }
.incident-card h3,
.incident-card p { margin: 4px 0; }
.incident-card p { white-space: pre-wrap; color: var(--muted); }
.equipment-component-list { display: grid; gap: 9px; }
.equipment-component-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 180px); align-items: center; gap: 10px; }
.equipment-component-row strong { overflow-wrap: anywhere; }
.equipment-evidence-components { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.equipment-evidence-components label { display: flex; align-items: center; gap: 7px; min-height: 44px; color: var(--ink); }
.equipment-evidence-components input { width: 20px; height: 20px; }
.equipment-status-line { font-weight: 800; color: var(--warning); }
.equipment-status-line[data-complete="true"] { color: var(--success); }
.schedule-operational-attention {
  display: block;
  width: fit-content;
  margin-top: 8px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .documentation-evidence-grid,
  .documentation-product-editor { grid-template-columns: 1fr; }
  .documentation-evidence-card[data-evidence-section="supplemental"] { grid-column: auto; }
}

@media (max-width: 430px) {
  .documentation-panel { margin-inline: -4px; padding: 14px; }
  .documentation-photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .documentation-actions { flex-direction: column; }
  .documentation-actions button { flex-basis: auto; width: 100%; }
  .incident-equipment-panel { margin-inline: -4px; padding: 14px; }
  .incident-equipment-heading { align-items: stretch; flex-direction: column; }
  .danger-outline-button { width: 100%; }
  .equipment-component-row { grid-template-columns: 1fr; }
  .equipment-evidence-components { grid-template-columns: 1fr; }
  .incident-form-actions,
  .equipment-actions { flex-direction: column; }
  .incident-form-actions button,
  .equipment-actions button { flex-basis: auto; width: 100%; }
}

.product-best-for { color: var(--muted); line-height: 1.4; margin: 4px 0; }
.product-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; }
.product-gallery-slide { flex: 0 0 100%; scroll-snap-align: center; border: 0; padding: 0; background: #eef2ef; }
.product-gallery-slide img { width: 100%; height: min(65vh, 600px); object-fit: contain; }
.product-photo-fullscreen { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 12px; background: #111; color: white; }
.product-photo-fullscreen[open] { display: flex; flex-direction: column; gap: 8px; }
.product-photo-fullscreen::backdrop { background: #111; }
.product-photo-fullscreen button { display: block; margin-left: auto; padding: 12px 20px; }
.product-photo-fullscreen img { width: 100%; height: 0; min-height: 0; flex: 1; object-fit: contain; background: #fff; border-radius: 8px; }

.epoxy-swatches { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 12px; }
.epoxy-swatches[hidden], .product-gallery[hidden] { display: none; }
.epoxy-swatch { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.epoxy-swatch img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.epoxy-request-dialog { max-width: 560px; width: calc(100vw - 32px); max-height: 90dvh; border: 0; border-radius: 12px; }
.epoxy-request-dialog form { display: grid; gap: 16px; }
.epoxy-request-dialog label { display: grid; gap: 6px; font-weight: 700; }
.epoxy-request-dialog select, .epoxy-request-dialog textarea { width: 100%; padding: 12px; }

.fullscreen-gallery { height: 0; min-height: 0; flex: 1; }
.fullscreen-gallery .product-gallery-slide img { height: 100%; width: 100%; }

/* Checkbox layout must not override saved-signature/legacy-control hiding. */
.checkbox-row[hidden] { display: none !important; }
.preview-ended { position: sticky; top: 64px; z-index: 30; padding: 12px; background: #fff1f2; border: 2px solid #b42318; border-radius: 8px; }
.preview-ended button { width: 100%; min-height: 48px; color: #9f1239; font-weight: 700; }
.requested-product-notes { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Product pages share the white page surface; keep information close together. */
.product-gallery, .product-gallery-slide { background: #fff; }
.product-detail-body { gap: 9px; align-content: start; }
.product-detail-row h3, .product-detail-row p { margin: 0; }
.product-detail-row p { padding-top: 2px; }
.epoxy-request-success { padding: 22px; border: 3px solid #24734d; background: #e4f7ea; color: #174d32; border-radius: 14px; font-size: 23px; font-weight: 800; }

.quantity-stepper { display:flex; align-items:center; gap:8px; }
.quantity-stepper input { width:76px; text-align:center; min-height:48px; }
.quantity-step-button { min-width:52px; min-height:52px; font-size:28px; border:1px solid #99acc3; border-radius:10px; background:#fff; color:#173a60; touch-action:manipulation; }
.job-charge-receipt { margin:18px 0; padding:20px; border:1px solid #bed0e1; border-radius:14px; background:white; font-size:19px; color:#152e46; }
.receipt-line { display:grid; grid-template-columns:1fr auto; gap:5px 14px; padding:12px 0; border-bottom:1px solid #e0e7ef; }
.receipt-line small { grid-column:1 / -1; font-size:16px; color:#52657a; }
.receipt-total { display:flex; justify-content:space-between; gap:16px; padding:10px 0; }
.receipt-emphasis { font-size:23px; border-top:1px solid #9fb4c9; font-weight:700; }
.receipt-warning { color:#9a3412; font-weight:600; }
.receipt-tag { margin-left: 6px; color: var(--muted, #64748b); font-size: 12px; font-weight: 600; white-space: nowrap; }
.receipt-rate { margin: 0 0 6px; font-weight: 600; }

.visualizer-view { display: flex; flex-direction: column; gap: 16px; max-width: 100%; overflow-x: hidden; }
.visualizer-view input[type="checkbox"],
.visualizer-view input[type="radio"] { width: 28px; min-width: 28px; max-width: 28px; height: 28px; min-height: 28px; padding: 0; margin: 0; flex: 0 0 28px; accent-color: var(--blue-600); }
.visualizer-view input[type="file"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.visualizer-photo { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 100%; }
.visualizer-photo-button { width: 100%; }
.visualizer-photo-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--surface-muted); cursor: zoom-in; }
.visualizer-note { display: flex; flex-direction: column; gap: 8px; }
.visualizer-hint { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.visualizer-segment { display: grid; grid-template-columns: 1fr 1fr; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.visualizer-segment-option { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 0; padding: 8px 12px; background: var(--surface); position: relative; text-align: center; }
.visualizer-segment-option input { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0; }
.visualizer-segment-text { font-size: 16px; font-weight: 750; line-height: 1.2; }
.visualizer-segment-option:has(input:checked) { background: var(--blue-600); color: #ffffff; }
.visualizer-segment-option input:focus-visible + .visualizer-segment-text { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.visualizer-choices { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.visualizer-product { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; min-width: 0; max-width: 100%; }
.visualizer-product-picture { width: 40px; height: 40px; flex: 0 0 40px; object-fit: cover; border-radius: 6px; background: var(--surface-muted); }
.visualizer-product-picture.is-fallback { background: var(--surface-muted); }
.visualizer-product-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.visualizer-flakes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.visualizer-flake { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; text-align: center; }
.visualizer-flake-swatch { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-muted); display: grid; }
.visualizer-flake-swatch img { width: 100%; height: 100%; object-fit: cover; }
.visualizer-flake-swatch.is-fallback { background: var(--surface-muted); }
.visualizer-flake-line { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; max-width: 100%; }
.visualizer-flake-name { min-width: 0; max-width: 100%; font-size: 13px; font-weight: 700; line-height: 1.2; overflow-wrap: normal; word-break: normal; text-align: center; }
.visualizer-flake:has(input:checked) { border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-100); }
.visualizer-flake input:focus-visible + .visualizer-flake-name { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.visualizer-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 100%; }
.visualizer-compare img { width: 100%; max-width: 100%; height: auto; border-radius: 8px; background: var(--surface-muted); cursor: zoom-in; }
.visualizer-compare figcaption { font-weight: 700; margin-bottom: 8px; }
.visualizer-zoom { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 100vw; background: rgba(15, 23, 42, 0.92); overflow: hidden; }
.visualizer-zoom-close { align-self: flex-end; box-sizing: border-box; min-width: 44px; min-height: 44px; margin: 12px 12px 0; padding: 0 12px; border: 1px solid #ffffff; border-radius: 10px; background: transparent; color: #ffffff; font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; }
.visualizer-zoom-save { align-self: center; box-sizing: border-box; min-height: 44px; margin: 12px; padding: 10px 18px; border: 1px solid var(--blue-600); border-radius: 10px; background: var(--blue-600); color: #ffffff; font-size: 16px; font-weight: 700; cursor: pointer; }
.visualizer-zoom-stage { flex: 1; width: 100%; max-width: 100%; min-height: 0; overflow: auto; touch-action: pan-x pan-y pinch-zoom; }
.visualizer-zoom-picture { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; touch-action: pan-x pan-y pinch-zoom; }
.visualizer-zoom-stage.is-zoomed { touch-action: pan-x pan-y pinch-zoom; }
.visualizer-zoom-stage.is-zoomed .visualizer-zoom-picture { width: 200%; max-width: none; }
@media (max-width: 640px) { .visualizer-compare { grid-template-columns: 1fr; } }
