/* =====================================================================
   Farewell.fm — design system
   A warm, contemplative, editorial aesthetic: deep twilight surfaces,
   gold light, generous space, serif display type.
   ===================================================================== */

:root {
  /* Surfaces */
  --bg:        #0c0e14;
  --bg-2:      #11131c;
  --surface:   #171a25;
  --surface-2: #1e2230;
  --border:    rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);

  /* Text */
  --text:  #f3f0e9;
  --muted: #a6a5b2;
  --faint: #6f6e7c;

  /* Accents */
  --gold:      #d8b06b;
  --gold-soft: #e7cd96;
  --gold-deep: #b88f48;
  --rose:      #cf938c;
  --danger:    #e07a70;
  --ok:        #7bbf8e;
  --spotify:   #1db954;
  --facebook:  #1877f2;

  /* Shape & light */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --shadow:    0 18px 50px -20px rgba(0, 0, 0, .7);
  --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, .6);

  --maxw: 1140px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font-display: "Playfair Display", Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", "Noto Serif JP", "Yu Mincho", "Noto Naskh Arabic", "Tahoma", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans Arabic", "Geeza Pro", "Tahoma", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient background glow shared by all pages */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 78% -5%, rgba(216, 176, 107, .14), transparent 60%),
    radial-gradient(50% 45% at 8% 8%, rgba(207, 147, 140, .10), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gold);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600; font-size: .95rem;
  transition: transform .25s var(--ease), background .25s, box-shadow .25s, border-color .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep));
  color: #2a1f08;
  box-shadow: 0 12px 30px -12px rgba(216, 176, 107, .6);
}
.btn-primary:hover { box-shadow: 0 16px 38px -10px rgba(216, 176, 107, .75); transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.04); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.09); border-color: var(--gold); }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.02rem; }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-danger { background: rgba(224,122,112,.12); border-color: rgba(224,122,112,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(224,122,112,.2); }
.btn-facebook { background: var(--facebook); color: #fff; }
.btn-facebook:hover { background: #2d88ff; }
.btn-spotify { background: var(--spotify); color: #04210f; }
.btn-spotify:hover { background: #28d965; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(12, 14, 20, .72);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.brand .dot { color: var(--gold); }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--muted); font-size: .92rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: .8rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 7rem 0 6rem; overflow: hidden; }
.hero-media {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,14,20,.55) 0%, rgba(12,14,20,.82) 55%, var(--bg) 100%);
}
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 1.2rem 0 1.4rem; }
.hero h1 em { font-style: italic; color: var(--gold-soft); }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: #d9d6ce; max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }
.hero-note { margin-top: 1.3rem; font-size: .85rem; color: var(--faint); }

/* ---------- Sections ---------- */
section { padding: 5.5rem 0; }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head.center { margin-inline: auto; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin: .8rem 0 1rem; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* Concept split */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 4rem; align-items: center; }
.split-media { position: relative; }
.split-media img {
  width: 100%; height: 520px; object-fit: cover;
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.split-media .badge {
  position: absolute; bottom: -22px; left: -22px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 1rem 1.3rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: .8rem; max-width: 270px;
}
.split-media .badge .ic { font-size: 1.6rem; }
.split h2 { font-size: clamp(1.9rem, 3.5vw, 2.7rem); margin-bottom: 1.2rem; }
.split p { color: var(--muted); margin-bottom: 1.1rem; }
.checklist { list-style: none; margin-top: 1.6rem; display: grid; gap: .9rem; }
.checklist li { display: flex; gap: .8rem; align-items: flex-start; color: var(--text); }
.checklist li svg { flex: none; margin-top: 3px; color: var(--gold); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.step {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 2.2rem 1.8rem; position: relative; transition: transform .3s var(--ease), border-color .3s;
}
.step:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.step .num {
  font-family: var(--font-display); font-size: 2.6rem; color: var(--gold);
  opacity: .55; line-height: 1; margin-bottom: 1rem;
}
.step h3 { font-size: 1.35rem; margin-bottom: .6rem; }
.step p { color: var(--muted); font-size: .96rem; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.feature {
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); transition: transform .3s var(--ease), border-color .3s;
}
.feature:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.feature-img { height: 170px; background-size: cover; background-position: center; }
.feature-body { padding: 1.6rem; }
.feature-body h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.feature-body p { color: var(--muted); font-size: .94rem; }

/* CTA band */
.cta-band { position: relative; border-radius: var(--r-lg); overflow: hidden; padding: 5rem 2rem; text-align: center; }
.cta-band .bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -1; }
.cta-band .bg::after { content: ""; position: absolute; inset: 0; background: rgba(10,12,18,.7); }
.cta-band h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 1rem; }
.cta-band p { color: #d9d6ce; max-width: 560px; margin: 0 auto 2rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 3rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer .muted { font-size: .88rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-aside { position: relative; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside .bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -1; }
.auth-aside .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(12,14,20,.55), rgba(12,14,20,.9)); }
.auth-aside blockquote { font-family: var(--font-display); font-size: 1.7rem; font-style: italic; line-height: 1.4; max-width: 420px; }
.auth-aside cite { display: block; margin-top: 1rem; font-style: normal; font-size: .9rem; color: var(--muted); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.auth-card > p.sub { color: var(--muted); margin-bottom: 2rem; }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .45rem; color: var(--text); }
.field input {
  width: 100%; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); color: var(--text); font-size: .98rem;
  transition: border-color .2s, background .2s;
}
.field input:focus { outline: none; border-color: var(--gold); background: var(--surface-2); }
.field input::placeholder { color: var(--faint); }

.divider { display: flex; align-items: center; gap: 1rem; margin: 1.6rem 0; color: var(--faint); font-size: .82rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.social-row { display: grid; gap: .8rem; }
.alt-link { margin-top: 1.6rem; font-size: .92rem; color: var(--muted); text-align: center; }
.alt-link a { color: var(--gold-soft); font-weight: 600; }

.form-msg { padding: .8rem 1rem; border-radius: var(--r-sm); font-size: .9rem; margin-bottom: 1.2rem; display: none; }
.form-msg.error { display: block; background: rgba(224,122,112,.12); border: 1px solid rgba(224,122,112,.35); color: var(--danger); }
.form-msg.ok { display: block; background: rgba(123,191,142,.12); border: 1px solid rgba(123,191,142,.35); color: var(--ok); }

/* ---------- App dashboard ---------- */
.app-shell { padding: 2.5rem 0 5rem; }
.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.playlist-title-input {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 600;
  background: transparent; border: none; color: var(--text); width: 100%;
  border-bottom: 2px dashed transparent; padding: .2rem 0; letter-spacing: -.01em;
}
.playlist-title-input:focus { outline: none; border-bottom-color: var(--border-strong); }
.playlist-message {
  margin-top: .6rem; width: 100%; resize: vertical; min-height: 54px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--muted); padding: .7rem .9rem; font-family: inherit; font-size: .95rem;
}
.playlist-message:focus { outline: none; border-color: var(--gold); color: var(--text); }

.toolbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.app-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: start; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.6rem; }
.panel h3 { font-size: 1.3rem; margin-bottom: .3rem; }
.panel .panel-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; }

/* Track list */
.tracklist { display: flex; flex-direction: column; gap: .7rem; }
.track {
  display: grid; grid-template-columns: auto 56px 1fr auto; gap: .9rem; align-items: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: .7rem .9rem; transition: border-color .2s, transform .2s;
}
.track:hover { border-color: var(--border-strong); }
.track.dragging { opacity: .5; }
.track.drag-over { border-color: var(--gold); }
.track .handle { color: var(--faint); cursor: grab; font-size: 1.1rem; user-select: none; }
.track .art { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.track .meta { min-width: 0; }
.track .meta .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .meta .a { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .meta .moment { color: var(--gold); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.track .acts { display: flex; gap: .35rem; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--muted);
  transition: all .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,.08); }
.icon-btn.playing { color: var(--gold); border-color: var(--gold); }
.icon-btn.del:hover { color: var(--danger); border-color: rgba(224,122,112,.5); }

.empty {
  text-align: center; padding: 3rem 1rem; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
}
.empty .ic { font-size: 2.4rem; margin-bottom: .6rem; }

/* Search box + results */
.search-box { position: relative; margin-bottom: 1rem; }
.search-box input {
  width: 100%; padding: .9rem 1rem .9rem 2.7rem;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r);
  color: var(--text); font-size: .98rem;
}
.search-box input:focus { outline: none; border-color: var(--gold); }
.search-box .s-ic { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.chip {
  font-size: .82rem; padding: .4rem .85rem; border-radius: 999px;
  background: rgba(216,176,107,.1); border: 1px solid rgba(216,176,107,.25); color: var(--gold-soft);
  transition: all .2s;
}
.chip:hover { background: rgba(216,176,107,.2); }

.results { display: flex; flex-direction: column; gap: .5rem; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.result {
  display: grid; grid-template-columns: 48px 1fr auto auto; gap: .8rem; align-items: center;
  padding: .5rem; border-radius: var(--r); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.result:hover { background: var(--bg-2); border-color: var(--border); }
.result img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.result .t { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .a { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .add { color: var(--gold); }

.loader { text-align: center; color: var(--faint); padding: 2rem; font-size: .9rem; }
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--border-strong); border-top-color: var(--gold);
  border-radius: 50%; margin: 0 auto .6rem; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Share link row */
.share-link { display: flex; gap: .5rem; }
.share-link input {
  flex: 1; min-width: 0; padding: .6rem .8rem;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--gold-soft); font-size: .82rem; font-family: ui-monospace, monospace;
}
.share-link input:focus { outline: none; border-color: var(--gold); }

/* Stat strip */
.stats { display: flex; gap: 1.4rem; margin-top: .8rem; flex-wrap: wrap; }
.stat .n { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-soft); }
.stat .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6,7,11,.72); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 1.5rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  width: 100%; max-width: 460px; padding: 1.8rem; box-shadow: var(--shadow);
}
.modal h3 { font-size: 1.5rem; margin-bottom: .3rem; }
.modal .modal-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.3rem; }
.modal label { display: block; font-size: .82rem; font-weight: 600; margin: 1rem 0 .4rem; }
.modal select, .modal textarea, .modal input {
  width: 100%; padding: .7rem .9rem; background: var(--bg-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text);
  font-family: inherit; font-size: .95rem;
}
.modal textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: .7rem; margin-top: 1.6rem; justify-content: flex-end; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: .8rem 1.3rem; border-radius: 999px; box-shadow: var(--shadow); font-size: .92rem;
  animation: toast-in .3s var(--ease); max-width: 90vw;
}
.toast.ok { border-color: rgba(123,191,142,.5); }
.toast.error { border-color: rgba(224,122,112,.5); }
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } }

/* Language switcher */
.lang-select {
  font-family: inherit; font-size: .85rem; font-weight: 500;
  color: var(--text); background: rgba(255,255,255,.04);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: .45rem 1.6rem .45rem .85rem; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23a6a5b2' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
}
.lang-select:hover { border-color: var(--gold); }
.lang-select:focus { outline: none; border-color: var(--gold); }
.lang-select option { background: var(--surface); color: var(--text); }

/* User menu pill */
.user-pill { display: flex; align-items: center; gap: .6rem; padding: .35rem .35rem .35rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.03); }
.user-pill .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--gold); display: grid; place-items: center; color: #2a1f08; font-weight: 700; font-size: .9rem; }
.user-pill .name { font-size: .88rem; font-weight: 500; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .split { grid-template-columns: 1fr; gap: 2.5rem; }
  .split-media img { height: 360px; }
  .steps, .features { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .container { padding-inline: 18px; }
  .hero { padding: 5rem 0 4rem; }
  .track { grid-template-columns: auto 48px 1fr auto; }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; margin: 3rem auto 4rem; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 1.4rem; }
.legal h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold-soft); margin: 2rem 0 .6rem; }
.legal p, .legal li { color: var(--muted); line-height: 1.75; }
.legal p { margin-bottom: .8rem; }
.legal ul { margin: .4rem 0 1.1rem 1.4rem; display: grid; gap: .45rem; }
.legal a { color: var(--gold-soft); text-decoration: underline; }
.legal code { background: var(--surface-2); padding: .12rem .4rem; border-radius: 5px; font-size: .88em; color: var(--gold-soft); }
.legal-updated { font-size: .85rem; color: var(--faint); }
.legal-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: .88rem; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: .6rem .8rem; text-align: left; color: var(--muted); vertical-align: top; }
.legal-table th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.footer-links a { color: var(--gold-soft); }
.footer-links a:hover { text-decoration: underline; }
.donate-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--gold-soft); font-weight: 600; text-decoration: none;
  padding: .35rem .9rem; border: 1px solid rgba(216, 176, 107, .35);
  border-radius: 999px; margin-bottom: .7rem; transition: all .2s;
}
.donate-link:hover { background: rgba(216, 176, 107, .12); border-color: var(--gold); text-decoration: none; }

/* ---------- Cookie notice ---------- */
.cookie-banner {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 300; max-width: 720px; width: calc(100% - 32px);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 1rem 1.2rem; box-shadow: var(--shadow);
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  animation: toast-in .4s var(--ease);
}
.cookie-banner p { color: var(--muted); font-size: .86rem; flex: 1; min-width: 220px; margin: 0; }
.cookie-banner a { color: var(--gold-soft); text-decoration: underline; }
.cookie-banner .cb-actions { display: flex; gap: .5rem; }

/* ---------- RTL adjustments ---------- */
[dir="rtl"] .lang-select {
  padding: .45rem .85rem .45rem 1.6rem;
  background-position: left .7rem center;
}
[dir="rtl"] .auth-main .lang-switch { right: auto !important; left: 1.5rem !important; }
[dir="rtl"] .split-media .badge { left: auto; right: -22px; }
[dir="rtl"] .checklist li svg { transform: scaleX(-1); }
[dir="rtl"] .legal-table th, [dir="rtl"] .legal-table td { text-align: right; }

/* ---------- Mobile refinements ---------- */
.legal-table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; -webkit-overflow-scrolling: touch; }
.legal-table-wrap .legal-table { min-width: 440px; margin: 0; }

@media (max-width: 640px) {
  .nav { position: sticky; }
  .nav-inner { height: 62px; }
  .brand { font-size: 1.15rem; gap: .4rem; }
  .brand svg { width: 22px; height: 22px; }
  .nav-actions { gap: .45rem; }
  .nav-actions .btn-sm, .nav-actions .btn { padding: .45rem .85rem; font-size: .82rem; }
  .lang-select { font-size: .8rem; padding: .42rem 1.45rem .42rem .6rem; background-position: right .55rem center; }
  .user-pill { padding: .3rem; gap: 0; }
  .user-pill .name { display: none; }
  .split-media .badge { left: 10px; right: auto; bottom: -16px; max-width: 220px; }
  [dir="rtl"] .split-media .badge { right: 10px; left: auto; }
  .app-head { gap: 1rem; }
  .toolbar { width: 100%; }
  .footer-inner { flex-direction: column; text-align: center; gap: 1rem; }
  .footer-inner .footer-links { text-align: center; }
}

@media (max-width: 420px) {
  .nav-inner .brand svg { display: none; }       /* keep the wordmark, drop the icon */
  .brand { font-size: 1rem; }
  .nav-actions { gap: .3rem; }
  .nav-actions .btn-sm, .nav-actions .btn { padding: .4rem .62rem; font-size: .76rem; }
  .lang-select { font-size: .76rem; padding: .4rem 1.25rem .4rem .5rem; background-position: right .45rem center; }
  .hero h1 { font-size: 2.15rem; }
  .section-head h2, .split h2 { font-size: 1.7rem; }
  .cookie-banner { padding: .9rem 1rem; bottom: 10px; }
  .modal { padding: 1.3rem; }
  .track .acts { gap: .25rem; }
  .icon-btn { width: 34px; height: 34px; }
}
