/* Fonts are served from this origin. JetBrains Mono, Schibsted Grotesk: SIL Open Font License. */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/static/fonts/schibsted-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/static/fonts/schibsted-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Ulvium account and admin — black, ember light. Tokens match the landing page. */
:root {
  --night: #050506;
  --panel: #0b0b0d;
  --raised: #141416;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --snow: #f7f7f5;
  --mist: #a3a3a8;
  --amber: #ff7a1a;
  --amber-hi: #ffb347;
  --amber-ink: #170800;
  --ok: #6fd69a;
  --bad: #ff6b5e;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(1rem, 4vw, 2rem);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--night); color: var(--snow); font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body.glow { background: radial-gradient(60rem 30rem at 50% -12rem, rgba(255, 110, 20, .2), transparent 70%), var(--night); background-repeat: no-repeat; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; }
a { color: var(--amber-hi); text-underline-offset: 3px; }
a:hover { color: var(--snow); }
[hidden] { display: none !important; }
::selection { background: var(--amber); color: var(--amber-ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted, .lede { color: var(--mist); }
.lede { margin-top: .5rem; }
.eyebrow { font: 500 .74rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--snow); text-decoration: none; }
.brand-lg { font-size: 1.4rem; }
.mark { width: 1.5rem; height: 1.5rem; fill: var(--amber); filter: drop-shadow(0 0 10px rgba(255, 110, 20, .55)); transition: transform .5s var(--ease); }
.brand-lg .mark { width: 1.9rem; height: 1.9rem; }
.brand:hover .mark { transform: rotate(-8deg) scale(1.08); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.9rem; padding: 0 1.4rem; border-radius: 999px; font: 600 .98rem var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .3s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-small { height: 2.25rem; padding: 0 1rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-solid { background: linear-gradient(180deg, var(--amber-hi), var(--amber)); color: var(--amber-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-solid:hover:not(:disabled) { color: var(--amber-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 28px -8px rgba(255, 110, 20, .65); }
.btn-ghost { border-color: var(--line-strong); color: var(--snow); background: rgba(255, 255, 255, .03); }
.btn-ghost:hover:not(:disabled) { border-color: var(--mist); background: rgba(255, 255, 255, .08); color: var(--snow); }
.btn-danger { border-color: rgba(255, 107, 94, .4); color: var(--bad); background: rgba(255, 107, 94, .06); }
.btn-danger:hover:not(:disabled) { border-color: var(--bad); background: rgba(255, 107, 94, .14); color: var(--bad); }

/* Cards */
.card { border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012)), var(--panel); }
.pad { padding: clamp(1.25rem, 3vw, 1.75rem); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.big { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin: .5rem 0 .4rem; }

/* Forms */
.field { display: block; margin-top: 1.1rem; }
.field > span { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .4rem; }
.field small { display: block; margin-top: .35rem; color: var(--mist); font-size: .82rem; }
input, select, textarea { width: 100%; height: 2.9rem; padding: 0 .95rem; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--snow); font: 400 1rem var(--sans); transition: border-color .2s, box-shadow .2s, background .2s; }
textarea { height: auto; padding: .7rem .95rem; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mist) 50%), linear-gradient(135deg, var(--mist) 50%, transparent 50%); background-position: calc(100% - 1.05rem) 50%, calc(100% - .75rem) 50%; background-size: .3rem .3rem; background-repeat: no-repeat; padding-right: 2rem; }
select option { background: var(--raised); color: var(--snow); }
input::placeholder { color: rgba(163, 163, 168, .6); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 122, 26, .22); background: rgba(255, 255, 255, .05); }
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; padding: 0; accent-color: var(--amber); vertical-align: -.15rem; }
.msg { min-height: 1.4rem; margin: .9rem 0; font-size: .9rem; color: var(--mist); }
.msg.is-error { color: var(--bad); }
.msg.is-ok { color: var(--ok); }
.inline-form { display: flex; gap: .6rem; margin: 1rem 0 .25rem; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1 1 12rem; height: 2.25rem; font-size: .92rem; border-radius: 999px; }
.inline-form select { flex: 0 1 10rem; }
.row { display: flex; gap: .6rem; }
.row > * { flex: 1; }

/* Auth pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.75rem; padding: 2.5rem var(--pad); }
.auth-card { width: 100%; max-width: 26.5rem; padding: clamp(1.5rem, 5vw, 2.25rem); box-shadow: 0 40px 100px -50px rgba(255, 110, 20, .45); }
.providers { display: grid; gap: .65rem; margin-top: 1.4rem; }
.btn-provider { gap: .7rem; border-color: var(--line-strong); background: #111113; color: #ededee; }
.btn-provider:hover { border-color: rgba(255, 122, 26, .55); background: #17171a; color: var(--snow); }
.fine { margin-top: .9rem; text-align: center; color: var(--mist); font-size: .8rem; line-height: 1.5; }
.fine a { color: var(--mist); }
.fine a:hover { color: var(--snow); }
.divider { display: flex; align-items: center; gap: .9rem; margin: 1.4rem 0 .2rem; color: var(--mist); font: 500 .74rem var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#signin-msg { margin-bottom: 0; }
.alt { margin-top: 1.25rem; text-align: center; color: var(--mist); font-size: .92rem; }
.hint { margin-top: 1rem; color: var(--mist); font-size: .88rem; }
.code-input { font: 700 1.5rem var(--mono); letter-spacing: .18em; text-align: center; text-transform: uppercase; height: 3.6rem; }
.code-show { margin-top: 1.25rem; padding: .9rem; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: center; font: 700 1.6rem var(--mono); letter-spacing: .18em; color: var(--amber-hi); }

/* App chrome */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 3.75rem; padding: 0 var(--pad); background: rgba(5, 5, 6, .78); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--line); }
.topbar-right { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.toplink { color: var(--mist); text-decoration: none; font-size: .92rem; font-weight: 600; }
.toplink:hover { color: var(--snow); }
.who { color: var(--mist); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.shell { max-width: 62rem; margin: 0 auto; padding: 2.25rem var(--pad) 4rem; display: grid; gap: 1.1rem; }
.page-head { margin-bottom: .6rem; }
.grid { display: grid; gap: 1.1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Meters */
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .95rem; }
.meter-row b { font-size: 1.15rem; color: var(--amber-hi); font-weight: 700; }
.bar { height: 10px; margin-top: .65rem; border-radius: 5px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--amber), var(--amber-hi)); box-shadow: 0 0 14px rgba(255, 122, 26, .6); transition: width .7s var(--ease); }
.meter.is-full .bar i { background: linear-gradient(90deg, #ff4b3a, var(--bad)); box-shadow: 0 0 14px rgba(255, 90, 70, .6); }
.meter.is-full .meter-row b { color: var(--bad); }
.meter-sub { margin-top: .5rem; color: var(--mist); font-size: .84rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem -.5rem 0; padding: 0 .5rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mist); padding: .55rem .75rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link:hover td { background: rgba(255, 255, 255, .03); }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table .wrap { white-space: normal; min-width: 14rem; }
.table td.empty { text-align: center; color: var(--mist); padding: 2rem 1rem; white-space: normal; }
.table code, .reveal code, .diff { font: 400 .82rem var(--mono); }

.reveal { margin: 1rem 0 0; padding: 1.2rem 1.25rem; border: 1px solid rgba(255, 122, 26, .45); border-radius: 14px; background: rgba(255, 122, 26, .07); font-size: .92rem; }
.reveal-row { display: flex; gap: 1rem; align-items: center; margin-top: 1.1rem; }
.reveal code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--amber-hi); padding: .6rem .8rem; background: rgba(0, 0, 0, .28); border: 1px solid var(--line-strong); border-radius: 10px; letter-spacing: .02em; }
.reveal .btn-block { margin-top: 1.15rem; }

/* Badges */
.badge { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font: 500 .74rem var(--mono); border: 1px solid var(--line-strong); color: var(--mist); }
.badge.ok { color: var(--ok); border-color: rgba(111, 214, 154, .35); }
.badge.bad { color: var(--bad); border-color: rgba(255, 107, 94, .4); }
.badge.hot { color: var(--amber-ink); border-color: transparent; background: linear-gradient(180deg, var(--amber-hi), var(--amber)); font-weight: 700; }
.badge.warm { color: var(--amber-hi); border-color: rgba(255, 122, 26, .45); }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); min-height: calc(100vh - 3.75rem); }
.side { position: sticky; top: 3.75rem; align-self: start; display: flex; flex-direction: column; gap: .15rem; padding: 1.5rem .9rem; height: calc(100vh - 3.75rem); border-right: 1px solid var(--line); }
.side a { padding: .55rem .85rem; border-radius: 10px; color: var(--mist); text-decoration: none; font-weight: 600; font-size: .94rem; transition: background .2s, color .2s; }
.side a:hover { color: var(--snow); background: rgba(255, 255, 255, .04); }
.side a[aria-current="page"] { color: var(--snow); background: rgba(255, 122, 26, .12); box-shadow: inset 2px 0 0 var(--amber); }
.admin-main { padding: 2rem var(--pad) 4rem; display: grid; gap: 1.1rem; align-content: start; min-width: 0; outline: none; }
.admin-main > .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stat { padding: 1.1rem 1.25rem; }
.stat b { display: block; margin-top: .45rem; font: 700 1.55rem var(--mono); letter-spacing: -.03em; }
.stat small { display: block; margin-top: .2rem; color: var(--mist); font-size: .82rem; }
.stat b.pos { color: var(--ok); }
.stat b.neg { color: var(--bad); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; }
.filters input, .filters select { height: 2.25rem; font-size: .9rem; border-radius: 999px; width: auto; flex: 1 1 10rem; max-width: 18rem; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin-top: 1rem; color: var(--mist); font-size: .86rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; font-size: .93rem; margin-top: .75rem; }
.kv dt { color: var(--mist); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.cell-input { height: 2.1rem; padding: 0 .6rem; border-radius: 9px; font: 400 .86rem var(--mono); min-width: 6rem; }
.cell-input.wide { min-width: 17rem; }
.cell-input.narrow { min-width: 4.25rem; width: 4.75rem; }
.diff { margin: 0; max-width: 26rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--mist); }
.back { color: var(--mist); text-decoration: none; font-size: .9rem; }

.dialog { width: min(30rem, calc(100vw - 2rem)); padding: 1.6rem; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--raised); color: var(--snow); box-shadow: 0 40px 120px -20px #000; }
.dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
.dialog h2 { margin-bottom: .4rem; }
.dialog .row { margin-top: 1.25rem; justify-content: flex-end; }
.dialog .row > * { flex: 0 0 auto; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 2rem); padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--raised); font-size: .92rem; box-shadow: 0 20px 60px -15px #000; }
.toast.is-error { border-color: rgba(255, 107, 94, .5); color: var(--bad); }

@media (max-width: 860px) {
  .grid.two, .meters { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .side { position: sticky; top: 3.75rem; z-index: 5; flex-direction: row; height: auto; padding: .5rem var(--pad); overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(5, 5, 6, .9); backdrop-filter: blur(12px); }
  .side a { white-space: nowrap; }
  .side a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--amber); }
  .who { display: none; }
}
@media (max-width: 480px) {
  .grid.four { grid-template-columns: 1fr; }
  .reveal-row { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Plans for sale on the account page */
.plans { display: grid; gap: .75rem; margin-top: .4rem; }
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1.5rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px; }
.plan-name { font-weight: 600; font-size: 1.05rem; }
.plan .muted { margin-top: .2rem; font-size: .88rem; }
.plan-price { color: var(--mist); white-space: nowrap; }
.plan-price b { color: var(--snow); font-size: 1.1rem; margin-right: .15rem; }
.plan .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) { .plan { grid-template-columns: 1fr; gap: .75rem; } }

/* Checkout page */
.pay-card { max-width: 30rem; }
.pay-who { color: var(--mist); font-size: .86rem; }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: .9rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.pay-head h1 { font-size: clamp(1.8rem, 5vw, 2.3rem); }
.pay-price { text-align: right; color: var(--mist); font-size: .9rem; white-space: nowrap; }
.pay-price b { display: block; color: var(--snow); font-size: 1.7rem; font-weight: 700; }
.packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: 1.1rem; }
.pack { height: 2.75rem; border: 1px solid var(--line-strong); border-radius: 12px; background: none; color: var(--snow); font: 600 1rem var(--mono); cursor: pointer; transition: border-color .15s, background .15s; }
.pack:hover { background: rgba(255, 255, 255, .06); }
.pack.is-on { border-color: var(--amber); background: rgba(255, 140, 40, .12); color: var(--amber-hi); }
.pay-points { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .55rem; color: var(--mist); font-size: .95rem; }
.pay-points li { position: relative; padding-left: 1.2rem; }
.pay-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: .4rem; height: .4rem; border-radius: 50%; background: var(--amber); }
.pay-card .btn-block { margin-top: .4rem; }
.pay-card .fine a { text-underline-offset: 3px; }
.amount-field { margin-top: .9rem; }
.amount-input { display: flex; align-items: center; gap: .4rem; height: 2.9rem; padding: 0 .9rem; border: 1px solid var(--line-strong); border-radius: 12px; }
.amount-input:focus-within { border-color: var(--amber); }
.amount-input i { font-style: normal; color: var(--mist); font-family: var(--mono); }
.amount-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--snow); font: 500 1.05rem var(--mono); }
#amount .hint { margin-top: .4rem; }

/* Support: order notes on the account page, inbox and thread in admin */
.order-note { margin-top: .4rem; max-width: 26rem; font-size: .84rem; color: var(--mist); white-space: normal; }
.linklike { padding: 0; border: 0; background: none; color: var(--amber-hi); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linklike:hover { color: var(--snow); }
.nav-count { display: inline-block; min-width: 1.3rem; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; background: var(--amber); color: var(--amber-ink); font: 700 .72rem/1.3rem var(--mono); text-align: center; }
.badge.unread { margin-left: .5rem; }
.thread { display: flex; flex-direction: column; gap: .8rem; max-height: 55vh; overflow-y: auto; padding: .25rem .25rem 1rem; }
.thread-msg { max-width: min(42rem, 85%); }
.thread-msg.is-team { align-self: flex-end; }
.thread-body { padding: .7rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-msg.is-team .thread-body { background: rgba(255, 122, 26, .14); border-color: rgba(255, 122, 26, .35); }
.thread-meta { margin-top: .25rem; font-size: .76rem; color: var(--mist); }
.thread-msg.is-team .thread-meta { text-align: right; }
.reply { border-top: 1px solid var(--line); padding-top: 1rem; }
.reply-box { width: 100%; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--night); color: var(--snow); font: 400 .95rem/1.5 var(--sans); resize: vertical; }
.reply-box:focus { outline: none; border-color: var(--amber); }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; flex-wrap: wrap; }
