:root {
  --bg: #faf7f1;
  --bg-2: #f2ede3;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --ink: #121215;
  --muted: #6d6a63;
  --line: rgba(18, 18, 21, 0.08);
  --accent: #ff6f3c;
  --accent-2: #ffb85c;
  --accent-soft: rgba(255, 111, 60, 0.12);
  --success: #2f8a58;
  --warn: #c9892c;
  --shadow: 0 22px 60px rgba(24, 18, 12, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --display: "Syne", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 184, 92, 0.16), transparent 24%),
    radial-gradient(circle at 100% 10%, rgba(255, 111, 60, 0.12), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: var(--body);
}

body {
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.bg-orb,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-orb-a {
  background: radial-gradient(circle at 14% 14%, rgba(255, 111, 60, 0.12), transparent 28%);
}

.bg-orb-b {
  background: radial-gradient(circle at 84% 18%, rgba(18, 18, 21, 0.06), transparent 22%);
}

.grain {
  opacity: 0.08;
  background-image:
    radial-gradient(rgba(18, 18, 21, 0.08) 0.7px, transparent 0.7px),
    radial-gradient(rgba(18, 18, 21, 0.05) 0.7px, transparent 0.7px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
}

.shell {
  width: min(calc(100% - 18px), 960px);
  margin: 0 auto;
  padding: 10px 0 56px;
  overflow-x: hidden;
}

.stack-gap {
  display: grid;
  gap: 14px;
}

.screen-frame {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.screen-frame.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 0.98fr;
  gap: 14px;
}

.panel,
.hero {
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 18px;
}

.topbar,
.panel,
.hero {
  animation: rise 0.5s ease both;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 0;
  backdrop-filter: blur(16px);
}

.brand,
.profile-main,
.topbar-actions,
.lang-switch,
.action-row,
.note-tags,
.stats-row,
.stat-strip,
.profile-top,
.owner-top,
.mini-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.details-panel {
  padding: 0;
  overflow: hidden;
}

.details-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text);
}

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

.details-panel[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.details-panel .details-body {
  padding: 0 18px 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}

.modal-sheet {
  width: min(560px, 100%);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.modal-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.brand-button {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.brand strong,
.hero h1,
.profile-main h2,
.success-panel h3 {
  font-family: var(--display);
}

.brand strong {
  display: block;
  font-size: 22px;
}

.lang-switch {
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 18, 21, 0.04);
}

.lang-btn,
.tab,
.ghost-button,
.primary-button,
.prompt-chip,
.hero-chip,
.mini-profile,
.story-preview {
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.lang-btn:hover,
.tab:hover,
.ghost-button:hover,
.primary-button:hover,
.prompt-chip:hover,
.mini-profile:hover,
.story-preview:hover {
  transform: translateY(-1px);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  font-family: var(--mono);
  font-size: 12px;
}

.lang-btn.active {
  background: var(--ink);
  color: #fff;
}

.ghost-button,
.tab,
.prompt-chip {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.ghost-button,
.primary-button,
.tab {
  border-radius: 999px;
  padding: 12px 15px;
}

.ghost-button.strong,
.tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(255, 111, 60, 0.22);
}

.hero {
  padding: 22px;
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(38px, 8vw, 68px);
  line-height: 0.96;
}

.hero p,
.section-copy,
.mode-copy,
.hint-box,
.empty-panel p,
.success-panel p,
.hook-card,
.mission-card p,
.story-preview strong,
.consent-box span,
.profile-main span,
.mini-copy span,
.footer a {
  color: var(--muted);
}

.hero p {
  max-width: 40ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

.hero-chip-row,
.prompt-row,
.mini-list,
.story-grid,
.hint-list,
.notes-grid {
  display: grid;
  gap: 10px;
}

.hero-chip-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.hero-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.hero-chip,
.rank-pill,
.vibe-pill,
.tag,
.mini-metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.hero-chip {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.eyebrow,
.field span,
.heat-meta span,
.unlock-card span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-copy {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.share-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form,
.profile-panel,
.owner-hero,
.mission-card,
.story-preview,
.success-panel {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  color: var(--ink);
  outline: none;
  padding: 14px 15px;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 111, 60, 0.35);
  box-shadow: 0 0 0 4px rgba(255, 111, 60, 0.08);
}

.consent-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  background: rgba(18, 18, 21, 0.04);
  border: 1px solid var(--line);
}

.consent-box input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.toggle-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  background: rgba(18, 18, 21, 0.04);
  border: 1px solid var(--line);
}

.toggle-box input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.toggle-box strong {
  display: block;
  font-size: 14px;
}

.mode-card,
.hint-box,
.link-card,
.unlock-card,
.empty-inline {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(18, 18, 21, 0.04);
  border: 1px solid var(--line);
}

.notes-intro {
  margin: 0;
  padding-top: 8px;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.pull-indicator {
  position: sticky;
  top: 64px;
  z-index: 5;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.pull-indicator.visible {
  opacity: 1;
}

.mode-card strong {
  display: block;
}

.mode-card p,
.success-panel p,
.hook-card,
.mission-card p,
.story-preview strong {
  margin: 0;
  line-height: 1.5;
}

.profile-top,
.owner-top {
  justify-content: space-between;
  align-items: flex-start;
}

.profile-main h2 {
  margin: 0;
  font-size: 30px;
  line-height: 0.95;
}

.vibe-pill {
  padding: 10px 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 111, 60, 0.18);
}

.stat-strip,
.stats-row {
  flex-wrap: wrap;
}

.stat-strip span,
.stats-row div {
  min-width: 90px;
}

.stat-strip span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 21, 0.04);
}

.stats-row {
  justify-content: space-between;
}

.stats-row strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

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

.heat-meter {
  display: grid;
  gap: 10px;
}

.heat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.heat-meta strong {
  font-family: var(--display);
  font-size: 26px;
}

.meter-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(18, 18, 21, 0.08);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

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

.mini-list {
  display: grid;
}

.mini-profile {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 22px;
  text-align: left;
}

.mini-copy {
  display: grid;
  gap: 3px;
  text-align: left;
  flex: 1;
}

.mini-copy strong,
.unlock-card strong {
  color: var(--ink);
}

.mini-metric,
.rank-pill {
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(18, 18, 21, 0.05);
}

.rank-pill {
  min-width: 36px;
}

.link-card {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-word;
  background: var(--ink);
  color: #fff;
}

.action-row {
  flex-wrap: wrap;
}

.action-row.compact {
  gap: 8px;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.filter-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 140ms ease;
}

.filter-pill:hover {
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.filter-count {
  opacity: 0.6;
  font-size: 11px;
  margin-left: 3px;
}

.show-more-btn {
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 140ms ease;
}

.show-more-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.notes-grid {
  display: grid;
  gap: 12px;
}

.date-group {
  padding: 2px 2px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 18, 21, 0.12);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  gap: 12px;
}

.note-card.is-hidden {
  opacity: 0.9;
}

.note-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.note-tags {
  flex-wrap: wrap;
}

.tag {
  padding: 6px 9px;
  background: rgba(18, 18, 21, 0.05);
  color: var(--muted);
}

.tag.accent {
  color: var(--accent);
  background: var(--accent-soft);
}

.tag.warn {
  color: #8a5b13;
  background: rgba(201, 137, 44, 0.14);
}

.tag.ghost {
  color: #8b5760;
  background: rgba(139, 87, 96, 0.12);
}

.note-body {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 500;
}

.note-body[role="button"] {
  cursor: pointer;
}

.modal-content {
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 12px;
}

.guess-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.unlock-card small {
  color: var(--muted);
}

.hint-list {
  display: flex;
  flex-wrap: wrap;
}

.hint-list span {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 13px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge-label {
  color: var(--muted);
  font-size: 12px;
}

.mini-badge {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(18, 18, 21, 0.06);
  border: 1px solid rgba(18, 18, 21, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

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

.story-preview {
  padding: 16px;
  text-align: left;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.6)),
    radial-gradient(circle at top right, rgba(255, 111, 60, 0.18), transparent 38%);
}

.theme-ember {
  box-shadow:
    inset 0 0 0 1px rgba(255, 111, 60, 0.06),
    var(--shadow);
}

.theme-sand {
  box-shadow:
    inset 0 0 0 1px rgba(211, 156, 78, 0.09),
    var(--shadow);
}

.theme-mint {
  box-shadow:
    inset 0 0 0 1px rgba(76, 197, 155, 0.09),
    var(--shadow);
}

.theme-pearl {
  box-shadow:
    inset 0 0 0 1px rgba(167, 177, 222, 0.09),
    var(--shadow);
}

.theme-ember .meter-fill,
.theme-ember .vibe-pill {
  background: linear-gradient(90deg, rgba(255, 111, 60, 0.16), rgba(255, 184, 92, 0.18));
  color: #cb4e20;
}

.theme-sand .meter-fill,
.theme-sand .vibe-pill {
  background: linear-gradient(90deg, rgba(211, 156, 78, 0.18), rgba(237, 196, 110, 0.18));
  color: #9b651f;
}

.theme-mint .meter-fill,
.theme-mint .vibe-pill {
  background: linear-gradient(90deg, rgba(76, 197, 155, 0.18), rgba(136, 224, 198, 0.18));
  color: #1f7f63;
}

.theme-pearl .meter-fill,
.theme-pearl .vibe-pill {
  background: linear-gradient(90deg, rgba(167, 177, 222, 0.22), rgba(197, 207, 241, 0.22));
  color: #50608f;
}

.story-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.sender-panel {
  max-width: 100%;
  margin: 0;
  min-height: calc(100vh - 170px);
  display: flex;
  flex-direction: column;
}

.sender-panel .form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sender-panel textarea[name="body"] {
  min-height: 38vh;
  flex: 1;
}

@media (min-width: 860px) {
  .sender-panel {
    max-width: 560px;
    margin: 0 auto;
  }
}

.sender-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.sender-info {
  display: grid;
  gap: 6px;
}

.sender-info h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
}

.sender-headline {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.vibe-pill.compact {
  padding: 6px 10px;
  font-size: 10px;
}

.privacy-note {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.consent-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.consent-card {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  padding: 12px 8px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 140ms ease;
}

.consent-card:hover {
  transform: translateY(-1px);
}

.consent-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.consent-card-icon {
  font-size: 20px;
  line-height: 1;
}

.consent-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.consent-card-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.consent-info {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(18, 18, 21, 0.04);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.dashboard-header {
  display: grid;
  gap: 16px;
}

.share-strip {
  display: grid;
  gap: 10px;
}

.stats-inline {
  color: var(--muted);
  font-size: 14px;
}

.empty-panel,
.onboard-panel,
.success-panel {
  text-align: center;
  place-items: center;
}

.empty-panel strong,
.success-panel h3 {
  font-size: 28px;
}

.success-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(47, 138, 88, 0.12);
  color: var(--success);
  font-size: 24px;
}

.hook-card {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 111, 60, 0.18);
  background: var(--accent-soft);
}

.mission-card strong {
  font-family: var(--display);
  font-size: 28px;
}

.onboard-panel p {
  margin: 0;
  max-width: 32ch;
  color: var(--muted);
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar.compact {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.ember {
  background: linear-gradient(135deg, #16171c, #ff6f3c);
}

.avatar.sand {
  background: linear-gradient(135deg, #4b351e, #cf9951);
}

.avatar.mint {
  background: linear-gradient(135deg, #15332e, #4cc59b);
}

.avatar.pearl {
  background: linear-gradient(135deg, #283045, #a7b1de);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 10px 0;
  background: rgba(250, 247, 241, 0.88);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.footer a {
  text-decoration: none;
  font-size: 13px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(18, 18, 21, 0.94);
  color: #fff;
  box-shadow: var(--shadow);
}

button[disabled] {
  opacity: 0.46;
  cursor: not-allowed;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html[data-theme="dark"] {
  --bg: #111114;
  --bg-2: #17171c;
  --surface: rgba(28, 29, 36, 0.92);
  --surface-strong: rgba(34, 35, 44, 0.96);
  --ink: #eeeae2;
  --muted: #b0aca4;
  --line: rgba(238, 234, 226, 0.13);
  --accent-soft: rgba(255, 111, 60, 0.18);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 184, 92, 0.06), transparent 24%),
    radial-gradient(circle at 100% 10%, rgba(255, 111, 60, 0.08), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .mini-profile,
html[data-theme="dark"] .story-preview {
  border-color: rgba(238, 234, 226, 0.1);
  background: rgba(28, 30, 38, 0.94);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(22, 23, 30, 0.9);
  color: var(--ink);
  border-color: rgba(238, 234, 226, 0.12);
}

html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .tab,
html[data-theme="dark"] .prompt-chip,
html[data-theme="dark"] .hero-chip,
html[data-theme="dark"] .hero-step,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .mini-profile,
html[data-theme="dark"] .story-preview,
html[data-theme="dark"] .mode-card,
html[data-theme="dark"] .hint-box,
html[data-theme="dark"] .unlock-card,
html[data-theme="dark"] .empty-inline {
  background: rgba(34, 35, 44, 0.9);
  color: var(--ink);
  border-color: rgba(238, 234, 226, 0.1);
}

html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .filter-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

html[data-theme="dark"] .ghost-button.strong {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

html[data-theme="dark"] .lang-btn.active {
  background: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .lang-switch {
  background: rgba(238, 234, 226, 0.06);
  border-color: rgba(238, 234, 226, 0.1);
}

html[data-theme="dark"] .toggle-box,
html[data-theme="dark"] .consent-box {
  background: rgba(238, 234, 226, 0.06);
  border-color: rgba(238, 234, 226, 0.08);
}

html[data-theme="dark"] .note-body,
html[data-theme="dark"] .profile-main h2,
html[data-theme="dark"] .sender-info h2,
html[data-theme="dark"] .mini-copy strong,
html[data-theme="dark"] .unlock-card strong,
html[data-theme="dark"] .story-preview strong {
  color: var(--ink);
}

html[data-theme="dark"] .theme-ember .vibe-pill,
html[data-theme="dark"] .theme-ember .meter-fill {
  background: linear-gradient(90deg, rgba(255, 111, 60, 0.28), rgba(255, 184, 92, 0.22));
  color: #ffd4c3;
}

html[data-theme="dark"] .theme-sand .vibe-pill,
html[data-theme="dark"] .theme-sand .meter-fill {
  background: linear-gradient(90deg, rgba(211, 156, 78, 0.28), rgba(237, 196, 110, 0.22));
  color: #ffe0b0;
}

html[data-theme="dark"] .theme-mint .vibe-pill,
html[data-theme="dark"] .theme-mint .meter-fill {
  background: linear-gradient(90deg, rgba(76, 197, 155, 0.28), rgba(136, 224, 198, 0.22));
  color: #d1fff2;
}

html[data-theme="dark"] .theme-pearl .vibe-pill,
html[data-theme="dark"] .theme-pearl .meter-fill {
  background: linear-gradient(90deg, rgba(167, 177, 222, 0.28), rgba(197, 207, 241, 0.22));
  color: #e0e6ff;
}

html[data-theme="dark"] .link-card {
  background: rgba(238, 234, 226, 0.1);
  color: var(--ink);
}

html[data-theme="dark"] .tag,
html[data-theme="dark"] .rank-pill,
html[data-theme="dark"] .mini-metric,
html[data-theme="dark"] .stat-strip span {
  background: rgba(238, 234, 226, 0.08);
  color: var(--muted);
}

html[data-theme="dark"] .tag.accent {
  color: var(--accent);
  background: var(--accent-soft);
}

html[data-theme="dark"] .tag.warn {
  color: #f5c77d;
  background: rgba(201, 137, 44, 0.18);
}

html[data-theme="dark"] .tag.ghost {
  color: #e8b0b9;
  background: rgba(139, 87, 96, 0.16);
}

html[data-theme="dark"] .footer {
  background: rgba(17, 17, 20, 0.88);
  border-color: rgba(238, 234, 226, 0.08);
}

html[data-theme="dark"] .show-more-btn {
  background: rgba(34, 35, 44, 0.9);
  border-color: rgba(238, 234, 226, 0.1);
  color: var(--muted);
}

html[data-theme="dark"] .consent-card {
  background: rgba(34, 35, 44, 0.9);
  border-color: rgba(238, 234, 226, 0.1);
}

html[data-theme="dark"] .consent-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

html[data-theme="dark"] .consent-info {
  background: rgba(238, 234, 226, 0.06);
  border-color: rgba(238, 234, 226, 0.08);
}

@media (max-width: 860px) {
  .grid.two,
  .story-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(calc(100% - 12px), 960px);
    padding-top: 8px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-chip-row,
  .hero-steps,
  .guess-form {
    grid-template-columns: 1fr;
  }

  .hero-steps {
    flex-direction: column;
  }

  .filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .panel,
  .hero {
    padding: 16px;
    border-radius: 24px;
  }

  .profile-top,
  .owner-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-row {
    gap: 12px;
  }

  .sender-panel {
    max-width: 100%;
  }

  .consent-cards {
    grid-template-columns: 1fr;
  }
}
