:root {
  --ink: #113a5c;
  --muted: #5f7184;
  --line: #d7e4ef;
  --paper: #f3f8fc;
  --panel: #ffffff;
  --accent: #0069a6;
  --accent-dark: #004d7d;
  --gold: #ffc425;
  --blue: #0077b6;
  --rose: #d3632f;
  --sky: #e7f4fb;
  --shadow: 0 18px 45px rgba(17, 58, 92, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(0, 105, 166, 0.18), rgba(255, 196, 37, 0.22)),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 14px;
}

.phone {
  width: min(390px, 100%);
  height: min(844px, calc(100vh - 36px));
  min-height: 690px;
  position: relative;
  overflow: hidden;
  border: 10px solid #082b49;
  border-radius: 38px;
  background: #fbfdff;
  box-shadow: var(--shadow);
}

.status-bar {
  height: 34px;
  padding: 9px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  background: #fbfdff;
}

.signal {
  font-size: 11px;
}

.screen {
  display: none;
  height: calc(100% - 34px);
  overflow-y: auto;
  padding: 18px 18px 92px;
}

.screen.active {
  display: block;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.topbar.compact {
  min-height: 42px;
}

.topbar h1,
.topbar h2,
.brief-title h2,
.profile-head h2,
.research-state h2,
.success-state h2 {
  margin: 0;
  line-height: 1.05;
}

.topbar h1 {
  font-size: 42px;
}

.topbar h2 {
  font-size: 19px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--panel);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.hero-panel {
  padding: 20px;
  border-radius: 8px;
  background: var(--sky);
  border: 1px solid #b8d9ec;
}

.hero-panel p {
  margin: 0 0 18px;
  max-width: 240px;
  font-size: 18px;
  line-height: 1.35;
}

.capture-button,
.primary,
.secondary {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
}

.capture-button,
.primary {
  color: white;
  background: linear-gradient(180deg, #0b7db8, var(--accent-dark));
}

.secondary {
  color: var(--ink);
  background: #f4f8fb;
  border: 1px solid var(--line);
}

.camera-dot {
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  display: inline-block;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 24px;
}

.quick-actions button,
.action-strip button,
.tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent-dark);
  font-weight: 750;
}

.mini-icon {
  display: block;
  margin: 0 auto 5px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.section-head,
.brief-title,
.lead-row,
.action-strip,
.tabs {
  display: flex;
  align-items: center;
}

.section-head {
  justify-content: space-between;
}

.section-head h2,
.source-list h3,
.brief-section h3,
.timeline h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
}

.lead-row {
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lead-row.raised {
  margin-top: 10px;
}

.lead-row div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.lead-row h3,
.lead-row p {
  margin: 0;
}

.lead-row h3 {
  font-size: 15px;
}

.lead-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lead-row strong {
  color: var(--accent);
  font-size: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.avatar.alt {
  background: var(--rose);
}

.avatar.green {
  background: #00a0df;
}

.avatar.large {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
}

.avatar.xlarge {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
}

.camera-view {
  position: relative;
  height: 420px;
  overflow: hidden;
  border-radius: 8px;
  background: #dcecf6;
}

.camera-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

.camera-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--accent-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(231, 244, 251, 0.9)),
    var(--sky);
}

.camera-placeholder strong {
  font-size: 20px;
}

.camera-placeholder small {
  color: var(--muted);
  font-size: 13px;
}

.large-dot {
  width: 44px;
  height: 44px;
  border-color: var(--accent);
}

.focus-box {
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: 118px;
  height: 95px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: white;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  font-weight: 900;
  padding: 10px;
}

.bottom-sheet,
.brief-card,
.source-list,
.brief-section,
.timeline,
.profile-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.bottom-sheet {
  margin-top: -34px;
  position: relative;
  padding: 18px;
}

.bottom-sheet h2,
.bottom-sheet p {
  margin: 0 0 10px;
}

.photo-picker {
  display: block;
  margin: 4px 0 10px;
}

.photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #405a70;
  font-size: 12px;
  font-weight: 800;
}

input,
textarea,
.search-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 13px 12px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.source-list {
  display: grid;
  gap: 11px;
  margin-top: 18px;
  padding: 16px;
}

.source-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.source-list input {
  width: auto;
}

.sticky-actions {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
}

.sticky-actions.two {
  grid-template-columns: 1fr 1.2fr;
}

#brief {
  padding-bottom: 18px;
}

#brief .sticky-actions {
  position: static;
  left: auto;
  right: auto;
  bottom: 0;
  margin-top: 12px;
  padding-top: 0;
  background: transparent;
}

.research-state,
.success-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 14px;
}

.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border: 5px solid #d9ebf5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-lines {
  display: grid;
  gap: 8px;
  width: 240px;
  max-width: 100%;
  margin: 0 auto;
}

.progress-lines span {
  height: 9px;
  border-radius: 999px;
  background: #d9ebf5;
}

.brief-card {
  padding: 14px;
  position: relative;
}

.brief-title {
  gap: 12px;
}

.brief-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  width: fit-content;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #694900;
  background: #fff0b7;
  font-size: 12px;
  font-weight: 900;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.info-grid div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.info-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.info-grid strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.brief-section {
  padding: 14px;
  margin-top: 10px;
}

.notice {
  background: #fff8dc;
  border-color: #f1d27a;
  margin-bottom: 14px;
}

.brief-section p {
  margin: 0;
  color: #284a66;
  font-size: 13px;
  line-height: 1.45;
}

.selected-photo-card {
  min-height: 156px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sky);
  margin-bottom: 12px;
}

.selected-photo-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

#confirm-placeholder {
  min-height: 156px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 16px;
  text-align: center;
  color: var(--accent-dark);
}

#confirm-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.checkmark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-size: 33px;
  font-weight: 900;
}

.search-field {
  color: var(--muted);
}

.tabs {
  gap: 8px;
  margin: 12px 0;
}

.tabs button {
  flex: 1;
}

.tabs .active {
  color: #082b49;
  background: var(--gold);
  border-color: #f1b400;
}

.profile-head {
  padding: 22px 16px;
  text-align: center;
}

.profile-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.profile-head .status-pill {
  margin: 13px auto 0;
}

.action-strip {
  gap: 8px;
  margin: 12px 0;
}

.action-strip button {
  flex: 1;
  font-size: 13px;
}

.timeline {
  padding: 16px;
}

.timeline-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.timeline-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-height: 760px) {
  .phone {
    height: calc(100vh - 20px);
    min-height: 620px;
  }

  .camera-view {
    height: 350px;
  }
}
