:root {
  --bg: #f6f1e8;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffdf9;
  --text: #1d2a1c;
  --muted: #596659;
  --line: rgba(35, 48, 28, 0.14);
  --accent: #0e7a53;
  --accent-strong: #08583b;
  --warning: #c0672e;
  --shadow: 0 20px 45px rgba(42, 37, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 126, 0.45), transparent 28%),
    radial-gradient(circle at top right, rgba(27, 161, 98, 0.14), transparent 22%),
    linear-gradient(180deg, #efe7d6 0%, #f8f4ec 45%, #f3ede2 100%);
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.88)),
    linear-gradient(115deg, rgba(14, 122, 83, 0.08), rgba(192, 103, 46, 0.08));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-art-frame {
  width: min(45%, 620px);
  min-width: 280px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(18, 40, 28, 0.12);
  box-shadow: 0 18px 36px rgba(20, 31, 17, 0.14);
  background: #d8cab0;
}

.hero-art {
  display: block;
  width: 100%;
  height: auto;
}

.hero-copy-block {
  padding: 24px 10px 6px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.95;
  max-width: 13ch;
  margin-inline: auto;
}

.hero-copy,
.panel-header p,
.hero-note,
.feedback,
.match-meta,
.empty-state,
#session-summary {
  color: var(--muted);
}

#session-summary {
  white-space: pre-line;
}

.hero-copy {
  max-width: 62ch;
  font-size: 1.06rem;
  margin: 18px 0 10px;
  margin-inline: auto;
}

.hero-note {
  font-size: 0.92rem;
  max-width: 64ch;
  margin-inline: auto;
}

.access-note {
  position: relative;
}

.creator-note {
  margin-top: 10px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.creator-note a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.creator-note a:hover {
  text-decoration: underline;
}

.inline-tooltip {
  position: relative;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.inline-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(25, 38, 24, 0.94);
  color: #fffdf8;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(21, 21, 19, 0.18);
  transition: opacity 140ms ease, transform 140ms ease;
}

.inline-tooltip:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

.grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.panel,
.checklist-card,
.matches-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

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

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

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

.profile-actions button {
  flex: 1 1 0;
}

.profile-field {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(40, 52, 34, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.profile-label {
  font-size: 0.84rem;
  color: var(--muted);
}

.profile-value {
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
  word-break: break-word;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.94rem;
}

input {
  width: 100%;
  border: 1px solid rgba(40, 52, 34, 0.18);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
}

select {
  width: 100%;
  border: 1px solid rgba(40, 52, 34, 0.18);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
}

textarea {
  width: 100%;
  border: 1px solid rgba(40, 52, 34, 0.18);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid rgba(14, 122, 83, 0.18);
  border-color: var(--accent);
}

input:focus {
  outline: 2px solid rgba(14, 122, 83, 0.18);
  border-color: var(--accent);
}

select:focus {
  outline: 2px solid rgba(14, 122, 83, 0.18);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--accent);
  color: white;
}

.ghost {
  background: rgba(14, 122, 83, 0.08);
  color: var(--accent-strong);
}

.danger {
  background: rgba(176, 39, 39, 0.12);
  color: #8d2020;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}

.tab {
  flex: 1;
  background: rgba(14, 122, 83, 0.08);
  color: var(--accent-strong);
}

.tab.active {
  background: var(--accent-strong);
  color: white;
}

.feedback {
  min-height: 24px;
  margin: 14px 0 0;
}

.dashboard-feedback {
  margin: 10px 0 2px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 12px));
  z-index: 50;
  min-width: 260px;
  max-width: min(92vw, 380px);
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(14, 122, 83, 0.96);
  color: #fffdf8;
  box-shadow: 0 18px 34px rgba(22, 31, 18, 0.24);
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.hidden {
  display: none !important;
}

.dashboard-panel {
  min-height: 760px;
}

.dashboard-actions,
.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checklist-head {
  flex-wrap: wrap;
  align-items: flex-start;
}

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

.checklist-tools button {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.checklist-head input {
  flex: 1 1 240px;
  min-width: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

#public-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  min-width: 0;
}

.stat strong {
  display: block;
  font-size: 1.9rem;
  margin-bottom: 6px;
}

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

.checklist-card,
.matches-card {
  padding: 18px;
}

.sticker-groups {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.group {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.65);
}

.group-toggle {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.group-toggle:hover {
  transform: none;
  background: rgba(14, 122, 83, 0.05);
}

.group-items {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.group.open .group-items {
  display: grid;
}

.sticker-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(245, 241, 231, 0.9);
  border: 1px solid rgba(31, 47, 26, 0.09);
  font-size: 0.9rem;
}

.sticker-pill-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.sticker-pill-duplicate {
  justify-content: space-between;
}

.sticker-pill-duplicate.selected {
  border-color: rgba(14, 122, 83, 0.28);
  background: rgba(235, 248, 241, 0.95);
}

.sticker-quantity {
  width: 68px;
  min-width: 68px;
  padding: 8px 10px;
  text-align: center;
}

.sticker-pill input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.matches-card {
  margin-top: 18px;
}

.insight-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.insight-row {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.insight-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.insight-row-top strong {
  font-size: 1rem;
}

.insight-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(14, 122, 83, 0.1);
  overflow: hidden;
}

.insight-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0e7a53, #d7a24b);
}

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

.explain-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.explain-card strong {
  display: block;
  margin-bottom: 8px;
}

.explain-card p {
  margin: 0;
  color: var(--muted);
}

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

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}

.admin-user-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  max-height: 620px;
  overflow: auto;
}

.admin-user-card {
  width: 100%;
  text-align: left;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  padding: 16px;
  display: grid;
  gap: 6px;
  justify-items: start;
  box-shadow: none;
}

.admin-user-card.active {
  background: rgba(14, 122, 83, 0.13);
  border-color: rgba(14, 122, 83, 0.38);
}

.admin-user-card strong,
.admin-user-card span {
  pointer-events: none;
}

.admin-page .auth-panel {
  max-width: 460px;
}

.admin-grid-auth {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
}

.admin-grid-dashboard #admin-dashboard-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.admin-toolbar {
  flex-wrap: wrap;
  align-items: stretch;
}

.admin-toolbar button {
  flex: 0 0 auto;
}

#admin-dashboard-panel .checklist-card,
#admin-dashboard-panel .panel,
#admin-dashboard-panel .admin-layout,
#admin-dashboard-panel .admin-user-list,
#admin-dashboard-panel #admin-edit-form {
  min-width: 0;
}

#admin-edit-form {
  gap: 14px;
}

#admin-edit-form .dashboard-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

#admin-edit-form .dashboard-actions button {
  min-width: 180px;
}

#admin-selected-label {
  max-width: 100%;
  word-break: break-word;
}

.admin-page .dashboard-panel {
  min-height: auto;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 21, 19, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(100%, 520px);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.matches-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.match-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.match-card h4 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  background: rgba(14, 122, 83, 0.12);
  color: var(--accent-strong);
}

.chip.alt {
  background: rgba(192, 103, 46, 0.14);
  color: #8e4b1f;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  margin-top: 20px;
}

@media (max-width: 1080px) {
  .grid,
  .checklists,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  #public-stats,
  .public-explainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-panel {
    min-height: auto;
  }

  .admin-grid-auth {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px 14px 28px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .hero-art-frame {
    width: min(78%, 520px);
    min-width: 0;
  }

  .hero-copy-block {
    padding: 18px 0 2px;
  }

  .inline-fields,
  .stats {
    grid-template-columns: 1fr;
  }

  #public-stats,
  .public-explainer {
    grid-template-columns: 1fr;
  }

  .checklist-head,
  .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-tooltip::after {
    left: 0;
    top: calc(100% + 10px);
    transform: none;
    white-space: normal;
    width: min(260px, 80vw);
  }

  .inline-tooltip:hover::after {
    transform: translateY(0);
  }

  .admin-toolbar button,
  #admin-edit-form .dashboard-actions button {
    width: 100%;
    min-width: 0;
  }
}
