:root {
  color-scheme: light;
  --navy-950: #0f172a;
  --navy-900: #112353;
  --navy-800: #112353;
  --navy-700: #112353;
  --blue-600: #112353;
  --blue-100: #e8ebf2;
  --blue-50: #f5f6f9;
  --teal-700: #087c68;
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --green-700: #15803d;
  --green-100: #dcfce7;
  --amber-700: #a16207;
  --amber-100: #fef3c7;
  --red-700: #b42318;
  --red-100: #fee4e2;
  --slate-950: #172033;
  --slate-800: #263248;
  --slate-700: #3f4b5f;
  --slate-600: #5d6879;
  --slate-500: #7b8595;
  --slate-300: #cfd6e1;
  --slate-200: #e2e7ef;
  --slate-100: #f0f3f7;
  --slate-50: #f7f9fc;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(7, 23, 47, 0.05), 0 1px 5px rgba(7, 23, 47, 0.04);
  --shadow-md: 0 12px 35px rgba(7, 23, 47, 0.11), 0 2px 8px rgba(7, 23, 47, 0.05);
  --shadow-lg: 0 24px 80px rgba(7, 23, 47, 0.2);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 1240px;
  font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--white); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--slate-950);
  background: var(--white);
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, label[for], a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--white);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 10px max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid rgba(207, 214, 225, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--navy-900);
  text-decoration: none;
}
.brand-mark { width: 42px; height: 42px; object-fit: contain; transition: transform 0.2s ease; }
.brand:hover .brand-mark { transform: scale(1.04); }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Outfit", sans-serif; font-size: 19px; letter-spacing: -0.025em; }
.brand small { color: var(--slate-500); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }

.site-header nav { display: flex; align-items: center; gap: 6px; }
.site-header nav a {
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.site-header nav a:hover, .site-header nav a.active { color: var(--navy-900); background: var(--blue-50); }
.local-badge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-600);
  font-size: 13px;
  font-weight: 650;
}
.local-badge span { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px var(--green-100); }

#app { width: min(var(--max-width), calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }

.page-loader { display: grid; min-height: 52vh; place-content: center; justify-items: center; color: var(--slate-600); }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--teal-700); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Outfit", sans-serif; color: var(--navy-900); }
h1 { margin-bottom: 8px; color: var(--navy-950); font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.035em; }
h2 { margin-bottom: 8px; color: var(--navy-950); font-size: 23px; line-height: 1.2; letter-spacing: -0.02em; }
h3 { margin-bottom: 5px; color: var(--navy-950); font-size: 17px; line-height: 1.25; }
.lede { max-width: 700px; margin-bottom: 0; color: var(--slate-600); font-size: 17px; }
.muted { color: var(--slate-600); }
.micro { color: var(--slate-500); font-size: 12px; }

.primary-button, .secondary-button, .tertiary-button, .danger-button, .camera-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.primary-button { color: white; background: var(--navy-900); box-shadow: 0 7px 18px rgba(17, 35, 83, 0.18); }
.primary-button:hover { transform: translateY(-1px); opacity: 0.92; box-shadow: 0 10px 24px rgba(17, 35, 83, 0.24); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.58; transform: none; box-shadow: none; }
.secondary-button { color: var(--navy-900); border-color: var(--slate-300); background: var(--white); box-shadow: var(--shadow-sm); }
.secondary-button:hover { border-color: #9eb1cc; background: var(--blue-50); }
.tertiary-button { min-height: 38px; padding: 8px 11px; color: var(--navy-700); background: transparent; }
.tertiary-button:hover { background: var(--blue-50); }
.danger-button { color: var(--red-700); border-color: #f2b8b5; background: #fff8f7; }
.full-width { width: 100%; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 10px; color: var(--slate-600); background: transparent; }
.icon-button:hover { color: var(--red-700); background: var(--red-100); }
.icon-button svg { width: 19px; fill: currentColor; }

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 400px;
  margin-bottom: 34px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius-lg);
  color: white;
  background:
    radial-gradient(circle at 88% 5%, rgba(255, 255, 255, 0.14), transparent 28rem),
    var(--navy-900);
  box-shadow: var(--shadow-md);
}
.hero-copy { z-index: 1; align-self: center; padding: clamp(34px, 6vw, 70px); }
.hero-copy .eyebrow { color: #cbd5e1; }
.hero-copy h1 { max-width: 640px; color: white; }
.hero-copy p { max-width: 600px; color: #cfdaec; font-size: 18px; }
.hero-copy .primary-button { margin-top: 15px; color: var(--navy-950); background: white; box-shadow: none; }
.hero-visual { position: relative; min-height: 340px; }
.evidence-fan { position: absolute; inset: 40px 45px 40px 0; }
.evidence-card {
  position: absolute;
  display: grid;
  width: 220px;
  height: 270px;
  place-content: center;
  justify-items: center;
  gap: 14px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 24px;
  color: var(--navy-900);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 28px 50px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}
.evidence-card svg { width: 64px; fill: var(--blue-600); }
.evidence-card strong { font-size: 15px; }
.evidence-card:nth-child(1) { top: 24px; right: 120px; transform: rotate(-8deg); }
.evidence-card:nth-child(2) { top: 65px; right: 10px; transform: rotate(9deg); }
.evidence-card:nth-child(3) { top: 10px; right: 55px; width: 180px; height: 225px; transform: translateY(70px); background: #e7fff9; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 28px 0 16px; }
.section-heading h2 { margin-bottom: 0; }
.count-pill, .status-pill, .confidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.count-pill { color: var(--slate-600); background: var(--slate-100); }
.status-pill { color: var(--blue-600); background: var(--blue-100); }
.status-pill.collecting { color: var(--amber-700); background: var(--amber-100); }
.status-pill.review { color: var(--teal-700); background: var(--teal-100); }
.confidence-pill.high { color: var(--green-700); background: var(--green-100); }
.confidence-pill.medium { color: var(--amber-700); background: var(--amber-100); }
.confidence-pill.low { color: var(--red-700); background: var(--red-100); }

.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.record-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.record-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.record-card-image { display: grid; height: 190px; place-content: center; overflow: hidden; color: var(--slate-500); background: linear-gradient(140deg, #e9effa, #f5f8fc); }
.record-card-image img { width: 100%; height: 100%; object-fit: cover; }
.record-card-image svg { width: 54px; fill: #9cabc0; }
.record-card-body { padding: 18px; }
.record-card-body h3 { overflow: hidden; margin-bottom: 4px; text-overflow: ellipsis; white-space: nowrap; }
.record-card-body p { min-height: 24px; margin-bottom: 12px; color: var(--slate-600); font-size: 14px; }
.record-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--slate-500); font-size: 12px; }
.draft-card { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.draft-thumb { display: grid; flex: 0 0 68px; height: 68px; place-content: center; overflow: hidden; border-radius: 13px; color: var(--slate-500); background: var(--slate-100); }
.draft-thumb img { width: 100%; height: 100%; object-fit: cover; }
.draft-main { min-width: 0; flex: 1; }
.draft-main h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-main p { margin-bottom: 0; color: var(--slate-600); font-size: 13px; }
.draft-list { display: grid; gap: 11px; }
.empty-state { display: grid; min-height: 220px; place-content: center; justify-items: center; padding: 30px; border: 1px dashed var(--slate-300); border-radius: var(--radius); text-align: center; background: rgba(255,255,255,0.55); }
.empty-state svg { width: 48px; margin-bottom: 14px; fill: #9cabc0; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 420px; margin-bottom: 0; color: var(--slate-600); }

.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; }
.step { display: flex; flex: 1; align-items: center; gap: 10px; color: var(--slate-500); font-size: 12px; font-weight: 750; }
.step::after { content: ""; flex: 1; height: 2px; background: var(--slate-200); }
.step:last-child { flex: 0 auto; }
.step:last-child::after { display: none; }
.step-number { display: grid; width: 28px; height: 28px; place-items: center; border: 2px solid var(--slate-300); border-radius: 50%; background: white; }
.step.active { color: var(--navy-900); }
.step.active .step-number, .step.complete .step-number { color: white; border-color: var(--blue-600); background: var(--blue-600); }
.step.complete::after { background: var(--blue-600); }

.intake-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 24px; }
.panel { border: 1px solid var(--slate-200); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.panel-header { padding: 21px 22px 16px; border-bottom: 1px solid var(--slate-200); }
.panel-header h2, .panel-header h3 { margin-bottom: 4px; }
.panel-header p { margin-bottom: 0; color: var(--slate-600); font-size: 14px; }
.panel-body { padding: 22px; }
.sticky-panel { position: sticky; top: 100px; }

.dropzone {
  position: relative;
  display: grid;
  min-height: 225px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  border: 2px dashed #b9c7da;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(145deg, var(--blue-50), white);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragging { border-color: var(--blue-600); background: #e5efff; }
.dropzone-icon { display: grid; width: 58px; height: 58px; margin-bottom: 13px; place-items: center; border-radius: 18px; color: var(--blue-600); background: white; box-shadow: var(--shadow-sm); }
.dropzone-icon svg { width: 30px; fill: currentColor; }
.dropzone h3 { margin-bottom: 5px; }
.dropzone p { margin-bottom: 14px; color: var(--slate-600); font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.divider-label { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--slate-500); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--slate-200); }
.intake-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option-card { display: flex; min-height: 112px; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--slate-200); border-radius: 14px; background: white; text-align: left; }
.option-card:hover { border-color: #9eb5d8; background: var(--blue-50); }
.option-icon { display: grid; flex: 0 0 44px; height: 44px; place-items: center; border-radius: 13px; color: var(--navy-700); background: var(--blue-100); }
.option-icon svg { width: 23px; fill: currentColor; }
.option-card strong, .option-card small { display: block; }
.option-card small { margin-top: 3px; color: var(--slate-600); font-size: 12px; }

.form-group { margin-bottom: 17px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: var(--slate-800); font-size: 13px; font-weight: 750; }
.form-label small { color: var(--slate-500); font-weight: 500; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--slate-300);
  border-radius: 11px;
  color: var(--slate-950);
  outline: none;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input, .select { height: 45px; padding: 0 12px; }
.textarea { min-height: 98px; padding: 11px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.input-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.input-with-button { display: flex; gap: 8px; }
.input-with-button .input { min-width: 0; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: var(--slate-700); font-size: 13px; }
.check-row input { margin-top: 3px; accent-color: var(--blue-600); }
.check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 2px; color: var(--slate-500); font-size: 11px; }

.evidence-section { margin-top: 23px; }
.evidence-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.evidence-tile { position: relative; overflow: hidden; min-height: 130px; border: 1px solid var(--slate-200); border-radius: 13px; background: var(--slate-100); }
.evidence-tile img { width: 100%; height: 130px; object-fit: cover; }
.evidence-file { display: grid; min-height: 130px; place-content: center; justify-items: center; padding: 12px; color: var(--navy-700); text-align: center; text-decoration: none; }
.evidence-file:hover { background: var(--blue-50); }
.evidence-file svg { width: 38px; margin-bottom: 7px; fill: currentColor; }
.evidence-file span { max-width: 130px; overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.evidence-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 5px; }
.evidence-actions button { display: grid; width: 31px; height: 31px; place-items: center; border: 0; border-radius: 9px; color: var(--navy-900); background: rgba(255,255,255,0.94); box-shadow: var(--shadow-sm); }
.evidence-actions button:hover { color: var(--red-700); }
.primary-flag { position: absolute; left: 7px; bottom: 7px; padding: 4px 7px; border-radius: 7px; color: white; background: rgba(11,31,68,0.82); font-size: 10px; font-weight: 750; backdrop-filter: blur(6px); }

.privacy-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 17px; padding: 13px; border-radius: 12px; color: var(--slate-600); background: var(--slate-50); font-size: 12px; }
.privacy-note svg { flex: 0 0 18px; width: 18px; fill: var(--teal-700); }
.analysis-ready { padding: 18px; border: 1px solid #b7e5da; border-radius: 14px; background: #f1fffb; }
.analysis-ready h3 { margin-bottom: 5px; }
.analysis-ready p { margin-bottom: 13px; color: var(--slate-600); font-size: 13px; }
.provider-line { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 10px 11px; border-radius: 10px; color: var(--slate-700); background: white; font-size: 12px; }
.provider-line span { width: 8px; height: 8px; border-radius: 50%; background: var(--green-700); }
.saved-product-page { display: grid; gap: 10px; padding: 14px; border: 1px solid #b7e5da; border-radius: 14px; background: #f1fffb; }
.saved-product-page > .option-icon { margin-bottom: 1px; }
.saved-product-page h3 { margin-bottom: 3px; font-size: 15px; }
.saved-product-page p { margin-bottom: 0; color: var(--slate-600); font-size: 12px; }
.warning-box, .info-box, .error-box { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 12px; font-size: 13px; }
.warning-box { color: #704d08; background: var(--amber-100); }
.info-box { color: var(--navy-700); background: var(--blue-50); }
.error-box { color: var(--red-700); background: var(--red-100); }

.qr-panel { display: grid; grid-template-columns: 300px 1fr; align-items: center; gap: 27px; }
.qr-image { width: 100%; padding: 12px; border: 1px solid var(--slate-200); border-radius: 18px; background: white; box-shadow: var(--shadow-sm); }
.qr-copy ol { margin: 16px 0; padding-left: 20px; color: var(--slate-700); }
.qr-copy li { margin-bottom: 7px; }
.connection-banner { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 999px; color: var(--teal-700); background: var(--teal-100); font-size: 12px; font-weight: 750; }
.connection-banner span { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-600); }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5, 18, 39, 0.68); backdrop-filter: blur(7px); }
.modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px; background: white; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 24px 17px; border-bottom: 1px solid var(--slate-200); }
.modal-header h2 { margin-bottom: 3px; }
.modal-header p { margin-bottom: 0; color: var(--slate-600); font-size: 13px; }
.modal-body { padding: 24px; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 24px; }
.review-hero { display: grid; grid-template-columns: 180px 1fr; gap: 20px; margin-bottom: 22px; padding: 18px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: linear-gradient(145deg, white, var(--blue-50)); }
.review-photo { display: grid; height: 180px; place-content: center; overflow: hidden; border-radius: 14px; color: var(--slate-500); background: var(--slate-100); }
.review-photo img { width: 100%; height: 100%; object-fit: cover; }
.review-photo svg { width: 52px; fill: #9cabc0; }
.review-summary { align-self: center; }
.review-summary h2 { margin-bottom: 5px; font-size: 27px; }
.review-summary p { margin-bottom: 11px; color: var(--slate-600); }
.review-section { padding: 22px; border-bottom: 1px solid var(--slate-200); }
.review-section:last-child { border-bottom: 0; }
.review-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.review-section-title h3 { margin: 0; }
.attributes-list { display: grid; gap: 9px; }
.attribute-row { display: grid; grid-template-columns: 0.8fr 1.2fr 38px; gap: 8px; }
.uncertainty-list { margin: 0; padding-left: 20px; color: var(--slate-700); font-size: 13px; }
.uncertainty-list li { margin-bottom: 7px; }
.source-list { display: grid; gap: 9px; }
.source-item { padding: 11px; border-radius: 10px; background: var(--slate-50); }
.source-item strong { display: block; font-size: 12px; }
.source-item p { margin: 3px 0 0; color: var(--slate-600); font-size: 12px; }
.save-bar { position: sticky; z-index: 10; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 14px 16px; border: 1px solid rgba(207,214,225,0.86); border-radius: 15px; background: rgba(255,255,255,0.94); box-shadow: var(--shadow-md); backdrop-filter: blur(12px); }
.save-bar p { margin: 0; color: var(--slate-600); font-size: 12px; }

.save-success-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 14px 18px; border: 1px solid rgba(52,168,83,0.35); border-radius: var(--radius-lg); background: linear-gradient(120deg, rgba(52,168,83,0.10), rgba(52,168,83,0.04)); box-shadow: var(--shadow-sm); }
.save-success-banner .save-success-copy { display: flex; align-items: center; gap: 12px; }
.save-success-banner .save-success-copy svg { flex-shrink: 0; color: #2c7a44; }
.save-success-banner strong { display: block; color: #1f5c33; }
.save-success-banner p { margin: 2px 0 0; color: var(--slate-600); font-size: 13px; }
.save-success-banner button { white-space: nowrap; }
.detail-hero { display: grid; grid-template-columns: minmax(260px, 0.8fr) 1.2fr; overflow: hidden; margin-bottom: 24px; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-sm); }
.detail-photo { display: grid; min-height: 360px; place-content: center; overflow: hidden; color: var(--slate-500); background: var(--slate-100); }
.detail-photo img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }
.detail-copy { align-self: center; padding: clamp(28px, 5vw, 54px); }
.detail-copy h1 { font-size: clamp(30px, 4vw, 44px); }
.detail-copy .button-row { margin-top: 22px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 20px 0; }
.fact { padding: 14px; border-radius: 12px; background: var(--slate-50); }
.fact small, .fact strong { display: block; }
.fact small { margin-bottom: 3px; color: var(--slate-500); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; }
.fact strong { overflow-wrap: anywhere; font-size: 14px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 24px; }
.provider-settings { display: grid; gap: 18px; }
.provider-card { border: 1px solid var(--slate-200); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.provider-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--slate-200); }
.provider-name { display: flex; align-items: center; gap: 12px; }
.provider-logo { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: white; background: var(--navy-900); font-size: 13px; font-weight: 900; }
.provider-logo.anthropic { color: #4a3628; background: #f0e2d2; }
.provider-name strong, .provider-name small { display: block; }
.provider-name small { color: var(--slate-500); font-size: 11px; }
.provider-card-body { padding: 20px; }
.key-status { display: inline-flex; align-items: center; gap: 6px; color: var(--slate-600); font-size: 12px; }
.key-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-300); }
.key-status.configured span { background: var(--green-700); }
.radio-cards { display: grid; gap: 9px; }
.radio-card { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--slate-200); border-radius: 11px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.radio-card input { accent-color: var(--blue-600); }
.radio-card strong, .radio-card small { display: block; }
.radio-card small { color: var(--slate-500); font-size: 11px; }

.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; width: min(390px, calc(100% - 40px)); gap: 9px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--slate-200); border-radius: 12px; color: var(--slate-800); background: white; box-shadow: var(--shadow-md); animation: toast-in 0.2s ease-out; }
.toast.success { border-color: #a7e0b8; }
.toast.error { border-color: #f0aaa5; }
.toast strong { display: block; font-size: 13px; }
.toast p { margin: 2px 0 0; color: var(--slate-600); font-size: 12px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.capture-body { min-height: 100dvh; color: var(--slate-950); background: #f3f7fb; }
.capture-shell { width: min(100%, 620px); min-height: 100dvh; margin: 0 auto; background: white; box-shadow: 0 0 70px rgba(7,23,47,0.12); }
.capture-header { display: grid; grid-template-columns: 43px 1fr auto; align-items: center; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 17px 14px; color: white; background: var(--navy-900); }
.capture-logo { display: grid; width: 40px; height: 40px; place-items: center; padding: 7px; border-radius: 12px; background: white; }
.capture-logo img { width: 100%; height: 100%; object-fit: contain; }
.capture-header strong, .capture-header small { display: block; }
.capture-header strong { font-size: 15px; }
.capture-header small { color: #b9c8de; font-size: 11px; }
.connection-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 750; }
.connection-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }
.connection-dot.connected::before { background: #2dd4bf; }
.capture-content { padding: 20px 17px max(25px, env(safe-area-inset-bottom)); }
.capture-guidance { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; background: var(--blue-50); }
.guidance-number { display: grid; flex: 0 0 29px; height: 29px; place-items: center; border-radius: 50%; color: white; background: var(--blue-600); font-size: 13px; font-weight: 800; }
.capture-guidance strong { display: block; font-size: 14px; }
.capture-guidance p { margin: 2px 0 0; color: var(--slate-600); font-size: 12px; }
.capture-actions { display: grid; gap: 10px; margin: 22px 0; }
.camera-button { min-height: 105px; flex-direction: column; color: white; border-radius: 16px; background: var(--navy-900); box-shadow: 0 13px 30px rgba(17,35,83,0.22); font-size: 17px; }
.camera-button svg { width: 37px; fill: currentColor; }
.capture-library { width: 100%; }
.mobile-received-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 23px 0 10px; }
.mobile-received-heading strong, .mobile-received-heading small { display: block; }
.mobile-received-heading strong { font-size: 14px; }
.mobile-received-heading small { color: var(--slate-500); font-size: 11px; }
#mobile-upload-status { color: var(--teal-700); font-size: 11px; font-weight: 750; }
.mobile-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; min-height: 102px; margin-bottom: 22px; }
.mobile-photo { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 12px; background: var(--slate-100); }
.mobile-photo img { width: 100%; height: 100%; object-fit: cover; }
.mobile-photo button { position: absolute; top: 5px; right: 5px; display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 50%; color: white; background: rgba(7,23,47,0.76); }
.capture-finished { display: grid; min-height: calc(100dvh - 70px); place-content: center; justify-items: center; padding: 38px 25px; text-align: center; }
.capture-finished h1 { margin: 16px 0 7px; font-size: 31px; }
.capture-finished p { max-width: 340px; margin: 0; color: var(--slate-600); }
.success-orb, .error-orb { display: grid; width: 70px; height: 70px; place-items: center; border-radius: 50%; font-size: 34px; font-weight: 800; }
.success-orb { color: var(--green-700); background: var(--green-100); }
.error-orb { color: var(--red-700); background: var(--red-100); }

@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { position: fixed; z-index: 20; right: 16px; bottom: 16px; left: 16px; justify-content: space-around; padding: 7px; border: 1px solid var(--slate-200); border-radius: 16px; background: rgba(255,255,255,0.96); box-shadow: var(--shadow-md); }
  .local-badge { display: none; }
  #app { padding-bottom: 110px; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .intake-layout, .review-layout, .settings-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { min-height: 65px; padding: 9px 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand small { display: none; }
  #app { width: min(100% - 26px, var(--max-width)); padding-top: 25px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .primary-button { width: 100%; }
  .hero-copy { padding: 34px 24px; }
  .hero-copy p { font-size: 16px; }
  .record-grid { grid-template-columns: 1fr; }
  .intake-options { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input-row, .review-hero, .detail-hero, .detail-grid { grid-template-columns: 1fr; }
  .review-photo { height: 230px; }
  .attribute-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--slate-200); }
  .qr-panel { grid-template-columns: 1fr; }
  .qr-image { max-width: 330px; margin: auto; }
  .save-bar { align-items: stretch; flex-direction: column; }
  .save-bar .button-row, .save-bar button { width: 100%; }
  .draft-card { align-items: flex-start; }
  .draft-card > .secondary-button { padding: 9px; font-size: 0; }
  .draft-card > .secondary-button::after { content: "Open"; font-size: 13px; }
}

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