:root {
  --bg: #f3efe6;
  --bg-soft: #ebe4d6;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: #fffaf1;
  --ink: #1e2421;
  --muted: #5f665e;
  --line: rgba(30, 36, 33, 0.12);
  --gold: #c79b52;
  --forest: #1b252c;
  --amber: #bb7a20;
  --shadow: 0 24px 60px rgba(39, 26, 8, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(199, 155, 82, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(27, 37, 44, 0.24), transparent 26%),
    linear-gradient(180deg, #223038 0%, #1b252c 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup__logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.brand-lockup__text {
  display: flex;
  flex-direction: column;
}

.brand-lockup__chain {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

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

.topnav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--forest);
}

.topnav a:hover,
.topnav__more:hover {
  background: rgba(27, 37, 44, 0.08);
  color: var(--forest);
}

.topnav__more {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font: inherit;
}

.topnav__more span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 22, 0.35);
  backdrop-filter: blur(2px);
  z-index: 30;
}

.more-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  background: rgba(255, 250, 241, 0.96);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translateX(calc(100% + 24px));
  transition: transform 220ms ease;
  z-index: 40;
}

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

.more-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.more-drawer__header h2 {
  margin: 6px 0 0;
  font-family: "Instrument Serif", serif;
  font-size: 2rem;
  line-height: 0.95;
}

.more-drawer__close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(27, 37, 44, 0.06);
  color: var(--forest);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.more-drawer__section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.more-drawer__section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.more-drawer__label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.more-drawer__section a {
  display: block;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--ink);
  font-weight: 500;
}

.more-drawer__section a:hover {
  background: rgba(27, 37, 44, 0.08);
  color: var(--forest);
}

.app-shell {
  padding-top: 24px;
}

.hero,
.page {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  padding: 36px;
}

.hero__copy h1,
.page__header h1 {
  margin: 0 0 14px;
  font-family: "Instrument Serif", serif;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 0.95;
}

.page__header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.result-snapshot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
  color: rgba(95, 102, 94, 0.9);
  font-size: 0.82rem;
  line-height: 1.35;
}

.result-snapshot__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.result-snapshot__item strong {
  color: rgba(95, 102, 94, 0.78);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-snapshot__divider {
  color: rgba(30, 36, 33, 0.22);
}

.result-intro--compact {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 90ch;
  margin-top: 0;
  font-size: 0.96rem;
  line-height: 1.45;
}

.result-heading__logo,
.profile-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  padding: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero__panel,
.panel,
.result-card,
.analysis-card,
.source-card {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(30, 36, 33, 0.08);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.hero__panel {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(27, 37, 44, 0.94), rgba(17, 24, 29, 0.98)),
    #1b252c;
  color: #f6efde;
}

.score-card__label,
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.build-version {
  margin: 0 0 12px;
  color: rgba(246, 239, 222, 0.78);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.lede {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero__actions,
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.result-link {
  color: var(--forest);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  background: linear-gradient(135deg, var(--forest), #11181d);
  color: #fffaf1;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
  color: var(--ink);
}

.button--small {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.checklist {
  margin: 18px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.page {
  padding: 28px;
}

.page__header {
  margin-bottom: 24px;
}

.page__eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow--muted {
  color: rgba(95, 102, 94, 0.68);
  text-align: right;
}

.search-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel__heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(27, 37, 44, 0.14);
  box-shadow: 0 12px 28px rgba(27, 37, 44, 0.07);
}

.search-intro {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}

.search-intro h2 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  line-height: 1.02;
}

.search-intro p,
.search-guidance p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-form__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

#brand-input {
  padding: 18px 20px;
  border: 1px solid rgba(27, 37, 44, 0.22);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(27, 37, 44, 0.07);
  font-size: 1.02rem;
}

#brand-input:focus {
  outline: 2px solid rgba(27, 37, 44, 0.16);
  outline-offset: 2px;
  border-color: rgba(27, 37, 44, 0.4);
}

.helper-text,
.status {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

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

.search-guidance article {
  padding: 14px;
  border-radius: 18px;
  background: rgba(27, 37, 44, 0.06);
  border: 1px solid rgba(27, 37, 44, 0.1);
}

.panel--recent {
  padding-top: 14px;
}

.panel--recent .panel__heading {
  margin-bottom: 12px;
}

.status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(27, 37, 44, 0.08);
  border: 1px solid rgba(27, 37, 44, 0.12);
}

.status--error {
  color: #8b2e12;
  background: rgba(187, 122, 32, 0.14);
  border-color: rgba(187, 122, 32, 0.18);
}

.suggestions-panel {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(199, 155, 82, 0.1);
  border: 1px solid rgba(199, 155, 82, 0.18);
}

.suggestion-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.suggestion-chip {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(27, 37, 44, 0.16);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
}

.recent-list,
.source-grid,
.analysis-grid,
.result-grid {
  display: grid;
  gap: 14px;
}

.recent-item,
.source-card,
.analysis-card,
.result-card {
  padding: 16px;
}

.recent-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.recent-item:hover,
.recent-item:focus-visible {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, rgba(27, 37, 44, 0.96), rgba(17, 24, 29, 0.97)),
    #1b252c;
  border-color: rgba(27, 37, 44, 0.92);
  box-shadow: 0 16px 34px rgba(19, 32, 29, 0.18);
  color: #fff8ec;
  outline: none;
}

.recent-item:hover .recent-item__meta,
.recent-item:focus-visible .recent-item__meta,
.recent-item:hover .recent-item__title,
.recent-item:focus-visible .recent-item__title {
  color: #fff8ec;
}

.recent-item:active {
  transform: translateY(0);
}

.recent-item__meta,
.result-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.recent-item__title,
.source-card h2,
.analysis-card h2,
.result-card h2 {
  margin: 8px 0 6px;
  font-size: 1.04rem;
}

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

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.overview-stat {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.overview-stat__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-stat__value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
}

.overview-stat__sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-card--hero {
  grid-column: 1 / -1;
  background:
    linear-gradient(180deg, rgba(27, 37, 44, 0.95), rgba(17, 24, 29, 0.98)),
    #1b252c;
  color: #fff8ec;
}

.band-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}

.hero-summary {
  margin: 18px 0 0;
  max-width: 68ch;
  color: rgba(255, 248, 236, 0.92);
  font-size: 1rem;
  line-height: 1.65;
}

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

.analysis-grid--compact {
  margin-top: 16px;
}

.analysis-card--full {
  margin-top: 16px;
  padding: 18px;
}

.confirm-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.confirm-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(27, 37, 44, 0.06);
  border: 1px solid rgba(27, 37, 44, 0.1);
}

.confirm-card h2,
.profile-grid h3 {
  margin: 0 0 8px;
}

.confirm-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

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

.profile-stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(27, 37, 44, 0.05);
  border: 1px solid rgba(27, 37, 44, 0.08);
}

.profile-stat__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-stat__value {
  display: block;
  line-height: 1.5;
}

.analysis-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.7;
}

.analysis-card p,
.source-card p,
.result-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.simple-page-card {
  grid-column: 1 / -1;
}

.simple-page-body {
  width: 100%;
  max-width: none;
}

.simple-page-body > * {
  max-width: none;
}

.simple-page-body p,
.simple-page-body ul,
.simple-page-body ol,
.simple-page-body h3,
.simple-page-body hr {
  max-width: none;
}

.simple-page-body p,
.simple-page-body li {
  line-height: 1.7;
}

.simple-page-body ul,
.simple-page-body ol {
  margin: 12px 0 0;
  padding-left: 20px;
}

.simple-page-body h3 {
  margin: 22px 0 8px;
}

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

.sources-toolbar {
  margin-bottom: 16px;
}

.page__header-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page__header-inline h1 {
  margin: 0;
}

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

.source-form textarea,
.source-form input {
  width: 100%;
}

.donate-embed {
  width: 100%;
  min-height: 520px;
  border: 0;
  border-radius: 18px;
  background: rgba(27, 37, 44, 0.04);
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-list__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(27, 37, 44, 0.05);
  border: 1px solid rgba(27, 37, 44, 0.08);
}

.admin-table {
  display: grid;
  gap: 12px;
}

.admin-table__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(27, 37, 44, 0.05);
  border: 1px solid rgba(27, 37, 44, 0.08);
}

.admin-table__row div {
  display: grid;
  gap: 4px;
}

.admin-table__row strong {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-table__row span {
  word-break: break-word;
}

.admin-table__row--source {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.admin-table__full {
  grid-column: 1 / -1;
}

.admin-actions {
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(27, 37, 44, 0.08);
  border: 1px solid rgba(27, 37, 44, 0.14);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--forest);
}

.sources-admin-link {
  margin-top: 18px;
}

.sources-admin-link a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.source-card__image {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  flex-shrink: 0;
}

.source-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  font-weight: 700;
}

.source-card__meta {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.source-card__meta a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.source-link-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.source-link {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(27, 37, 44, 0.06);
  border: 1px solid rgba(27, 37, 44, 0.08);
}

.source-link strong {
  display: block;
  margin-bottom: 6px;
}

.source-link a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .search-layout,
  .confirm-layout,
  .search-intro,
  .search-guidance,
  .overview-strip,
  .analysis-grid,
  .profile-grid,
  .source-grid,
  .result-grid,
  .sources-toolbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    border-radius: 28px;
    align-items: flex-start;
    flex-direction: column;
  }

  .more-drawer {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 20px, 1200px);
  }

  .hero,
  .page {
    padding: 22px;
  }

  .search-form__row {
    grid-template-columns: 1fr;
  }
}
