@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #07080b;
  --bg-elevated: #0c0e13;
  --surface: #11141a;
  --surface-alt: #171b22;
  --surface-hover: #1c2129;
  --surface-strong: #222832;
  --overlay: rgba(2, 3, 5, 0.78);
  --camera-bg: #030405;
  --border: #282e38;
  --border-hover: #3b4451;
  --border-strong: #5a6574;
  --border-luminous: rgba(224, 195, 132, 0.34);
  --text: #f7f5ef;
  --text-secondary: #b3b6bc;
  --text-tertiary: #7d838d;
  --text-inverse: #111318;
  --accent: #e0c384;
  --accent-hover: #efd7a4;
  --accent-active: #c8a965;
  --accent-soft: rgba(224, 195, 132, 0.1);
  --accent-glow: rgba(224, 195, 132, 0.2);
  --bg-rgb: 7, 8, 11;
  --surface-rgb: 17, 20, 26;
  --text-rgb: 247, 245, 239;
  --accent-rgb: 224, 195, 132;
  --success: #66d49a;
  --success-soft: rgba(102, 212, 154, 0.1);
  --error: #ff7b78;
  --error-soft: rgba(255, 123, 120, 0.1);
  --warning: #f1bd64;
  --warning-soft: rgba(241, 189, 100, 0.1);
  --info: #82b8ff;
  --info-soft: rgba(130, 184, 255, 0.1);
  --focus: #9dc4ff;
  --focus-ring: rgba(157, 196, 255, 0.24);
  --camera-message-bg: rgba(3, 4, 5, 0.76);
  --flash: rgba(247, 245, 239, 0.82);
  --font-heading: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 8%, rgba(var(--accent-rgb), 0.065), transparent 28rem),
    radial-gradient(circle at 14% 40%, rgba(var(--text-rgb), 0.025), transparent 24rem),
    var(--bg);
  color: var(--text);
  font: 400 0.9rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: calc(0.75rem + var(--safe-top));
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--text-inverse);
  font-weight: 700;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--border);
  background: rgba(var(--bg-rgb), 0.9);
  backdrop-filter: blur(16px);
}

.topbar__inner {
  width: min(100% - 2rem, 1040px);
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover .brand__copy strong,
.brand:focus-visible .brand__copy strong {
  color: var(--accent-hover);
}

.brand:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 8px;
}

.brand__mark {
  width: 42px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-luminous);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand__copy {
  display: grid;
  gap: 0.14rem;
  line-height: 1;
}

.brand__copy strong {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  transition: color 160ms ease;
}

.brand__copy small {
  color: var(--text-tertiary);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.event-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.event-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.page-shell {
  width: min(100% - 2rem, 760px);
  min-height: calc(100vh - 150px);
  margin-inline: auto;
  padding: 2.6rem 0 4.5rem;
}

.hero {
  max-width: 690px;
  margin-bottom: 2rem;
}

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.1em;
}

.hero h1 {
  max-width: 680px;
  margin-bottom: 0.9rem;
  font: 700 clamp(1.7rem, 7vw, 2.6rem) / 1.08 var(--font-heading);
  letter-spacing: -0.035em;
}

.hero__copy {
  max-width: 610px;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: clamp(0.92rem, 2.5vw, 1rem);
}

.hero__signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.2rem;
  color: var(--text-tertiary);
  font-size: 0.73rem;
  font-weight: 600;
}

.hero__signals span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__signals .icon {
  color: var(--accent);
}

.search-workspace {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(var(--surface-rgb), 0.82);
  box-shadow: inset 0 1px 0 rgba(var(--text-rgb), 0.04), 0 26px 70px rgba(var(--bg-rgb), 0.5);
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.25rem 1rem;
}

.workspace-heading .eyebrow {
  margin-bottom: 0.3rem;
}

.workspace-heading h2 {
  margin: 0;
  font: 700 1.08rem/1.25 var(--font-heading);
  letter-spacing: -0.02em;
}

.workspace-heading__edition {
  padding-bottom: 0.18rem;
  color: var(--text-tertiary);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
}

.tab {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tab:hover {
  background: var(--surface);
  color: var(--text);
}

.tab:active {
  background: var(--surface-strong);
}

.tab:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.tab:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tab[aria-selected="true"] {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--accent);
}

.tab-panel {
  padding-top: 1rem;
}

.button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--accent);
  color: var(--text-inverse);
  font: 700 0.9rem/1 var(--font-body);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 10px 30px var(--accent-glow);
  transform: translateY(-1px);
}

.button:active {
  border-color: var(--accent-active);
  background: var(--accent-active);
  box-shadow: none;
  transform: scale(0.98);
}

.button:focus-visible,
.icon-button:focus-visible,
.shutter:focus-visible,
.camera-action:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.button:disabled,
.icon-button:disabled,
.shutter:disabled,
.camera-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button[data-loading="true"]:disabled {
  opacity: 0.72;
}

.button__spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(var(--bg-rgb), 0.24);
  border-top-color: var(--text-inverse);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button--secondary {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--text);
}

.button--secondary:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: none;
}

.button--secondary:active {
  background: var(--surface-strong);
}

.capture {
  min-height: 370px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(var(--text-rgb), 0.04);
  transition: border-color 160ms ease, background 160ms ease;
}

.capture:hover {
  border-color: var(--border-hover);
}

.capture:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.capture[data-dragging="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.capture[data-state="ready"] {
  border-color: var(--border-luminous);
}

.capture[data-state="error"] {
  border-color: var(--error);
  background: var(--error-soft);
}

.capture__empty {
  width: 100%;
  min-height: 368px;
  padding: 2rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.capture__icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--border-luminous);
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.65rem;
}

.capture__kicker {
  margin-bottom: 0.45rem;
  color: var(--accent) !important;
  font-size: 0.63rem !important;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.capture h3 {
  margin-bottom: 0.4rem;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.capture p {
  max-width: 440px;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.capture__copy {
  margin-bottom: 0;
}

.capture__actions {
  width: min(100%, 500px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.storage-promise {
  width: min(100%, 500px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.45;
  text-align: left;
}

.storage-promise .icon {
  margin-top: 0.1rem;
  color: var(--success);
}

.capture__preview {
  width: 100%;
  min-height: 370px;
  display: grid;
  background: var(--camera-bg);
}

.preview-frame {
  position: relative;
  min-height: 310px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(var(--bg-rgb), 0.72));
  pointer-events: none;
}

.capture__preview img {
  width: 100%;
  height: min(48vh, 430px);
  min-height: 310px;
  object-fit: contain;
  background: var(--camera-bg);
}

.preview-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 1;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.62rem;
  border: 1px solid var(--border-luminous);
  border-radius: 999px;
  background: var(--camera-message-bg);
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.capture__preview-copy {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1rem 0;
  background: var(--surface);
}

.capture__preview-copy strong {
  font-size: 0.86rem;
}

.capture__preview-copy span {
  color: var(--text-tertiary);
  font-size: 0.72rem;
}

.capture__preview-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) 1.28fr;
  gap: 0.7rem;
  padding: 1rem;
  background: var(--surface);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
  padding-inline: 0.25rem;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.5;
}

.privacy-note .icon {
  margin-top: 0.15rem;
  color: var(--success);
}

.name-form {
  padding: 1rem 0.2rem 0.2rem;
}

.name-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.search-field {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-input {
  width: 100%;
  min-height: 54px;
  padding: 0.8rem 3rem 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.95rem;
  appearance: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:hover {
  border-color: var(--border-hover);
}

.search-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: 0;
}

.search-input:active {
  background: var(--surface-strong);
}

.search-input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.search-input[aria-invalid="true"] {
  border-color: var(--error);
}

.search-field__icon {
  position: absolute;
  top: 50%;
  right: 1rem;
  color: var(--text-tertiary);
  pointer-events: none;
  transform: translateY(-50%);
}

.name-form .button {
  width: 100%;
}

.input-help {
  margin: 0.8rem 0 0;
  padding-inline: 0.25rem;
  color: var(--text-tertiary);
  font-size: 0.73rem;
}

.status {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.status > .icon {
  font-size: 1rem;
}

.status[data-state="loading"]::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.status[data-state="error"] {
  border-color: var(--error);
  background: var(--error-soft);
  color: var(--error);
}

.status[data-state="success"] {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.results {
  margin-top: 2.25rem;
  scroll-margin-top: 90px;
  animation: app-enter 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.section-heading .eyebrow {
  margin-bottom: 0.3rem;
}

.section-heading h2 {
  margin: 0;
  font: 700 1.35rem/1.18 var(--font-heading);
  letter-spacing: -0.03em;
}

.result-count {
  padding-bottom: 0.15rem;
  color: var(--text-tertiary);
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
}

.summary-item,
.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
}

.summary-item--success,
.badge--success {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.summary-item--warning {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.summary-item--info {
  border-color: var(--info);
  background: var(--info-soft);
  color: var(--info);
}

.badge--accent {
  border-color: var(--border-luminous);
  background: var(--accent-soft);
  color: var(--accent);
}

.results-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.result-card {
  width: 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--surface-alt), var(--surface));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  animation: app-enter 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.result-card:nth-child(2) {
  animation-delay: 45ms;
}

.result-card:nth-child(3) {
  animation-delay: 90ms;
}

.result-card:nth-child(4) {
  animation-delay: 135ms;
}

.result-card:hover {
  border-color: var(--border-luminous);
  box-shadow: 0 18px 44px rgba(var(--bg-rgb), 0.52);
  transform: translateY(-1px);
}

.result-card:active {
  transform: scale(0.995);
}

.result-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.result-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.result-card__media {
  position: relative;
  width: 92px;
  height: 108px;
}

.result-card__photo,
.result-card__placeholder {
  width: 92px;
  height: 108px;
  border: 1px solid var(--border);
  border-radius: 13px;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-strong);
}

.result-card__placeholder {
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-size: 1.5rem;
  font-weight: 700;
}

.result-card__number {
  position: absolute;
  right: -0.35rem;
  bottom: -0.35rem;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 0.7rem;
  font-weight: 800;
}

.result-card__body {
  min-width: 0;
  align-self: center;
}

.result-card__identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.3rem;
}

.result-card__person {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.result-card__confidence {
  color: var(--success);
  font-size: 0.66rem;
  font-weight: 700;
}

.result-card h3 {
  margin-bottom: 0.26rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.result-card__role {
  display: -webkit-box;
  margin-bottom: 0.62rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.result-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.empty-results {
  padding: 2.5rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  text-align: center;
}

.empty-results__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--text-tertiary);
  font-size: 1.25rem;
}

.empty-results h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.empty-results p {
  max-width: 440px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer {
  padding: 1.5rem 1rem calc(1.5rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  text-align: center;
}

.footer__rule {
  width: 34px;
  height: 1px;
  display: block;
  margin: 0 auto 0.8rem;
  background: var(--accent);
}

.footer p {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.dialog {
  width: min(calc(100% - 1.5rem), 700px);
  max-height: min(92vh, 900px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(var(--bg-rgb), 0.72);
  overflow: hidden;
}

.dialog::backdrop {
  background: var(--overlay);
}

.dialog__bar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.dialog__bar h2 {
  margin: 0.15rem 0 0;
  font-size: 0.94rem;
  line-height: 1.2;
}

.dialog__label {
  color: var(--accent);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.icon-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  color: var(--text);
}

.icon-button:active {
  background: var(--surface-strong);
  transform: scale(0.97);
}

.detail-dialog {
  overflow-y: auto;
}

.detail-content {
  padding: 1rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.detail-hero__media {
  width: 118px;
  height: 142px;
}

.detail-hero__photo,
.detail-hero__placeholder {
  width: 118px;
  height: 142px;
  border: 1px solid var(--border-luminous);
  border-radius: 16px;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-alt);
}

.detail-hero__placeholder {
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-size: 2rem;
  font-weight: 700;
}

.detail-hero .eyebrow {
  margin-bottom: 0.42rem;
}

.detail-name {
  margin-bottom: 0.45rem;
  font: 700 clamp(1.45rem, 6vw, 2.1rem) / 1.08 var(--font-heading);
  letter-spacing: -0.03em;
}

.detail-role {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.detail-section {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section > h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.detail-section > p {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.detail-section__intro {
  margin-bottom: 1rem !important;
}

.content-record {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 4px 14px 14px 4px;
  background: var(--bg-elevated);
}

.content-record__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.content-record dl {
  margin: 0;
}

.content-field + .content-field {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.content-field dt {
  margin-bottom: 0.3rem;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-field dd {
  max-width: 68ch;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.62;
}

.content-field--question {
  padding: 1rem;
  border: 1px solid var(--border-luminous) !important;
  border-radius: 12px;
  background: var(--accent-soft);
}

.content-field--question dd {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.link-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.dialog__bar--camera {
  position: relative;
  border-color: var(--border);
  background: var(--camera-bg);
}

.camera-dialog {
  background: var(--camera-bg);
}

.camera-stage {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--camera-bg);
}

.camera-stage video {
  width: 100%;
  height: min(68vh, 650px);
  min-height: 460px;
  object-fit: cover;
}

.camera-stage video[data-facing="user"] {
  transform: scaleX(-1);
}

.camera-message {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--camera-message-bg);
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--flash);
  opacity: 0;
  pointer-events: none;
}

.camera-flash--active {
  animation: camera-flash 140ms ease-out both;
}

.camera-controls {
  min-height: 112px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  justify-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem calc(1rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--camera-bg);
}

.camera-action {
  width: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 0.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
}

.camera-action span {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.camera-action:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  color: var(--text);
}

.camera-action:active {
  transform: scale(0.97);
}

.shutter {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.shutter > span {
  width: 62px;
  height: 62px;
  display: block;
  border-radius: 50%;
  background: var(--text);
  transition: background 120ms ease, transform 120ms ease;
}

.shutter:hover > span {
  background: var(--accent-hover);
  transform: scale(0.94);
}

.shutter:active > span {
  background: var(--accent-active);
  transform: scale(0.86);
}

.camera-controls__spacer {
  width: 58px;
}

.app-enter {
  animation: app-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.search-workspace.app-enter {
  animation-delay: 70ms;
}

@keyframes app-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes camera-flash {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 599px) {
  .page-shell {
    width: min(100% - 2rem, 760px);
  }

  .dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .detail-dialog {
    max-height: 92vh;
  }

  .camera-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100svh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
  }

  .camera-dialog[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .dialog__bar--camera {
    min-height: calc(70px + var(--safe-top));
    padding-top: calc(0.85rem + var(--safe-top));
  }

  .camera-stage {
    min-height: 0;
    height: auto;
  }

  .camera-stage video {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .camera-controls {
    min-height: calc(112px + var(--safe-bottom));
    padding-bottom: calc(1rem + var(--safe-bottom));
  }
}

@media (max-width: 599px) and (max-height: 700px) {
  .dialog__bar--camera {
    min-height: calc(64px + var(--safe-top));
    padding-top: calc(0.55rem + var(--safe-top));
    padding-bottom: 0.55rem;
  }

  .camera-message {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.68rem;
  }

  .camera-controls {
    min-height: calc(96px + var(--safe-bottom));
    padding-top: 0.5rem;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
  }

  .shutter {
    width: 72px;
    height: 72px;
  }

  .shutter > span {
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 389px) {
  .topbar__inner,
  .page-shell {
    width: calc(100% - 1.75rem);
  }

  .brand__copy small {
    display: none;
  }

  .page-shell {
    padding-top: 2rem;
  }

  .search-workspace {
    padding: 0.75rem;
    border-radius: 20px;
  }

  .capture__preview-actions {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 0.8rem;
  }

  .result-card__media,
  .result-card__photo,
  .result-card__placeholder {
    width: 80px;
  }

  .result-card__footer .badge {
    display: none;
  }

  .detail-hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .detail-hero__media,
  .detail-hero__photo,
  .detail-hero__placeholder {
    width: 96px;
    height: 122px;
  }
}

@media (min-width: 600px) {
  .search-workspace {
    padding: 1.25rem;
  }

  .capture__actions {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .detail-content {
    padding: 1.25rem;
  }
}

@media (min-width: 900px) {
  .page-shell {
    padding: 3.2rem 0 5rem;
  }
}

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