/* ==========================================================================
   Steam Friends Tracker - "journal first"
   One quiet ground, one surface tint, colour only where it means something:
   green = came, red = left / banned, grey = changed. Three palettes share the
   same tokens; the html[data-theme] attribute picks one (bright is the default, see the inline script in the templates).
   ========================================================================== */
:root {
    /* graphite */
    --bg: #141517;
    --bg-2: #1c1e21;
    --bg-3: #24272b;
    --line: rgba(255, 255, 255, 0.07);
    --text: #e9e9e6;
    --text-2: #9a9c99;
    --text-3: #67696c;
    --accent: #e9e9e6;            /* primary action = light on dark */
    --accent-ink: #141517;
    --link: #c9ccd1;
    --added: #4bc58d;
    --removed: #ef5f5b;
    --added-bar: #2f9e6e;
    --removed-bar: #d2504c;
    --online: #6fc3d6;
    --ingame: #9ccc4e;
    --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius: 10px;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    --max: 1060px;
    --nav-h: 64px;
    color-scheme: dark;
}
:root[data-theme="steam"] {
    --bg: #171a21; --bg-2: #1e2530; --bg-3: #27303d; --line: rgba(199, 213, 224, 0.08);
    --text: #dfe6ee; --text-2: #8f9aa6; --text-3: #5b6672;
    --accent: #66c0f4; --accent-ink: #0f1a24; --link: #9ecbeb;
    --added: #6cc04a; --removed: #e8524d; --added-bar: #4f9d33; --removed-bar: #c94540;
    --online: #57cbde; --ingame: #90ba3c;
}
:root[data-theme="bright"] {
    --bg: #1b212c; --bg-2: #252d3a; --bg-3: #303a49; --line: rgba(255, 255, 255, 0.09);
    --text: #e8edf4; --text-2: #a0acbd; --text-3: #6f7c8d;
    --accent: #7cc7ff; --accent-ink: #0d141c; --link: #a9d3f5;
    --added: #5fd39b; --removed: #ff6b66; --added-bar: #34a875; --removed-bar: #d94c47;
    --online: #5dd0e6; --ingame: #a3d64f;
}
:root[data-theme="black"] {
    --bg: #000000; --bg-2: #121214; --bg-3: #1c1c1f; --line: rgba(255, 255, 255, 0.08);
    --text: #f4f4f4; --text-2: #9b9b9b; --text-3: #5f5f5f;
    --accent: #ffffff; --accent-ink: #000000; --link: #d6d6d6;
    --added: #30d158; --removed: #ff453a; --added-bar: #1fa64a; --removed-bar: #d63a30;
    --online: #64d2ff; --ingame: #a6e22e;
}
/* semantic aliases kept for shared components */
:root { --ban: var(--removed); --rename: var(--text-2); --privacy: var(--text-2); --brand: var(--accent); --brand-2: var(--accent); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.55; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { display: block; width: 1em; height: 1em; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(255, 255, 255, 0.18); }
[hidden] { display: none !important; }

.shell { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.c-added { color: var(--added); } .c-removed { color: var(--removed); } .c-ban { color: var(--removed); }
.c-rename, .c-privacy { color: var(--text-2); } .c-brand { color: var(--accent); }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; transition: color .15s, background .15s; }
.link:hover { color: var(--text); background: var(--bg-2); }
.link:active { transform: translateY(1px); }
.link svg { width: 13px; height: 13px; }
.link:disabled { opacity: .5; cursor: default; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav .shell { display: flex; align-items: center; gap: 14px; height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.logo:hover { color: var(--text); text-decoration: none; }
.logo-mark { width: 24px; height: 24px; }
.logo em { font-style: normal; color: var(--text-2); font-weight: 500; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-search { margin-left: auto; flex: 0 1 240px; min-width: 120px; display: flex; }
.nav-search .input { padding: 8px 12px 8px 34px; font-size: 14px; }
.nav-search .input-wrap > svg { left: 11px; width: 15px; height: 15px; }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.nav-search + .nav-right { margin-left: 0; }
.lang-toggle { display: inline-flex; }
.lang-toggle button { padding: 4px 6px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); text-transform: uppercase; transition: color .15s, background .15s; }
.lang-toggle button:hover { color: var(--text); background: var(--bg-2); }
.lang-toggle button.active { color: var(--text-2); }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; flex: none; transition: background .15s; }
.user-btn:hover { background: var(--bg-2); }
.user-btn img { width: 28px; height: 28px; border-radius: 50%; }
.user-btn span { font-size: 14px; max-width: 160px; }
.user-btn > svg { width: 13px; height: 13px; color: var(--text-3); }
.user-dd { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--bg-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; }
.user-dd.open { display: block; }
.user-dd a, .user-dd button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; text-align: left; }
.user-dd a:hover, .user-dd button:hover { background: var(--bg-3); text-decoration: none; }
.user-dd svg { width: 15px; height: 15px; color: var(--text-2); }
.user-dd .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.user-dd .mono { color: var(--text-3); padding: 6px 12px 2px; font-size: 11px; }
.nav .burger { display: none; }
.burger svg { width: 18px; height: 18px; }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; line-height: 1.2; background: var(--bg-2); color: var(--text); white-space: nowrap; transition: background .15s, transform .1s, filter .15s, box-shadow .15s; }
.btn:hover { background: var(--bg-3); color: var(--text); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.btn-steam { background: var(--bg-2); color: var(--text); }
.btn-steam:hover { background: var(--bg-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-danger { color: var(--removed); background: transparent; }
.btn-danger:hover { background: rgba(239, 95, 91, .14); color: var(--removed); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn-icon { padding: 8px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.input { width: 100%; padding: 11px 14px; border-radius: var(--radius); background: var(--bg-2); border: 0; color: var(--text); outline: none; transition: box-shadow .15s, background .15s; }
.input::placeholder { color: var(--text-3); }
.input:focus { background: var(--bg-3); box-shadow: 0 0 0 1px var(--text-3); }
.input-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.input-wrap > svg { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-left: 38px; }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9c99' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--bg-3); flex: none; cursor: pointer; transition: background .2s, box-shadow .15s; }
.switch:hover { box-shadow: 0 0 0 4px var(--bg-2); }
.switch:hover::after { background: var(--text); }
.switch[aria-checked="true"]:hover { filter: brightness(1.1); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s cubic-bezier(.2, .8, .3, 1.2), background .15s; }
.switch[aria-checked="true"] { background: var(--added); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: #0e1a12; }

/* ---------- generic ---------- */
.card { background: transparent; }
.card-pad { padding: 0; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 600; }
.section { padding: 56px 0 0; }
.section-title { font-weight: 600; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 8px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; font-size: 13px; color: var(--text-2); transition: background .15s, color .15s, transform .1s; }
.chip:active { transform: scale(.97); }
.chip:hover { color: var(--text); background: var(--bg-2); }
.chip.active { color: var(--text); background: var(--bg-3); }
.chip svg { width: 13px; height: 13px; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.chip[data-k="added"] .dot { background: var(--added); }
.chip[data-k="removed"] .dot, .chip[data-k="bans"] .dot { background: var(--removed); }
.chips { display: flex; flex-wrap: wrap; gap: 2px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: 11px; line-height: 1.5; white-space: nowrap; background: var(--bg-3); color: var(--text-2); }
.badge svg { width: 11px; height: 11px; }
.badge-ban, .badge-vac { background: rgba(239, 95, 91, .14); color: var(--removed); }
.badge-brand, .badge-added { background: var(--bg-3); color: var(--text); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.avatar { position: relative; flex: none; width: 36px; height: 36px; }
.avatar img { width: 100%; height: 100%; border-radius: 9px; object-fit: cover; background: var(--bg-2); }
.avatar.round img { border-radius: 50%; }
.avatar .st { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); background: var(--text-3); }
.avatar .st.online { background: var(--online); }
.avatar .st.ingame { background: var(--ingame); }
.avatar.banned img { box-shadow: 0 0 0 2px var(--removed); }
.avatar-md { width: 56px; height: 56px; }
.avatar-md img { border-radius: 12px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-lg img { border-radius: 14px; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-sm img { border-radius: 7px; }

/* ---------- profile header ---------- */
.ph { display: flex; gap: 16px; align-items: flex-start; padding: 24px 0 8px; }
.ph-main { min-width: 0; flex: 1; }
.ph h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph .meta { color: var(--text-2); font-size: 14px; margin-top: 4px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.ph .meta .sep { color: var(--text-3); }
.ph .meta a { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.ph .meta a svg { width: 12px; height: 12px; }
.ph .meta .link { font-size: 14px; padding: 0; }
.ph-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.ph-actions .link svg { width: 15px; height: 15px; }
.ph-note { color: var(--text-2); font-size: 14px; margin-top: 10px; max-width: 100ch; display: flex; gap: 8px; }
.ph-note svg { width: 15px; height: 15px; color: var(--removed); margin-top: 3px; }
.ph-note.ok svg { color: var(--text-3); }
/* the first tab's hover background hangs 10px to the left; give the scroll box that room so it is not clipped */
.views { display: flex; align-items: center; gap: 4px; margin-top: 26px; margin-left: -10px; padding-left: 10px; overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.view { padding: 8px 10px; margin-left: -10px; margin-right: 10px; color: var(--text-2); font-weight: 600; font-size: 15px; white-space: nowrap; border-radius: 8px; display: inline-flex; gap: 6px; align-items: baseline; transition: color .15s, background .15s; }
.view + .view { margin-left: 0; }
.view:hover { color: var(--text); background: var(--bg-2); }
.view.active { color: var(--text); }
.view .count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); font-weight: 400; }
.views .grow { flex: 1; }
.views .link { white-space: nowrap; margin-left: 12px; }
.views .link.on { color: var(--text); }
.sub-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; min-height: 0; }
.pane { display: none; }
.pane.active { display: block; }

/* ---------- ledger ---------- */
.ph-guide { display: block; margin-top: 4px; }
.link-inline { border: 0; padding: 0; margin-left: 4px; background: none; cursor: pointer; font: inherit; color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; transition: text-decoration-color .15s; }
.link-inline:hover { text-decoration-color: var(--accent); }
.av-pair img[data-peek] { cursor: zoom-in; }
.tip.img-tip { padding: 4px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.tip.img-tip img { display: block; width: 184px; height: 184px; border-radius: 7px; object-fit: cover; background: var(--bg-2); }
.ledger { display: flex; flex-direction: column; gap: 26px; margin-top: 22px; scroll-margin-top: calc(var(--nav-h) + 16px); transition: opacity .18s ease; }
.ledger.fading { opacity: .35; pointer-events: none; }
/* numbered pages under the ledger */
.ledger-pager { gap: 4px; padding: 22px 0 4px; flex-wrap: wrap; }
.pager .pg { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
             font-family: var(--font-mono); font-size: 12px; color: var(--text-2); background: transparent; transition: background .15s, color .15s; }
.pager .pg:hover:not([disabled]) { background: var(--bg-2); color: var(--text); }
.pager .pg.active { background: var(--bg-3); color: var(--text); }
.pager .pg[disabled] { opacity: .3; cursor: default; }
.pager .pg.nav svg { width: 14px; height: 14px; transform: rotate(90deg); }
.pager .pg.nav.next svg { transform: rotate(-90deg); }
.pager .dots { padding: 0 2px; color: var(--text-3); }
/* the count sits on its own line under the page numbers */
.pager .range { flex-basis: 100%; text-align: center; margin-top: 6px; color: var(--text-3); }
.day-head { position: sticky; top: var(--nav-h); z-index: 5; display: flex; align-items: baseline; gap: 10px; padding: 6px 0 8px; background: linear-gradient(var(--bg) 80%, transparent); }
.day-head h3 { font-size: 15px; font-weight: 600; }
.day-head .date { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.day-head .line { flex: 1; }
.tally { display: inline-flex; gap: 10px; font-family: var(--font-mono); font-size: 12px; }
.tally span { display: inline-flex; align-items: center; gap: 3px; }
.tally svg { width: 11px; height: 11px; }
.day-list { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 42px 18px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; margin: 0 -10px; border-radius: 9px; transition: background .15s, transform .15s; }
.ev:hover { background: var(--bg-2); transform: translateX(2px); }
.ev .avatar img { transition: transform .2s; }
.ev:hover .avatar img { transform: scale(1.06); }
.ev .time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.ev .kind { width: 18px; height: 18px; display: grid; place-items: center; color: var(--text-3); }
.ev .kind svg { width: 15px; height: 15px; }
.ev[data-k="added"] .kind { color: var(--added); }
.ev[data-k="removed"] .kind, .ev[data-k="bans"] .kind { color: var(--removed); }
.ev .avatar { width: 32px; height: 32px; }
.ev .avatar img { border-radius: 8px; }
.ev .who { min-width: 0; display: flex; flex-direction: column; }
.ev .name { font-weight: 600; font-size: 14px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.ev .name a { color: inherit; }
.ev .name a:hover { text-decoration: none; color: var(--text-2); }
.ev .what { color: var(--text-2); font-size: 13px; }
.ev .what b { color: var(--text); font-weight: 600; }
.ev .what .arrow { color: var(--text-3); padding: 0 4px; }
.ev .what .old { color: var(--text-3); text-decoration: line-through; }
.ev .act { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.ev:hover .act, .ev:focus-within .act { opacity: 1; }
.ev .act .btn { padding: 5px; }
.ev .av-pair { display: inline-flex; gap: 6px; align-items: center; margin-left: 10px; vertical-align: middle; }
.ev .av-pair img { width: 20px; height: 20px; border-radius: 5px; }
.ev-more { padding: 16px 0; }

/* ---------- strip ---------- */
.strip-wrap { margin-top: 14px; }
.strip-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 2px; }
.strip-head h2 { font-size: 13px; font-weight: 500; color: var(--text-2); }
.strip-legend { display: inline-flex; gap: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-left: auto; }
.strip-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }
.strip { width: 100%; height: 96px; display: block; overflow: visible; cursor: crosshair; }
.strip .bar.up { fill: var(--added-bar); }
.strip .bar.down { fill: var(--removed-bar); }
.strip .tick { fill: var(--removed); }
.strip .hit { fill: transparent; }
.strip .axis { stroke: var(--line); stroke-width: 1; }
.strip .lbl { fill: var(--text-3); font-family: var(--font-mono); font-size: 10px; }
.strip g.day.sel .hit { fill: rgba(255, 255, 255, 0.06); }
.strip.has-sel g.day:not(.sel) .bar { opacity: .3; }
.strip g.day:hover .hit { fill: rgba(255, 255, 255, 0.04); }
.strip-empty { color: var(--text-3); font-size: 13px; padding: 4px 0 0; }
.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--bg-3); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); display: none; min-width: 140px; }
.tip.show { display: block; }
.tip .t { font-weight: 600; margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

/* ---------- friends ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin: 18px 0 10px; flex-wrap: wrap; }
.toolbar .input-wrap { max-width: 260px; }
.toolbar .input { padding: 8px 12px 8px 34px; font-size: 14px; }
.toolbar select.input { width: auto; padding-left: 12px; }
.toolbar .summary { color: var(--text-2); font-size: 13px; width: 100%; }
/* column gap ≥ the cards' negative side margins (2×10px), so a hover highlight never covers the neighbour */
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 24px; }
.friend { display: flex; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; min-width: 0; transition: background .15s, transform .15s; }
.friend:hover { background: var(--bg-2); transform: translateY(-1px); }
.friend .avatar img { transition: transform .2s; }
.friend:hover .avatar img { transform: scale(1.06); }
.friend .avatar { width: 40px; height: 40px; }
.friend .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.friend .name { font-weight: 600; font-size: 14px; color: var(--text); }
.friend .name:hover { color: var(--text-2); text-decoration: none; }
.friend .sub { font-size: 12px; color: var(--text-2); }
.friend .sub.ingame { color: var(--ingame); }
.friend .sub.online { color: var(--online); }
.friend .since { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.friend .rm { font-family: var(--font-mono); font-size: 11px; color: var(--removed); }

/* hover card for a friend: who, status, facts, flags as pills */
.tip.friend-tip { width: 290px; padding: 10px 12px; border: 1px solid var(--line); }
.tip.friend-tip .fh { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tip.friend-tip .fh .avatar { width: 36px; height: 36px; flex-shrink: 0; }
.tip.friend-tip .fn { min-width: 0; flex: 1; }
.tip.friend-tip .n { font-weight: 600; font-size: 13px; color: var(--text); }
.tip.friend-tip .s { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 1px; }
.tip.friend-tip .s .online { color: var(--online); }
.tip.friend-tip .s .ingame { color: var(--ingame); }
.tip.friend-tip .fm { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.tip.friend-tip .s .rm { color: var(--removed); }
/* the rule above the pills: on the facts row when there is one, else on the pills row itself */
.tip.friend-tip .fb { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tip.friend-tip .fm + .fb { padding-top: 0; border-top: 0; }
.tip.friend-tip .fb .badges { display: contents; }
.badge-faceit { background: rgba(255, 92, 0, .14); color: #ff8a3d; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 18px 0 6px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

/* ---------- watchlist rows ---------- */
.watchlist { display: flex; flex-direction: column; margin-top: 6px; }
.watch { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 12px; margin: 0 -12px; border-radius: 12px; transition: background .15s; }
.watch:hover { background: var(--bg-2); }
.watch .avatar { width: 40px; height: 40px; }
.watch .avatar img { transition: transform .2s; }
.watch:hover .avatar img { transform: scale(1.06); }
.w-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.w-main .name { font-weight: 600; font-size: 14px; color: var(--text); }
.w-main .name:hover { color: var(--text-2); text-decoration: none; }
.w-main .sub { font-size: 12px; color: var(--text-2); }
.w-main .sub.ingame { color: var(--ingame); }
.w-main .sub.online { color: var(--online); }
.w-info { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.w-info .badges:empty { display: none; }
.w-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.w-acts { display: inline-flex; gap: 2px; opacity: .75; transition: opacity .15s; }
.watch:hover .w-acts { opacity: 1; }
.w-acts .btn { padding: 7px; }
.w-acts .btn svg { width: 15px; height: 15px; }
.w-acts .btn-danger:hover { background: rgba(239, 95, 91, .14); }

/* ---------- notes / states ---------- */
.notice { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); }
.notice > div { flex: 1 1 240px; min-width: 0; }
.notice > .btn { align-self: center; }
.notice svg { width: 18px; height: 18px; flex: none; color: var(--text-2); margin-top: 2px; }
.notice .t { font-weight: 600; margin-bottom: 2px; }
.notice .s { color: var(--text-2); font-size: 14px; }
.claim-line { display: flex; gap: 10px; align-items: flex-start; color: var(--text-3); font-size: 13px; max-width: 64ch; margin-top: 40px; }
.claim-line svg { width: 15px; height: 15px; margin-top: 3px; }
.claim-line b { color: var(--text-2); font-weight: 500; }
.empty { padding: 40px 0; color: var(--text-2); font-size: 14px; max-width: 60ch; }
.empty svg { display: none; }
.empty .t { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.state { max-width: 520px; margin: 80px auto; }
.state .icon { display: none; }
.state h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.state p { color: var(--text-2); margin-bottom: 20px; }
.resolve-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); }
.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-3); border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow); max-width: 360px; display: flex; gap: 10px; align-items: center; }
.toast::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); flex: none; }
.toast.ok::before { background: var(--added); } .toast.err::before, .toast.warn::before { background: var(--removed); }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { width: 100%; max-width: 440px; background: var(--bg-2); border-radius: 16px; padding: 22px 24px 20px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-x { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); transition: background .15s, color .15s, transform .15s; }
.modal-x:hover { background: var(--bg-3); color: var(--text); transform: rotate(90deg); }
.modal-x svg { width: 16px; height: 16px; }
.modal h2 { font-size: 17px; margin-bottom: 10px; }
.modal p { color: var(--text-2); margin-bottom: 14px; font-size: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.modal .notice, .modal .resolve-card { background: var(--bg-3); }
.modal .btn:not(.btn-primary) { background: var(--bg-3); }
.modal .btn-danger { background: transparent; }
.setting { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 0 -12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.setting:hover { background: var(--bg-3); }
.setting.static { cursor: default; }
.setting .l { flex: 1; min-width: 0; }
.setting .l b { display: block; font-weight: 600; font-size: 14px; }
.setting .l span { color: var(--text-2); font-size: 13px; }

/* ---------- landing ---------- */
.hero { padding: 84px 0 0; }
.hero h1 { font-size: clamp(28px, 4.4vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; max-width: 22ch; text-wrap: balance; }
.hero .lede { font-size: 16px; color: var(--text-2); max-width: 56ch; margin: 12px 0 26px; }
.hero-form { display: flex; gap: 8px; max-width: 640px; }
.hero-form .input-wrap .input { height: 50px; font-size: 15px; padding-left: 42px; border-radius: 12px; }
.hero-form .input-wrap > svg { left: 15px; width: 17px; height: 17px; }
.hero-form .btn { height: 50px; border-radius: 12px; padding: 0 20px; }
.hero-hint { font-size: 13px; color: var(--text-3); margin-top: 12px; }
.example { margin-top: 64px; }
.example .eyebrow { margin-bottom: 4px; }
.example .ledger { margin-top: 8px; }
.owner-line { margin-top: 56px; color: var(--text-3); font-size: 13px; max-width: 64ch; }
.owner-line a { color: var(--text-2); }
.footer { padding: 72px 0 40px; color: var(--text-3); font-size: 12px; }
.footer .shell { display: flex; flex-direction: column; gap: 18px; }
.footer .about { display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--text-3); }
.footer .r { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.footer .looks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.footer .looks .lbl { color: var(--text-3); }
.footer .looks .sep { color: var(--text-3); opacity: .6; }
.footer .looks a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.footer .looks a:hover { color: var(--accent); border-color: var(--accent); }
.theme-picker { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.theme-picker .lbl { margin-right: 4px; }
.theme-picker button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; color: var(--text-2); font-size: 13px; transition: background .15s, color .15s, transform .1s; }
.theme-picker button:hover .sw { transform: scale(1.15); }
.theme-picker .sw { transition: transform .15s; }
.theme-picker button:hover { color: var(--text); background: var(--bg-2); }
.theme-picker button.active { color: var(--text); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--text-3); }
.theme-picker .sw { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); flex: none; }

/* ---------- admin / tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 12px 12px; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.tbl tr:hover td { background: var(--bg-2); }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.tbl .who img { width: 34px; height: 34px; border-radius: 8px; }
.tbl .who a { font-size: 15px; }
.tbl .acts { display: inline-flex; gap: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); font-family: var(--font-mono); font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.tier-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--bg-3); }
.tier-bar i { display: block; height: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; background: var(--bg-3); color: var(--text-2); }
.pill.ok { color: var(--added); } .pill.warn, .pill.err { color: var(--removed); }
.stats { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.stat .d { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
#aStats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 20px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.admin-grid .card { padding: 18px; border-radius: 14px; background: var(--bg-2); }
.admin-grid .card-head, .admin-grid .card-pad { padding: 0; }
.admin-grid .card-head { margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; margin: 24px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 2px; margin-right: 18px; color: var(--text-2); font-weight: 600; font-size: 15px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab svg { display: none; }
.tab.active { color: var(--text); }
.tab .count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
    body { font-size: 14px; }
    .shell { padding: 0 16px; }
    .nav-links { display: none; }
    .nav-search { display: none; }
    .nav .burger { display: inline-flex; }
    .nav-links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; background: var(--bg-2); padding: 8px; }
    .hero { padding: 44px 0 0; }
    .hero-form { flex-direction: column; }
    .ph { gap: 12px; }
    .ph h1 { font-size: 21px; }
    .ph-actions { width: 100%; padding-top: 0; }
    .ph-actions #copyId { display: none; }
    .views { flex-wrap: wrap; row-gap: 2px; }
    .views .grow { flex-basis: 100%; }
    .views .link { margin-left: 0; margin-right: 14px; }
    .ev { grid-template-columns: 18px 32px minmax(0, 1fr); gap: 8px; padding: 7px 6px; margin: 0 -6px; }
    .ev .time { grid-column: 1 / -1; order: 10; padding-left: 2px; }
    .ev .act { display: none; }
    .friend { margin: 0 -6px; padding: 8px 6px; }
    .watch { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px 12px; padding: 10px 8px; margin: 0 -8px; }
    .w-info { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; }
    .w-acts { grid-column: 3; grid-row: 1; opacity: 1; }
    .w-info:empty { display: none; }
    .user-btn span { display: none; }
    .nav .btn-steam span { display: none; }
    .nav .btn-steam { padding: 8px 10px; }
    .admin-grid { grid-template-columns: 1fr; }
}
/* ---------- loader & reveal ---------- */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; transition: opacity .35s ease, visibility .35s; opacity: 0; visibility: hidden; }
.loader.show { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility .2s; }
.loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-spin { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--bg-3); border-top-color: var(--text); animation: spin .9s linear infinite; margin-bottom: 6px; }
.loader-t { font-weight: 600; font-size: 16px; }
.loader-s { color: var(--text-2); font-size: 14px; text-align: center; max-width: 360px; padding: 0 20px; }
.loader-bar { width: 220px; height: 3px; border-radius: 2px; background: var(--bg-3); overflow: hidden; margin-top: 8px; }
.loader-bar i { display: block; width: 35%; height: 100%; background: var(--text-2); border-radius: 2px; animation: loader-move 1.2s ease-in-out infinite; }
@keyframes loader-move { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.page { opacity: 0; }
body.ready .page { opacity: 1; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.pane.active { animation: fade .3s ease; }
.ledger .day { animation: rise .45s ease both; }
.ev.new, .friend.new { animation: rise-in .38s cubic-bezier(.22,.61,.36,1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.strip-wrap:not([hidden]), .sub-tools:not([hidden]) { animation: fade .25s ease; }
.modal { animation: pop .22s cubic-bezier(.2, .8, .3, 1.1); }
.modal-bg.open { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.toast { animation: fade .25s ease; }
@media (prefers-reduced-motion: reduce) { .page, .ledger .day, .ev.new, .friend.new, .pane.active, .modal, .toast { animation: none !important; } .page { opacity: 1; } .ev:hover, .friend:hover, .btn:hover { transform: none; } }

/* admin: presence + visits chart */
.online { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; color: var(--added); }
.online i { width: 7px; height: 7px; border-radius: 50%; background: var(--added); box-shadow: 0 0 0 3px color-mix(in srgb, var(--added) 22%, transparent); }
.visit-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.visit-tile { padding: 12px 14px; border-radius: 10px; background: var(--bg-2); }
.visit-tile .l { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.visit-tile .v { font-size: 22px; font-weight: 600; margin-top: 4px; }
.visit-tile .v .mono { font-size: 11px; font-weight: 400; }
.visit-tile .d { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 2px; }
.sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); margin-bottom: 6px; }
.legend span, .tip .r span { display: inline-flex; align-items: center; gap: 6px; }
svg.lines { width: 100%; height: 200px; display: block; }
svg.lines .grid { stroke: var(--line); }
svg.lines .ax { fill: var(--text-3); font-family: var(--font-mono); font-size: 9px; }
svg.lines .cross { stroke: var(--text-3); stroke-dasharray: 3 3; }
svg.lines .pt { stroke: var(--bg); stroke-width: 2; }
