/* ============================================================
   TOKEN PAGES — confirm, unsubscribe, preferences

   Reached from an email, read once, then closed. So: one card,
   one message, one way out. No nav, no rail, no ads.
   ============================================================ */

.token-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding-block: var(--s10);
}

.token-card {
  width: 100%;
  max-width: 420px;
  padding: var(--s8) var(--s6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  text-align: center;
}

.token-card.wide {
  max-width: 520px;
  text-align: start;
}

.token-brand {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}

:root[lang='ar'] .token-brand,
[lang='ar'] .token-brand {
  letter-spacing: 0;
}

.token-title {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
  margin-top: var(--s4);
}

[lang='ar'] .token-title {
  font-size: 25px;
  line-height: 40px;
}

.token-body {
  margin-top: var(--s3);
  font-size: 15px;
  line-height: 25px;
  color: var(--text-2);
}

[lang='ar'] .token-body {
  font-size: 16px;
  line-height: 30px;
}

.token-email {
  margin-top: var(--s2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
}

.token-link {
  display: inline-block;
  margin-top: var(--s6);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast);
}

.token-link:hover {
  color: var(--accent);
}

/* -------------------------------------------------- preferences */

.pref-list {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
}

.pref-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  cursor: pointer;
}

.pref-row.threshold {
  flex-direction: column;
  gap: var(--s3);
  cursor: default;
}

.pref-row input[type='checkbox'] {
  /* Comfortably clickable without being a control that shouts. */
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: none;
}

.pref-row strong {
  display: block;
  font-size: 15px;
  font-weight: 550;
}

.pref-help {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 21px;
  color: var(--text-2);
}

.pref-row input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.pref-saved {
  margin-top: var(--s4);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.pref-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-top: var(--s7);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.pref-unsub {
  font-size: 13px;
  color: var(--text-3);
  transition: color var(--t-fast);
}

.pref-unsub:hover {
  color: var(--danger);
}

/* ==========================================================
   SIGNUP FORM
   Used once on the homepage. Deliberately quiet: the stories
   are the page, this is an offer beside them.
   ========================================================== */

.subscribe {
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.subscribe.compact {
  padding: 0;
  background: none;
  border: none;
}

.subscribe-heading {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}

[lang='ar'] .subscribe-heading {
  font-size: 21px;
  line-height: 36px;
}

.subscribe-blurb {
  margin-top: var(--s2);
  font-size: 14.5px;
  line-height: 23px;
  color: var(--text-2);
  max-width: 46ch;
}

[lang='ar'] .subscribe-blurb {
  font-size: 15.5px;
  line-height: 28px;
}

.subscribe-row {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s4);
  flex-wrap: wrap;
}

.subscribe-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: var(--s3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
}

.subscribe-input::placeholder {
  color: var(--text-3);
}

.subscribe-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.subscribe-btn {
  flex: none;
  padding: var(--s3) var(--s5);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-chip);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  transition: opacity var(--t-fast);
}

.subscribe-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.subscribe-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.subscribe-check {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin-top: var(--s3);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--text-2);
  cursor: pointer;
}

.subscribe-check input {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  accent-color: var(--accent);
  flex: none;
}

.subscribe-error {
  margin-top: var(--s3);
  font-size: 13.5px;
  color: var(--danger);
}

.subscribe-privacy {
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 18px;
  color: var(--text-3);
}

[lang='ar'] .subscribe-privacy {
  font-size: 12.5px;
  line-height: 21px;
}

/* Replaces the form on success: an empty field beside "check your
   inbox" invites a second submission. */
.subscribe-done {
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--accent-quiet);
  border-radius: var(--radius-card);
}

.subscribe-done-title {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--s2);
}

/* Telegram: the alternative, styled as a quiet link rather than a
   second button. Email stays the primary path. */
.subscribe-telegram {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s4);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast);
}

.subscribe-telegram:hover {
  color: var(--accent);
}

.subscribe-telegram svg {
  flex: none;
  opacity: 0.8;
}

.subscribe-telegram-note {
  color: var(--text-3);
  font-weight: 400;
}

/* Telegram as the primary signup, while email is hidden.
   One accent use here — the button — and the filter list stays quiet
   below it, so the block reads as one offer rather than two. */
.subscribe-tg-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-chip);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  transition: opacity var(--t-fast);
}

.subscribe-tg-btn:hover {
  opacity: 0.9;
  color: #ffffff;
}

.subscribe-tg-btn svg {
  flex: none;
}

.subscribe-tg-filters {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.subscribe-tg-filters-intro {
  font-size: 13.5px;
  line-height: 21px;
  color: var(--text-2);
}

.subscribe-tg-filters-list {
  margin-top: var(--s2);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subscribe-tg-filters-list li {
  font-size: 13.5px;
  line-height: 22px;
  color: var(--text-2);
  /* Logical property so the marker sits on the correct side in RTL. */
  padding-inline-start: var(--s4);
  position: relative;
}

.subscribe-tg-filters-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.subscribe-tg-filters-how {
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 18px;
  color: var(--text-3);
  /* Slash-prefixed commands are LTR even inside Arabic text. */
  unicode-bidi: isolate;
}

[lang='ar'] .subscribe-tg-filters-how {
  font-size: 12.5px;
  line-height: 21px;
}

/* ============================================================
   Accounts

   Deliberately restrained. An account is an upgrade, never a gate,
   so these pages must not feel like a wall — same surfaces, same
   rules, same accent budget as everything else.
   ============================================================ */

.auth-page {
  padding-block: var(--s10);
  max-width: 460px;
}

.auth-card {
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 32px;
  font-weight: 500;
  color: var(--text);
}

.auth-blurb {
  margin-top: var(--s2);
  font-size: 14.5px;
  line-height: 23px;
  color: var(--text-2);
}

/* Social first: most people use it, and putting the password fields
   first implies the email path is the expected one. */
.auth-providers {
  margin-top: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border-lift);
  border-radius: var(--radius-chip);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  transition: border-color var(--t-fast);
}

.auth-provider:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s5) 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-label {
  display: block;
  margin-top: var(--s4);
  margin-bottom: var(--s1);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

[lang='ar'] .auth-label {
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}

.auth-input {
  width: 100%;
  padding: var(--s3);
  background: var(--bg);
  border: 1px solid var(--border-lift);
  border-radius: var(--radius-chip);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-submit {
  display: block;
  width: 100%;
  margin-top: var(--s5);
  padding: var(--s3) var(--s5);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-chip);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  transition: opacity var(--t-fast);
}

.auth-submit:hover:not(:disabled) {
  opacity: 0.9;
  color: #ffffff;
}

.auth-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-error {
  margin-top: var(--s3);
  font-size: 13.5px;
  color: var(--danger);
}

.auth-alt {
  margin-top: var(--s5);
  font-size: 13.5px;
  color: var(--text-2);
  text-align: center;
}

.auth-alt a {
  color: var(--accent);
}

.auth-done {
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--accent-quiet);
  border-radius: var(--radius-card);
}

.auth-done-title {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--s2);
}

/* ---------------------------------------------------- account page */

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--border);
}

.account-email {
  margin-top: var(--s1);
  color: var(--text-3);
}

.account-signout {
  padding: var(--s2) var(--s4);
  border: 1px solid var(--border-lift);
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13.5px;
}

.account-signout:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.account-block {
  padding-block: var(--s6);
  border-bottom: 1px solid var(--border);
}

.account-h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.account-help {
  margin-top: var(--s1);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--text-2);
}

.account-label {
  margin-top: var(--s4);
  margin-bottom: var(--s2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

[lang='ar'] .account-label {
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}

.account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* Border and colour carry the on state. No fill: accent text on an
   accent tint is too low-contrast to read in either theme. */
.account-chip {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border-lift);
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition:
    border-color var(--t-fast),
    color var(--t-fast);
}

.account-chip.on {
  border-color: var(--accent);
  color: var(--accent);
}

.account-note {
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.account-saved {
  color: var(--accent);
}

.account-list {
  margin-top: var(--s3);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  font-size: 13.5px;
  color: var(--text-2);
  /* Usernames and platform names are LTR inside Arabic text. */
  unicode-bidi: isolate;
}

.account-secondary {
  margin-top: var(--s4);
  padding: var(--s2) var(--s4);
  border: 1px solid var(--border-lift);
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13.5px;
}

.account-secondary:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.account-danger {
  margin-top: var(--s4);
  padding: var(--s2) var(--s4);
  border: 1px solid var(--danger);
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--danger);
  font-family: var(--font-sans);
  font-size: 13.5px;
}

.account-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}

.account-danger:disabled {
  opacity: 0.5;
  cursor: wait;
}

.account-delete-error {
  color: var(--danger);
}

/* ============================================================
   Story image

   Optional throughout. Sits after the summary so the reader has
   the point in words before anything loads, and is capped in
   height so a tall source image cannot push the briefing off
   the screen.
   ============================================================ */

.story-image {
  margin-top: var(--s6);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.story-image img {
  display: block;
  width: 100%;
  height: auto;
  /* A 3000px-tall screenshot would otherwise bury what_changed. */
  max-height: 420px;
  object-fit: cover;
}

.story-image figcaption {
  padding: var(--s2) var(--s3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  /* A company name is LTR even inside Arabic text. */
  unicode-bidi: isolate;
}

[lang='ar'] .story-image figcaption {
  font-size: 12.5px;
}
