/* One Life Hardcore SMP — shared site styles.
   Layout: one centered column (max 1160px) with a sticky top bar; sections stack, grids collapse to one column on phones. */
:root {
  --ink-0: #05070d;      /* page */
  --ink-1: #0a1122;      /* surfaces */
  --ink-2: #101a33;      /* raised surfaces */
  --line: #1c2a4a;
  --line-strong: #2a3d66;
  --text: #e9eef8;
  --dim: #9aa6c0;
  --accent: #35d7ff;
  --accent-deep: #0047ff;
  --on-accent: #ffffff;
  --ice: #7ee8ff;
  --blue: #2f6bff;
  --blood: #ff5a5f;
  --display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --radius: 10px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ice); }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1520px; margin: 0 auto; padding-inline: 20px; }

/* Page head banner (Network, Server Info, and the dashboard all use this) */
.page-head { border-bottom: 1px solid var(--line); background: radial-gradient(60% 100% at 80% 0%, rgba(47,107,255,.16), transparent 70%); }
.page-head .wrap { padding-block: clamp(2.5rem, 7vw, 4.5rem) 2.25rem; display: flex; flex-direction: column; gap: 1rem; }
.page-head h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: .02em; }
.page-head .intro { color: var(--dim); max-width: 64ch; font-size: 1.05rem; }

/* Tables (Network's compare table, the admin panel's user table) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-1); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .95rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); background: var(--ink-2); font-weight: 600; }
td { color: var(--dim); }
td:first-child { color: var(--text); font-weight: 700; white-space: nowrap; }

/* Top bar - brand on the left, the main nav as a centred pill, actions
   (Discord, notifications, account) on the right. Under 860px the nav
   moves into a dropdown panel opened by the menu button. Used by the
   public pages and the account/tickets pages; the admin panel has its
   own shell and never renders this. */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--ink-0) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(53,215,255,.4) 50%, transparent);
}
.topbar > .wrap { display: flex; align-items: center; gap: .6rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); flex: none; margin-right: .75rem; }
.brand img { width: 32px; height: 32px; image-rendering: auto; filter: drop-shadow(0 0 10px rgba(126,232,255,.3)); transition: transform .25s ease; }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.brand-name {
  font-family: var(--display); font-weight: 800; font-size: 1.02rem; letter-spacing: .05em; text-transform: uppercase; width: fit-content;
  background: linear-gradient(90deg, #00e5ff, #4d8fff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-family: var(--mono); font-size: .58rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }

.navlinks {
  display: flex; gap: .15rem; margin-inline: auto; padding: .25rem;
  border-radius: 12px; background: color-mix(in srgb, var(--ink-1) 75%, transparent); border: 1px solid var(--line);
}
.navlinks a {
  position: relative; display: inline-flex; white-space: nowrap; align-items: center; gap: .45rem;
  color: var(--dim); text-decoration: none; font-size: .86rem; font-weight: 700; line-height: 1;
  padding: .55rem .85rem; border-radius: 9px;
  transition: color .15s ease, background-color .15s ease;
}
.navlinks a svg { width: 15px; height: 15px; flex: none; opacity: .75; transition: color .15s ease, opacity .15s ease; }
.navlinks a:hover { color: var(--text); background: var(--ink-2); }
.navlinks a:hover svg { opacity: 1; }
.navlinks a[aria-current="page"] {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--ink-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.navlinks a[aria-current="page"] svg { color: var(--accent); opacity: 1; }

/* Header dropdown (Server Info -> Server info / Rules / Updates & News).
   Opens on hover for mouse users, on click/tap + keyboard via the header script. */
.nav-group { position: relative; display: flex; }
.nav-group-btn {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; cursor: pointer;
  padding: .55rem .7rem .55rem .85rem; border: 0; border-radius: 9px; background: none;
  font: inherit; font-size: .86rem; font-weight: 700; line-height: 1; color: var(--dim);
  transition: color .15s ease, background-color .15s ease;
}
.nav-group-btn svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.nav-group-btn .nav-caret { width: 13px; height: 13px; margin-left: -.1rem; transition: transform .2s ease; }
.nav-group-btn:hover, .nav-group.is-open .nav-group-btn { color: var(--text); background: var(--ink-2); }
.nav-group-btn:hover svg, .nav-group.is-open .nav-group-btn svg { opacity: 1; }
.nav-group:has(a[aria-current="page"]) > .nav-group-btn {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--ink-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.nav-group:has(a[aria-current="page"]) > .nav-group-btn svg:first-child { color: var(--accent); opacity: 1; }
.nav-menu {
  position: absolute; top: 100%; left: 50%; z-index: 60; min-width: 300px; padding-top: 10px;
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.nav-group.is-open .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; transition-delay: 0s; }
.nav-group.is-open .nav-caret { transform: rotate(180deg); }
@media (hover: hover) {
  .nav-group:hover .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; transition-delay: 0s; }
  .nav-group:hover .nav-caret { transform: rotate(180deg); }
}
.nav-menu-inner {
  display: grid; gap: .15rem; padding: .4rem; border-radius: 14px;
  background: var(--ink-1); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.85), 0 0 0 1px rgba(126,232,255,.04);
}
.navlinks .nav-menu a {
  display: flex; align-items: flex-start; gap: .75rem; padding: .62rem .7rem; border-radius: 10px;
  white-space: normal; line-height: 1.25; color: var(--text); font-weight: 700;
}
.navlinks .nav-menu a:hover { background: var(--ink-2); }
.navlinks .nav-menu a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 10%, var(--ink-2)); box-shadow: none; }
.nav-menu-ico {
  width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
  color: var(--ice); background: rgba(53,215,255,.08); border: 1px solid rgba(53,215,255,.22);
}
.navlinks .nav-menu-ico svg { width: 16px; height: 16px; opacity: 1; color: inherit; }
.nav-menu b { display: block; font-size: .88rem; }
.nav-menu small { display: block; margin-top: .22rem; font-size: .76rem; font-weight: 500; color: var(--dim); }

.topbar-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; flex: none;
  height: 36px; padding: 0 .8rem; border-radius: 10px;
  font-size: .84rem; font-weight: 700; color: #c9d0ff; text-decoration: none;
  background: rgba(140,158,255,.08); border: 1px solid rgba(140,158,255,.3);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.topbar-discord:hover { background: rgba(140,158,255,.16); border-color: rgba(140,158,255,.55); color: #fff; }
.topbar-discord svg { width: 16px; height: 16px; flex: none; }

.nav-toggle {
  display: none; order: 10; flex: none; width: 38px; height: 38px; place-items: center; padding: 0; cursor: pointer;
  border-radius: 10px; background: var(--ink-1); border: 1px solid var(--line-strong); color: var(--text);
}
.nav-toggle:hover { border-color: var(--ice); }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

.mobile-nav { border-top: 1px solid var(--line); }
.mobile-nav .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding-block: .85rem 1rem; }
.mobile-nav a {
  display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; border-radius: 11px;
  background: var(--ink-1); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem;
}
.mobile-nav a svg { width: 17px; height: 17px; flex: none; color: var(--ice); }
.mobile-nav a[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--ink-1)); }
/* Mobile: the Server Info dropdown as a full-width group */
.mobile-group { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .5rem; padding: .7rem; border-radius: 13px; background: color-mix(in srgb, var(--ink-1) 60%, transparent); border: 1px solid var(--line); }
.mobile-group-label { display: flex; align-items: center; gap: .55rem; padding: 0 .2rem; font: 700 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.mobile-group-label svg { width: 15px; height: 15px; color: var(--ice); }
.mobile-group-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.mobile-group-links a { justify-content: center; text-align: center; padding: .7rem .5rem; font-size: .86rem; }
/* Home sits alone above the full-width Server Info group - span it too so the grid has no gap */
.mobile-nav .wrap > a[href="/"] { grid-column: 1 / -1; }

@media (max-width: 1000px) {
  .topbar-discord { width: 36px; padding: 0; }
  .topbar-discord span { display: none; }
  .navlinks a { padding-inline: .7rem; }
}
/* six nav items: below 1180px drop the small leading icons so the logged-in account button still fits */
@media (max-width: 1180px) {
  .navlinks > a > svg:first-child, .navlinks .nav-group-btn > svg:first-child { display: none; }
}
@media (max-width: 860px) {
  .navlinks { display: none; }
  .nav-toggle { display: grid; }
  .brand { margin-right: auto; }
}
@media (min-width: 861px) {
  .mobile-nav { display: none !important; }
}
@media (max-width: 480px) {
  .topbar-discord { display: none; }
  .account-trigger .skin-head + span { display: none; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .brand img { width: 28px; height: 28px; }
  .topbar > .wrap { gap: .45rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 .95rem/1 var(--body); letter-spacing: .01em;
  padding: .85rem 1.3rem; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(90deg, #00b8e6, #0047ff); color: var(--on-accent); border-color: rgba(126,232,255,.45); }
.btn-primary:hover { background: linear-gradient(90deg, #14c8f2, #1f5cff); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-danger { background-color: #ff3b3f; background-image: linear-gradient(90deg, #ff8a8d, #e6262b); color: #fff; border-color: rgba(255,90,95,.5); }
.btn-danger:hover { background-image: linear-gradient(90deg, #ffa1a3, #ff3b3f); }
.btn-ghost:hover { border-color: var(--ice); }
.btn-sm { padding: .55rem .9rem; font-size: .85rem; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Account menu */
.account-menu { position: relative; }
.account-trigger .skin-head { width: 22px; height: 22px; border-radius: 5px; image-rendering: pixelated; flex: none; }
.account-trigger .skin-head.placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  background: #000; color: #fff; font-weight: 800; font-size: 12px; line-height: 1;
}
.account-dropdown {
  position: absolute; top: calc(100% + .6rem); right: 0; width: max-content; min-width: 160px; max-width: 260px;
  background: var(--ink-1); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .4rem; display: flex; flex-direction: column; gap: .1rem;
  box-shadow: 0 16px 34px rgba(0,0,0,.5); z-index: 30;
}
.account-dropdown .menu-link {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  color: var(--text); font: 600 .88rem var(--body); text-decoration: none;
  padding: .6rem .75rem; border-radius: 7px;
}
.account-dropdown .menu-link:hover { background: var(--ink-2); color: var(--ice); }
.account-dropdown form { margin: 0; }

/* Account card (login / sign up popover) */
.account-dropdown.account-card { width: 380px; max-width: calc(100vw - 32px); padding: 1.5rem; gap: 0; box-sizing: border-box; }
.account-card-head { position: relative; padding-right: 4.75rem; margin-bottom: 1.4rem; }
.account-card-head h3 { font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.25; margin-bottom: .35rem; }
.account-card-head p { color: var(--dim); font-size: .82rem; line-height: 1.4; }
.account-switch {
  position: absolute; top: .1rem; right: 0;
  background: none; border: 0; color: var(--ice); font: 700 .82rem var(--body);
  cursor: pointer; padding: 0; text-decoration: none;
}
.account-switch:hover { color: var(--text); text-decoration: underline; }
.account-panel { display: flex; flex-direction: column; gap: 1.1rem; }
.account-panel .field { display: flex; flex-direction: column; gap: .4rem; }
.account-panel .field label { font-size: .82rem; color: var(--dim); font-weight: 600; }
.account-panel .field input {
  background: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text);
  padding: .75rem .9rem; font-size: .95rem; font-family: var(--body); width: 100%; box-sizing: border-box;
  transition: border-color .15s ease;
}
.account-panel .field input:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px rgba(126,232,255,.15); }
.remember-me { display: flex; align-items: center; gap: .65rem; font-size: .87rem; color: var(--dim); cursor: pointer; user-select: none; width: auto; padding: 0; }
.remember-me input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative;
  width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid var(--line-strong);
  background: var(--ink-2); cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.remember-me input[type="checkbox"]:hover { border-color: var(--ice); }
.remember-me input[type="checkbox"]:checked {
  border-color: transparent; background: linear-gradient(90deg, #00b8e6, #0047ff);
}
.remember-me input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.remember-me input[type="checkbox"]:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.account-submit { width: 100%; margin-top: .2rem; }
.account-error { background: rgba(255,90,95,.1); border: 1px solid rgba(255,90,95,.4); color: #ff9a9d; border-radius: 8px; padding: .65rem .8rem; font-size: .85rem; }
.account-error.account-success, .error.account-success { background: rgba(94,226,154,.1); border-color: rgba(94,226,154,.4); color: #5ee29a; }
.account-error .resend-link {
  display: inline; background: none; border: 0; padding: 0; margin-top: .4rem;
  color: inherit; text-decoration: underline; cursor: pointer; font: inherit;
}

.field-hint { font-size: .78rem; min-height: 1em; }
.field-hint.ok { color: #5ee29a; }
.field-hint.bad { color: var(--blood); }
.field-hint.pending { color: var(--dim); }

.pw-requirements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; }
.pw-requirements li { display: flex; align-items: center; gap: .55rem; color: var(--dim); transition: color .15s ease; }
.pw-requirements li::before {
  content: "○"; font-size: .65rem; width: 1em; flex: none; text-align: center; color: var(--line-strong);
  transition: color .15s ease;
}
.pw-requirements li.met { color: #5ee29a; }
.pw-requirements li.met::before { content: "✓"; color: #5ee29a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; }

@media (max-width: 420px) {
  .account-dropdown.account-card { width: calc(100vw - 32px); padding: 1.25rem; }
}

/* Section scaffolding */
section { scroll-margin-top: 72px; }
.eyebrow {
  font-family: var(--mono); font-weight: 700; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  width: fit-content;
  background: linear-gradient(90deg, #00e5ff, #4d8fff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head { display: flex; flex-direction: column; gap: .6rem; max-width: 62ch; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: .02em; }
.section-head p { color: var(--dim); }

/* Footer - brand column (blurb, server address, socials) plus three link
   columns, then a slim credits bar. */
.site-footer {
  position: relative; border-top: 1px solid var(--line); padding-top: 3.25rem; color: var(--dim); font-size: .9rem;
  background: radial-gradient(60% 120% at 50% 0%, rgba(47,107,255,.08), transparent 70%), linear-gradient(180deg, #060a15, var(--ink-0));
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(53,215,255,.35) 50%, transparent);
}
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; min-width: 0; }
.footer-brand p { max-width: 38ch; }
.footer-ip {
  display: inline-flex; align-items: center; gap: .6rem; max-width: 100%;
  padding: .5rem .55rem .5rem .75rem; border-radius: 11px; background: var(--ink-1); border: 1px solid var(--line-strong);
}
.footer-ip svg { width: 15px; height: 15px; color: var(--ice); flex: none; }
.footer-ip code { font-family: var(--mono); font-weight: 600; font-size: .84rem; color: var(--text); user-select: all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-ip .ver { font-family: var(--mono); font-size: .68rem; font-weight: 700; color: var(--ice); padding: .15rem .45rem; border-radius: 999px; border: 1px solid rgba(126,232,255,.3); flex: none; }
.footer-social { display: flex; gap: .5rem; }
.footer-social a {
  display: inline-flex; align-items: center; gap: .45rem; height: 36px; padding: 0 .8rem; border-radius: 10px;
  background: var(--ink-1); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: .84rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.footer-social a svg { width: 16px; height: 16px; color: var(--ice); }
.footer-social a:hover { border-color: var(--ice); background: var(--ink-2); }
.footer-col { min-width: 0; }
.footer-col h4 { margin: .35rem 0 1rem; font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer-col a { color: var(--dim); text-decoration: none; font-weight: 600; transition: color .15s ease; }
.footer-col a:hover { color: var(--ice); }
.credits { border-top: 1px solid var(--line); margin-top: 2.75rem; padding-block: 1.2rem 1.5rem; }
.credits .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; }
.credits-main { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; color: var(--dim); font-size: .85rem; }
.credits-main .mono { font-family: var(--mono); color: var(--text); }
.credits-main strong { font-weight: 800; background: linear-gradient(90deg, #00e5ff, #4d8fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.credits-main .sep { color: var(--line-strong); }
.footer-fine { font-size: .76rem; color: #6f7b94; }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.25rem; }
}

/* Sidebar page nav (used on any page with a left-hand section index) */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2.5rem; }
nav.toc { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); align-self: start; padding-block: 2.5rem; }
nav.toc .label { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: .6rem; }
nav.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
nav.toc a { display: block; text-decoration: none; color: var(--dim); font-size: .9rem; font-weight: 600; padding: .35rem .6rem; border-radius: 6px; }
nav.toc a:hover { color: var(--text); background: var(--ink-1); }
.content { min-width: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  nav.toc { position: static; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
  nav.toc ul { flex-direction: row; flex-wrap: wrap; }
  nav.toc a { font-size: .82rem; padding: .3rem .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[hidden] { display: none !important; }

/* Navbar-only "Beta" sticker - pinned to the bottom-right corner of the
   Tickets nav item, tilted like a little stamp rather than sitting inline
   with the text. */
.nav-tickets-link { position: relative; padding-right: .3rem; }
.beta-tag {
  position: absolute; right: -.3rem; top: -.45rem; z-index: 1;
  display: inline-flex; align-items: center; line-height: 1; transform: rotate(8deg);
  font-size: .48rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  padding: .09rem .3rem; border-radius: 999px;
  background: linear-gradient(90deg, #00b8e6, #0047ff); color: #fff;
  box-shadow: 0 2px 6px rgba(0,71,255,.5); pointer-events: none;
}

.beta-tag.is-alpha { background: linear-gradient(90deg, #f5c451, #ff8a3d); color: #1b1300; box-shadow: 0 2px 6px rgba(255,138,61,.45); }

/* Pulsing notification badge animation - same look as the webapp's own. */
@keyframes ticket-badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,23,68,.7); transform: scale(1); }
  50% { box-shadow: 0 0 0 9px rgba(255,23,68,0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(255,23,68,0); transform: scale(1); }
}
.is-pulsing { animation: ticket-badge-pulse 1.4s ease-in-out infinite; }

/* Header popovers - notification centre, the logged-in account menu and
   the login / sign up card. Everything is scoped to the header pieces
   (.notif-*, .account-usermenu, .account-card) so the full-page login
   form and the profile page's forms keep their own look. */
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Shared trigger buttons in the top bar */
.topbar .notif-trigger, .topbar .account-trigger.btn-ghost {
  height: 38px; border-radius: 10px; background: var(--ink-1); border-color: var(--line-strong);
}
.topbar .notif-trigger { width: 38px; padding: 0; }
.topbar .notif-trigger svg { width: 18px; height: 18px; }
.topbar .account-trigger.btn-ghost { padding: 0 .65rem 0 .4rem; gap: .5rem; }
.topbar .account-trigger.btn-ghost .skin-head { width: 26px; height: 26px; border-radius: 6px; }
.topbar .account-trigger .chev { width: 14px; height: 14px; color: var(--dim); transition: transform .2s ease; }
.topbar .account-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.topbar .notif-trigger:hover, .topbar .account-trigger.btn-ghost:hover,
.topbar .notif-trigger[aria-expanded="true"], .topbar .account-trigger.btn-ghost[aria-expanded="true"] { border-color: var(--ice); background: var(--ink-2); transform: none; }
.topbar .account-trigger.btn-primary { height: 38px; padding-inline: 1.1rem; border-radius: 10px; }

/* Popover frame (both dropdowns) */
.topbar .account-dropdown, .notif-dropdown {
  background: linear-gradient(180deg, #0d1630, var(--ink-1) 120px);
  border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.75), 0 0 0 1px rgba(126,232,255,.04) inset;
  transform-origin: top right; animation: pop-in .16s ease-out;
}

/* ---------- Notification centre ---------- */
.notif-menu { position: relative; }
.notif-trigger { position: relative; }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .66rem; font-weight: 700; line-height: 1;
  border-radius: 999px; background: linear-gradient(135deg, #ff1f4b, #c40024); color: #fff;
  border: 2px solid var(--ink-0);
}
/* Header popovers: drop in when opened, fade back up when closed (the header
   script adds .is-closing, waits for this, then hides the element). */
@keyframes ol-pop-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ol-pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px) scale(.98); } }
.notif-dropdown, .account-dropdown { transform-origin: top right; animation: ol-pop-in .2s cubic-bezier(.2, .8, .3, 1); }
.notif-dropdown.is-closing, .account-dropdown.is-closing { animation: ol-pop-out .14s ease-in forwards; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .notif-dropdown, .account-dropdown { animation: none !important; } }
.notif-dropdown {
  position: absolute; top: calc(100% + .6rem); right: 0; width: 360px; max-width: calc(100vw - 32px);
  z-index: 30; overflow: hidden; display: flex; flex-direction: column;
}
.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .95rem 1rem .85rem; border-bottom: 1px solid var(--line);
}
.nd-title { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: .95rem; }
.nd-title .nd-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--ink-2)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.nd-title .nd-ico svg { width: 15px; height: 15px; }
.nd-count {
  font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: #ff8a9b;
  padding: .25rem .55rem; border-radius: 999px; background: rgba(255,31,75,.1); border: 1px solid rgba(255,31,75,.35);
}
.notif-list { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; padding: .4rem; gap: .2rem; }
.notif-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 1.6rem 1rem 1.5rem; color: var(--dim); font-size: .84rem; }
.notif-empty .ne-ico {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: .4rem; color: #5ee29a;
  background: color-mix(in srgb, #5ee29a 10%, var(--ink-2)); border: 1px solid color-mix(in srgb, #5ee29a 30%, transparent);
}
.notif-empty .ne-ico svg { width: 20px; height: 20px; }
.notif-empty strong { color: var(--text); font-size: .92rem; }
.notif-item {
  --k: var(--accent);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem;
  border-radius: 11px; border: 1px solid transparent; transition: background-color .15s ease, border-color .15s ease;
}
.notif-item[data-kind="created"] { --k: #5ee29a; }
.notif-item[data-kind="rate_closed"] { --k: #f5a623; }
.notif-item:hover { background: var(--ink-2); border-color: var(--line); }
.notif-item-link {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: .75rem; row-gap: .15rem; align-items: center;
  padding: .7rem .2rem .7rem .65rem; text-decoration: none; color: var(--text); min-width: 0;
}
.notif-item-link::before {
  content: ""; grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--k) 12%, var(--ink-2)); border: 1px solid color-mix(in srgb, var(--k) 32%, transparent);
}
.notif-item-link::after {
  content: ""; position: absolute; left: calc(.65rem + 9px); top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--k);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3Cpath d='M8 10h8M8 13h5'/%3E%3C/svg%3E");
}
.notif-item[data-kind="created"] .notif-item-link::after {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z'/%3E%3Cpath d='M13 5v2M13 17v2M13 11v2'/%3E%3C/svg%3E");
}
.notif-item[data-kind="rate_closed"] .notif-item-link::after {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E");
}
.notif-item-text { font-size: .85rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.notif-item-text strong { color: var(--text); font-weight: 700; }
.notif-item-text.is-two-line { white-space: normal; overflow: visible; text-overflow: clip; }
.notif-item-text.is-two-line strong { display: block; margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-time { font-family: var(--mono); font-size: .68rem; color: #7d89a3; }
.notif-item-dismiss {
  margin-right: .45rem; width: 26px; height: 26px; flex: none;
  display: grid; place-items: center; border-radius: 8px; padding: 0;
  background: none; border: 1px solid transparent; color: var(--dim); font-size: 1.05rem; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}
.notif-item:hover .notif-item-dismiss, .notif-item-dismiss:focus-visible { opacity: 1; }
.notif-item-dismiss:hover { background: rgba(255,90,95,.1); border-color: rgba(255,90,95,.35); color: var(--blood); }
@media (hover: none) { .notif-item-dismiss { opacity: 1; } }
.notif-dropdown-foot {
  display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .75rem 1rem;
  border-top: 1px solid var(--line); color: var(--ice); font-size: .84rem; font-weight: 700; text-decoration: none;
  background: color-mix(in srgb, var(--ink-0) 40%, transparent); transition: background-color .15s ease;
}
.notif-dropdown-foot svg { width: 14px; height: 14px; transition: transform .15s ease; }
.notif-dropdown-foot:hover { background: var(--ink-2); }
.notif-dropdown-foot:hover svg { transform: translateX(2px); }

/* ---------- Logged-in account menu ---------- */
.topbar .account-dropdown.account-usermenu { width: 290px; padding: 0; gap: 0; overflow: hidden; }
.um-head { display: flex; align-items: center; gap: .8rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.um-avatar { width: 44px; height: 44px; border-radius: 11px; image-rendering: pixelated; flex: none; border: 1px solid var(--line-strong); background: #000; }
.um-avatar.placeholder { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; }
.um-id { display: flex; flex-direction: column; min-width: 0; gap: .1rem; flex: 1; }
.um-id strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-id span { font-size: .78rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-id span b { color: var(--ice); font-weight: 700; }
.um-id .um-warn { color: #ffcf7a; }
.um-role {
  align-self: flex-start; font-family: var(--mono); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); padding: .22rem .5rem; border-radius: 999px; border: 1px solid rgba(53,215,255,.4); background: rgba(53,215,255,.08);
}
.um-links { display: flex; flex-direction: column; padding: .4rem; gap: .1rem; }
.topbar .account-usermenu .menu-link {
  display: flex; align-items: center; gap: .7rem; padding: .62rem .7rem; border-radius: 9px;
  font: 600 .88rem var(--body); color: var(--text);
}
.topbar .account-usermenu .menu-link svg { width: 17px; height: 17px; flex: none; color: var(--dim); transition: color .15s ease; }
.topbar .account-usermenu .menu-link:hover { background: var(--ink-2); color: var(--text); }
.topbar .account-usermenu .menu-link:hover svg { color: var(--ice); }
.topbar .account-usermenu .menu-link.is-accent { color: #ffcf7a; }
.topbar .account-usermenu .menu-link.is-accent svg { color: #ffcf7a; }
.um-foot { padding: .4rem; border-top: 1px solid var(--line); }
.topbar .account-usermenu .um-foot .menu-link { color: #ff9a9d; }
.topbar .account-usermenu .um-foot .menu-link svg { color: #ff9a9d; }
.topbar .account-usermenu .um-foot .menu-link:hover { background: rgba(255,90,95,.1); }

/* ---------- Login / sign up card ---------- */
.topbar .account-dropdown.account-card { width: 390px; padding: 1.35rem 1.35rem 1.2rem; }
.account-card .ac-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.1rem; }
.account-card .ac-logo {
  width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(126,232,255,.18), var(--ink-2)); border: 1px solid var(--line-strong);
}
.account-card .ac-logo img { width: 30px; height: 30px; filter: drop-shadow(0 0 8px rgba(126,232,255,.4)); }
.account-card .ac-head h3 { font-family: var(--display); font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.account-card .ac-head p { color: var(--dim); font-size: .8rem; line-height: 1.4; margin-top: .15rem; }
.account-card .ac-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding: .25rem; margin-bottom: 1.1rem; border-radius: 11px; background: var(--ink-0); border: 1px solid var(--line); }
.account-card .account-switch {
  position: static; padding: .55rem .5rem; border-radius: 8px; text-align: center;
  color: var(--dim); font: 700 .84rem var(--body); text-decoration: none; transition: color .15s ease, background-color .15s ease;
}
.account-card .account-switch:hover { color: var(--text); text-decoration: none; background: var(--ink-2); }
.account-card .account-switch.is-active { color: #fff; background: linear-gradient(90deg, #00b8e6, #0047ff); box-shadow: 0 6px 16px -8px rgba(0,120,255,.9); }
.account-card .account-switch.ac-link { display: inline; padding: 0; background: none; color: var(--ice); font-size: inherit; }
.account-card .account-switch.ac-link:hover { text-decoration: underline; background: none; }
.account-card .account-panel { gap: .95rem; }
.account-card .field label { font-size: .76rem; font-weight: 700; color: var(--dim); }
.account-card .ac-input { position: relative; display: flex; align-items: center; }
.account-card .ac-input > svg { position: absolute; left: .8rem; width: 16px; height: 16px; color: #6f7b94; pointer-events: none; transition: color .15s ease; }
.account-card .ac-input:focus-within > svg { color: var(--ice); }
.account-card .field .ac-input input { padding: .72rem .9rem .72rem 2.4rem; border-radius: 10px; background: var(--ink-0); font-size: .92rem; }
.account-card .field .ac-input input:hover { border-color: #3a5182; }
.account-card .ac-input .pw-toggle {
  position: absolute; right: .35rem; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: none; color: #6f7b94; cursor: pointer;
}
.account-card .ac-input .pw-toggle:hover { color: var(--text); background: var(--ink-2); }
.account-card .ac-input .pw-toggle svg { width: 16px; height: 16px; }
.account-card .ac-input .pw-toggle .i-hide { display: none; }
.account-card .ac-input .pw-toggle.is-on .i-show { display: none; }
.account-card .ac-input .pw-toggle.is-on .i-hide { display: block; }
.account-card .ac-input input[type="password"], .account-card .ac-input input.has-toggle { padding-right: 2.6rem; }
.account-card .pw-requirements { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .6rem; margin-top: .15rem; }
.account-card .account-submit { margin-top: .1rem; padding-block: .8rem; border-radius: 10px; }
.account-card .account-submit svg { width: 16px; height: 16px; }
.account-card .ac-foot { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); text-align: center; color: var(--dim); font-size: .82rem; }

/* Phones: both popovers become a full-width sheet under the top bar
   instead of hanging off their (not right-aligned) trigger buttons. */
@media (max-width: 560px) {
  .topbar .account-dropdown, .topbar .account-dropdown.account-card, .topbar .account-dropdown.account-usermenu, .notif-dropdown {
    position: fixed; top: calc(64px + env(safe-area-inset-top, 0px) + 6px); left: 10px; right: 10px; width: auto; max-width: none;
    max-height: calc(100dvh - 90px); overflow-y: auto;
  }
  .account-card .pw-requirements { grid-template-columns: 1fr; }
}

/* Site-wide custom scrollbar - every page (public site, account/tickets
   pages and the admin panel all load this file) and every scrollable box
   gets the same thin, rounded scrollbar instead of the browser default.
   Firefox + modern Chrome/Edge use scrollbar-width/scrollbar-color;
   Safari (and older Chromium) fall back to the ::-webkit-scrollbar rules. */
html { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--ink-0); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-track { background: var(--ink-0); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Legal links under the footer fine print */
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem .55rem; margin: .6rem 0 0; font-size: .8rem; }
.footer-legal a { color: var(--dim); text-decoration: none; }
.footer-legal a:hover { color: var(--text); text-decoration: underline; }
.footer-legal .sep { color: var(--line-strong, #2a3a5c); }
