:root {
  --bg: #0e0c0a;
  --bg-grid: #17130f;
  --panel: #151210;
  --line: #2b2420;
  --line-soft: #201b17;
  --gold: #e8a33d;
  --gold-soft: #caa06a;
  --cinnamon: #d9895f;
  --text: #f4ede2;
  --text-dim: #948a7c;
  --text-faint: #5c554c;
  --success: #7fb894;
  --error: #d9695f;
  --radius: 10px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--font-body);
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 400px;
}

.logo {
  display: block;
  height: 96px;
  margin: 0 auto 28px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cinnamon), var(--gold) 50%, var(--gold-soft));
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 24px 0;
}

.step {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.2s ease, width 0.2s ease;
}

.step.is-active {
  background: var(--gold);
  width: 28px;
}

.step.is-done {
  background: var(--gold-soft);
}

.panel {
  padding: 24px 24px 32px;
}

.hidden {
  display: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}

.title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 24px;
  line-height: 1.5;
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 18px;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
}

input[type="text"]::placeholder {
  color: var(--text-faint);
}

button {
  width: 100%;
  background: var(--gold);
  color: #241505;
  border: none;
  border-radius: 6px;
  padding: 14px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover {
  background: #f2b458;
}

button:active {
  transform: scale(0.985);
}

button:disabled {
  background: var(--line-soft);
  color: var(--text-faint);
  cursor: not-allowed;
}

.status {
  min-height: 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin: 14px 0 0;
  text-align: center;
}

.status.err { color: var(--error); }
.status.ok { color: var(--success); }

/* verification code box */
.code-box {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 18px 20px;
  margin-bottom: 20px;
}

.code-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.cmd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 10px 10px 16px;
  margin: 0 0 14px;
}

.cmd-row code {
  flex: 1;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  background: var(--panel);
  border-color: var(--gold-soft);
  color: var(--gold);
}

.copy-btn svg {
  width: 17px;
  height: 17px;
}

.icon-check {
  display: none;
}

.copy-btn.is-copied {
  border-color: var(--success);
  color: var(--success);
}

.copy-btn.is-copied .icon-copy {
  display: none;
}

.copy-btn.is-copied .icon-check {
  display: block;
}

.expiry {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin: 0;
}

/* logged in state */
.seal {
  width: 56px;
  height: 56px;
  margin: 4px auto 18px;
}

.seal svg {
  width: 100%;
  height: 100%;
}

.seal-ring {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
}

.seal-check {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verified-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 8px;
}

.name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  margin: 0 0 20px;
}

#logout-btn {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: underline;
  cursor: pointer;
}

#logout-btn:hover {
  color: var(--gold);
}

.footnote {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.5;
  margin: 12px 12px 0;
}

.legal {
  margin-top: 6px;
}

button:focus-visible,
input[type="text"]:focus-visible,
.copy-btn:focus-visible,
#logout-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .panel { padding: 22px 20px 28px; }
  .logo { height: 52px; }
}

/* --- search bar --- */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  margin: 22px 0 20px;
  transition: border-color 0.15s ease;
}

.search-wrap:focus-within {
  border-color: var(--gold);
}

.search-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

input.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  line-height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
  vertical-align: middle;
}

input.search-input:focus {
  outline: none;
}

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

/* --- account row --- */
.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.account-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  background: var(--bg);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-meta {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

.account-logout {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: underline;
  cursor: pointer;
}

.account-logout:hover {
  color: var(--gold);
}

/* ============ DASHBOARD (full screen) ============ */

#auth-view.hidden,
.dashboard.hidden {
  display: none;
}

.dashboard {
  min-height: 100vh;
  width: calc(100% + 48px);
  margin: -24px;
  display: flex;
  flex-direction: column;
}

.dash-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5vh 32px 0;
}

.dash-logo {
  height: 120px;
  width: auto;
}

.dash-logout {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: underline;
  cursor: pointer;
}

.dash-logout:hover {
  color: var(--gold);
}

.dash-hero {
  padding: 2vh 24px 2vh;
  text-align: center;
  background-image: radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 1px);
  background-size: 22px 22px;
}

.dash-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2vh;
  letter-spacing: -0.01em;
}

.search-container {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.dash-search {
  padding: 0 18px;
  border-radius: 10px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 20;
  text-align: left;
}

.search-suggestions.hidden {
  display: none;
}

.suggestion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.suggestion-row:hover,
.suggestion-row.is-active {
  background: var(--bg);
}

.suggestion-row + .suggestion-row {
  border-top: 1px solid var(--line-soft);
}

.suggestion-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.suggestion-name {
  font-size: 13px;
  color: var(--text);
}

.suggestion-empty {
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.dash-search input.search-input {
  height: 52px;
  line-height: 52px;
  font-size: 15px;
}

.dash-search .search-icon {
  width: 18px;
  height: 18px;
}

.dash-body {
  flex: 1;
  padding: 8px 24px 36px;
}

.dash-grid {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: start;
}

.dash-col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* --- activity feed --- */
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.activity-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.activity-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
}

.activity-body {
  min-width: 0;
}

.activity-line {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
}

.activity-name {
  font-weight: 600;
}

.activity-meta {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 2px;
}

.tag-legit {
  color: var(--success);
  background: rgba(127, 184, 148, 0.14);
}

.tag-scam {
  color: var(--error);
  background: rgba(217, 105, 95, 0.14);
}

/* --- stats side panel --- */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.stat-row-last {
  border-bottom: none;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-dim);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.stat-value-good {
  color: var(--text-faint);
}

.side-link {
  display: block;
  margin-top: 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}

.side-link:hover {
  color: #f2b458;
}

/* --- hero avatar --- */
.dash-avatar {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 12px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
}

.dash-grid.hidden {
  display: none;
}

@media (max-width: 700px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .dash-nav { padding: 14px 18px; }
  .dash-hero { padding: 48px 20px 32px; }
  .dash-name { font-size: 26px; }
}

/* ============ LANDING PAGE ============ */

body.landing-active {
  display: block;
  padding: 0;
}

.landing-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

#landing-view {
  position: relative;
  width: calc(100% + 48px);
  margin: -24px;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.landing-nav {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 2vh 24px 0;
}

.landing-logo {
  height: clamp(70px, 12vh, 216px);
  width: auto;
}

.landing-hero {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 2vh 24px 4vh;
  text-align: center;
}

.landing-eyebrow {
  text-align: center;
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vh, 46px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 1.5vh;
}

.landing-sub {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto 2vh;
}

.landing-cta {
  width: auto;
  display: inline-block;
  padding: 13px 32px;
  font-size: 15px;
}

.landing-note {
  font-size: 12px;
  color: var(--text-faint);
  margin: 1.5vh 0 0;
}

.landing-how {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 3vh 24px 4vh;
  border-top: 1px solid var(--line);
}

.how-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 2vh;
}

#landing-view.hidden {
  display: none;
}

.how-item {
  text-align: left;
}

.how-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  margin-bottom: 14px;
}

.how-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.how-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

.landing-footer {
  position: relative;
  padding: 0 24px 40px;
}

.landing-footer .footnote {
  margin: 0;
}

@media (max-width: 720px) {
  .landing-title { font-size: 34px; }
  .how-row { grid-template-columns: 1fr; gap: 32px; }
  .landing-how { padding: 44px 24px 56px; }
}

/* --- search results panel --- */
.back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 18px;
  cursor: pointer;
}

.back-link:hover {
  color: var(--gold);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.profile-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin: 4px 0 0;
}

.empty-state {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  padding: 20px 0 4px;
}

/* ============ DEDICATED PROFILE PAGE ============ */

body.profile-page {
  display: block;
  padding: 0;
}

.profile-page-wrap {
  min-height: 100vh;
  width: 100%;
}

.profile-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 32px 0;
}

.profile-nav-logo {
  height: 120px;
  width: auto;
}

.profile-back {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.profile-back:hover {
  background: transparent;
  color: var(--gold);
}

.profile-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 40px 36px;
}

.profile-banner {
  text-align: center;
  padding: 64px 24px 40px;
}

.profile-banner-avatar {
  display: block;
  width: 108px;
  height: 108px;
  margin: 0 auto 20px;
  border-radius: 18px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
}

.profile-banner-name {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.profile-banner-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 0 18px;
}

.profile-score {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(232, 163, 61, 0.12);
  border: 1px solid var(--gold-soft);
  padding: 6px 16px;
  border-radius: 100px;
}

.profile-content {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

.profile-col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
}

@media (max-width: 800px) {
  .profile-nav { padding: 2vh 20px 0; }
  .profile-main { padding: 0 20px 60px; }
  .profile-banner { padding: 44px 16px 32px; }
  .profile-banner-name { font-size: 30px; }
  .profile-content { grid-template-columns: 1fr; }
}

/* --- vouch box (on profile page) --- */
.vouch-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.vouch-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.vouch-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.vouch-btn {
  flex: 1;
  width: auto;
  padding: 10px 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--line);
}

.vouch-btn-legit.is-selected {
  background: rgba(127, 184, 148, 0.16);
  border-color: var(--success);
  color: var(--success);
}

.vouch-btn-scam.is-selected {
  background: rgba(217, 105, 95, 0.16);
  border-color: var(--error);
  color: var(--error);
}

input.vouch-context {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  margin-bottom: 10px;
  -webkit-appearance: none;
  appearance: none;
}

input.vouch-context:focus {
  outline: none;
  border-color: var(--gold);
}

input.vouch-context::placeholder {
  color: var(--text-faint);
}

.vouch-delete {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
  padding: 9px 10px;
  margin-top: 4px;
}

.vouch-delete:hover {
  border-color: var(--error);
  color: var(--error);
}

.dash-single {
  max-width: 480px;
  margin: 0 auto;
}

/* ============ MODAL, TOAST, GIVEN/RECEIVED LAYOUT ============ */

.profile-content {
  align-items: start;
}

.profile-col-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vouch-open-btn {
  margin-top: 22px;
  width: 100%;
}

/* --- modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-close {
  width: auto;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

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

.modal-body {
  padding: 18px 22px 22px;
}

.modal-warning {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--gold);
  background: rgba(232, 163, 61, 0.1);
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 4px 0 14px;
}

.modal-warning.hidden {
  display: none;
}

.modal-save-btn {
  margin-top: 4px;
}

.modal-danger-zone {
  border-top: 1px solid var(--line-soft);
  padding: 16px 22px 20px;
}

.modal-danger-zone.hidden {
  display: none;
}

.modal-delete-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
  padding: 9px 10px;
}

.modal-delete-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

.modal-delete-confirm {
  margin-top: 12px;
}

.modal-delete-confirm.hidden {
  display: none;
}

.modal-delete-text {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.5;
}

.modal-delete-actions {
  display: flex;
  gap: 8px;
}

.modal-cancel-btn,
.modal-confirm-delete-btn {
  flex: 1;
  width: auto;
  padding: 9px 10px;
  font-size: 12.5px;
}

.modal-cancel-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}

.modal-confirm-delete-btn {
  background: var(--error);
  color: #2a0e0c;
  border: none;
}

/* --- toast --- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 12px 22px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.6);
  z-index: 200;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.toast.toast-ok {
  border-color: var(--success);
  color: var(--success);
}

.toast.toast-err {
  border-color: var(--error);
  color: var(--error);
}

/* ============ TERMS & PRIVACY PAGE ============ */

body.legal-page {
  display: block;
  padding: 0;
}

.legal-page-wrap {
  min-height: 100vh;
  width: 100%;
}

.legal-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 4vh 24px 36px;
}

.legal-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin: 0 0 36px;
}

.legal-section {
  margin-bottom: 30px;
}

.legal-section h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.legal-section p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.legal-section ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.legal-section li {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* --- site footer link: plain text, fixed to viewport bottom, no bar --- */
.site-footer-link {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 50;
  text-align: center;
  pointer-events: none;
}

.site-footer-link a {
  pointer-events: auto;
  font-size: 11.5px;
  color: var(--text-faint);
  text-decoration: underline;
}

.site-footer-link a:hover {
  color: var(--gold);
}