/* Deer Honey workshop portal.
   A goldsmith's bench on paper: warm cream, honey amber, espresso ink.
   Serif display type over a quiet humanist body, big tactile controls. */

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

:root {
  color-scheme: light dark;

  --paper: #faf3e7;
  --paper-deep: #f3e9d7;
  --card: #fffdf8;
  --card-2: #f8efdd;
  --ink: #2c2117;
  --ink-soft: #4a3b2c;
  --muted: #7a6a55;
  --line: #e6d9c3;
  --line-strong: #d5c4a6;

  --honey: #c8860d;
  --honey-deep: #9a6606;
  --honey-ink: #8f5f05;
  --honey-soft: #f6e3bd;
  --honey-glow: rgba(200, 134, 13, 0.14);

  --green: #3f7d54;
  --green-soft: #e2eee2;
  --red: #b23c2a;
  --red-soft: #f7e3dd;
  --amber-ink: #8a5e00;
  --amber-soft: #f7ecd2;

  --shadow: 0 1px 2px rgba(76, 55, 22, 0.08), 0 6px 18px rgba(76, 55, 22, 0.07);
  --shadow-lift: 0 2px 4px rgba(76, 55, 22, 0.1), 0 12px 28px rgba(76, 55, 22, 0.12);
  --ring: 0 0 0 3px rgba(200, 134, 13, 0.35);

  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --font-body: 'Avenir Next', Avenir, Seravek, 'Gill Sans Nova', 'Segoe UI', Calibri, 'Helvetica Neue', sans-serif;

  --radius: 12px;
  --radius-small: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1813;
    --paper-deep: #191310;
    --card: #2a221a;
    --card-2: #322921;
    --ink: #f2e7d5;
    --ink-soft: #dccbb2;
    --muted: #a8937a;
    --line: #3c3123;
    --line-strong: #52432f;

    --honey: #e2a33c;
    --honey-deep: #f0b95f;
    --honey-ink: #eab259;
    --honey-soft: #453314;
    --honey-glow: rgba(226, 163, 60, 0.12);

    --green: #86c49a;
    --green-soft: #23352a;
    --red: #e08a78;
    --red-soft: #40231d;
    --amber-ink: #e5b96a;
    --amber-soft: #3b2f16;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.4);
    --ring: 0 0 0 3px rgba(226, 163, 60, 0.4);
  }
}

/* ---------- Reset and base ---------- */

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 420px at 50% -160px, var(--honey-glow), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0);
  background-size: auto, 26px 26px;
  -webkit-font-smoothing: antialiased;
}

/* Gold leaf edge along the very top of the page. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--honey) 18%, var(--honey-deep) 50%, var(--honey) 82%, transparent);
  z-index: 60;
  pointer-events: none;
}

img, svg { max-width: 100%; }

a { color: var(--honey-ink); }
a:hover { color: var(--honey-deep); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-small);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius-small);
  z-index: 99;
}
.skip-link:focus { left: 8px; }

.noscript-note {
  max-width: 480px;
  margin: 4rem auto;
  text-align: center;
  font-size: 1.1rem;
}

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

#chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  color: var(--honey);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.main-nav { display: flex; gap: 6px; }

.main-nav a {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-soft);
  border: 1.5px solid transparent;
}

.main-nav a:hover { background: var(--card-2); color: var(--ink); }

.main-nav a[aria-current='page'] {
  background: var(--honey);
  border-color: var(--honey);
  color: #241a08;
}

@media (prefers-color-scheme: dark) {
  .main-nav a[aria-current='page'] { color: #241a08; }
}

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

#view {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 80px;
}

.view-section { animation: fade-up 0.35s ease both; }

.page-head { margin-bottom: 1.4rem; }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  margin: 0 0 0.2rem;
}

.page-sub { margin: 0; color: var(--muted); font-size: 1.02rem; }

.muted-note { color: var(--muted); font-size: 0.95rem; }

/* ---------- Loading and errors ---------- */

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 5rem 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.loading-drop {
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--honey);
  animation: drip 1.1s ease-in-out infinite;
}

@keyframes drip {
  0%, 100% { transform: rotate(-45deg) scale(0.85); opacity: 0.55; }
  50% { transform: rotate(-45deg) scale(1.1); opacity: 1; }
}

.error-panel {
  max-width: 480px;
  margin: 4rem auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.error-panel h2 { font-family: var(--font-display); margin-top: 0; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  padding: 12px 22px;
  min-height: 46px;
  border-radius: var(--radius-small);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-primary {
  background: linear-gradient(180deg, var(--honey), var(--honey-deep));
  color: #241a08;
  box-shadow: var(--shadow);
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-lift); }

.btn-ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--honey); color: var(--honey-ink); }

.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--card-2); }

.btn-small { min-height: 38px; padding: 8px 16px; font-size: 0.95rem; }
.btn-big { min-height: 54px; padding: 14px 30px; font-size: 1.1rem; width: 100%; }

.link-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--honey-ink);
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--honey-deep); }

/* ---------- Chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }

.chip {
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 9px 18px;
  min-height: 42px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.chip:hover { border-color: var(--honey); color: var(--honey-ink); }

.chip.active {
  background: var(--honey);
  border-color: var(--honey);
  color: #241a08;
}

/* ---------- Cards (board) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  animation: fade-up 0.4s ease both;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--honey);
  color: var(--ink);
}

.job-card.is-overdue { border-left: 4px solid var(--red); }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.25;
}

.card-customer { color: var(--muted); margin-top: -4px; }

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--honey);
  flex: none;
}

.status-name { white-space: nowrap; }

.progress {
  flex: 1;
  height: 5px;
  min-width: 40px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--honey), var(--honey-deep));
}

.card-money {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 0.98rem;
}

.money-quoted { color: var(--ink-soft); }
.money-balance { color: var(--muted); }
.money-balance.owing { color: var(--honey-ink); font-weight: 700; }

/* ---------- Badges and chips ---------- */

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge.t-repair { background: var(--red-soft); color: var(--red); }
.badge.t-commission { background: var(--honey-soft); color: var(--honey-ink); }
.badge.t-remodel { background: var(--green-soft); color: var(--green); }
.badge.t-other { background: var(--paper-deep); color: var(--muted); }
.badge.badge-status { background: var(--card-2); color: var(--ink-soft); }
.badge.badge-mini { font-size: 0.68rem; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }

.due-chip {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.due-chip.overdue { background: var(--red-soft); color: var(--red); }
.due-chip.today, .due-chip.soon { background: var(--amber-soft); color: var(--amber-ink); }
.due-chip.done { background: var(--green-soft); color: var(--green); }
.due-chip.none { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }

/* ---------- Empty state ---------- */

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.empty-icon { width: 56px; height: 56px; color: var(--honey); opacity: 0.7; margin-bottom: 0.5rem; }

/* ---------- Job detail ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.98rem;
}
.back-link::before { content: '\2190\00a0'; }
.back-link:hover { color: var(--honey-ink); }

.job-head { margin-bottom: 1.2rem; }

.badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 0.5rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 1.4rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.stat-owing { border-color: var(--honey); background: linear-gradient(180deg, var(--card), var(--honey-soft)); }

.stat-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-top: 2px;
}

.job-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.job-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.job-side { position: sticky; top: 84px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.sub-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.1rem 0 0.3rem;
}

.prose { margin: 0; white-space: pre-line; }

.customer-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.2rem;
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
}

.kv dt { color: var(--muted); font-size: 0.95rem; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.links-row { display: flex; flex-wrap: wrap; gap: 10px; }

.out-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.out-link svg { width: 14px; height: 14px; color: var(--muted); }
.out-link:hover { border-color: var(--honey); color: var(--honey-ink); }
.out-link:hover svg { color: var(--honey-ink); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.items {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.98rem;
}

table.items th {
  text-align: left;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--line-strong);
}

table.items td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.items tbody tr:nth-child(even) { background: var(--card-2); }
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  table.items tbody tr:nth-child(even) { background: color-mix(in srgb, var(--card-2) 55%, transparent); }
}

table.items .num, table.items th.num { text-align: right; white-space: nowrap; }

.leads-table { min-width: 760px; }

.lead-name { font-weight: 650; }
.cell-sub { display: block; font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.lead-notes { max-width: 220px; color: var(--muted); font-size: 0.92rem; }

.tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 600;
  font-size: 0.95rem;
}
.tick svg { width: 15px; height: 15px; flex: none; }

.lead-result { font-size: 0.92rem; font-weight: 600; }
.lead-result.ok { color: var(--green); }
.lead-result.warn { color: var(--amber-ink); }
.lead-result.err { color: var(--red); }

/* ---------- Actions ---------- */

.actions-list { display: flex; flex-direction: column; gap: 14px; }

.action { display: flex; flex-direction: column; gap: 6px; }

.action-btn { width: 100%; justify-content: flex-start; }

.action-note { margin: 0; font-size: 0.88rem; color: var(--muted); }

.confirm-box {
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 14px;
}

.confirm-text { margin: 0 0 10px; font-size: 0.98rem; }

.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.percent-field { margin-bottom: 10px; }
.percent-field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.percent-field input { width: 90px; }

.result {
  border-radius: var(--radius-small);
  padding: 12px 14px;
  border: 1px solid;
  font-size: 0.95rem;
}

.result.ok { background: var(--green-soft); border-color: var(--green); }
.result.warn { background: var(--amber-soft); border-color: var(--amber-ink); }
.result.err { background: var(--red-soft); border-color: var(--red); }

.result-title { margin: 0 0 4px; font-weight: 700; }
.result.ok .result-title { color: var(--green); }
.result.warn .result-title { color: var(--amber-ink); }
.result.err .result-title { color: var(--red); }

.result-line { margin: 2px 0; overflow-wrap: anywhere; }
.result-status { color: var(--muted); font-size: 0.88rem; }

details.raw { margin-top: 8px; }
details.raw summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); }
details.raw pre {
  margin: 8px 0 0;
  padding: 10px;
  background: var(--paper-deep);
  border-radius: var(--radius-small);
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Forms ---------- */

input, select, textarea {
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 11px 14px;
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--honey);
  box-shadow: var(--ring);
}

textarea { resize: vertical; }

.form-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 24px;
  margin: 0 0 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px;
}

.field label, .qty-field label {
  display: block;
  font-weight: 650;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.field.grow { grid-column: span 2; }
.field.grow-full { grid-column: 1 / -1; }

.req {
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: 4px;
}

.hint { margin: 6px 0 0; font-size: 0.9rem; color: var(--muted); }

.check-field { align-self: end; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
}

.check input { width: 22px; height: 22px; accent-color: var(--honey); padding: 0; }

/* ---------- Intake line items ---------- */

.item-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }

.item-row {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px 16px 16px;
  margin: 0;
}

.item-row-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.item-num {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-right: auto;
}

.mode-toggle {
  display: inline-flex;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}

.mode-btn {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  padding: 7px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mode-btn.active { background: var(--honey); color: #241a08; }

.pb-fields, .manual-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
}

.pb-fields .field, .manual-fields .field { flex: 1 1 180px; }
.pb-fields .field.service-field { flex: 2 1 260px; position: relative; }
.manual-fields .field.grow { flex: 2 1 260px; }
.qty-field { flex: 0 1 90px !important; }
.qty-field input { text-align: center; }

.labour-tag {
  align-self: flex-end;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-lift);
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

.search-result {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.98rem;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.search-result:hover, .search-result:focus-visible { background: var(--honey-soft); color: var(--honey-ink); }

.search-empty { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 0.95rem; }

.item-price {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
  min-height: 1.2em;
}

.price-main { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.price-sub { color: var(--muted); font-size: 0.92rem; }
.price-err { color: var(--red); font-size: 0.95rem; font-weight: 600; }

.running-total {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1.5px solid var(--line-strong);
  font-size: 1.15rem;
  text-align: right;
}

.running-total strong { font-family: var(--font-display); font-size: 1.5rem; margin-left: 8px; }

.submit-row { margin-top: 4px; }

.form-errors {
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: var(--radius-small);
  color: var(--red);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 600;
}

.form-errors p { margin: 3px 0; }

/* ---------- Success panel ---------- */

.success-panel {
  max-width: 560px;
  margin: 2rem auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem 2rem;
}

.success-icon { width: 72px; height: 72px; color: var(--honey); margin-bottom: 0.6rem; }

.success-total {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 1rem 0;
}

.success-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
  align-items: center;
}

.warn-box {
  background: var(--amber-soft);
  border: 1px solid var(--amber-ink);
  color: var(--amber-ink);
  border-radius: var(--radius-small);
  padding: 12px 16px;
  margin: 1rem 0;
  text-align: left;
  font-size: 0.98rem;
}

/* ---------- Notices ---------- */

.notice {
  background: var(--honey-soft);
  border: 1px solid var(--honey);
  color: var(--honey-ink);
  border-radius: var(--radius-small);
  padding: 12px 16px;
  margin-bottom: 1.2rem;
  font-size: 0.98rem;
}

.form-links { margin-bottom: 1.2rem; }

.send-cell { min-width: 170px; }

/* ---------- Auth (PIN screen) ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  padding: 3rem 2.4rem;
  text-align: center;
  animation: fade-up 0.45s ease both;
}

.auth-mark { width: 64px; height: 64px; color: var(--honey); }

.auth-name {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  margin: 0.6rem 0 0.1rem;
}

.auth-sub {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin: 0 0 2rem;
}

.pin-label {
  display: block;
  font-weight: 650;
  margin-bottom: 10px;
  font-size: 1.02rem;
}

#pin {
  text-align: center;
  font-size: 1.9rem;
  letter-spacing: 0.45em;
  padding: 12px 8px 12px calc(8px + 0.45em);
  margin-bottom: 14px;
}

.auth-error { color: var(--red); font-weight: 600; margin: 12px 0 0; }

.auth-note { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem; }
.auth-note-sub { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- Animation ---------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
}

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

@media (max-width: 860px) {
  .job-layout { grid-template-columns: 1fr; }
  .job-side { position: static; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  #chrome { flex-direction: column; align-items: flex-start; gap: 10px; }
  .main-nav { width: 100%; }
  .main-nav a { flex: 1; text-align: center; padding: 10px 8px; }

  .field.grow { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }

  .item-row-top { flex-wrap: wrap; }
  .card-money { flex-direction: column; gap: 4px; }
}

/* ---------- Build status page ---------- */

.status-headline {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46rem;
  margin: 0 0 1.8rem;
}

.status-group { margin-bottom: 2rem; }

.status-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding-left: 14px;
  border-left: 4px solid var(--line-strong);
}

.status-group-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
}

.status-group-sub { margin: 0; color: var(--muted); font-size: 0.95rem; }

.status-live .status-group-head { border-left-color: var(--green); }
.status-coming .status-group-head { border-left-color: var(--honey); }
.status-blocked .status-group-head { border-left-color: var(--red); }
.status-question .status-group-head { border-left-color: var(--honey-deep); }

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.status-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.status-card h3 {
  font-size: 1.02rem;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; }

.status-card .status-extra {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
  color: var(--honey-ink);
}

.status-live .status-card { border-top: 3px solid var(--green); }
.status-coming .status-card { border-top: 3px solid var(--honey); }
.status-blocked .status-card { border-top: 3px solid var(--red); }
.status-question .status-card { border-top: 3px solid var(--honey-deep); }

.q-badge {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--honey-soft);
  color: var(--honey-ink);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
