/* Nexus Game — shared design system (loaded by every page) */

/* ===== Fonts =====
   Self-hosted (latin subset, variable weight): the CSP only allows fonts from
   'self', and it keeps visitors' requests away from third parties.
   Inter for text, Space Grotesk for display headings, JetBrains Mono for data. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/assets/fonts/inter.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/assets/fonts/space-grotesk.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/jetbrains-mono.woff2') format('woff2'); }
/* Arabic letters only (unicode-range): Latin text keeps the fonts above. */
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/assets/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ===== Tokens ===== */
:root {
  --bg: #07090f;
  --bg-2: #0b0e18;
  --surface: #0e111b;
  --surface-2: #141826;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .15);
  --field: rgba(255, 255, 255, .04);
  --text: #eef1f8;
  --muted: #8b93a7;
  --muted-2: #5f6678;
  --accent: #5b8cff;
  --accent-2: #8a7cff;
  --accent-soft: rgba(91, 140, 255, .14);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .12);
  --warning: #ffa726;
  --warning-soft: rgba(255, 167, 38, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  --grid-line: rgba(255, 255, 255, .022);
}
/* Arabic: Cairo for the Arabic letters, the Latin fonts for everything else.
   Letter spacing would break the joined Arabic script, so it is switched off. */
:root[lang="ar"] {
  --font: 'Inter', 'Cairo', 'Segoe UI', system-ui, sans-serif;
  --display: 'Space Grotesk', 'Cairo', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cairo', ui-monospace, monospace;
}
:root[lang="ar"] body * { letter-spacing: 0 !important; }
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --border: rgba(15, 23, 42, .1);
  --border-strong: rgba(15, 23, 42, .18);
  --field: rgba(15, 23, 42, .03);
  --text: #0f172a;
  --muted: #5a6478;
  --muted-2: #8a93a6;
  --accent-soft: rgba(59, 99, 235, .1);
  --shadow: 0 12px 30px rgba(15, 23, 42, .12);
  --grid-line: rgba(15, 23, 42, .035);
}

/* ===== Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  /* A faint blueprint grid behind every page. */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .15s, color .15s;
}
::selection { background: var(--accent-soft); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
.icon { width: 1.1em; height: 1.1em; flex: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
[data-hidden="true"] { display: none !important; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 1.12rem;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.brand img, .brand svg { width: 30px; height: 30px; }
.brand-word { display: inline-block; }
.brand .brand-accent {
  color: var(--accent);
  background: linear-gradient(90deg, #2f7bff, #8b3dff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 18px; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: color .12s, background .12s;
}
.site-nav .nav-num { font-family: var(--mono); font-size: .72rem; color: var(--muted-2); }
.site-nav a:hover { color: var(--text); background: var(--field); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.site-nav a[aria-current="page"] .nav-num { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-btn { width: auto !important; min-width: 38px; padding: 0 10px; font-family: var(--font); font-size: .82rem; font-weight: 700; }
:root[lang="ar"] .lang-btn { font-size: .74rem; }
.header-actions .btn-secondary, .header-actions .icon-btn { background: transparent; }

/* Signed-in customer chip: avatar initial, name, days left. */
.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding-block: 0; padding-inline: 5px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font-size: .86rem; font-weight: 600; max-width: 240px;
}
.user-chip:hover { border-color: var(--border-strong); }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.user-chip .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.days-badge {
  font-family: var(--mono); font-size: .72rem; font-weight: 600; white-space: nowrap;
  padding: 3px 7px; border-radius: 6px; color: var(--success); background: var(--success-soft);
}
.days-badge.warn { color: var(--warning); background: var(--warning-soft); }
.days-badge.bad { color: var(--danger); background: var(--danger-soft); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
@media (max-width: 760px) {
  .site-nav {
    display: none; flex-basis: 100%; flex-direction: column; align-items: stretch;
    padding: 8px 0 4px; margin-left: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; }
  .nav-toggle { display: inline-flex; }
  /* One row: brand, then the actions and the menu button on the right; the
     opened menu drops below them. */
  .site-header-inner { padding: 10px 16px; gap: 8px; }
  .site-header-inner > .brand { order: 1; }
  .site-header-inner > .header-actions { order: 2; gap: 6px; }
  .site-header-inner > .nav-toggle { order: 3; }
  .site-header-inner > .site-nav { order: 4; }
}
/* On a phone the secondary header buttons (Code, Account, Logout) keep only
   their icon; the label stays in the accessibility tree as the button name. */
@media (max-width: 600px) {
  .header-actions .btn-sm:not(.btn-primary) {
    width: 38px; height: 38px; padding: 0; gap: 0; font-size: 0; border-radius: 10px;
  }
  .header-actions .btn-sm:not(.btn-primary) .icon { width: 17px; height: 17px; }
  .header-actions .icon-btn, .nav-toggle { width: 36px; height: 36px; }
}
/* Signed in, a narrow phone cannot fit the brand name next to every button:
   keep the logo, and leave the subscription badge to the Account dialog. */
@media (max-width: 440px) {
  .site-header-inner:has(.header-actions .btn-ghost:not([data-hidden="true"]):not(.hide-mobile)) .brand { font-size: 0; gap: 0; }
  .site-header-inner:has(.header-actions .btn-ghost:not([data-hidden="true"]):not(.hide-mobile)) .header-actions .badge { display: none; }
  .user-chip .user-name { display: none; }
  .user-chip { padding: 0 4px; }
}
@media (max-width: 360px) {
  .site-header-inner { padding: 10px 12px; }
  .site-header-inner > .header-actions { gap: 4px; }
  .header-actions .btn-sm:not(.btn-primary), .header-actions .icon-btn, .nav-toggle { width: 34px; height: 34px; }
}

/* Between phone and wide desktop the header row runs short of room: the chip
   keeps its avatar, and the Steam Guard link its icon. */
@media (max-width: 1080px) {
  .user-chip .user-name { display: none; }
  .header-actions a.btn-sm[href="/code"] { font-size: 0; gap: 0; width: 38px; height: 38px; padding: 0; }
  .header-actions a.btn-sm[href="/code"] .icon { width: 17px; height: 17px; }
  .site-nav { margin-inline-start: 4px; gap: 2px; }
  .site-nav a { padding: 8px 10px; }
}

/* ===== Mobile tab bar =====
   Pages that carry one (body.has-tabbar) move their navigation to the bottom
   of the screen on a phone, so the header keeps only the brand and status. */
.tabbar { display: none; }
@media (max-width: 760px) {
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.has-tabbar .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 4px; border: 0; background: none; border-radius: 10px;
    color: var(--muted); font-size: .7rem; font-weight: 600;
  }
  .tabbar .icon { width: 21px; height: 21px; }
  .tabbar [aria-current="page"] { color: var(--accent); }
  body.has-tabbar .nav-toggle, body.has-tabbar .site-nav { display: none !important; }
  body.has-tabbar .header-actions .hide-mobile { display: none !important; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; font-weight: 700; font-size: .86rem;
  padding: 9px 15px; border: 1px solid transparent;
  white-space: nowrap; transition: background .12s, border-color .12s, color .12s, transform .08s, filter .12s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.09); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }
.btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: border-color .12s, color .12s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.icon-btn:disabled { opacity: .5; cursor: not-allowed; }
/* Used by store.html and partner.html; no stylesheet defined it, so these
   buttons rendered at inline width instead of filling their column. */
.btn-block { display: flex; width: 100%; }
.btn-block + .btn-block { margin-top: 8px; }
.form-note { font-size: .86rem; margin-bottom: 12px; }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.field .hint { font-size: .74rem; color: var(--muted-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--field); color: var(--text); font-size: .92rem;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:user-invalid { border-color: var(--danger); }
.field textarea { resize: vertical; min-height: 84px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-error { color: var(--danger); font-size: .82rem; min-height: 1.2em; margin-top: 4px; }
.form-message { font-size: .85rem; min-height: 1.2em; margin-top: 6px; }
.form-message.ok { color: var(--success); }
.form-message.err { color: var(--danger); }
.input-wrap { position: relative; display: flex; }
.input-wrap input { padding-right: 42px; }
.input-wrap .input-action {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.input-wrap .input-action:hover { color: var(--text); }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ===== Dialogs ===== */
dialog.dialog {
  /* Always centered, whatever the page scroll position is. */
  position: fixed; inset: 0; margin: auto;
  width: min(520px, calc(100vw - 32px));
  max-height: min(86vh, 720px);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text);
  padding: 0; box-shadow: var(--shadow);
  overflow: auto;
}
dialog.dialog::backdrop { background: rgba(5, 7, 12, .7); backdrop-filter: blur(4px); }
.dialog-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.dialog-header h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.dialog-body { padding: 18px 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ===== Empty state ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state .empty-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--surface-2); display: grid; place-items: center; color: var(--muted-2);
}
.empty-state .empty-icon .icon { width: 22px; height: 22px; }
.empty-state p { font-size: .9rem; max-width: 42ch; }

/* ===== Toasts ===== */
.toast-host {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 200; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px);
  transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.toast-success .toast-dot { background: var(--success); }
.toast-error .toast-dot { background: var(--danger); }

/* ===== Layout helpers ===== */
.page-width { max-width: 1320px; margin: 0 auto; padding: 0 22px; }
.topbar { height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.footer-inner {
  max-width: 1320px; margin: 0 auto; padding: 40px 22px 28px;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-desc { font-size: .9rem; color: var(--muted); max-width: 380px; line-height: 1.65; margin-top: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-width: 640px) { .footer-links { justify-content: flex-start; } }
.footer-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border-strong);
  font-size: .88rem; font-weight: 600; color: var(--text); transition: border-color .12s, color .12s; white-space: nowrap;
}
.footer-link .icon { color: var(--muted); }
a.footer-link:hover { border-color: var(--accent); color: var(--accent); }
.footer-bottom {
  max-width: 1320px; margin: 0 auto; padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.footer-bottom, .footer-bottom a {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2);
}
.footer-bottom a:hover { color: var(--text); }
.footer-nav { display: flex; gap: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
:root[lang="ar"] .footer-bottom, :root[lang="ar"] .footer-bottom a { font-family: var(--font); }

/* ===== Public announcement (assets/announce.js; previewed in the admin panel) ===== */
.nx-announce {
  --tone: var(--accent); --tone-soft: var(--accent-soft);
  position: fixed; z-index: 60; inset-inline-end: 20px; top: 96px;
  width: min(380px, calc(100vw - 32px));
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 12px 14px 16px; padding-inline: 16px 12px;
  border-radius: 18px; overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tone) 13%, transparent) 0%, transparent 58%),
    color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  opacity: 0; transform: translateY(-12px) scale(.98);
  transition: opacity .26s var(--ease), transform .26s var(--ease), top .2s var(--ease);
}
.nx-announce::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: linear-gradient(180deg, var(--tone), color-mix(in srgb, var(--tone) 40%, transparent));
}
.nx-announce::after {
  content: ''; position: absolute; inset-block-start: -60px; inset-inline-end: -60px; width: 160px; height: 160px;
  border-radius: 50%; background: radial-gradient(circle, var(--tone-soft), transparent 70%); pointer-events: none;
}
.nx-announce.is-in { opacity: 1; transform: none; }
.nx-announce-promo { --tone: var(--accent-2); --tone-soft: rgba(138, 124, 255, .18); }
.nx-announce-success { --tone: var(--success); --tone-soft: var(--success-soft); }
.nx-announce-warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.nx-announce-icon {
  flex-shrink: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(140deg, var(--tone-soft), rgba(138, 124, 255, .16));
  border: 1px solid color-mix(in srgb, var(--tone) 34%, transparent);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--tone) 22%, transparent);
  position: relative; z-index: 1;
}
.nx-announce-icon img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.nx-announce-label { font-size: .7rem; font-weight: 700; letter-spacing: .03em; color: var(--tone); opacity: .95; }
:root[lang="ar"] .nx-announce-label { letter-spacing: 0; }
.nx-announce-body { flex: 1; min-width: 0; display: grid; gap: 4px; position: relative; z-index: 1; padding-top: 1px; }
.nx-announce-title { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.35; }
.nx-announce-text { font-size: .86rem; color: color-mix(in srgb, var(--text) 78%, var(--muted)); line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; }
.nx-announce-link {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-top: 8px;
  padding: 6px 13px; border-radius: 999px; background: var(--tone-soft);
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  color: var(--tone); font-size: .82rem; font-weight: 700; text-decoration: none;
  transition: background .15s var(--ease);
}
.nx-announce-link:hover { background: color-mix(in srgb, var(--tone) 24%, transparent); }
.nx-announce-link svg { width: 14px; height: 14px; }
.nx-announce-close {
  flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -2px 0 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; position: relative; z-index: 1;
}
.nx-announce-close:hover { background: var(--field); color: var(--text); }
.nx-announce-close svg { width: 15px; height: 15px; }
.nx-announce-timer { position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px; background: color-mix(in srgb, var(--tone) 14%, transparent); z-index: 1; }
.nx-announce-timer > i {
  display: block; height: 100%; background: var(--tone); transform-origin: left center;
  animation: nx-announce-time 15s linear forwards;
}
[dir="rtl"] .nx-announce-timer > i { transform-origin: right center; }
/* Reading it pauses the count. */
.nx-announce:hover .nx-announce-timer > i, .nx-announce:focus-within .nx-announce-timer > i { animation-play-state: paused; }
.nx-announce.is-preview .nx-announce-timer { display: none; }
@keyframes nx-announce-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.nx-announce.is-preview { position: relative; inset: auto; top: auto; opacity: 1; transform: none; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
@media (max-width: 600px) {
  .nx-announce:not(.is-preview) { inset-inline: 12px; width: auto; top: auto !important; bottom: 12px; transform: translateY(12px); }
  .nx-announce:not(.is-preview).is-in { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .nx-announce { transition: none; } }
