/* AnonyVPN — brand kit v2: ink #151719, off-white #F3F2ED, vpn orange #FF9F43 (dark only; on dark the product
   colour may carry text). Flat marks everywhere; the 3D mark only once, as the landing hero. Inter + IBM Plex Mono,
   self-hosted. No inline styles anywhere (CSP style-src 'self'). */
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-var-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/plex-mono-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #151719; --surface: #1c1f21; --field: #1b1e20; --fg: #f3f2ed; --fg-2: #b4b9bc; --fg-3: #999fa3;
  --rule: #303538; --rule-strong: #3e4447; --accent: #ff9f43; --accent-hover: #ffb46b; --on-accent: #151719;
  --ok: #9fd4a8; --warn: #e0927f; --warn-bg: rgba(224, 146, 127, 0.07); --note-bg: rgba(232, 230, 225, 0.04);
  --radius: 6px; --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 400 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
a { color: var(--fg); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
.lead { color: var(--fg-2); font-size: 17px; }
.small { color: var(--fg-3); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; height: 25px; width: auto; }
.hero__mark { display: block; margin: 0 0 20px; }
.top__nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.top__nav a { text-decoration: none; color: var(--fg-2); }
.top__nav a[aria-current="page"], .top__nav a:hover { color: var(--fg); }
.main { width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; flex: 1; }
.main--wide { max-width: 1100px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 20px 24px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--fg-3); }
.foot a { color: var(--fg-3); }

.hero { padding: 6vh 0 2vh; }
.eyebrow { font: 400 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.checks { list-style: none; padding: 0; margin: 0 0 1.6em; }
.checks li { position: relative; padding-left: 26px; margin: 0 0 8px; color: var(--fg-2); }
.checks li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 24px; margin: 0 0 24px; }
.head { margin: 0 0 20px; }
.note { background: var(--note-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; font-size: 15px; }
.note--warn { background: var(--warn-bg); border-color: rgba(224, 146, 127, 0.35); }
.warn-text { color: var(--warn); }

.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--font); padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--rule-strong); background: transparent; color: var(--fg); cursor: pointer; text-decoration: none; }
.button:hover, button:hover { border-color: var(--fg); color: #fff; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.danger { color: var(--warn); border-color: rgba(224, 146, 127, 0.45); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; }
.small-btn { padding: 7px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: progress; }
form.inline { display: inline; margin: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.stack button { align-self: flex-start; margin-top: 8px; }
label { font: 500 14px/1.3 var(--font); color: var(--fg-2); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--fg); }
input, select { font: 400 16px/1.3 var(--font); color: var(--fg); background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 11px 12px; width: 100%; }
input[type=checkbox] { width: auto; }
select option { background: var(--surface); }

.devices { list-style: none; padding: 0; margin: 0 0 28px; border-top: 1px solid var(--rule); }
.devices .empty { padding: 18px 0; color: var(--fg-3); border-bottom: 1px solid var(--rule); }
.device { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.device__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.device__name { font-size: 17px; }
.device__edit { margin-top: 8px; }
.device__edit summary { cursor: pointer; color: var(--fg-2); font-size: 14px; }
.device__edit form { margin-top: 10px; }
.device__edit input { max-width: 260px; }
.pill { display: inline-block; font: 500 12px/1 var(--font); padding: 5px 8px; border-radius: 99px; border: 1px solid var(--rule-strong); color: var(--fg-2); }
.pill--ok { color: var(--ok); border-color: rgba(159, 212, 168, 0.4); }
.pill--warn { color: var(--warn); border-color: rgba(224, 146, 127, 0.4); }

.newconf { margin-top: 8px; }
.newconf__grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px; margin: 0 0 16px; align-items: start; }
.qr svg { width: 100%; height: auto; border-radius: 8px; display: block; }
.conf { font: 400 13px/1.5 var(--mono); background: #0f1112; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; margin: 0; overflow-x: auto; white-space: pre; }
.cmd { white-space: pre-wrap; word-break: break-all; margin: 0 0 12px; user-select: all; }
@media (max-width: 640px) { .newconf__grid { grid-template-columns: 1fr; } .qr { max-width: 280px; } .top { padding: 14px 16px; } }

.tabs { display: flex; gap: 18px; margin: 0 0 24px; border-bottom: 1px solid var(--rule); }
.tabs a { padding: 0 0 10px; text-decoration: none; color: var(--fg-2); }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom: 2px solid var(--accent); }
.tablewrap { overflow-x: auto; margin: 0 0 28px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--fg-3); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.plain { list-style: none; padding: 0; margin: 0 0 16px; }
.plain li { padding: 6px 0; }
.steps { padding-left: 20px; color: var(--fg-2); }
.legal h2 { margin-top: 1.6em; }
.legal li { margin: 0 0 6px; color: var(--fg-2); }

/* ---- the app shell (signed-in pages): AnonyChat's layout. The rail is fixed to the viewport (100dvh) and never
   scrolls; only the page content scrolls; the account entry stays pinned at the bottom at every window height. ---- */
:root { --rail: 72px; --rail-full: 240px; --radius-control: 10px; --ease-rail: cubic-bezier(0.4, 0, 0.2, 1); }
.ico { width: 20px; height: 20px; flex: none; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: #2a2116; color: var(--accent); flex: none; }
.avatar .ico { width: 15px; height: 15px; }
.avatar--sm { width: 22px; height: 22px; }

/* phones: no rail, a fixed bottom bar */
.rail { display: none; }
.bar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; align-items: center; justify-content: space-around; gap: 2px;
  padding: 10px 4px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: rgba(21, 23, 25, 0.95);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.bar__cell { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; color: var(--fg-3); text-decoration: none; }
.bar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/1.2 var(--font); }
.bar__cell[aria-current="page"] { color: var(--fg); }
.bar__cell[aria-current="page"] .ico { color: var(--accent); }
.bar__cell[aria-current="page"] .bar__label { font-weight: 600; }
.bar__cell[aria-current="page"]::after { content: ""; position: absolute; top: -10px; width: 32px; height: 3px; border-radius: 99px; background: var(--accent); }
html.app .appmain { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
html.app .main { padding-top: 28px; }

@media (min-width: 768px) {
  .bar { display: none; }
  html.app .appmain { margin-left: var(--rail); padding-bottom: 0; }
  html.app .main { padding-top: 48px; }
  .rail {
    position: fixed; left: 0; top: 0; z-index: 30; display: flex; flex-direction: column; height: 100vh; height: 100dvh;
    width: var(--rail); padding: 12px; overflow: hidden; border-right: 1px solid var(--rule); background: var(--bg);
    transition: width 280ms var(--ease-rail), padding 280ms var(--ease-rail), box-shadow 280ms var(--ease-rail);
  }
  /* The brand slot = AnonyChat's signed-in rail, to the pixel (owner 2026-10-09): one 44 px row; compact: the mark's
     100-unit box 28 px at 8 px in (viewport 20,20); labelled (≥ 1280): the lockup 26 px tall at 12 px in (viewport
     28,25), its mark where the compact mark sits. They swap on rail STATE only, never on hover. */
  .rail__brand { position: relative; display: flex; align-items: center; height: 44px; margin-bottom: 16px; flex: none; }
  .rail__mark { position: absolute; left: 8px; width: 28px; height: 28px; transition: opacity 200ms; }
  .rail__wordmark { position: absolute; left: 12px; height: 26px; width: auto; max-width: none; opacity: 0; transition: opacity 200ms; }
  .rail__nav { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
  .rail__spacer { flex: 1; }
  .rail__link {
    position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--radius-control);
    color: var(--fg-3); text-decoration: none; cursor: pointer; list-style: none; transition: background-color 150ms, color 150ms;
  }
  .rail__link::-webkit-details-marker { display: none; }
  .rail__link:hover { background: rgba(28, 31, 33, 0.6); color: var(--fg-2); }
  .rail__link[aria-current="page"] { background: var(--surface); color: var(--fg); }
  .rail__link[aria-current="page"] > .ico { color: var(--accent); }
  .rail__link[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 99px; background: var(--accent); }
  .rail__label { margin-left: 0; max-width: 0; overflow: hidden; white-space: nowrap; font: 500 15px/1.2 var(--font); opacity: 0;
    transition: max-width 200ms cubic-bezier(0.22, 0.61, 0.36, 1), margin 200ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 200ms; }
  .rail__account { position: relative; }
  /* fixed (not absolute): the rail never scrolls and clips its overflow; a fixed menu is not clipped by it */
  .rail__menu {
    position: fixed; left: 12px; bottom: 68px; z-index: 40; min-width: 216px; padding: 6px; display: grid; gap: 2px;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  }
  .rail__menu .small { margin: 6px 10px 4px; font-size: 12.5px; }
  .rail__menu a, .rail__menu button {
    display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: 400 15px/1.2 var(--font);
    text-align: left; text-decoration: none; justify-content: flex-start;
  }
  .rail__menu a:hover, .rail__menu button:hover { background: rgba(243, 242, 237, 0.06); color: var(--fg); border-color: transparent; }
  .rail__menu form { margin: 0; }
}
/* hover (collapsed rail, real pointer, after 120 ms) or keyboard focus: widen OVER the content, labels in; the icons
   and the brand stay exactly where they are (AnonyChat's rail brief F-2) */
@media (min-width: 768px) and (max-width: 1279.98px) {
  @media (hover: hover) and (pointer: fine) {
    .rail:hover { width: var(--rail-full); transition-delay: 120ms; box-shadow: 26px 0 50px -24px rgba(0, 0, 0, 0.9); }
    .rail:hover .rail__link { justify-content: flex-start; padding-left: 14px; }
    .rail:hover .rail__label { flex: 1; max-width: 10rem; margin-left: 12px; opacity: 1; transition-delay: 120ms; }
  }
  .rail:has(:focus-visible) { width: var(--rail-full); box-shadow: 26px 0 50px -24px rgba(0, 0, 0, 0.9); }
  .rail:has(:focus-visible) .rail__link { justify-content: flex-start; padding-left: 14px; }
  .rail:has(:focus-visible) .rail__label { flex: 1; max-width: 10rem; margin-left: 12px; opacity: 1; }
}
@media (min-width: 1280px) {
  html.app .appmain { margin-left: var(--rail-full); }
  .rail { width: var(--rail-full); padding: 16px; }
  .rail .rail__link { justify-content: flex-start; padding: 0 12px; }
  .rail .rail__label { margin-left: 12px; max-width: 10rem; flex: 1; opacity: 1; }
  .rail .rail__mark { opacity: 0; }
  .rail .rail__wordmark { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .rail, .rail__label, .rail__mark, .rail__wordmark { transition: none; }
}

/* plans, admin forms */
fieldset { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px 16px; margin: 0 0 8px; }
legend { padding: 0 6px; font-weight: 600; }
textarea { font: 400 14px/1.45 var(--mono); color: var(--fg); background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 10px 12px; width: 100%; }
input.date { width: auto; padding: 6px 8px; font-size: 13px; }
.plans th[scope="row"] { color: var(--fg-2); font-weight: 500; }
.plans thead th { color: var(--fg); font-size: 15px; }
.plans .is-current { color: var(--accent); }
.plans td, .plans th { padding: 12px 14px; }
