/* ==========================================================================
   Valexis Rewards - design system
   Paper + ink with an electric lime reward accent.
   ========================================================================== */

:root {
    --bg: #f4f3ee;
    --bg-deep: #ebe9e1;
    --surface: #ffffff;
    --surface-2: #fafaf6;
    --ink: #0f1115;
    --ink-2: #353a45;
    --muted: #6b7180;
    --faint: #9aa0ac;
    --line: #e3e1d8;
    --line-strong: #d3d0c4;

    --lime: #c5f23a;
    --lime-soft: #eefbc4;
    --lime-deep: #5f7f0c;
    --night: #0f1115;
    --night-2: #181b22;
    --night-line: #2a2e38;

    --green: #15803d;   --green-bg: #e3f5e9;
    --amber: #b45309;   --amber-bg: #fdf0dc;
    --red: #c02626;     --red-bg: #fde6e6;
    --blue: #1d4ed8;    --blue-bg: #e2eafd;
    --violet: #6d28d9;  --violet-bg: #eee6fd;
    --grey: #555b67;    --grey-bg: #ecebe6;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 17, 21, .05);
    --shadow: 0 1px 2px rgba(15, 17, 21, .04), 0 8px 24px -12px rgba(15, 17, 21, .14);
    --shadow-lg: 0 24px 60px -24px rgba(15, 17, 21, .35);

    --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --display: "Unbounded", "Manrope", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    --header-h: 68px;

    --solid: #0f1115;
    --on-solid: #ffffff;
    --solid-accent: #c5f23a;
    --emblem: #0f1115;
    --tint: rgba(15, 17, 21, .06);
    --unread-bg: #fbfdf2;
    --header-bg: rgba(244, 243, 238, .86);
    --row-hover: #fcfcf9;
    --on-lime: #0f1115;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font: 600 clamp(1.6rem, 2.6vw, 2.1rem)/1.15 var(--display); letter-spacing: -.02em; }
h2 { font: 600 1.25rem/1.25 var(--display); letter-spacing: -.015em; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
::selection { background: var(--lime); color: var(--on-lime); }

.icon { width: 18px; height: 18px; flex: none; }
.icon.inline { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.center { text-align: center; }

/* Layout helpers -------------------------------------------------------- */
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--gap, 18px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 980px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Buttons --------------------------------------------------------------- */
.btn {
    --b-bg: var(--solid); --b-fg: var(--on-solid); --b-line: var(--solid);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 18px;
    border: 1px solid var(--b-line); border-radius: 999px;
    background: var(--b-bg); color: var(--b-fg);
    font: 700 .92rem/1 var(--font); letter-spacing: .005em;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(15, 17, 21, .45); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .input:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(197, 242, 58, .9); outline-offset: 2px; }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-lime { --b-bg: var(--lime); --b-fg: var(--on-lime); --b-line: #b4e021; }
.btn-ghost { --b-bg: transparent; --b-fg: var(--ink); --b-line: var(--line-strong); }
.btn-ghost:hover { --b-bg: var(--surface); }
.btn-soft { --b-bg: var(--bg-deep); --b-fg: var(--ink); --b-line: transparent; }
.btn-danger { --b-bg: var(--red); --b-fg: #fff; --b-line: var(--red); }
.btn-danger-ghost { --b-bg: transparent; --b-fg: var(--red); --b-line: var(--red-line, #f0bdbd); }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: .84rem; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn .icon { width: 17px; height: 17px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Forms ----------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.label .opt { font-weight: 500; color: var(--faint); }
.input, .select, .textarea {
    width: 100%; min-height: 46px; padding: 11px 14px;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: var(--surface); color: var(--ink);
    font: 500 .95rem/1.4 var(--font);
    transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7180' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(197, 242, 58, .45); }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--red); }
.hint { font-size: .8rem; color: var(--muted); }
.error-text { font-size: .8rem; color: var(--red); font-weight: 600; }
.input-group { position: relative; }
.input-group .input { padding-right: 76px; }
.input-suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 .8rem var(--mono); color: var(--muted); pointer-events: none; }
.input-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.code-input { font: 700 1.6rem/1 var(--mono); letter-spacing: .5em; text-align: center; padding-left: .5em; }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: .9rem; color: var(--muted); }
.file-drop:hover { border-color: var(--ink); color: var(--ink); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* Cards & surfaces ------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 1rem; font-family: var(--font); font-weight: 800; letter-spacing: 0; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-link { display: block; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card-link:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }

.panel-dark {
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--night); color: #f3f4f1; border-radius: var(--radius-lg);
}
.panel-dark::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(420px 220px at 100% 0%, rgba(197, 242, 58, .22), transparent 70%),
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px;
}
.panel-dark .muted { color: #a3a8b3; }

/* Stat tiles */
.stat { padding: 18px 20px; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-label .icon { width: 16px; height: 16px; }
.stat-value { margin-top: 8px; font: 600 1.55rem/1.1 var(--display); letter-spacing: -.02em; }
.stat-value small { font: 700 .8rem var(--mono); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat-sub { margin-top: 4px; font-size: .82rem; color: var(--muted); }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--green); background: var(--green-bg); }
.badge-amber { color: var(--amber); background: var(--amber-bg); }
.badge-red { color: var(--red); background: var(--red-bg); }
.badge-blue { color: var(--blue); background: var(--blue-bg); }
.badge-violet { color: var(--violet); background: var(--violet-bg); }
.badge-grey { color: var(--grey); background: var(--grey-bg); }
.badge-lime { color: var(--on-lime); background: var(--lime); }
.badge-lime::before { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .8rem; font-weight: 700; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.chip.is-active, .chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.reward-tag { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px; border-radius: 10px; background: var(--lime); color: var(--on-lime); font: 700 .95rem var(--display); letter-spacing: -.01em; white-space: nowrap; }
.reward-tag small { font: 800 .7rem var(--mono); }

/* Avatars */
.avatar { --hue: 80; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: hsl(var(--hue) 70% 88%); color: hsl(var(--hue) 55% 25%); font: 800 .8rem var(--font); letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar.xl { width: 88px; height: 88px; font-size: 1.7rem; }
.stars { color: var(--line-strong); letter-spacing: 1px; font-size: .9rem; }
.stars .on { color: #e8a208; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { padding: 11px 16px; text-align: left; font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--row-hover); }
.amount-pos { color: var(--green); font-weight: 800; white-space: nowrap; }
.amount-neg { color: var(--ink); font-weight: 800; white-space: nowrap; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-deep); color: var(--ink); }
.list-icon.lime { background: var(--lime-soft); color: var(--lime-deep); }

/* Empty state */
.empty { padding: 44px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--lime-soft); color: var(--lime-deep); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 16px; }

/* Alerts / flashes */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; font-size: .9rem; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--green-bg); color: #0d5c2b; border-color: #c4e8d0; }
.alert-error { background: var(--red-bg); color: #8c1b1b; border-color: #f4c6c6; }
.alert-info { background: var(--blue-bg); color: #193d9e; border-color: #c9d7fa; }
.alert-warn { background: var(--amber-bg); color: #84400b; border-color: #f4dbb4; }
.flash-stack { position: fixed; z-index: 90; top: calc(var(--header-h) + 12px); right: 16px; display: grid; gap: 10px; width: min(420px, calc(100% - 32px)); }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: flash-in .35s cubic-bezier(.2, .9, .3, 1.2); }
.flash-close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; padding: 0; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-deep); width: max-content; max-width: 100%; overflow-x: auto; }
.tab { padding: 8px 16px; border-radius: 999px; font-size: .86rem; font-weight: 700; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .count { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--solid); color: var(--on-solid); font-size: .7rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); font-size: .88rem; }
.pagination a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }
.pagination .icon { width: 15px; height: 15px; }

/* Dialog */
dialog.modal { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(15, 17, 21, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .25s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { font-size: 1.1rem; }
.modal-body { padding: 18px 22px 22px; }
.modal-close { background: var(--bg); border: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink); }

/* Page header */
.page { padding: 30px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 800 .74rem var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--lime-deep); border-radius: 2px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: .86rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
.back-link .icon { width: 16px; height: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { font-size: 1.05rem; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--header-bg); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.app-header .container { height: 100%; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--emblem); color: var(--lime); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font: 700 1.02rem var(--display); letter-spacing: -.02em; }
.brand-name span { color: var(--lime-deep); }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: .9rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.nav a .icon { width: 17px; height: 17px; opacity: .75; }
.nav a:hover { background: var(--bg-deep); color: var(--ink); }
.nav a.is-active { background: var(--solid); color: var(--on-solid); }
.nav a.is-active .icon { opacity: 1; color: var(--solid-accent); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.balance-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font: 700 .86rem var(--mono); white-space: nowrap; }
.balance-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); text-decoration: none; background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--bg-deep); color: var(--ink); }
.icon-btn .icon { width: 20px; height: 20px; }
.dot-count { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--emblem); color: var(--lime); font: 800 .66rem/18px var(--font); text-align: center; border: 2px solid var(--bg); }
.menu { position: relative; }
.menu-trigger { display: flex; align-items: center; gap: 6px; padding: 3px; border: 0; background: none; border-radius: 999px; cursor: pointer; }
.menu-trigger:hover { background: var(--bg-deep); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); display: none; }
.menu.is-open .menu-panel { display: block; animation: modal-in .18s ease; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font: 600 .9rem var(--font); color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg); }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.nav-toggle { display: none; }
@media (max-width: 1020px) {
    .nav-toggle { display: grid; }
    .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 4px; margin: 0; padding: 12px 16px 18px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); display: none; }
    .nav.is-open { display: flex; }
    .nav a { padding: 12px 14px; }
    .balance-pill .label-full { display: none; }
}
@media (max-width: 560px) { .balance-pill { display: none; } .brand-name { display: none; } }

.app-footer { padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.app-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.app-footer a { color: var(--ink-2); }

/* Dashboard hero balance */
.balance-hero { padding: 28px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; }
.balance-hero .big { font: 600 clamp(2rem, 4.4vw, 3.1rem)/1 var(--display); letter-spacing: -.035em; margin-top: 10px; }
.balance-hero .big small { font: 700 1rem var(--mono); color: var(--lime); margin-left: 8px; letter-spacing: 0; }
.hero-split { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--night-line); border: 1px solid var(--night-line); border-radius: 16px; overflow: hidden; align-self: center; }
.hero-split > div { padding: 14px 16px; background: var(--night-2); }
.hero-split .k { font-size: .74rem; color: #a3a8b3; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hero-split .v { margin-top: 4px; font: 700 1rem var(--mono); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.panel-dark .btn-ghost { --b-fg: #fff; --b-line: #3a3f4b; }
.panel-dark .btn-ghost:hover { --b-bg: rgba(255,255,255,.06); }
@media (max-width: 860px) { .balance-hero { grid-template-columns: 1fr; } }

/* Pillar cards (Earn / Market / Stake) */
.pillar { padding: 22px; display: flex; flex-direction: column; gap: 12px; min-height: 190px; }
.pillar-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--emblem); color: var(--lime); }
.pillar-icon .icon { width: 22px; height: 22px; }
.pillar p { color: var(--muted); font-size: .9rem; }
.pillar .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .88rem; }

/* Task cards */
.task-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.task-card .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .8rem; color: var(--muted); }
.task-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.task-card .meta .icon { width: 14px; height: 14px; }
.task-card h3 { font-size: 1.02rem; }
.task-card p { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.progress { height: 6px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ink), #3d4350); }
.progress.lime > span { background: linear-gradient(90deg, #a6d61f, var(--lime)); }
.panel-dark .progress { background: var(--night-line); }

/* Job cards */
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); text-decoration: none; }
.job-row:last-child { border-bottom: 0; }
.job-row:hover { background: var(--surface-2); }
.job-row h3 { font-size: 1rem; margin-bottom: 6px; }
.job-row p { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.job-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-meta .icon { width: 14px; height: 14px; }
.job-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
@media (max-width: 640px) { .job-row { grid-template-columns: 1fr; } .job-side { align-items: flex-start; text-align: left; flex-direction: row; } }

.prose { font-size: .95rem; color: var(--ink-2); line-height: 1.7; overflow-wrap: anywhere; }
.prose a { color: var(--ink); font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* Chat ------------------------------------------------------------------ */
.chat-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .chat-shell { grid-template-columns: 1fr; } }
.chat { display: flex; flex-direction: column; height: min(72vh, 760px); min-height: 460px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(var(--surface-2), var(--surface)); }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--solid); border-color: var(--solid); color: var(--on-solid); border-radius: 16px 16px 4px 16px; }
.msg.mine .bubble a { color: var(--solid-accent); }
.msg-time { font-size: .7rem; color: var(--faint); margin-top: 4px; }
.msg.mine .msg-time { text-align: right; }
.msg-system { align-self: center; max-width: 90%; padding: 8px 14px; border-radius: 999px; background: var(--bg-deep); color: var(--ink-2); font-size: .8rem; font-weight: 600; text-align: center; }
.msg-delivery .bubble { border: 2px solid var(--lime); background: var(--lime-soft); color: var(--ink); }
.msg.mine.msg-delivery .bubble { background: var(--lime-soft); color: var(--ink); border-color: var(--lime); }
.msg-delivery .bubble a { color: var(--ink); }
.delivery-label { display: flex; align-items: center; gap: 6px; font: 800 .72rem var(--font); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; color: var(--lime-deep); }
.attachment { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--tint); font-size: .84rem; font-weight: 700; text-decoration: none; }
.msg.mine .attachment { background: rgba(128, 128, 128, .2); }
.attachment img { max-width: 240px; border-radius: 8px; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; min-height: 46px; max-height: 160px; resize: none; }
.chat-file { position: relative; }
.chat-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chat-file-name { font-size: .78rem; color: var(--muted); padding: 0 14px 10px; }
.chat-closed { padding: 14px 18px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); text-align: center; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.thread-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; align-items: center; }
.thread-item:hover { background: var(--surface-2); }
.thread-item.unread { background: var(--unread-bg); }
.thread-item.unread .thread-title { font-weight: 800; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime-deep); flex: none; }

/* Wallet ---------------------------------------------------------------- */
.wallet-option { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: border-color .15s, transform .15s; }
.wallet-option:hover { border-color: var(--ink); transform: translateY(-1px); }
.wallet-option + .wallet-option { margin-top: 10px; }
.wallet-option.recommended { border: 2px solid var(--ink); background: linear-gradient(120deg, var(--lime-soft), var(--surface) 60%); }
.wallet-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--emblem); color: var(--lime); flex: none; overflow: hidden; }
.wallet-logo img { width: 100%; height: 100%; object-fit: cover; }
.wallet-logo.light { background: var(--bg); color: var(--ink); }
.address-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font: 600 .86rem var(--mono); overflow-wrap: anywhere; }
.qr-box { display: grid; place-items: center; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); width: max-content; margin: 0 auto; }
.qr-box canvas, .qr-box img { width: 210px !important; height: 210px !important; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 12px; font-size: .9rem; }
.steps li::before { content: counter(step); display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--emblem); color: var(--lime); font: 800 .74rem var(--font); }

/* Staking plans */
.plan { padding: 22px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.plan-apr { font: 600 2.2rem/1 var(--display); letter-spacing: -.03em; }
.plan-apr small { font: 700 .8rem var(--font); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.plan.featured { border: 2px solid var(--ink); }
.plan.featured::after { content: "Popular"; position: absolute; top: 18px; right: 18px; padding: 3px 10px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font: 800 .7rem var(--font); text-transform: uppercase; letter-spacing: .06em; }

/* Notifications */
.notif { display: flex; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); text-decoration: none; }
.notif.unread { background: var(--unread-bg); }
.notif:hover { background: var(--surface-2); }

/* Profile */
.profile-hero { padding: 28px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; isolation: isolate; padding: 40px 48px; display: flex; flex-direction: column; background: var(--night); color: #f1f2ee; }
.auth-art::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background:
        radial-gradient(600px 380px at 85% 10%, rgba(197, 242, 58, .20), transparent 70%),
        radial-gradient(500px 400px at 0% 100%, rgba(120, 140, 255, .14), transparent 70%);
}
.auth-art::after {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
    background:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 36px 36px,
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 36px 36px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-art .brand-name { color: #fff; }
.auth-art .brand-name span { color: var(--lime); }
.auth-art .brand-mark { background: var(--lime); color: var(--on-lime); }
.auth-copy { margin-top: auto; max-width: 480px; }
.auth-copy h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.05; letter-spacing: -.035em; }
.auth-copy h1 em { font-style: normal; color: var(--lime); }
.auth-copy p { margin-top: 16px; color: #a9aeb8; font-size: 1rem; max-width: 420px; }
.float-cards { position: relative; height: 270px; margin: 36px 0 28px; }
.float-card { position: absolute; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px; background: rgba(24, 27, 34, .82); border: 1px solid var(--night-line); backdrop-filter: blur(8px); box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); font-size: .86rem; animation: bob 7s ease-in-out infinite; }
.float-card .fc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--lime); color: var(--on-lime); flex: none; }
.float-card .fc-icon.alt { background: #2a2e38; color: var(--lime); }
.float-card .fc-amt { font: 700 .9rem var(--mono); color: var(--lime); }
.float-card .fc-sub { color: #8d929d; font-size: .76rem; }
.float-card:nth-child(1) { top: 0; left: 0; }
.float-card:nth-child(2) { top: 92px; left: 30%; animation-delay: -2.3s; }
.float-card:nth-child(3) { top: 190px; left: 6%; animation-delay: -4.6s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }
.auth-foot { margin-top: 28px; display: flex; gap: 22px; color: #7d828c; font-size: .8rem; }
.auth-foot strong { display: block; color: #fff; font: 600 1.05rem var(--display); }
.auth-main { display: flex; flex-direction: column; padding: 32px 24px; background: var(--bg); }
.auth-top { display: flex; justify-content: flex-end; font-size: .88rem; color: var(--muted); }
.auth-top a { margin-left: 6px; font-weight: 800; color: var(--ink); }
.auth-form { width: min(420px, 100%); margin: auto; padding: 32px 0; }
.auth-form h2 { font-size: 1.6rem; letter-spacing: -.025em; }
.auth-form .sub { margin: 8px 0 26px; color: var(--muted); }
.auth-mobile-brand { display: none; margin-bottom: 26px; }
.password-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.password-meter span { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.password-meter[data-score="1"] span:nth-child(-n+1) { background: var(--red); }
.password-meter[data-score="2"] span:nth-child(-n+2) { background: var(--amber); }
.password-meter[data-score="3"] span:nth-child(-n+3) { background: #84b317; }
.password-meter[data-score="4"] span { background: var(--green); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--faint); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-mobile-brand { display: inline-flex; }
}

/* ==========================================================================
   Landing page
   ========================================================================== */
.land-header { position: absolute; inset: 0 0 auto; z-index: 10; padding: 22px 0; }
.land-header .container { display: flex; align-items: center; gap: 20px; }
.land-header .brand-name { color: #fff; }
.land-header .brand-name span, .land-header .brand-mark { color: var(--lime); }
.land-header .brand-mark { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.land-nav { display: flex; gap: 26px; margin-left: 24px; }
.land-nav a { color: #c3c7cf; font-weight: 600; font-size: .92rem; text-decoration: none; }
.land-nav a:hover { color: #fff; }
.land-header .header-right .btn-ghost { --b-fg: #fff; --b-line: rgba(255,255,255,.22); }
@media (max-width: 820px) { .land-nav { display: none; } }
.hero { position: relative; overflow: hidden; isolation: isolate; padding: 150px 0 110px; background: var(--night); color: #f2f3ef; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background:
        radial-gradient(700px 420px at 78% 18%, rgba(197, 242, 58, .22), transparent 70%),
        radial-gradient(600px 500px at 5% 95%, rgba(110, 130, 255, .14), transparent 70%);
}
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 44px 44px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 1; letter-spacing: -.045em; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero .lead { margin-top: 22px; font-size: 1.12rem; color: #b0b5be; max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero .btn-ghost { --b-fg: #fff; --b-line: rgba(255,255,255,.25); }
.hero-proof { display: flex; gap: 28px; margin-top: 40px; color: #8c919b; font-size: .84rem; flex-wrap: wrap; }
.hero-proof strong { display: block; color: #fff; font: 600 1.3rem var(--display); letter-spacing: -.02em; }
.hero-visual { position: relative; }
.token-orb { position: relative; width: min(380px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #e6ff8a, var(--lime) 30%, #6f9411 72%, #2b3a06); box-shadow: 0 0 0 14px rgba(197,242,58,.08), 0 0 0 30px rgba(197,242,58,.04), 0 40px 120px -20px rgba(197,242,58,.45); display: grid; place-items: center; animation: orb 9s ease-in-out infinite; }
.token-orb svg { width: 46%; height: 46%; color: var(--on-lime); }
@keyframes orb { 50% { transform: translateY(-14px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .token-orb { animation: none; } }
.hero-visual .float-card { animation-duration: 8s; }
.hero-visual .float-card:nth-child(2) { top: 6%; left: -6%; }
.hero-visual .float-card:nth-child(3) { top: 46%; right: -4%; left: auto; }
.hero-visual .float-card:nth-child(4) { bottom: 4%; left: 4%; top: auto; animation-delay: -3s; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { max-width: 420px; margin: 0 auto; } }
.land-section { padding: 96px 0; }
.land-section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.land-head { max-width: 640px; margin-bottom: 44px; }
.land-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.08; letter-spacing: -.035em; }
.land-head p { margin-top: 14px; color: var(--muted); font-size: 1.05rem; }
.feature { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.feature .pillar-icon { width: 52px; height: 52px; border-radius: 16px; }
.feature h3 { font: 600 1.15rem var(--display); letter-spacing: -.02em; }
.feature p { color: var(--muted); }
.feature ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; font-size: .9rem; }
.feature li { display: flex; gap: 8px; }
.feature li .icon { width: 16px; height: 16px; color: var(--lime-deep); margin-top: 3px; }
.how { counter-reset: how; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.how > div { counter-increment: how; padding: 24px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--line); }
.how > div::before { content: "0" counter(how); display: block; font: 600 .9rem var(--display); color: var(--lime-deep); margin-bottom: 18px; }
.how h3 { margin-bottom: 6px; }
.how p { color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .how { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .how { grid-template-columns: 1fr; } }
.wallet-band { padding: 40px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.wallet-band h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.03em; line-height: 1.1; }
.wallet-band p { margin-top: 12px; color: #a9aeb8; }
@media (max-width: 860px) { .wallet-band { grid-template-columns: 1fr; padding: 28px; } }
.token-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--night-line); border-radius: 18px; overflow: hidden; border: 1px solid var(--night-line); }
.token-facts > div { padding: 18px; background: var(--night-2); }
.token-facts .k { font-size: .74rem; font-weight: 700; color: #8d929d; text-transform: uppercase; letter-spacing: .08em; }
.token-facts .v { margin-top: 6px; font: 600 1.05rem var(--display); color: #fff; overflow-wrap: anywhere; }
.cta-band { text-align: center; padding: 80px 24px; }
.cta-band h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); letter-spacing: -.04em; }
.cta-band p { margin: 14px auto 28px; color: var(--muted); max-width: 520px; }
.land-footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.land-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ==========================================================================
   Admin console
   ========================================================================== */
.admin { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--night) 252px, transparent 252px); }
@media (max-width: 960px) { .admin { background: none; } }
.admin-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; background: var(--night); color: #d6d9de; display: flex; flex-direction: column; gap: 4px; }
.admin-side .brand { padding: 0 10px 18px; }
.admin-side .brand-name { color: #fff; }
.admin-side .brand-mark { background: var(--lime); color: var(--on-lime); }
.admin-side .tag { margin-left: 4px; padding: 2px 8px; border-radius: 6px; background: #262a33; font: 800 .64rem var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.admin-side .group { margin: 14px 10px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #6c717c; }
.admin-side a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: #c4c8cf; text-decoration: none; font-weight: 600; font-size: .9rem; }
.admin-side a:hover { background: #1b1e25; color: #fff; }
.admin-side a.is-active { background: #22262e; color: #fff; }
.admin-side a.is-active .icon { color: var(--lime); }
.admin-side .count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: .7rem; font-weight: 800; }
.admin-side .side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #23262e; }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: var(--header-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.admin-content { padding: 28px; }
.admin-toggle { display: none; }
@media (max-width: 960px) {
    .admin { grid-template-columns: 1fr; }
    .admin-side { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
    .admin-side.is-open { transform: none; box-shadow: var(--shadow-lg); }
    .admin-toggle { display: grid; }
    .admin-content { padding: 20px 16px; }
    .admin-top { padding: 0 16px; }
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filter-bar .input, .filter-bar .select { min-height: 38px; padding-top: 7px; padding-bottom: 7px; width: auto; font-size: .88rem; }
.proof-img { max-width: 100%; max-height: 360px; border-radius: 12px; border: 1px solid var(--line); }
.warn-box { padding: 14px 16px; border-radius: 14px; background: var(--amber-bg); color: #7a3c0a; font-size: .88rem; border: 1px solid #f4dbb4; }

/* Error page */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-code { font: 600 clamp(4rem, 12vw, 7rem)/1 var(--display); letter-spacing: -.06em; background: linear-gradient(180deg, var(--ink), #5a606c); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ==========================================================================
   Dark theme (set on <html data-theme="dark"> by the inline script in partials/head.php)
   ========================================================================== */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c0e12;
    --bg-deep: #171a21;
    --surface: #13161c;
    --surface-2: #171a21;
    --ink: #eceee8;
    --ink-2: #c3c7ce;
    --muted: #8e939e;
    --faint: #646a76;
    --line: #242830;
    --line-strong: #343944;

    --lime-soft: rgba(197, 242, 58, .12);
    --lime-deep: #c5f23a;
    --night: #101318;
    --night-2: #171a21;
    --night-line: #2a2e38;

    --green: #4ade80;   --green-bg: rgba(74, 222, 128, .12);
    --amber: #fbbf24;   --amber-bg: rgba(251, 191, 36, .12);
    --red: #f87171;     --red-bg: rgba(248, 113, 113, .12);
    --blue: #60a5fa;    --blue-bg: rgba(96, 165, 250, .12);
    --violet: #a78bfa;  --violet-bg: rgba(167, 139, 250, .14);
    --grey: #a3a8b2;    --grey-bg: rgba(255, 255, 255, .07);
    --red-line: rgba(248, 113, 113, .45);

    --solid: #eceee8;
    --on-solid: #0f1115;
    --solid-accent: #4d6b00;
    --emblem: #22262f;
    --tint: rgba(255, 255, 255, .08);
    --unread-bg: rgba(197, 242, 58, .05);
    --header-bg: rgba(12, 14, 18, .82);
    --row-hover: #171a21;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
}
:root[data-theme="dark"] .panel-dark { border: 1px solid var(--line); }
:root[data-theme="dark"] .avatar { background: hsl(var(--hue) 30% 22%); color: hsl(var(--hue) 70% 82%); }
:root[data-theme="dark"] .alert-success { color: #86efac; border-color: rgba(74, 222, 128, .25); }
:root[data-theme="dark"] .alert-error { color: #fca5a5; border-color: rgba(248, 113, 113, .25); }
:root[data-theme="dark"] .alert-info { color: #93c5fd; border-color: rgba(96, 165, 250, .25); }
:root[data-theme="dark"] .alert-warn, :root[data-theme="dark"] .warn-box { color: #fcd34d; border-color: rgba(251, 191, 36, .25); }
:root[data-theme="dark"] .flash-stack .alert { background-color: var(--surface); }
:root[data-theme="dark"] .error-code { background: linear-gradient(180deg, #eceee8, #6b7180); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="dark"] .proof-img, :root[data-theme="dark"] .attachment img { background: #fff; }
:root[data-theme="dark"] .checkbox input, :root[data-theme="dark"] input[type=radio] { accent-color: var(--lime); }

/* Theme toggle: shows the moon in light mode and the sun in dark mode. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-choice { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font: 700 .86rem var(--font); cursor: pointer; }
.theme-choice:hover { border-color: var(--line-strong); }
.theme-choice.is-active { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime-soft); }
.theme-swatch { width: 100%; height: 54px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(135deg, #f4f3ee 50%, #ffffff 50%); position: relative; overflow: hidden; }
.theme-swatch::after { content: ""; position: absolute; left: 10px; top: 10px; width: 40%; height: 8px; border-radius: 4px; background: #0f1115; box-shadow: 0 14px 0 -1px #c5f23a; }
.theme-swatch.dark { background: linear-gradient(135deg, #0c0e12 50%, #13161c 50%); }
.theme-swatch.dark::after { background: #eceee8; }
.theme-swatch.system { background: linear-gradient(90deg, #f4f3ee 50%, #0c0e12 50%); }
:root[data-theme="dark"] .admin-side { border-right: 1px solid var(--line); }
