:root {
  --navy-950: #05283e;
  --navy-900: #07344f;
  --blue-700: #0876ae;
  --blue-600: #0b89c7;
  --blue-100: #e5f4fb;
  --orange-600: #eb5c22;
  --orange-500: #f3742c;
  --orange-100: #fff0e8;
  --teal-600: #13877e;
  --teal-100: #e6f6f3;
  --ink-900: #172934;
  --ink-700: #3f5663;
  --ink-500: #71848f;
  --line: #dce5e9;
  --surface: #ffffff;
  --canvas: #f3f6f7;
  --danger: #b63b3b;
  --shadow: 0 10px 35px rgba(15, 46, 62, 0.08);
  --radius-lg: 22px;
  --radius-md: 15px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 100% 2%, rgba(11, 137, 199, 0.08), transparent 23rem),
    var(--canvas);
  color: var(--ink-900);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(220, 229, 233, 0.9);
  backdrop-filter: blur(14px);
}

.header-inner, .app-shell, .bottom-inner {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo { width: min(250px, 67vw); height: auto; display: block; }

.draft-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.draft-dot { width: 7px; height: 7px; border-radius: 50%; background: #e5a028; box-shadow: 0 0 0 3px #fff0cf; }
.app-shell { padding: 27px 0 132px; }

.page-heading { margin-bottom: 20px; }
.eyebrow, .section-kicker { margin: 0 0 5px; color: var(--blue-700); font-size: 0.73rem; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(1.7rem, 7vw, 2.3rem); line-height: 1.05; letter-spacing: -0.035em; }
h2 { margin-bottom: 6px; font-size: clamp(1.35rem, 5vw, 1.72rem); line-height: 1.15; letter-spacing: -0.025em; }
h3 { margin-bottom: 3px; font-size: 1.1rem; line-height: 1.22; }
.heading-copy, .section-heading p { max-width: 520px; margin-bottom: 0; color: var(--ink-700); font-size: 0.92rem; }

.form-step, form { min-width: 0; max-width: 100%; }
.form-step { animation: fadeUp 0.3s ease both; }
.form-step[hidden] { display: none; }
.form-step + .form-step { margin-top: 28px; }
form > .voice-card { margin-bottom: 22px; }
@keyframes fadeUp { from { transform: translateY(6px); } to { transform: none; } }

.card, .summary-card {
  padding: 22px;
  border: 1px solid rgba(211, 223, 228, 0.95);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card + .card, .voice-card + .card, .card + .helper-card, .summary-card + .card, .review-card + .assistant-card { margin-top: 16px; }
.card-title-row { display: flex; align-items: center; gap: 13px; margin-bottom: 23px; }
.card-title-row.compact { margin-bottom: 18px; }
.card-title-row h2, .card-title-row h3 { margin-bottom: 0; }
.section-icon { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; }
.section-icon svg { width: 23px; }
.section-icon.blue { background: var(--blue-100); color: var(--blue-700); }
.section-icon.orange { background: var(--orange-100); color: var(--orange-600); }
.section-icon.teal { background: var(--teal-100); color: var(--teal-600); }

.form-grid { display: grid; gap: 16px; min-width: 0; }
.form-grid > *, .field, .input-wrap { min-width: 0; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field-label, .meal-field legend { color: var(--ink-700); font-size: 0.8rem; font-weight: 780; }
.field-label strong { color: var(--orange-600); }
.field-label small { margin-left: 5px; color: var(--ink-500); font-size: 0.67rem; font-weight: 650; }
.input-wrap { position: relative; display: flex; max-width: 100%; }
.input-wrap svg { position: absolute; top: 50%; left: 14px; width: 20px; color: #7b929e; transform: translateY(-50%); pointer-events: none; }
.input-wrap input { min-width: 0; max-width: 100%; padding-left: 44px; }

input, textarea, select {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid #cfdce2;
  border-radius: 13px;
  outline: none;
  background: #fbfcfc;
  color: var(--ink-900);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input, select { padding: 0 13px; }
input[type="date"] { display: block; flex: 1 1 0; width: 0; min-width: 0; max-width: 100%; inline-size: 0; }
input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
textarea { min-height: 70px; padding: 13px; line-height: 1.4; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue-600); background: #fff; box-shadow: 0 0 0 4px rgba(11, 137, 199, 0.12); }
input::placeholder, textarea::placeholder { color: #9aaab2; }
.field.has-error input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(182, 59, 59, 0.09); }

.vehicle-fieldset, .meal-field { padding: 0; border: 0; margin: 1px 0 0; }
.vehicle-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.choice-chip input, .meal-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-chip span { display: grid; place-items: center; min-height: 42px; padding: 0 15px; border: 1.5px solid #d2dfe4; border-radius: 999px; background: #fff; color: var(--ink-700); font-size: 0.82rem; font-weight: 720; cursor: pointer; }
.choice-chip input:checked + span { border-color: var(--blue-700); background: var(--blue-100); color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue-700); }
.choice-chip input:focus-visible + span, .meal-field input:focus-visible + span { outline: 3px solid rgba(11, 137, 199, 0.25); outline-offset: 2px; }

.helper-card, .assistant-card { display: flex; gap: 12px; padding: 16px 18px; border: 1px solid #cfe4ec; border-radius: var(--radius-md); background: #eef8fb; color: #2d5a6e; }
.helper-card svg, .assistant-card > svg { flex: 0 0 auto; width: 22px; color: var(--blue-700); }
.helper-card p, .assistant-card p { margin: 0; font-size: 0.84rem; }

.section-heading { margin: 0 3px 18px; }
.voice-card { overflow: hidden; border-radius: var(--radius-lg); background: linear-gradient(145deg, #062d46, #084c6b); color: #fff; box-shadow: 0 17px 40px rgba(4, 49, 75, 0.2); }
.voice-topline { display: flex; align-items: center; justify-content: flex-end; padding: 13px 18px 0; }
.voice-count { color: #c5dce7; font-size: 0.75rem; font-weight: 700; }
.voice-content { padding: 12px 18px 17px; text-align: left; }
.voice-content h3 { margin-bottom: 4px; font-size: 1.18rem; }
.voice-content > p { max-width: 560px; margin: 0 0 12px; color: #c8dce6; font-size: 0.8rem; }

.record-button { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 1fr 1fr; column-gap: 12px; justify-items: start; align-items: center; width: 100%; padding: 0; border: 0; background: transparent; color: #fff; text-align: left; cursor: pointer; touch-action: manipulation; }
.record-ring { grid-row: 1 / 3; display: grid; place-items: center; width: 64px; height: 64px; border: 4px solid rgba(255,255,255,0.16); border-radius: 50%; background: var(--orange-500); box-shadow: 0 8px 20px rgba(228, 73, 19, 0.28), inset 0 -4px 10px rgba(159, 42, 5, 0.18); transition: transform 0.16s, background 0.16s; }
.record-ring svg { width: 27px; stroke-width: 2; }
.record-label { align-self: end; font-size: 0.82rem; font-weight: 800; }
.record-timer { min-height: 18px; color: #b8d4e1; font-variant-numeric: tabular-nums; font-size: 0.76rem; }
.record-button.is-recording .record-ring { background: #d43d3d; animation: pulseRing 1.4s infinite; }
.record-button.is-recording .mic-icon { display: none; }
.stop-square { display: none; width: 24px; height: 24px; border-radius: 5px; background: #fff; }
.record-button.is-recording .stop-square { display: block; }
@keyframes pulseRing { 50% { box-shadow: 0 0 0 13px rgba(244, 102, 50, 0.13), 0 9px 24px rgba(228,73,19,.32); } }
.record-button:active .record-ring { transform: scale(0.95); }
.audio-list { display: grid; gap: 8px; margin: 0; padding: 0 14px 14px; list-style: none; }
.audio-item { display: flex; align-items: center; gap: 10px; min-height: 57px; padding: 9px 10px; border: 1px solid rgba(255,255,255,0.13); border-radius: 12px; background: rgba(255,255,255,0.09); }
.audio-play { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: var(--blue-700); cursor: pointer; }
.audio-play svg { width: 17px; fill: currentColor; stroke-width: 0; }
.audio-info { min-width: 0; flex: 1; text-align: left; }
.audio-info strong, .audio-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-info strong { font-size: 0.78rem; }
.audio-info span { margin-top: 2px; color: #afd1df; font-size: 0.68rem; }
.audio-remove { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: #c7dce5; cursor: pointer; }
.audio-remove svg { width: 18px; }

.collapsible-card { padding: 0; overflow: hidden; }
.collapsible-trigger { display: flex; align-items: center; gap: 13px; width: 100%; padding: 18px 20px; border: 0; background: #fff; text-align: left; cursor: pointer; }
.collapsible-trigger > span:nth-child(2) { display: grid; flex: 1; }
.collapsible-trigger small { color: var(--ink-500); font-size: 0.7rem; font-weight: 740; text-transform: uppercase; letter-spacing: 0.06em; }
.collapsible-trigger strong { font-size: 1rem; }
.chevron { width: 21px; color: var(--ink-500); transition: transform 0.2s; }
.collapsible-trigger[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.collapsible-content { padding: 0 20px 20px; border-top: 1px solid #edf1f2; }
.collapsible-content[hidden] { display: none; }
.field-help { margin: 14px 0; color: var(--ink-500); font-size: 0.79rem; }

.repeat-list { display: grid; gap: 11px; }
.repeat-card { padding: 14px; border: 1px solid #dce5e9; border-radius: 15px; background: #f9fbfb; }
.repeat-card .field { margin-bottom: 10px; }
.repeat-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.item-index, .worker-index { color: var(--blue-700); font-size: 0.72rem; font-weight: 830; letter-spacing: 0.06em; text-transform: uppercase; }
.remove-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #8799a2; cursor: pointer; }
.remove-button:hover { background: #fbeaea; color: var(--danger); }
.remove-button svg { width: 18px; }
.quantity-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quantity-row .field { margin-bottom: 0; }
.add-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 12px; border: 1.5px dashed #aabec7; border-radius: 13px; background: #fff; color: var(--blue-700); font-size: 0.84rem; font-weight: 800; cursor: pointer; }
.add-button:hover { border-color: var(--blue-600); background: var(--blue-100); }
.add-button svg { width: 19px; }
.worker-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr); gap: 10px; }
.meal-field { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.meal-field legend { float: left; margin-right: auto; line-height: 38px; }
.meal-field label span { display: grid; place-items: center; min-width: 50px; height: 38px; border: 1px solid #d1dfe4; border-radius: 10px; background: #fff; color: var(--ink-700); font-size: 0.78rem; font-weight: 750; cursor: pointer; }
.meal-field input:checked + span { border-color: var(--teal-600); background: var(--teal-100); color: #08756e; }

.review-heading { margin-bottom: 17px; }
.validation-banner { display: flex; gap: 11px; margin-bottom: 14px; padding: 14px; border: 1px solid #efc6c6; border-radius: 14px; background: #fff3f3; color: #873030; }
.validation-banner[hidden] { display: none; }
.validation-banner svg { flex: 0 0 auto; width: 22px; }
.validation-banner strong { font-size: 0.84rem; }
.validation-banner p { margin: 2px 0 0; font-size: 0.77rem; }
.summary-card { overflow: hidden; padding: 0; border: 0; background: var(--navy-900); color: #fff; }
.summary-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px; }
.summary-header h3 { margin: 12px 0 4px; font-size: 1.42rem; }
.summary-header p { margin: 0; color: #bed3de; font-size: 0.86rem; }
.summary-status { display: inline-flex; align-items: center; gap: 7px; color: #b9e5d8; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.summary-status i { width: 7px; height: 7px; border-radius: 50%; background: #55c5a5; box-shadow: 0 0 0 4px rgba(85,197,165,0.13); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255,255,255,0.2); border-radius: 12px; background: rgba(255,255,255,0.08); color: #fff; cursor: pointer; }
.icon-button svg { width: 19px; }
.summary-meta { display: grid; grid-template-columns: 1fr 1fr; margin: 0; background: rgba(0,0,0,0.12); }
.summary-meta div { padding: 14px 21px; }
.summary-meta div + div { border-left: 1px solid rgba(255,255,255,0.1); }
.summary-meta dt { color: #93b2c1; font-size: 0.65rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; }
.summary-meta dd { margin: 3px 0 0; font-size: 0.83rem; font-weight: 750; }

.review-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.review-label { color: var(--ink-500); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.text-button { min-height: 38px; padding: 0 8px; border: 0; background: transparent; color: var(--blue-700); font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.review-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.review-stat { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px; border-radius: 12px; background: #f4f7f8; }
.review-stat-icon { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.review-stat-icon svg { width: 18px; }
.review-stat-icon.audio { background: var(--orange-100); color: var(--orange-600); }
.review-stat-icon.rows { background: var(--blue-100); color: var(--blue-700); }
.review-stat-icon.people { background: var(--teal-100); color: var(--teal-600); }
.review-stat span:last-child { display: grid; }
.review-stat strong { font-size: 1rem; line-height: 1; }
.review-stat small { margin-top: 3px; color: var(--ink-500); font-size: 0.61rem; }
.summary-details { margin-top: 16px; border-top: 1px solid #e8edef; }
.summary-detail { display: flex; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #edf1f2; font-size: 0.78rem; }
.summary-detail:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-detail span { color: var(--ink-700); }
.summary-detail strong { text-align: right; }
.summary-empty { margin: 14px 0 0; color: var(--ink-500); font-size: 0.78rem; }
.assistant-card { margin-top: 16px; padding: 17px; background: #eef6ff; border-color: #cee0f1; }
.assistant-mark { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #dcecff; color: #2768a3; }
.assistant-mark svg { width: 21px; }
.assistant-card strong { display: block; margin-bottom: 3px; color: #254b6a; font-size: 0.84rem; }

.bottom-bar { position: fixed; z-index: 18; right: 0; bottom: 0; left: 0; padding: 12px 0 calc(12px + var(--safe-bottom)); border-top: 1px solid rgba(210,222,227,.9); background: rgba(255,255,255,.94); box-shadow: 0 -9px 25px rgba(13,45,61,.07); backdrop-filter: blur(14px); }
.bottom-inner { display: flex; gap: 10px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; padding: 0 20px; border-radius: 14px; font-weight: 820; cursor: pointer; }
.primary-button { flex: 1; border: 0; background: var(--orange-600); color: #fff; box-shadow: 0 8px 19px rgba(211,73,23,.22); }
.primary-button:hover { background: #d94e18; }
.primary-button:disabled { background: #aebbc1; box-shadow: none; cursor: not-allowed; }
.primary-button svg, .secondary-button svg { width: 20px; }
.secondary-button { flex: 0 0 auto; border: 1px solid #ccdae0; background: #fff; color: var(--ink-700); }
.full-width { width: 100%; }

.toast { position: fixed; z-index: 50; top: 86px; left: 50%; display: flex; align-items: center; gap: 9px; width: min(calc(100% - 32px), 440px); padding: 13px 15px; border-radius: 13px; background: var(--ink-900); color: #fff; box-shadow: 0 14px 35px rgba(0,0,0,.2); font-size: 0.82rem; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 19px; color: #68d0b1; stroke-width: 2.5; }

.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: end center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,27,40,.62); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(100%, 460px); padding: 30px 23px 23px; border-radius: 24px; background: #fff; text-align: center; box-shadow: 0 25px 70px rgba(0,0,0,.28); animation: modalUp .28s ease both; }
@keyframes modalUp { from { opacity: 0; transform: translateY(25px); } }
.success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: -62px auto 18px; border: 7px solid var(--canvas); border-radius: 50%; background: var(--teal-600); color: #fff; }
.success-icon svg { width: 31px; stroke-width: 2.6; }
.modal-card h2 { margin-bottom: 8px; }
.modal-card > p:not(.eyebrow) { margin-bottom: 22px; color: var(--ink-700); font-size: .88rem; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (min-width: 620px) {
  .app-shell { padding-top: 36px; }
  .two-columns { grid-template-columns: 0.85fr 1.5fr; }
  .form-grid .field { margin-bottom: 16px; }
  .modal { place-items: center; }
  .modal-card { padding-top: 36px; }
  .success-icon { margin-top: -72px; }
}

@media (max-width: 480px) {
  .header-inner, .app-shell, .bottom-inner { width: min(100% - 24px, 760px); }
  .header-inner { min-height: 62px; }
  .brand-logo { width: min(215px, 65vw); }
  .app-shell { padding-top: 21px; }
  .page-heading { align-items: flex-start; margin-bottom: 22px; }
  .card { padding: 18px; }
  .card.collapsible-card { padding: 0; }
  .voice-content { padding-inline: 16px; }
  .collapsible-trigger { padding: 18px; }
  .collapsible-content { padding: 0 18px 18px; }
  .review-stat-grid { gap: 6px; }
  .review-stat { display: grid; justify-items: center; gap: 5px; padding: 9px 5px; text-align: center; }
  .review-stat span:last-child { justify-items: center; }
  .worker-grid { grid-template-columns: 1fr 88px; }
}

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