:root {
  --ink: #162b32;
  --muted: #61757b;
  --canvas: #eef5f3;
  --paper: #ffffff;
  --line: #d8e4e1;
  --brand: #0b6b68;
  --brand-dark: #064b4a;
  --brand-soft: #e3f3f0;
  --warning: #a56200;
  --warning-soft: #fff4dc;
  --success: #1f7451;
  --shadow: 0 24px 70px rgba(17, 48, 52, 0.16);
  --radius: 18px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 8% 0%, #dcefeb 0, transparent 32%), var(--canvas); }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.prototype-note {
  min-height: 34px;
  padding: 8px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  color: #d6efeb;
  background: #102d32;
  font-size: 12px;
}
.prototype-note span:first-child { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.prototype-note span + span::before { content: "•"; margin-right: 12px; color: #6ab3aa; }

.app-shell { width: min(1180px, calc(100% - 48px)); min-height: calc(100vh - 82px); margin: 24px auto; display: grid; grid-template-columns: 240px 1fr; overflow: hidden; border: 1px solid rgba(11,107,104,.12); border-radius: 28px; background: rgba(255,255,255,.72); box-shadow: var(--shadow); }

.side-rail { padding: 30px 22px 24px; display: flex; flex-direction: column; background: #f8fbfa; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 40px; color: var(--brand-dark); text-decoration: none; font-size: 20px; font-weight: 850; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: white; font-size: 13px; letter-spacing: .04em; }
.side-rail nav { display: grid; gap: 8px; }
.rail-link { padding: 13px 14px; display: flex; gap: 12px; align-items: center; border-radius: 12px; color: #455d62; text-decoration: none; font-weight: 650; }
.rail-link:hover, .rail-link.active { background: var(--brand-soft); color: var(--brand-dark); }
.rail-profile { margin-top: auto; padding: 16px 8px 0; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
.rail-profile > span:nth-child(2) { min-width: 0; display: grid; }
.rail-profile strong, .rail-profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-profile strong { font-size: 13px; }
.rail-profile small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.rail-logout { margin-left: auto; padding: 6px 7px; border: 0; border-radius: 7px; color: var(--brand); background: var(--brand-soft); cursor: pointer; font-size: 10px; font-weight: 750; }
.rail-logout[hidden] { display: none; }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #d8ebe7; color: var(--brand-dark); font-size: 12px; font-weight: 800; }

.phone-stage { display: grid; place-items: center; padding: 36px; background: linear-gradient(145deg, rgba(255,255,255,.4), rgba(225,239,236,.75)); }
.phone-frame { position: relative; width: min(100%, 430px); height: min(820px, calc(100vh - 120px)); min-height: 650px; display: flex; flex-direction: column; overflow: hidden; border: 10px solid #173238; border-radius: 38px; background: var(--paper); box-shadow: 0 20px 50px rgba(15,55,57,.22); }
.mobile-header { min-height: 66px; padding: 14px 16px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); z-index: 3; }
.mobile-header::before { content: ""; position: absolute; top: 7px; left: 50%; width: 76px; height: 5px; border-radius: 99px; background: #c8d5d6; transform: translateX(-50%); }
.mobile-brand { grid-column: 2; text-align: center; color: var(--brand-dark); text-decoration: none; font-weight: 850; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-weight: 800; }
.icon-button:hover { background: var(--brand-soft); }
.icon-button.hidden { visibility: hidden; }

.screen { display: none; flex: 1; min-height: 0; padding: 22px 20px 96px; overflow-y: auto; }
.screen.active { display: block; animation: screen-in .22s ease-out; }
@keyframes screen-in { from { opacity: .2; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.screen-heading { margin-bottom: 22px; }
.screen-heading.compact { margin-bottom: 20px; }
.screen-heading h1 { max-width: 350px; margin: 5px 0 9px; color: #11393c; font-family: Georgia, Cambria, serif; font-size: clamp(27px, 7vw, 34px); line-height: 1.08; letter-spacing: -.025em; }
.screen-heading p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.5; }
.eyebrow { margin: 0; color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }

.primary-action, .secondary-action { width: 100%; min-height: 52px; padding: 13px 16px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 14px; cursor: pointer; font-weight: 780; }
.primary-action { border: 1px solid var(--brand); color: white; background: var(--brand); box-shadow: 0 8px 20px rgba(11,107,104,.18); }
.primary-action:hover { background: var(--brand-dark); }
.primary-action.large { justify-content: flex-start; padding: 17px; text-align: left; }
.primary-action.large > span:nth-child(2) { flex: 1; display: grid; }
.primary-action small { margin-top: 3px; color: #d9efeb; font-weight: 500; }
.action-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.13); font-size: 23px; }
.secondary-action { margin-top: 8px; border: 1px solid var(--line); background: white; color: var(--brand-dark); }

.status-grid { margin: 16px 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { min-height: 118px; padding: 15px; display: grid; justify-items: start; align-content: start; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfa; cursor: pointer; text-align: left; }
.stat-card.warning { border-color: #ead8b7; background: #fffaf0; }
.stat-number { font-family: Georgia, serif; color: var(--brand-dark); font-size: 28px; font-weight: 800; }
.stat-card > span:nth-child(2) { margin-top: 3px; font-size: 13px; font-weight: 750; }
.stat-card small { margin-top: 5px; color: var(--muted); }

.section-title { display: flex; justify-content: space-between; align-items: baseline; }
.section-title h2 { margin: 0 0 10px; font-size: 15px; }
.text-button { padding: 0; border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 800; }
.report-row { padding: 13px 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
button.report-row { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.report-row > span:nth-child(2) { min-width: 0; display: grid; }
.report-row strong, .report-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-row strong { font-size: 13px; }
.report-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.report-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--warning-soft); color: var(--warning); }
.report-icon.complete { background: #e5f4ec; color: var(--success); }
.pill { padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.pill.review { background: var(--warning-soft); color: var(--warning); }
.pill.done { background: #e5f4ec; color: var(--success); }

.step-header { margin-bottom: 18px; }
.progress-track { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #dce8e6; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.form-stack { display: grid; gap: 15px; }
.form-stack label { display: grid; gap: 7px; color: #334e53; font-size: 13px; font-weight: 750; }
.optional { color: #819195; font-size: 11px; font-weight: 500; }
.form-stack input, .form-stack select, .form-stack textarea { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid #bfcfcd; border-radius: 11px; outline: none; color: var(--ink); background: white; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,107,104,.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-note { padding: 11px 12px; display: flex; gap: 9px; align-items: flex-start; border-radius: 11px; background: var(--brand-soft); color: var(--brand-dark); }
.inline-note p { margin: 0; font-size: 11px; line-height: 1.4; }

.bottom-nav { position: absolute; inset: auto 0 0; min-height: 70px; display: none; grid-template-columns: repeat(3,1fr); align-items: center; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); z-index: 4; }
.bottom-nav a { display: grid; justify-items: center; gap: 3px; color: #6d7f83; text-decoration: none; font-size: 20px; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav small { font-size: 10px; font-weight: 700; }

.empty-state { min-height: 480px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-icon { font-size: 48px; color: var(--brand); }
.empty-state h1 { margin: 10px 0; font-family: Georgia,serif; font-size: 28px; }
.empty-state p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: 26px; padding: 11px 15px; border-radius: 12px; color: white; background: #173238; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  body { background: white; }
  .prototype-note { padding-inline: 12px; }
  .app-shell { width: 100%; min-height: calc(100vh - 34px); margin: 0; display: block; border: 0; border-radius: 0; box-shadow: none; }
  .side-rail { display: none; }
  .phone-stage { padding: 0; display: block; }
  .phone-frame { width: 100%; height: calc(100vh - 34px); min-height: 540px; border: 0; border-radius: 0; box-shadow: none; }
  .mobile-header::before { display: none; }
  .bottom-nav { display: grid; }
}

@media (max-width: 390px) {
  .prototype-note span:last-child { display: none; }
  .status-grid, .field-row { grid-template-columns: 1fr; }
  .phone-frame { height: calc(100vh - 34px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
