:root {
  --void: #12100e;
  --void-2: #1b1815;
  --paper: #f6efe3;
  --paper-2: #efe5d5;
  --ink: #17130f;
  --ink-soft: #6d6157;
  --stamp: #c0341d;
  --stamp-soft: rgba(192, 52, 29, 0.14);
  --gold: #e0a53f;
  --line: rgba(23, 19, 15, 0.14);
  --display: "Instrument Serif", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Instrument Serif has no Devanagari, so Hindi fell back to whatever serif the
   device had — on the one element, the notice, where the face is the joke.
   Tiro Devanagari Hindi is the matched serif and carries the same italic. */
html[lang="hi"] {
  --display: "Tiro Devanagari Hindi", "Nirmala UI", "Noto Serif Devanagari", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--paper);
  font-family: var(--ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Warm ambient glow behind everything */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 45vh at 50% -5%, rgba(224, 165, 63, 0.16), transparent 70%),
    radial-gradient(45vw 40vh at 85% 15%, rgba(192, 52, 29, 0.13), transparent 70%);
}

.wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  padding: 56px 16px 72px;
}

/* ---------- Header ---------- */

header { text-align: center; margin-bottom: 32px; }

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

h1 em {
  font-style: italic;
  color: var(--stamp);
  position: relative;
  white-space: nowrap;
}

h1 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.1em;
  height: 2px;
  background: currentColor;
  opacity: 0.45;
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 700ms 350ms cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes underline { to { transform: scaleX(1); } }

.tagline {
  margin: 0 auto;
  max-width: 44ch;
  color: rgba(246, 239, 227, 0.62);
  font-size: 1rem;
}

/* ---------- Input panel ---------- */

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(246, 239, 227, 0.12);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  backdrop-filter: blur(6px);
}

label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
}

label em { font-style: italic; color: var(--gold); }

.second-label { margin-top: 16px; }

input[type="text"] {
  width: 100%;
  padding: 15px 16px;
  font-size: 1.05rem;
  font-family: var(--ui);
  color: var(--paper);
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(246, 239, 227, 0.16);
  border-radius: 12px;
  transition: border-color 160ms, box-shadow 160ms;
}

input[type="text"]::placeholder { color: rgba(246, 239, 227, 0.32); }
input[type="text"]:hover { border-color: rgba(246, 239, 227, 0.3); }

input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(224, 165, 63, 0.18);
}

input[type="date"] {
  width: 100%;
  padding: 15px 16px;
  font-size: 1.05rem;
  font-family: var(--mono);
  color: var(--paper);
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(246, 239, 227, 0.16);
  border-radius: 12px;
  transition: border-color 160ms, box-shadow 160ms;
}

input[type="date"]:hover { border-color: rgba(246, 239, 227, 0.3); }

input[type="date"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(224, 165, 63, 0.18);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}

.quick-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

.chip {
  flex: 1 1 auto;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--ui);
  color: rgba(246, 239, 227, 0.75);
  background: rgba(246, 239, 227, 0.05);
  border: 1px solid rgba(246, 239, 227, 0.14);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms, background 140ms, color 140ms, border-color 140ms;
}

@media (max-width: 430px) {
  .chip { flex: 1 1 calc(50% - 4px); }
}

.chip:hover {
  color: var(--paper);
  border-color: rgba(224, 165, 63, 0.6);
  transform: translateY(-1px);
}

.chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #1b1408;
  font-weight: 600;
}

.primary-btn {
  position: relative;
  width: 100%;
  padding: 17px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--ui);
  letter-spacing: 0.01em;
  color: #fff6ec;
  background: linear-gradient(180deg, #d94227, #ad2d14);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(192, 52, 29, 0.85), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform 120ms, box-shadow 160ms, filter 160ms;
}

.primary-btn:hover { filter: brightness(1.07); box-shadow: 0 12px 28px -8px rgba(192, 52, 29, 0.95), inset 0 1px 0 rgba(255,255,255,0.28); }
.primary-btn:active { transform: translateY(2px) scale(0.995); }

input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.error {
  margin: 14px 0 0;
  padding: 11px 14px;
  background: rgba(192, 52, 29, 0.16);
  border-left: 3px solid var(--stamp);
  border-radius: 0 8px 8px 0;
  color: #ffc9bc;
  font-size: 0.92rem;
}

/* ---------- The notice (result) ---------- */

.notice {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 26px 24px 22px;
  margin-bottom: 22px;
  text-align: center;
  box-shadow:
    0 26px 50px -22px rgba(0,0,0,0.75),
    0 2px 0 rgba(255,255,255,0.05);
  animation: issue 520ms cubic-bezier(.2,.9,.3,1.2) both;
}

/* paper grain + torn top edge feel */
.notice::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.notice > * { position: relative; }

@keyframes issue {
  from { opacity: 0; transform: translateY(16px) scale(0.97) rotate(-0.4deg); }
  to   { opacity: 1; transform: none; }
}

.notice-head {
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-soft);
}

.notice-ref {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  opacity: 0.6;
}

.stamp {
  position: absolute;
  top: -18px;
  right: -12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 118px;
  height: 72px;
  padding: 6px;
  color: #a82a11;
  border: 3px double currentColor;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 0 0 99px rgba(192, 52, 29, 0.08);
  transform: rotate(-13deg);
  opacity: 1;
  z-index: 2;
  pointer-events: none;
}

.stamp-main {
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stamp-sub {
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.stamp.hit { animation: slam 460ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes slam {
  0%   { opacity: 0; transform: rotate(-30deg) scale(2.6); }
  55%  { opacity: 0.95; transform: rotate(-11deg) scale(0.94); }
  75%  { transform: rotate(-14deg) scale(1.04); }
  100% { opacity: 0.88; transform: rotate(-13deg) scale(1); }
}

.notice-subject {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink);
  word-break: break-word;
}

.result-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.fake-date {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 8.5vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 8px 0 10px;
  color: var(--ink);
}

.countdown {
  margin: 0 0 22px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.countdown strong {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--stamp);
}

.dot { margin: 0 7px; opacity: 0.45; }

/* ---------- Reason ---------- */

.reason {
  padding: 16px 18px;
  margin-bottom: 20px;
  text-align: left;
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
}

.reason-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.reason p {
  margin: 0;
  font-family: var(--display);
  font-size: 1.22rem;
  line-height: 1.38;
}

.reason.swap { animation: swap 380ms ease both; }

@keyframes swap {
  0%   { opacity: 0; transform: translateX(-8px); }
  100% { opacity: 1; transform: none; }
}

/* ---------- Actions ---------- */

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

.actions button {
  flex: 1 1 130px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-family: var(--ui);
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms, transform 120ms;
}

.actions button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}

.actions button:active { transform: translateY(1px); }

/* ---------- Add-to-calendar menu ---------- */

.cal-wrap {
  position: relative;
  flex: 1 1 130px;
  display: flex;
}

.cal-wrap > button { flex: 1 1 auto; }

.cal-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  min-width: 232px;
  padding: 6px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.55);
  animation: calIn 140ms ease both;
}

@keyframes calIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* Near the right edge the menu would otherwise run off a phone screen. */
@media (max-width: 520px) {
  .cal-menu { min-width: 0; width: max(232px, 100%); }
}

.cal-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-family: var(--ui);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.cal-item:hover,
.cal-item:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* The .ics entry is the fallback, not a peer of the one-click services. */
#cal-ics {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  border-radius: 0 0 8px 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.feedback {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stamp);
}

.feedback.warn { color: var(--ink-soft); letter-spacing: 0.08em; }

.fine-print {
  margin: 20px 0 0;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- The real date, behind a deliberate hold ---------- */

.reveal-btn {
  padding: 4px 2px;
  font-family: var(--ui);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 1px dotted currentColor;
  cursor: help;
  opacity: 0.75;
  transition: opacity 160ms, color 160ms;

  /* A long press must not select the text or raise iOS's callout menu. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.reveal-btn:hover { opacity: 1; color: var(--stamp); }

/* Something has to happen during the hold, or it reads as a dead control. */
.reveal-btn.holding {
  color: var(--stamp);
  opacity: 1;
  animation: holdPulse 900ms linear both;
}

@keyframes holdPulse {
  from { box-shadow: inset 0 -1px 0 rgba(192, 52, 29, 0); }
  to   { box-shadow: inset 0 -22px 0 rgba(192, 52, 29, 0.12); }
}

.real-reveal {
  display: block;
  margin-top: 8px;
  color: var(--stamp);
  /* visibility, not display: screen readers skip it while hidden, and the
     live region still announces it when it appears. */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 200ms, transform 200ms, visibility 0s linear 200ms;
}

.real-reveal.shown {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 200ms, transform 200ms, visibility 0s;
}

/* ---------- Explainer + footer ---------- */

/* ---------- Saved deadlines ---------- */

.saved {
  margin: 26px 0;
  padding: 22px;
  border: 1px solid rgba(246, 239, 227, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.saved-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.saved-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--paper);
}

.clear-all {
  padding: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.4);
  background: none;
  border: none;
  cursor: pointer;
}

.clear-all:hover { color: var(--stamp); }

.saved-list { list-style: none; margin: 0; padding: 0; }

.saved-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(246, 239, 227, 0.09);
}

.saved-item:last-child { border-bottom: none; }
.saved-item.past { opacity: 0.45; }

.saved-main { flex: 1 1 auto; min-width: 0; }

.saved-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.saved-when {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.saved-item.past .saved-when { color: rgba(246, 239, 227, 0.5); }

/* How much runway is left. Full only on the day it was issued, which is why
   this belongs here rather than on the freshly-issued notice. */
.runway {
  height: 5px;
  margin: 9px 0 10px;
  border-radius: 999px;
  background: rgba(246, 239, 227, 0.09);
  overflow: hidden;
}

.runway-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d94227, var(--gold));
  transition: width 600ms cubic-bezier(.22,1,.36,1);
}

.runway.low .runway-fill { background: var(--stamp); }

.saved-why {
  display: block;
  font-size: 0.86rem;
  color: rgba(246, 239, 227, 0.45);
  overflow-wrap: anywhere;
}

.saved-reveal {
  display: inline-block;
  margin-top: 9px;
  font-size: 0.72rem;
  color: rgba(246, 239, 227, 0.38);
}

.saved-reveal:hover { color: var(--gold); }
.saved-reveal.holding { color: var(--gold); }

.saved-real {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--gold);
}

.saved-remove {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(246, 239, 227, 0.4);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.saved-remove:hover {
  color: var(--stamp);
  border-color: rgba(192, 52, 29, 0.4);
}

.saved-privacy {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(246, 239, 227, 0.12);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(246, 239, 227, 0.45);
}

.saved-privacy strong { color: rgba(246, 239, 227, 0.75); }

.storage-warning {
  margin: 20px 0;
  padding: 12px 15px;
  background: rgba(224, 165, 63, 0.1);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: rgba(246, 239, 227, 0.65);
}

/* ---------- The deeper reading, folded away ---------- */

.deep { margin: 34px 0 22px; }

.deep-intro {
  margin: 0 0 14px;
  font-size: 0.94rem;
  color: rgba(246, 239, 227, 0.45);
}

.deep-item {
  border-bottom: 1px solid rgba(246, 239, 227, 0.1);
}

.deep-item:first-of-type { border-top: 1px solid rgba(246, 239, 227, 0.1); }

.deep-item > summary {
  position: relative;
  list-style: none;
  padding: 15px 34px 15px 0;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.22rem;
  line-height: 1.3;
  color: rgba(246, 239, 227, 0.88);
  transition: color 140ms;
}

/* The label is an <h2> so the page keeps a real outline for crawlers; it must
   look exactly like the plain text it replaced. */
.deep-item > summary > h2 {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  margin: 0;
  padding: 0;
  display: inline;
}

.deep-item > summary::-webkit-details-marker { display: none; }
.deep-item > summary:hover { color: var(--gold); }

/* A plus that becomes a minus, drawn rather than typed so it stays crisp. */
.deep-item > summary::after,
.deep-item > summary::before {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 13px;
  height: 2px;
  background: currentColor;
  opacity: 0.55;
  transition: transform 200ms ease, opacity 140ms;
}

.deep-item > summary::before { transform: translateY(-50%); }
.deep-item > summary::after { transform: translateY(-50%) rotate(90deg); }
.deep-item[open] > summary::after { transform: translateY(-50%) rotate(0deg); }
.deep-item[open] > summary { color: var(--gold); }

.deep-body {
  padding: 0 0 18px;
  color: rgba(246, 239, 227, 0.72);
  animation: deepOpen 220ms ease both;
}

@keyframes deepOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.deep-body p { margin: 0 0 14px; font-size: 1rem; }
.deep-body p:last-child { margin-bottom: 0; }
.deep-body strong { color: var(--paper); font-weight: 600; }
.deep-body em { font-style: italic; }
.deep-body ul { margin: 0 0 14px; padding-left: 20px; }
.deep-body li { margin-bottom: 8px; }

.deep-body code {
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(246, 239, 227, 0.08);
  border-radius: 5px;
  color: var(--paper);
}

.refs {
  padding-left: 18px;
  font-size: 0.88rem;
  color: rgba(246, 239, 227, 0.5);
}

.refs li { margin-bottom: 11px; }

/* ---------- Money blocks ---------- */

.ad-slot { margin: 26px 0; min-height: 0; text-align: center; }

.ad-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.3);
}

.aff-box {
  margin: 26px 0;
  padding: 20px 22px;
  border: 1px solid rgba(224, 165, 63, 0.28);
  border-radius: 14px;
  background: rgba(224, 165, 63, 0.05);
}

.aff-box h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--paper);
}

.aff-intro {
  margin: 0 0 14px;
  font-size: 0.94rem;
  color: rgba(246, 239, 227, 0.6);
}

.aff-list { list-style: none; margin: 0; padding: 0; }

.aff-list li {
  padding: 9px 0;
  border-top: 1px solid rgba(246, 239, 227, 0.09);
}

.aff-list li:first-child { border-top: none; }

.aff-list a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}

.aff-list a:hover { text-decoration: underline; }

.aff-note {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  color: rgba(246, 239, 227, 0.45);
}

.aff-disclosure {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(246, 239, 227, 0.09);
  font-size: 0.76rem;
  color: rgba(246, 239, 227, 0.4);
}

.tip-link {
  display: inline-block;
  margin-bottom: 16px;
  padding: 9px 18px;
  border: 1px solid rgba(224, 165, 63, 0.45);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--gold);
  text-decoration: none;
  transition: background 140ms;
}

.tip-link:hover { background: rgba(224, 165, 63, 0.12); }

.foot-nav {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-bottom: 12px;
}

.foot-nav a {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.5);
  text-decoration: none;
}

.foot-nav a:hover { color: var(--gold); }

footer {
  margin-top: 30px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: rgba(246, 239, 227, 0.32);
}

.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Language switcher ---------- */

.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: center;
  margin: 0 0 14px;
  font-size: 0.78rem;
}

.lang-switcher a {
  color: rgba(246, 239, 227, 0.42);
  text-decoration: none;
}

.lang-switcher a:hover { color: var(--gold); }

.lang-current {
  color: var(--gold);
  font-weight: 600;
}

/* ---------- Right-to-left ----------
 *
 * Only the rules with a hard-coded side need flipping; everything else is
 * already direction-agnostic. Arabic reads right-to-left, so a stamp pinned to
 * the right corner and a rule bordered on the left both land on the wrong
 * side of the page without these.
 */

[dir="rtl"] .notice-head,
[dir="rtl"] .notice-subject,
[dir="rtl"] .reason,
[dir="rtl"] .cal-menu,
[dir="rtl"] .cal-item,
[dir="rtl"] .deep-item > summary,
[dir="rtl"] .deep-body { text-align: right; }

[dir="rtl"] .stamp {
  right: auto;
  left: -12px;
  transform: rotate(13deg);
}

[dir="rtl"] .stamp.hit { animation-name: slamRtl; }

@keyframes slamRtl {
  0%   { opacity: 0; transform: rotate(30deg) scale(2.6); }
  55%  { opacity: 0.95; transform: rotate(11deg) scale(0.94); }
  75%  { transform: rotate(14deg) scale(1.04); }
  100% { opacity: 0.92; transform: rotate(13deg) scale(1); }
}

[dir="rtl"] .reason {
  border-left: none;
  border-right: 3px solid var(--gold);
  border-radius: 10px 0 0 10px;
}

[dir="rtl"] .error {
  border-left: none;
  border-right: 3px solid var(--stamp);
  border-radius: 8px 0 0 8px;
}

[dir="rtl"] .storage-warning {
  border-left: none;
  border-right: 3px solid var(--gold);
  border-radius: 8px 0 0 8px;
}

[dir="rtl"] .cal-menu { left: auto; right: 0; }

[dir="rtl"] .deep-item > summary { padding: 15px 0 15px 34px; }
[dir="rtl"] .deep-item > summary::after,
[dir="rtl"] .deep-item > summary::before { right: auto; left: 6px; }

[dir="rtl"] .refs,
[dir="rtl"] .deep-body ul { padding-left: 0; padding-right: 18px; }

/* The reference number is an ASCII code; it stays left-to-right inside an
   otherwise right-to-left page. */
[dir="rtl"] .notice-ref { direction: ltr; text-align: left; }
