:root {
  --bg: #07101d;
  --surface: #0d1726;
  --surface-2: #132238;
  --surface-3: #172a43;
  --text: #f6f8fb;
  --muted: #aab8ca;
  --line: rgba(255,255,255,.10);
  --accent: #58d3b0;
  --accent-2: #7ca8ff;
  --danger: #ff7d7d;
  --warning: #f6c66a;
  --shadow: 0 24px 80px rgba(0,0,0,.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(124,168,255,.14), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(88,211,176,.09), transparent 26rem),
    var(--bg);
  color: var(--text);
}
button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(124,168,255,.8);
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(7,16,29,.74);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #07101d;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(88,211,176,.16);
}
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: .98rem; letter-spacing: .01em; }
.brand-lockup span { color: var(--muted); font-size: .77rem; margin-top: 2px; }
.brand-lockup em { font-style: normal; opacity: .7; }
.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
}
.mode-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 8px 13px;
  color: var(--muted);
  cursor: pointer;
}
.mode-button.active { background: var(--surface-3); color: var(--text); }

main { flex: 1; }
.view { display: none; }
.view.active { display: block; }
.finder-wrap {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 42px 18px 54px;
}
.status-pill {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(88,211,176,.25);
  background: rgba(88,211,176,.08);
  color: #a7f5de;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.profile-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19,34,56,.92), rgba(13,23,38,.98));
  border-radius: 28px;
  padding: clamp(22px, 5vw, 34px);
  box-shadow: var(--shadow);
}
.profile-photo {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: linear-gradient(145deg, #263f62, #1b304d);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 2.2rem;
  font-weight: 800;
  color: #cfe1ff;
}
.eyebrow {
  margin: 0 0 7px;
  color: #9fc2ff;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
}
h1 { margin: 0; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.18rem; letter-spacing: -.02em; }
.lead { color: var(--muted); line-height: 1.55; margin: 12px 0 0; }
.guidance-card {
  margin: 24px 0 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(124,168,255,.08);
  border: 1px solid rgba(124,168,255,.16);
}
.guidance-card p { margin: 8px 0 0; color: #ced9e8; line-height: 1.5; }
.primary-action, .secondary-action {
  width: 100%;
  border: 0;
  cursor: pointer;
  border-radius: 18px;
}
.primary-action {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  padding: 17px 18px;
  background: linear-gradient(135deg, var(--accent), #83ead0);
  color: #071510;
  box-shadow: 0 16px 36px rgba(88,211,176,.18);
}
.primary-action:hover { filter: brightness(1.03); }
.primary-action:disabled { opacity: .65; cursor: wait; }
.primary-action strong, .primary-action small { display: block; }
.primary-action strong { font-size: .97rem; }
.primary-action small { margin-top: 3px; opacity: .72; font-size: .78rem; }
.action-icon { font-size: 1.5rem; }
.secondary-action {
  margin-top: 10px;
  padding: 13px 16px;
  background: transparent;
  color: #d7e2ef;
  border: 1px solid var(--line);
}
.secondary-action:hover { background: rgba(255,255,255,.035); }
.message { display: none; margin-top: 14px; padding: 14px 15px; border-radius: 14px; line-height: 1.45; font-size: .9rem; }
.message.visible { display: block; }
.message.success { background: rgba(88,211,176,.09); border: 1px solid rgba(88,211,176,.22); color: #c4f7e8; }
.message.warning { background: rgba(246,198,106,.08); border: 1px solid rgba(246,198,106,.22); color: #ffe0a5; }
.message.error { background: rgba(255,125,125,.08); border: 1px solid rgba(255,125,125,.22); color: #ffbcbc; }
.info-panel { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-panel summary { padding: 16px 0; cursor: pointer; font-weight: 700; }
.info-panel-body { padding: 0 0 14px; color: var(--muted); line-height: 1.5; }
.info-panel-body p { margin: 0 0 10px; }
.help-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.text-action {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: #e8eef7;
  cursor: pointer;
}
.privacy-note { color: #8091a7; font-size: .78rem; line-height: 1.45; text-align: center; padding: 0 14px; }

.dashboard-wrap { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 46px 0 60px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: start; gap: 22px; }
.dashboard-heading h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
.subject-state { padding: 8px 12px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.subject-state.safe { background: rgba(88,211,176,.1); color: #baf5e4; border: 1px solid rgba(88,211,176,.24); }
.subject-state.missing { background: rgba(255,125,125,.1); color: #ffc1c1; border: 1px solid rgba(255,125,125,.24); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 14px; }
.metric-card, .dashboard-card {
  border: 1px solid var(--line);
  background: rgba(13,23,38,.76);
  border-radius: 20px;
}
.metric-card { padding: 20px; min-height: 142px; }
.metric-card > span { color: var(--muted); font-size: .78rem; }
.metric-card > strong { display: block; margin: 10px 0 8px; font-size: 1.55rem; }
.metric-card small { color: #8293a9; }
.inline-button, .quiet-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.dashboard-card { margin-top: 14px; padding: 22px; }
.section-title-row, .tag-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.event-list { display: grid; gap: 10px; margin-top: 18px; }
.empty-state { color: #8091a7; padding: 28px 0 14px; line-height: 1.5; }
.event-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 14px 0; border-top: 1px solid var(--line); }
.event-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 5px rgba(124,168,255,.08); }
.event-item strong, .event-item span { display: block; }
.event-item span { color: var(--muted); margin-top: 3px; font-size: .82rem; }
.event-time { color: #8091a7; font-size: .76rem; white-space: nowrap; }
.tag-card { display: grid; gap: 4px; }
.tag-row { border-top: 1px solid var(--line); padding: 15px 0 5px; }
.tag-row div span { color: var(--muted); margin-top: 4px; display: block; font-size: .8rem; }
.footer { padding: 22px; color: #687b92; font-size: .73rem; text-align: center; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .brand-lockup em { display: none; }
  .dashboard-heading { display: grid; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: auto; }
}

@media (max-width: 480px) {
  .topbar { padding: 12px 14px; }
  .brand-lockup span { font-size: .69rem; }
  .mode-button { padding: 7px 10px; font-size: .78rem; }
  .finder-wrap { padding-top: 26px; }
  .profile-card { border-radius: 23px; }
  .help-row { grid-template-columns: 1fr; }
}

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