:root {
  --bg: #111315;
  --bg-elevated: #171a1d;
  --bg-panel: #1c2024;
  --bg-panel-2: #23282d;
  --bg-soft: rgba(255, 255, 255, 0.028);
  --bg-soft-strong: rgba(255, 255, 255, 0.05);
  --line: rgba(237, 242, 247, 0.1);
  --line-strong: rgba(237, 242, 247, 0.18);
  --text: #edf1f5;
  --muted: #9aa5b1;
  --muted-strong: #c7d0d9;
  --accent: #b98f4f;
  --accent-soft: rgba(185, 143, 79, 0.12);
  --accent-strong: rgba(185, 143, 79, 0.26);
  --good: #8bcf96;
  --mid: #d4b56f;
  --low: #c87878;
  --danger: #cf6f6f;
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --header-mobile: 64px;
  --header-desktop: 76px;
}

@font-face {
  font-family: "Sentinel UI";
  font-style: normal;
  font-display: block;
  font-weight: 100 700;
  src: url("/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations");
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Sentinel UI", sans-serif;
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 84%);
  opacity: 0.18;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

#appShell {
  display: block;
}

.appShell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-mobile);
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar__brand,
.topbar__actions,
.userBadge,
.guestBadge {
  display: flex;
  align-items: center;
}

.topbar__brand {
  gap: 12px;
  min-width: 0;
}

.brand__logoWrap {
  position: relative;
  flex: 0 0 auto;
}

.brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  object-fit: contain;
  padding: 4px;
}

.brand__copy {
  min-width: 0;
}

.brand__nameRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand__descriptor,
.topbar__mission,
.topbar__version,
.userBadge span,
.workspaceLead__label,
.leadStat__label,
.card__kicker,
.intakeSection__title,
.resultTop__label,
.feedbackCard__title,
.confidenceBreakdown__title,
.tile__title,
.log__title,
.referenceSection__title,
.emptyState__kicker,
.authCard__status {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}

.brand__descriptor {
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.topbar__version {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
}

.topbar__version--logo {
  position: absolute;
  right: -10px;
  bottom: -8px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.64rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.topbar__actions {
  margin-left: auto;
  gap: 14px;
  min-width: 0;
}

.topbar__mission {
  display: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 420px;
}

.userBadge {
  gap: 8px;
}

.guestBadge {
  gap: 8px;
  flex-wrap: wrap;
}

.guestBadge span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--muted-strong);
  font-size: 0.8rem;
}

.userBadge span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 220px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workstation {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 16px 14px 110px;
  flex: 1;
}

.workspaceLead {
  display: grid;
  gap: 16px;
  padding: 14px 0 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.workspaceLead__title {
  margin: 0;
  max-width: 720px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.workspaceLead__stats {
  display: grid;
  gap: 12px;
}

.leadStat {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.leadStat__label {
  display: block;
  margin-bottom: 6px;
}

.leadStat__value {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted-strong);
}

.appTabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.appTabs::-webkit-scrollbar {
  display: none;
}

.appTabBtn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.appTabBtn:hover {
  background: var(--bg-panel);
  border-color: var(--line-strong);
  color: var(--text);
}

.appTabBtn--active {
  background: var(--bg-panel);
  border-color: var(--line-strong);
  color: var(--text);
}

.appTabPanel {
  display: none;
}

.appTabPanel--active {
  display: block;
}

.shell,
.referenceShell,
.historyShell {
  width: 100%;
}

.shell {
  display: grid;
  gap: 14px;
}

.shell--identify {
  max-width: 1280px;
}

.shell--results {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card,
.emptyState,
.authCard,
.drawer {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  box-shadow: none;
}

.card,
.emptyState,
.authCard {
  border-radius: var(--radius-lg);
}

.card {
  overflow: hidden;
}

.card__header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.card__header--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card__title {
  margin: 4px 0 0;
  font-size: 1.08rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.card__title--large {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.card__hint,
.emptyState__text,
.referenceSummary,
.sceneSummary,
.safety,
.feedbackPrompt,
.feedbackStatus,
.referenceState,
.authSub,
.loadingText,
.preview__emptyText {
  color: var(--muted);
}

.card__hint,
.emptyState__text,
.referenceSummary,
.sceneSummary,
.safety,
.referenceState,
.authSub {
  margin: 8px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.card__headerActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emptyState {
  padding: 28px 22px;
}

.emptyState__title {
  margin: 8px 0 0;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

.btn,
.authBtn,
.referenceCopyBtn {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover,
.authBtn:hover,
.referenceCopyBtn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn:active,
.authBtn:active {
  background: rgba(255, 255, 255, 0.07);
}

.btn[disabled],
.authBtn[disabled] {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn--primary,
.authBtn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #111315;
}

.btn--primary:hover,
.authBtn--primary:hover {
  background: #c49a58;
  border-color: #c49a58;
}

.btn--ghost {
  background: transparent;
}

.btn--compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.authBtn--quiet {
  background: transparent;
}

.btn--wide,
.btn--block {
  width: 100%;
}

.appTabBtn:focus-visible,
.btn:focus-visible,
.authBtn:focus-visible,
.authInput:focus-visible,
.historyFilter:focus-visible,
.feedbackInput:focus-visible,
.referenceToggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 192, 122, 0.18);
}

.card--input {
  overflow: visible;
}

.uploader {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 18px 0;
}

.intakeLayout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.intakeLayout__rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intakeSection {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-panel-2);
}

.intakeSection--notes {
  background: var(--bg-panel-2);
}

.intakeSection--metadata {
  padding-bottom: 12px;
}

.intakeChecklist {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.intakeChecklist li {
  position: relative;
  padding-left: 18px;
  color: var(--muted-strong);
  font-size: 0.88rem;
  line-height: 1.45;
}

.intakeChecklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--accent);
}

.drop {
  display: block;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: border-color 140ms ease, background 140ms ease;
}

.drop:hover {
  border-color: rgba(217, 192, 122, 0.34);
}

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

.drop__body {
  position: relative;
}

.drop__prompt {
  position: absolute;
  inset: auto 16px 16px 16px;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.drop__promptInner {
  max-width: min(540px, calc(100% - 20px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(17, 19, 21, 0.94);
}

.drop__title {
  font-size: 0.98rem;
  font-weight: 650;
}

.drop__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.preview {
  padding: 0;
}

.osint-feed__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.osint-feed__state,
.osint-feed__meta {
  font-size: 0.76rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--muted-strong);
}

.osint-feed__meta {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.previewWrap,
.osint-feed__frame {
  position: relative;
  min-height: 360px;
  background: #14181c;
  overflow: hidden;
}

.previewWrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.14));
}

.previewImg {
  width: 100%;
  min-height: 360px;
  max-height: 640px;
  object-fit: contain;
  display: none;
}

.preview__empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 24px;
  text-align: center;
}

.preview__emptyTitle {
  font-size: 1.05rem;
  font-weight: 700;
}

.preview__emptyText {
  margin-top: 6px;
  max-width: 320px;
  font-size: 0.88rem;
  line-height: 1.5;
}

#previewWrap:has(#previewImg[style*="display: block"]) + .drop__prompt,
.drop:has(#previewImg[style*="display: block"]) .drop__prompt,
.drop:has(#previewEmpty[style*="display: none"]) .drop__prompt {
  display: none;
}

.osint-feed__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.25;
}

.overlay,
.evidenceOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.overlay {
  display: none;
  cursor: crosshair;
}

.evidenceOverlay {
  display: none;
  pointer-events: none;
}

.analysisMedia {
  position: relative;
  display: none;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.analysisMedia[hidden] {
  display: none !important;
}

.analysisMedia:not([hidden]) {
  display: block;
}

.analysisMedia__image {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

.analysisMedia__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hoverHint,
.evidenceTooltip {
  position: absolute;
  display: none;
  z-index: 4;
}

.hoverHint {
  left: 14px;
  right: 14px;
  bottom: 14px;
  width: fit-content;
  max-width: calc(100% - 28px);
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 19, 21, 0.96);
  color: var(--text);
  line-height: 32px;
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidenceTooltip {
  min-width: 190px;
  max-width: 280px;
  padding: 12px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius-md);
  background: rgba(17, 19, 21, 0.98);
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}

.evidenceTooltip--public {
  pointer-events: none;
}

.evidenceTooltip__title {
  margin-bottom: 4px;
  font-weight: 700;
}

.evidenceTooltip__meta {
  margin-top: 6px;
  color: var(--muted);
}

.uploader__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metaStrip,
.metaRow,
.badgeRow,
.feedbackRow,
.feedbackRadio,
.referenceAliasChips,
.modelReferenceCard__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metaPill,
.badge,
.chip,
.referenceChip,
.logTag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel-2);
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 650;
}

.metaPill {
  justify-content: flex-start;
}

.metaDetails {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel);
}

.metaDetails__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text);
}

.metaDetails__summary::-webkit-details-marker {
  display: none;
}

.metaDetails__summary::after {
  content: "+";
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
}

.metaDetails[open] .metaDetails__summary::after {
  content: "\2212";
}

.metaDetails__body {
  padding: 0 14px 14px;
}

.exifPanel {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.exifPanel__empty {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.exifList {
  margin: 0;
  display: grid;
  gap: 8px;
}

.exifRow {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 0.82rem;
  line-height: 1.45;
}

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

.exifRow dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.chip--mono {
  font-family: Consolas, Monaco, monospace;
}

.badge--high {
  border-color: rgba(139, 207, 150, 0.38);
  background: rgba(139, 207, 150, 0.12);
  color: #dff1e2;
}

.badge--med {
  border-color: rgba(212, 181, 111, 0.44);
  background: rgba(212, 181, 111, 0.12);
  color: #efe1ba;
}

.badge--low {
  border-color: rgba(200, 120, 120, 0.38);
  background: rgba(200, 120, 120, 0.12);
  color: #f0d4d4;
}

.badge--muted,
.chip--muted {
  color: var(--muted-strong);
}

.badge-high,
.badge-medium,
.badge-low {
  color: #fff;
  border-color: transparent;
  letter-spacing: 0.01em;
  text-transform: none;
}

.badge-high {
  background: #1f9d55;
}

.badge-medium {
  background: #d69e2e;
}

.badge-low {
  background: #e53e3e;
}

.intakeActionBar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.status {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.8rem;
}

.intakeNotice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(205, 176, 109, 0.28);
  border-radius: 8px;
  background: rgba(205, 176, 109, 0.08);
  color: rgba(241, 228, 193, 0.92);
  font-size: 0.8rem;
  line-height: 1.45;
}

.uploader__submitRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.items {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.items__empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.itemCard,
.confidenceBreakdown,
.feedbackCard,
.tile,
.referenceSection,
.referenceSectionCollapse,
.log,
.modelReferenceCard,
.historyTableWrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.itemCard {
  padding: 12px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.itemCard:hover,
.itemCard--hover {
  border-color: var(--line-strong);
  background: var(--bg-panel-2);
}

.itemCard--selected {
  border-color: var(--accent-strong);
  background: var(--bg-panel-2);
}

.itemCard--high {
  box-shadow: inset 3px 0 0 rgba(139, 207, 150, 0.72);
}

.itemCard--med {
  box-shadow: inset 3px 0 0 rgba(212, 181, 111, 0.72);
}

.itemCard--low {
  box-shadow: inset 3px 0 0 rgba(200, 120, 120, 0.72);
}

.itemCard__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.itemCard__title,
.resultTop__row,
.referenceTitleRow,
.referenceHead,
.referenceHead__copy,
.modelReferenceCard__header,
.modelReferenceCard__footer,
.drawer__header,
.authButtons,
.topbar__actions,
.historyControls {
  display: flex;
}

.itemCard__title {
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 650;
}

.itemCard__title > div:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.selectedIcon,
.itemIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.selectedIcon {
  min-width: 44px;
  height: 44px;
}

.itemCard__meta,
.timeline__meta,
.logTime,
.historyTable th,
.historyTable td,
.referenceFactsTable td,
.referenceList li,
.feedbackLabel,
.feedbackChecks,
.feedbackRadio {
  font-size: 0.82rem;
}

.itemCard__meta,
.timeline__meta,
.logTime,
.feedbackLabel {
  margin-top: 8px;
  color: var(--muted);
}

.resultTop,
.confidenceBreakdown,
.feedbackCard,
.log,
.modelReferenceCard {
  margin: 0 18px 18px;
}

.resultTop {
  padding: 18px 18px 0;
}

.resultTop__row {
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.resultTop__value {
  font-size: clamp(1.24rem, 1.9vw, 1.5rem);
  font-weight: 700;
  line-height: 1.18;
}

.resultHeadline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.confidenceBreakdown {
  padding: 14px;
}

.confidenceBreakdown__metrics {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.confidenceMetric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}

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

.confidenceMetric__bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.confidenceMetric__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.tile {
  overflow: hidden;
}

.tile--full {
  grid-column: 1 / -1;
}

.tile__title,
.referenceSection__title,
.log__title {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.list,
.referenceList {
  margin: 0;
  padding: 10px 16px 14px;
  list-style: none;
}

.list li,
.referenceList li {
  position: relative;
  padding: 8px 0 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.45;
}

.list li:last-child,
.referenceList li:last-child {
  border-bottom: 0;
}

.list li::before,
.referenceList li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.safety {
  padding: 14px 16px 16px;
}

.feedbackCard {
  padding: 14px;
}

.feedbackPrompt {
  margin-top: 10px;
  font-size: 0.9rem;
}

.feedbackWrongFields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.feedbackInput,
.historyFilter,
.authInput {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

textarea.feedbackInput {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
}

.feedbackChecks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  color: var(--muted-strong);
}

.feedbackChecks label,
.feedbackRadio label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedbackStatus {
  margin-top: 12px;
  min-height: 18px;
  font-size: 0.82rem;
}

.guestCtaCard {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(217, 192, 122, 0.06);
}

.engagementActions {
  margin: 0 18px 18px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.engagementActions__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.engagementActions__block {
  display: grid;
  gap: 10px;
}

.shareActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.guestCtaCard__eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guestCtaCard__title {
  margin: 8px 0 0;
  font-size: 1.12rem;
}

.guestCtaCard__text {
  margin: 10px 0 0;
  color: var(--muted-strong);
  line-height: 1.55;
}

.guestCtaCard__list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted-strong);
  line-height: 1.7;
}

.guestCtaCard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.modelReferenceCard {
  padding: 14px;
}

.modelReferenceCard__header,
.modelReferenceCard__footer {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modelReferenceCard__header {
  margin-bottom: 12px;
}

.modelReferenceCard__title {
  margin: 8px 0 0;
  font-size: 1rem;
}

.modelReferenceCard__frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  aspect-ratio: 16 / 10;
}

.modelReferenceCard__embed {
  width: 100%;
  height: 100%;
  border: 0;
}

.modelReferenceCard__footer {
  margin-top: 12px;
}

.modelReferenceCard__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.timeline__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.timeline__dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.timeline__title {
  font-size: 0.92rem;
  font-weight: 650;
}

.timeline__item--active,
.timeline__item--done {
  border-color: var(--accent-strong);
  background: rgba(217, 192, 122, 0.06);
}

.timeline__item--done .timeline__dot,
.timeline__item--active .timeline__dot {
  background: var(--accent);
}

.log {
  overflow: hidden;
}

.log__body {
  max-height: 220px;
  overflow: auto;
}

.logLine {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logLine:last-child {
  border-bottom: 0;
}

.logMsg {
  font-size: 0.84rem;
  line-height: 1.45;
}

.logTag {
  font-size: 0.68rem;
}

.logTag--purple {
  border-color: rgba(217, 192, 122, 0.4);
  background: rgba(217, 192, 122, 0.12);
  color: #f0e4be;
}

.referenceState {
  padding: 18px;
}

.referenceItemSwitcher {
  padding: 0 18px 18px;
}

.referenceItemList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.referenceItemButton {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.referenceItemButton:hover {
  border-color: var(--line-strong);
  background: var(--bg-panel-2);
}

.referenceItemButton--active {
  border-color: rgba(217, 192, 122, 0.72);
  background: rgba(217, 192, 122, 0.08);
}

.referenceItemButton__title,
.referenceItemButton__meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referenceItemButton__title {
  font-size: 0.86rem;
  font-weight: 650;
}

.referenceItemButton__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.referenceContent {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.referenceTitle {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 700;
}

.referenceHero {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.referenceMedia,
.referenceHero__content,
.referenceTitleBlock,
.referenceSummaryWrap,
.referenceSection,
.referenceSectionCollapse,
.referenceImageThumb,
.referenceSpecHighlights,
.referenceProvenance {
  display: grid;
  gap: 10px;
}

.referenceMedia {
  align-content: start;
}

.referenceMedia,
.referenceSectionCollapse,
.referenceSection {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.referenceImage {
  width: 100%;
  aspect-ratio: 4 / 3.1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.referenceImageEmpty {
  min-height: 180px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
}

.referenceGallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px;
}

.referenceImageThumb {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.referenceImageThumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.referenceImageThumb--active {
  border-color: rgba(217, 192, 122, 0.72);
}

.publicAnalysis__headline {
  margin-bottom: 14px;
}

.referenceCanonical {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.referenceMismatchNote {
  padding: 12px 14px;
  border: 1px solid rgba(217, 192, 122, 0.28);
  border-radius: 10px;
  background: rgba(217, 192, 122, 0.08);
  color: #f0e4be;
  font-size: 0.84rem;
  line-height: 1.5;
}

.referenceSummaryWrap {
  padding: 14px 16px 16px;
}

.referenceSummary--clamped {
  max-height: 112px;
  overflow: hidden;
}

.referenceOperatorSummary {
  padding: 14px 16px 0;
  color: var(--muted-strong);
  line-height: 1.55;
}

.referenceGrid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.referenceSection--full {
  grid-column: 1 / -1;
}

.referenceSection__body {
  display: grid;
  gap: 10px;
}

.referenceSpecHighlights {
  padding: 12px 16px 16px;
}

.referenceSpecHighlights .referenceFactsTable td:first-child {
  width: 42%;
}

.referenceSections {
  display: grid;
  gap: 14px;
  padding: 14px 0 0;
}

.referenceFactsTable {
  width: 100%;
  border-collapse: collapse;
}

.referenceFactsTable td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.referenceFactsTable td:first-child {
  color: var(--muted);
  width: 34%;
}

.referenceList a {
  color: #e5d7ad;
  text-decoration: none;
}

.referenceList a:hover {
  text-decoration: underline;
}

.referenceSectionCollapse {
  overflow: hidden;
}

.referenceSection__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.referenceSection__summary::-webkit-details-marker {
  display: none;
}

.referenceSection__summary::after {
  content: "›";
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.referenceSectionCollapse[open] > .referenceSection__summary::after {
  transform: rotate(90deg);
}

.referenceSectionCollapse[open] > .referenceSection__summary {
  border-bottom: 1px solid var(--line);
}

.referenceDetailCard {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.referenceProvenance {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.referenceProvenance__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.referenceProvenance__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.referenceProvenance__note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.referenceActions {
  display: flex;
  justify-content: flex-end;
}

.referenceLinkBtn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.referenceLinkBtn:hover {
  color: var(--muted-strong);
}

.feedbackCard summary {
  list-style: none;
  cursor: pointer;
}

.feedbackCard summary::-webkit-details-marker {
  display: none;
}

.feedbackCard__body {
  padding-top: 10px;
}

.referenceSourceRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.referenceToggle {
  margin-top: 10px;
}

@media (max-width: 960px) {
  .referenceHero,
  .referenceGrid {
    grid-template-columns: 1fr;
  }
}

.historyControls {
  justify-content: flex-end;
  padding: 0 18px 18px;
}

.historyFilter {
  max-width: 320px;
}

.historyTableWrap {
  margin: 0 18px 18px;
  overflow: hidden;
}

.historyTable {
  width: 100%;
  border-collapse: collapse;
}

.historyTable th,
.historyTable td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.historyTable th {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.72rem;
}

.historyRow {
  cursor: pointer;
  transition: background 140ms ease;
}

.historyRow:hover {
  background: rgba(255, 255, 255, 0.03);
}

.historyEmpty {
  display: none;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(540px, 100vw);
  height: 100vh;
  padding: 18px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  transform: translateX(100%);
  transition: transform 180ms ease;
  background: rgba(10, 15, 22, 0.98);
}

.drawer--open {
  transform: translateX(0);
}

.drawer__header {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer__title {
  font-size: 1rem;
  font-weight: 700;
}

.raw {
  margin: 16px 0 0;
  height: calc(100vh - 110px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.28);
  font-family: Consolas, Monaco, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.footer__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer__brandLink {
  color: var(--muted-strong);
  text-decoration: none;
}

.footer__brandLink:hover {
  color: var(--text);
}

.footer__right {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer__right a {
  text-decoration: none;
}

.floatingFeedbackLauncher {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 55;
  min-height: 52px;
  padding: 0 16px 0 14px;
  border: 1px solid rgba(217, 192, 122, 0.26);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(28, 34, 40, 0.98), rgba(17, 21, 26, 0.98)),
    var(--bg-panel);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.floatingFeedbackLauncher:hover {
  border-color: rgba(217, 192, 122, 0.42);
  background:
    linear-gradient(180deg, rgba(34, 41, 48, 0.98), rgba(19, 24, 29, 0.98)),
    var(--bg-panel);
}

.floatingFeedbackLauncher__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(185, 143, 79, 0.18);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.floatingFeedbackLauncher__label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  background: rgba(5, 7, 11, 0.78);
  backdrop-filter: blur(10px);
  padding: 24px;
}

.loadingOverlay--active {
  display: grid;
}

.loadingCard {
  width: min(560px, 100%);
  background: linear-gradient(180deg, rgba(16, 24, 35, 0.98), rgba(12, 18, 26, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.loadingCard__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.loadingCard__label,
.loadingFact__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.loadingCard__title {
  margin-top: 6px;
  font-size: 1.28rem;
  font-weight: 620;
  color: var(--text);
}

.loadingCard__timer {
  min-width: 62px;
  text-align: right;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted-strong);
}

.loadingCard__body {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 8px;
}

.loadingCard__copy {
  min-width: 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 900ms linear infinite;
}

.loadingText {
  font-size: 0.98rem;
  font-weight: 560;
  color: var(--text);
}

.loadingDetail {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted-strong);
}

.loadingFacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 20px 18px;
}

.loadingFact {
  min-width: 0;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.loadingFact strong {
  display: block;
  margin-top: 7px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.loadingTip {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted-strong);
}

@media (max-width: 720px) {
  .loadingCard__header,
  .loadingCard__body,
  .loadingFacts,
  .loadingTip {
    padding-left: 16px;
    padding-right: 16px;
  }

  .loadingFacts {
    grid-template-columns: 1fr;
  }

  .loadingCard__body {
    align-items: center;
  }

  .loadingCard__timer {
    min-width: auto;
  }
}

.authOverlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(217, 192, 122, 0.08), transparent 30%),
    rgba(7, 11, 17, 0.94);
}

.authOverlay--active {
  display: flex;
}

.feedbackOverlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at bottom right, rgba(185, 143, 79, 0.12), transparent 30%),
    rgba(6, 9, 14, 0.9);
  backdrop-filter: blur(10px);
}

.feedbackOverlay--active {
  display: flex;
}

.feedbackModal {
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 25, 31, 0.98), rgba(15, 19, 24, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.feedbackModal__header,
.feedbackModal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedbackModal__label {
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feedbackModal__title {
  margin: 6px 0 0;
  font-size: 1.34rem;
  line-height: 1.2;
}

.feedbackModal__copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.feedbackModal__hint {
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  font-size: 0.82rem;
  line-height: 1.45;
}

.feedbackModal__hint--disabled {
  border-color: rgba(200, 120, 120, 0.22);
  background: rgba(200, 120, 120, 0.08);
  color: #efc8c8;
}

.feedbackInput--floating {
  margin-top: 0;
  min-height: 132px;
}

.feedbackModal__actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.feedbackStatus--floating {
  margin-top: 12px;
  min-height: 18px;
}

.authOverlay--reset #registerFields,
.authOverlay--reset #authSupportRow,
.authOverlay--reset #authPasswordGroup {
  display: none !important;
}

.authCard {
  width: min(420px, 100%);
  padding: 24px;
}

.authBrand,
.resetBrand {
  display: flex;
  align-items: center;
  min-height: 64px;
  gap: 10px;
  padding: 0 24px 16px;
  border-bottom: 1px solid rgba(167, 181, 198, 0.08);
}

.authBrand {
  margin: -24px -24px 8px;
}

.authBrand__logo,
.resetBrand__logo {
  width: 36px;
  height: 36px;
  padding: 3px;
  border: 1px solid rgba(167, 181, 198, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  object-fit: contain;
}

.authBrand__copy,
.resetBrand__copy {
  min-width: 0;
}

.authBrand__row,
.resetBrand__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.authBrand__title,
.resetBrand__title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.authBrand__link,
.resetBrand__link {
  color: var(--muted);
  font-size: 0.76rem;
  text-decoration: none;
}

.authBrand__link:hover,
.resetBrand__link:hover {
  color: var(--muted-strong);
}

.authTitle {
  margin: 6px 0 0;
  font-size: 1.6rem;
  line-height: 1.15;
}

.authLabel {
  display: block;
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted-strong);
}

.authButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.authButtons .authBtn {
  flex: 1;
}

.authError {
  min-height: 18px;
  margin-top: 12px;
  color: #f1b4b4;
  font-size: 0.82rem;
}

.authError--success {
  color: var(--muted-strong);
}

.authFields {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.authSupportRow {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.authLinkBtn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.authLinkBtn:hover {
  color: var(--muted-strong);
}

.authCheck {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 0.85rem;
  line-height: 1.45;
}

.authCheck input {
  margin-top: 2px;
}

.mobilePreviewLightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(3, 5, 8, 0.94);
}

.mobilePreviewLightbox__head {
  display: flex;
  justify-content: flex-end;
  padding: 12px;
}

.mobilePreviewLightbox__body {
  display: grid;
  place-items: center;
  height: calc(100vh - 64px);
  padding: 16px;
}

.mobilePreviewLightbox__img {
  width: 100%;
  max-width: 960px;
  max-height: 100%;
  object-fit: contain;
}

.mobilePreviewOpen {
  overflow: hidden;
}

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

@media (min-width: 860px) {
  .workspaceLead {
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
    align-items: end;
  }

  .workspaceLead__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .topbar {
    min-height: var(--header-desktop);
    padding: 16px 20px;
  }

  .topbar__mission {
    display: block;
  }
}

@media (max-width: 1120px) {
  .intakeLayout,
  .shell--results {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .workstation {
    padding-inline: 10px;
  }

  .appTabs {
    position: static;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 0;
    overflow: visible;
  }

  .appTabBtn {
    min-height: 38px;
  }

  .workspaceLead {
    padding: 16px;
  }

  .card__header,
  .uploader,
  .resultTop,
  .grid,
  .confidenceBreakdown,
  .feedbackCard,
  .log,
  .modelReferenceCard,
  .historyControls,
  .historyTableWrap,
  .referenceContent {
    padding-left: 14px;
    padding-right: 14px;
    margin-left: 0;
    margin-right: 0;
  }

  .card__header {
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .card__header--split,
  .modelReferenceCard__header,
  .modelReferenceCard__footer,
  .referenceHead,
  .topbar,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__actions,
  .card__intro,
  .badgeRow {
    width: 100%;
  }

  .badgeRow {
    justify-content: flex-start;
  }

  .uploader {
    padding-bottom: 0;
  }

  .previewWrap,
  .previewImg,
  .preview__empty {
    min-height: 280px;
  }

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

  .feedbackChecks {
    grid-template-columns: minmax(0, 1fr);
  }

  .historyTable {
    display: block;
    overflow-x: auto;
  }

  .referenceImage {
    width: 100%;
    max-width: 100%;
  }

  .footer {
    padding-top: 0;
  }

  .authBrand,
  .resetBrand {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
  }

  .workstation {
    padding-top: 10px;
    padding-bottom: 92px;
  }

  .workspaceLead {
    gap: 10px;
    padding: 10px 0 8px;
    margin-bottom: 10px;
  }

  .workspaceLead__label {
    font-size: 0.68rem;
    letter-spacing: 0.01em;
  }

  .workspaceLead__title {
    margin-top: 0;
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .brand__descriptor,
  .topbar__mission {
    display: none;
  }

  .topbar__brand {
    flex: 1 1 auto;
    gap: 10px;
    min-width: 0;
  }

  .brand__logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .brand__name {
    font-size: 0.98rem;
  }

  .topbar__version--logo {
    right: -6px;
    bottom: -5px;
    min-height: 18px;
    padding: 0 5px;
    font-size: 0.58rem;
  }

  .topbar__actions {
    width: auto;
    margin-left: 0;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .guestBadge,
  .userBadge {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .appTabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 10px;
    padding-bottom: 0;
  }

  .appTabBtn {
    min-height: 34px;
    width: 100%;
    padding-inline: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
  }

  .userBadge span,
  .guestBadge span {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .userBadge {
    gap: 6px;
  }

  .userBadge span {
    display: none;
  }

  .guestBadge {
    gap: 6px;
  }

  .guestBadge span {
    display: none;
  }

  .topbar .btn--compact {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  #panelReference > .card > .card__header {
    display: none;
  }

  #panelReference > .card > .referenceState,
  #panelReference > .card > .referenceContent {
    padding-top: 14px;
  }

  .engagementActions__row,
  .shareActions {
    grid-template-columns: 1fr;
  }

  .resultTop__row {
    flex-direction: column;
  }

  .selectedIcon {
    min-width: 40px;
    height: 40px;
  }

  .drop__prompt {
    inset: auto 10px 10px 10px;
  }

  .drop__promptInner,
  .intakeSection,
  .leadStat,
  .itemCard,
  .timeline__item,
  .confidenceBreakdown,
  .feedbackCard,
  .modelReferenceCard {
    padding-left: 12px;
    padding-right: 12px;
  }

  .metaDetails__summary,
  .metaDetails__body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .uploader__actions,
  .uploader__submitRow {
    grid-template-columns: minmax(0, 1fr);
  }

.historyFilter {
  max-width: 100%;
}

  .floatingFeedbackLauncher {
    right: 12px;
    left: auto;
    bottom: max(12px, env(safe-area-inset-bottom, 0px) + 10px);
    min-height: 46px;
    padding: 0 12px;
  }

  .floatingFeedbackLauncher__label {
    font-size: 0.78rem;
  }

  .feedbackOverlay {
    padding: 12px;
    align-items: flex-end;
  }

  .feedbackModal {
    width: 100%;
    padding: 18px;
    border-radius: 14px 14px 0 0;
  }

  .feedbackModal__header {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .workspaceLead__stats--mobileAux {
    display: none;
  }
}

.adminShell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.adminToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.adminStorageBar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.adminStorageStat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.adminStorageStat span {
  font-size: 12px;
  color: var(--muted);
}

.adminStorageStat strong {
  font-size: 18px;
  color: var(--text);
}

.adminToolbar__group {
  display: flex;
  gap: 8px;
}

.adminStatus {
  margin: 0;
  min-width: 260px;
}

.adminStatus--error {
  color: #ffb7b7;
}

.adminPanel {
  display: none;
}

.adminPanel--active {
  display: block;
}

.adminGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.9fr);
  gap: 20px;
}

.adminGrid--history {
  grid-template-columns: minmax(0, 1.3fr) minmax(420px, 0.95fr);
}

.adminCard {
  min-height: 0;
}

.adminFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.adminFilters .historyFilter {
  flex: 1 1 160px;
}

.adminTableWrap {
  max-height: 540px;
}

.adminTable td,
.adminTable th {
  vertical-align: top;
}

.adminEmpty {
  margin-top: 12px;
}

.adminDetail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.adminDetailEmpty {
  margin: 0;
}

.adminKeyvals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.adminKeyvals div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.adminKeyvals span {
  font-size: 12px;
  color: var(--muted);
}

.adminKeyvals strong {
  font-size: 14px;
  color: var(--text);
}

.adminActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.adminActions--danger {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.adminDangerBtn {
  border-color: rgba(207, 111, 111, 0.4);
  color: #f2c2c2;
}

.adminDangerBtn:hover {
  border-color: rgba(207, 111, 111, 0.7);
  background: rgba(207, 111, 111, 0.08);
}

.adminSubsection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adminSubsection__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-strong);
  letter-spacing: 0.02em;
}

.adminList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adminList__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.adminList__item span {
  color: var(--muted);
  font-size: 13px;
}

.adminHistoryPreview {
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.adminHistoryPreview img {
  display: block;
  max-height: 280px;
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.adminCode {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0b1017;
  color: var(--muted-strong);
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

.resetShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.resetCard {
  width: min(100%, 520px);
}

.resetBrand {
  margin-bottom: 0;
}

.unsubscribeShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.unsubscribeCard {
  position: relative;
  overflow: hidden;
  width: min(100%, 620px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
}

.unsubscribeGlow {
  position: absolute;
  inset: -40% auto auto 62%;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 192, 122, 0.18), transparent 70%);
  pointer-events: none;
}

.unsubscribeBrand,
.unsubscribeHero,
.unsubscribeActions,
.unsubscribeFootnote {
  position: relative;
  z-index: 1;
}

.unsubscribeHero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unsubscribeTitle {
  max-width: 14ch;
  margin-bottom: 0;
}

.unsubscribeSummary {
  max-width: 52ch;
}

.unsubscribeDetail {
  margin: 0;
  border-color: rgba(167, 181, 198, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.018)),
    rgba(12, 18, 26, 0.9);
}

.statusPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.statusPill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
}

.statusPill--success {
  color: var(--good);
}

.statusPill--error {
  color: #f0abab;
}

.unsubscribeActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.unsubscribeFootnote {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.unsubscribeFootnote a {
  color: var(--muted-strong);
  text-decoration: none;
}

.unsubscribeFootnote a:hover {
  color: var(--text);
}

@media (max-width: 980px) {
  .adminGrid,
  .adminGrid--history {
    grid-template-columns: 1fr;
  }

  .adminKeyvals {
    grid-template-columns: 1fr;
  }

  .adminToolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .adminStorageBar {
    grid-template-columns: 1fr;
  }

  .adminStatus {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .unsubscribeCard {
    padding: 22px 18px;
  }

  .unsubscribeActions {
    flex-direction: column;
  }

  .unsubscribeActions .btn {
    width: 100%;
    justify-content: center;
  }
}
