:root {
  --navy: #12355b;
  --navy-deep: #092642;
  --teal: #15979c;
  --teal-soft: #e2f5f3;
  --gold: #f4b942;
  --gold-soft: #fff4d8;
  --ink: #172230;
  --muted: #657384;
  --line: #dce3e8;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --danger: #b93f45;
  --shadow: 0 14px 34px rgba(18, 53, 91, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar {
  min-height: 74px; padding: 0 5vw; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.brand span:last-child { color: var(--teal); }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; position: relative; background: conic-gradient(var(--navy) 0 32%, transparent 32% 35%, var(--gold) 35% 65%, transparent 65% 68%, var(--teal) 68%); }
.brand-mark::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: white; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.dashboard-clock { color: #5c6f80; font-size: .88rem; font-weight: 700; white-space: nowrap; }
.worker-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.worker-header .dashboard-clock { color: white; }
.worker-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.worker-change-button { white-space: nowrap; }
.owner-chip { padding: 8px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--navy); font-weight: 700; font-size: .88rem; }
.page { width: min(1180px, 92vw); margin: 0 auto; padding: 42px 0 80px; }
.page-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { color: var(--teal); font-weight: 800; text-transform: uppercase; letter-spacing: .09em; font-size: .75rem; margin-bottom: 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; color: var(--navy-deep); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.035em; }
h2 { color: var(--navy-deep); letter-spacing: -.02em; }
.subtle { color: var(--muted); max-width: 680px; line-height: 1.55; }
.btn { border: 0; border-radius: 10px; min-height: 44px; padding: 0 18px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--navy); color: white; box-shadow: 0 6px 15px rgba(18, 53, 91, .18); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-secondary { background: white; color: var(--navy); border: 1px solid var(--line); }
.btn-danger { background: #fff0f0; color: var(--danger); border: 1px solid #f2c9cb; }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-weight: 800; padding: 8px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 30px; }
.summary-card, .panel, .family-card, .worker-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; }
.summary-card { padding: 22px; }
.summary-label { color: var(--muted); font-size: .85rem; font-weight: 700; }
.summary-value { font-size: 2rem; font-weight: 850; color: var(--navy); margin-top: 5px; }
.family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.family-card { padding: 24px; }
.family-top { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.family-card h3 { margin-bottom: 5px; color: var(--navy); font-size: 1.3rem; }
.pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: var(--teal-soft); color: #0c6f73; font-size: .75rem; font-weight: 800; }
.family-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .88rem; margin: 22px 0; }
.family-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { padding: 55px 24px; text-align: center; background: white; border: 1px dashed #b7c4cd; border-radius: 18px; }
.empty-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft); color: #8d6200; display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 18px; }

.setup-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.steps { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 10px; position: sticky; top: 98px; }
.step { display: flex; gap: 10px; align-items: center; padding: 13px 10px; color: var(--muted); font-weight: 750; font-size: .88rem; border-radius: 9px; }
.step.active { background: var(--teal-soft); color: var(--navy); }
.step-number { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; font-size: .74rem; }
.panel { padding: 28px; }
.section-title { padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 19px; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 800; color: var(--navy-deep); font-size: .88rem; }
.help { color: var(--muted); font-size: .78rem; line-height: 1.4; }
input, textarea, select { width: 100%; border: 1px solid #c8d2d9; border-radius: 9px; padding: 12px 13px; background: #fff; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21, 151, 156, .12); }
textarea { min-height: 95px; resize: vertical; }
.repeat-list { display: grid; gap: 11px; }
.repeat-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.question-row { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fbfcfc; }
.question-grid { display: grid; grid-template-columns: 1fr 170px auto; gap: 10px; align-items: end; }
.question-row .field { margin: 0; }
.question-actions { display: flex; gap: 3px; align-items: center; padding-bottom: 2px; }
.move-btn { min-width: 35px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--navy); font-weight: 900; }
.move-btn:disabled { opacity: .3; cursor: not-allowed; }
.panel-actions { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; }
.notice { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 14px 16px; border-radius: 8px; color: #674a08; line-height: 1.45; margin-bottom: 22px; }
.success-box { text-align: center; padding: 28px; }
.success-check { width: 64px; height: 64px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 15px; }
.link-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; margin: 20px 0; }
.link-box code { align-self: center; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.worker-shell { min-height: 100vh; background: #eef5f4; }
.worker-header { background: var(--navy); color: white; padding: 22px 5vw; }
.worker-header .brand { color: white; }
.worker-header .brand span:last-child { color: #62d0ce; }
.worker-header .brand-mark { background: conic-gradient(white 0 32%, transparent 32% 35%, var(--gold) 35% 65%, transparent 65% 68%, var(--teal) 68%); }
.worker-header .brand-mark::after { background: var(--navy); }
.worker-page { width: min(760px, 92vw); margin: 0 auto; padding: 34px 0 70px; }
.worker-dashboard { width: min(920px, 92vw); }
.worker-card { padding: clamp(22px, 5vw, 38px); }
.worker-card h1 { font-size: 2rem; }
.handoff-card { background: var(--gold-soft); border: 1px solid #efd995; border-left: 5px solid var(--gold); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.handoff-card h2 { margin-bottom: 7px; }
.handoff-note { font-size: 1.05rem; line-height: 1.6; color: #473914; margin: 14px 0 0; white-space: pre-wrap; }
.entry-list { display: grid; gap: 12px; margin-bottom: 22px; }
.entry-details { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.entry-details summary { cursor: pointer; padding: 15px 17px; color: var(--navy); font-weight: 800; list-style-position: inside; }
.entry-details[open] summary { border-bottom: 1px solid var(--line); }
.entry-body { padding: 17px; display: grid; gap: 14px; }
.answer-row { display: grid; grid-template-columns: minmax(130px, .42fr) 1fr; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid #edf0f2; }
.answer-row:last-child { border-bottom: 0; padding-bottom: 0; }
.answer-label { color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.answer-value { color: var(--ink); line-height: 1.5; white-space: pre-wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.detail-item { background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.detail-item strong { display: block; color: var(--navy); margin-top: 4px; }
.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar { width: 66px; height: 66px; flex: 0 0 66px; border-radius: 50%; background: var(--teal-soft); color: var(--navy); display: grid; place-items: center; font-size: 1.45rem; font-weight: 900; overflow: hidden; border: 3px solid white; box-shadow: var(--shadow); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin: 24px 0; }
.action-card { text-align: left; min-height: 125px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 15px; color: var(--navy); box-shadow: var(--shadow); }
.action-card strong { display: block; font-size: 1.05rem; margin: 9px 0 5px; }
.action-card span { color: var(--muted); line-height: 1.4; font-size: .86rem; }
.action-icon { font-size: 1.35rem; }
.calendar-list { display: grid; gap: 12px; }
.calendar-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.calendar-date { text-align: center; color: var(--navy); font-weight: 900; }
.calendar-date strong { display: block; font-size: 1.45rem; }
.status-pending { background: var(--gold-soft); color: #775507; }
.status-confirmed { background: var(--teal-soft); color: #0c6f73; }
.form-section { margin-top: 30px; padding-top: 25px; border-top: 1px solid var(--line); }
.form-group { margin-top: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfc; }
.form-group h2 { margin-bottom: 20px; padding-bottom: 13px; border-bottom: 2px solid var(--teal-soft); }
.other-input { margin-top: 9px; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 9px; }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-pill span { display: inline-flex; border: 1px solid #c8d2d9; padding: 10px 13px; border-radius: 999px; background: white; font-weight: 700; color: var(--navy); }
.check-pill input:checked + span { background: var(--teal-soft); border-color: var(--teal); }
.worker-submit { width: 100%; margin-top: 26px; min-height: 52px; }
.link-button { appearance: none; border: 0; background: transparent; color: var(--teal); padding: 0; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--navy-deep); color: white; padding: 13px 17px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; }
.prototype-banner { display: none; }

@media (max-width: 780px) {
  .worker-header { align-items: flex-start; }
  .worker-header-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  .worker-change-button { min-height: 42px; }
  .page-header { flex-direction: column; }
  .summary-grid, .family-grid, .field-grid { grid-template-columns: 1fr; }
  .setup-layout { grid-template-columns: 1fr; }
  .steps { position: static; display: flex; overflow-x: auto; }
  .step { min-width: max-content; }
  .question-grid { grid-template-columns: 1fr; }
  .question-actions { padding-top: 4px; }
  .answer-row, .detail-grid { grid-template-columns: 1fr; gap: 6px; }
  .action-grid { grid-template-columns: 1fr; }
  .calendar-item { grid-template-columns: 62px 1fr; }
  .topbar { padding: 0 4vw; }
  .owner-chip { display: none; }
}
