/*
 * SibLinks portal 0.6. RTL first, mobile first, self-hosted fonts only (the CSP allows nothing else).
 * No inline styles anywhere: the CSP blocks style attributes, so every look lives here.
 */

/* ---------- Fonts (SIL Open Font License, see fonts/OFL.txt) ----------
 * Heebo (0.6.0): one variable file per script, any weight from 100 to 900. Clearer than
 * IBM Plex Sans Hebrew at small sizes. IBM Plex Mono stays for codes (Site ID, Secret). */
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/heebo-hebrew.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/heebo-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: "Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/plex-mono-latin-500.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
	color-scheme: light dark;
	--bg: #f4f5f7;
	--surface: #ffffff;
	--surface-2: #f9fafb;
	--surface-3: #f2f4f7;
	--line: #e4e7ec;
	--line-soft: #eaecf0;
	--line-strong: #d0d5dd;
	--text: #101828;
	--text-2: #344054;
	--muted: #475467;
	--faint: #5b6577;
	--accent: #4338ca;
	--accent-hover: #3730a3;
	--accent-soft: #eef2ff;
	--accent-ring: #c7d2fe;
	--accent-text: #3730a3;
	--on-accent: #ffffff;
	--ok: #067647;
	--ok-bg: #ecfdf3;
	--ok-line: #abefc6;
	--warn: #b54708;
	--warn-strong: #7a2e0e;
	--warn-bg: #fffaeb;
	--warn-line: #fedf89;
	--err: #b42318;
	--err-bg: #fef3f2;
	--err-line: #fecdca;
	--side-bg: #0b1220;
	--side-text: #a9b3c6;
	--side-faint: #7d889c;
	--side-hover: #141c30;
	--side-active: #1d2741;
	--side-line: #1a2338;
	--shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
	--shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
	--shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .16), 0 4px 8px -4px rgba(16, 24, 40, .06);
	--radius: 8px;
	--radius-lg: 14px;
	--font: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0a0e16;
		--surface: #111723;
		--surface-2: #151c2a;
		--surface-3: #1a2233;
		--line: #232c3e;
		--line-soft: #1e2636;
		--line-strong: #344057;
		--text: #e8ecf3;
		--text-2: #ced6e2;
		--muted: #a6b0c3;
		--faint: #8a95aa;
		--accent: #8b93f9;
		--accent-hover: #a5b4fc;
		--accent-soft: #1d2142;
		--accent-ring: #3c418a;
		--accent-text: #b4bdfd;
		--on-accent: #0a0e16;
		--ok: #75e0a7;
		--ok-bg: #0c2a1c;
		--ok-line: #14532d;
		--warn: #fdb022;
		--warn-strong: #fec84b;
		--warn-bg: #2b1d06;
		--warn-line: #5c3d0b;
		--err: #fda29b;
		--err-bg: #2d1210;
		--err-line: #6b1d17;
		--side-bg: #070a11;
		--side-hover: #111827;
		--side-active: #19223a;
		--side-line: #151d2e;
		--shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
		--shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
		--shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, .6);
	}
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 17px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 430 .94rem/1.6 var(--font);
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.9rem; line-height: 1.25; font-weight: 700; letter-spacing: 0; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; line-height: 1.4; font-weight: 700; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
strong, b { font-weight: 600; }
code, pre { font-family: var(--mono); font-size: .88em; }
code { word-break: break-all; }
pre {
	white-space: pre-wrap; word-break: break-all; margin: 0 0 .75rem; padding: 1rem;
	background: #0b1220; color: #e4e7ec; border-radius: 10px; text-align: left; line-height: 1.7;
}
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: .9rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr-title { text-align: right; word-break: break-all; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 3px solid var(--accent-ring); outline-offset: 2px;
}
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--surface); color: var(--text); padding: .5rem 1rem; border-radius: var(--radius); z-index: 50; box-shadow: var(--shadow-lg); }
.skip:focus { top: 8px; }
main:focus { outline: none; }

/* ---------- App shell (signed in) ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.side {
	background: var(--side-bg); color: var(--side-text);
	display: flex; align-items: center; justify-content: space-between; gap: .75rem;
	padding: 0 16px; min-height: 60px; position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
	width: 34px; height: 34px; border-radius: 9px; background: #4f46e5; color: #fff;
	display: flex; align-items: center; justify-content: center; flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-tag { font-size: .8125rem; color: var(--side-faint); }
.side-nav {
	position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
	display: flex; background: var(--surface); border-top: 1px solid var(--line);
	padding: 4px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav {
	flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	min-height: 54px; border-radius: var(--radius); color: var(--faint); font-size: .8125rem; font-weight: 500; text-decoration: none;
}
.nav:hover { text-decoration: none; color: var(--text); }
.nav .ic { width: 20px; height: 20px; }
.nav[aria-current="page"] { color: var(--accent-text); }
.nav-long, .nav-count { display: none; }
.side-sub { display: none; }
.side-user { display: flex; align-items: center; gap: 6px; }
.avatar {
	width: 34px; height: 34px; border-radius: 50%; background: #e0e7ff; color: #3730a3;
	display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .94rem; flex: none;
}
.side-user-text { display: none; }
.side-logout {
	display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
	border: 0; border-radius: var(--radius); background: transparent; color: var(--side-text); cursor: pointer;
}
.side-logout:hover { background: var(--side-hover); color: #fff; }
.main { flex: 1; min-width: 0; padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
.main-in { max-width: 1360px; margin: 0 auto; }
.foot {
	display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--faint); font-size: .875rem;
	padding: 1rem 0 0; margin-top: 1.5rem; border-top: 1px solid var(--line-soft);
}
.foot a { color: var(--faint); }

@media (min-width: 960px) {
	.app { flex-direction: row; }
	.side {
		position: sticky; top: 0; height: 100vh; overflow-y: auto; flex: 0 0 256px;
		flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; padding: 20px 14px;
	}
	.side > .brand { padding: 4px 8px 22px; }
	.side-nav {
		position: static; flex-direction: column; gap: 2px; padding: 0; background: transparent; border: 0;
	}
	.nav {
		flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 40px; padding: 0 12px;
		color: var(--side-text); font-size: .94rem;
	}
	.nav .ic { width: 18px; height: 18px; }
	.nav:hover { background: var(--side-hover); color: #fff; }
	.nav[aria-current="page"] { background: var(--side-active); color: #fff; }
	.nav-short { display: none; }
	.nav-long { display: inline; }
	.side-sub { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--side-line); margin-top: 14px; padding-top: 14px; }
	.side-user { margin-top: auto; padding: 16px 6px 4px; gap: 10px; }
	.side-user-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
	.side-user-name { color: #fff; font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.side-user-mail { font-size: .8125rem; color: var(--side-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
	.main { padding: 28px 32px 32px; }
}

/* ---------- Guest shell (login, signup and the pages around them) ---------- */
.auth { min-height: 100vh; display: flex; background: var(--surface); }
.auth-main { flex: 1 1 520px; display: flex; flex-direction: column; padding: 24px 20px; min-width: 0; }
.auth-main .brand { color: var(--text); }
.auth-main .brand-tag { color: var(--faint); }
.auth-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-in { width: 100%; max-width: 440px; }
.auth-in .card { border: 0; box-shadow: none; padding: 0; background: transparent; margin: 0; }
.auth-in h1 { font-size: 1.85rem; margin-bottom: .5rem; }
.auth-in .lead { color: var(--muted); font-size: 1rem; margin-bottom: 1.75rem; }
.auth-icon {
	width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text);
	display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem;
}
.auth-icon .ic { width: 24px; height: 24px; }
.auth-icon.warn { background: var(--warn-bg); color: var(--warn); }
.auth-icon.ok { background: var(--ok-bg); color: var(--ok); }
.auth .foot { margin-top: 0; border: 0; padding-top: 0; }
.auth-side { display: none; }
.divider { display: flex; align-items: center; gap: 12px; margin: 1.75rem 0; color: var(--faint); font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
@media (min-width: 960px) {
	.auth-main { padding: 32px 48px; }
	.auth-side {
		flex: 1 1 520px; display: flex; flex-direction: column; justify-content: center; gap: 36px;
		background-color: #0b1220; background-image: radial-gradient(#1a2338 1px, transparent 1px); background-size: 22px 22px;
		color: #fff; padding: 56px; position: relative; overflow: hidden;
	}
}
.pitch { max-width: 520px; }
.pitch-kicker { font-size: .875rem; font-weight: 600; color: #a5b4fc; margin: 0 0 .75rem; }
.pitch h2 { font-size: 2.1rem; line-height: 1.3; margin: 0; font-weight: 700; }
.pitch ul { list-style: none; margin: 1.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .85rem; color: #c9d2e3; }
.pitch li { display: flex; align-items: center; gap: 12px; }
.tick { width: 26px; height: 26px; border-radius: 50%; background: #1d2741; color: #a5b4fc; display: flex; align-items: center; justify-content: center; flex: none; }
.tick .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.demo { max-width: 470px; background: #fff; color: #101828; border-radius: 14px; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .5); overflow: hidden; }
.demo-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eaecf0; font-size: .94rem; font-weight: 600; }
.demo-pill { font-size: .8125rem; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 10px; }
.demo-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; font-size: .94rem; }
.demo-body p { margin: 0; color: #344054; }
.demo mark { background: #e0e7ff; color: #312e81; border-radius: 3px; padding: 0 3px; }
.demo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e4e7ec; border-radius: 10px; padding: 10px 12px; }
.demo-title { font-weight: 600; font-size: .875rem; }
.demo-why { font-size: .8125rem; color: #667085; }
.demo-strength { font-size: .8125rem; font-weight: 600; color: #067647; background: #ecfdf3; border-radius: 999px; padding: 1px 8px; margin-inline-start: 6px; }
.demo-btns { display: flex; gap: 6px; flex: none; }
.demo-btn { font-size: .8125rem; font-weight: 600; border-radius: 6px; padding: 4px 10px; border: 1px solid #d0d5dd; color: #344054; }
.demo-btn.primary { background: #4338ca; border-color: #4338ca; color: #fff; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-kicker { margin: 0 0 4px; font-size: .875rem; color: var(--faint); }
.page-kicker a { color: var(--faint); }
.page-sub { margin: 6px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Cards and grids ---------- */
.card {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
	box-shadow: var(--shadow-xs); padding: 18px 20px; margin-bottom: 16px; min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 4px 0 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 16px 20px 0; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .card, .row > .card { margin-bottom: 0; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.row.top { align-items: flex-start; }
.col-wide { flex: 2 1 540px; min-width: 0; }
.col-narrow { flex: 1 1 300px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
@media (min-width: 720px) { .grid { grid-template-columns: 1fr 1fr; } }

/* KPI tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); margin-bottom: 16px; }
@media (min-width: 720px) { .kpis { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
.kpi { margin: 0; padding: 16px; display: flex; flex-direction: column; }
@media (min-width: 720px) { .kpi { padding: 16px 18px; } }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: .94rem; font-weight: 600; }
.kpi-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; flex: none; }
.big, .stat .big { font-size: clamp(1.7rem, 5vw, 2.1rem); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 6px 0 6px; font-variant-numeric: tabular-nums; }
.big small { font-size: 1.1rem; color: var(--faint); font-weight: 500; letter-spacing: 0; }
.kpi-meta { margin: 0; font-size: .9rem; color: var(--muted); }
.kpi-meta + .kpi-meta { margin-top: 4px; }
.trend { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .8125rem; font-weight: 600; margin-inline-end: 4px; direction: ltr; }
.trend.up { background: var(--ok-bg); color: var(--ok); }
.trend.down { background: var(--surface-3); color: var(--muted); }

/* Meter (SVG, so no inline styles are needed for the width) */
.meter { display: block; width: 100%; height: 6px; margin: 4px 0 8px; overflow: visible; }
.meter-track { fill: var(--surface-3); }
.meter-fill { fill: var(--accent); }
.meter-fill.soft { fill: var(--faint); }
.meter-fill.warn { fill: #f79009; }

/* Chart */
.chart-box { position: relative; margin-top: 8px; }
.chart { width: 100%; height: 170px; display: block; overflow: visible; }
.chart rect { fill: var(--accent); opacity: .88; }
.chart rect:hover { opacity: 1; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: .8125rem; margin-top: 8px; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; color: var(--faint); text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; }

/* Lots */
.lots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lot-top { display: flex; justify-content: space-between; gap: 8px; font-size: .94rem; }
.lot-name { font-weight: 700; }
.lot-count { color: var(--muted); }
.lot-exp { font-size: .875rem; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.col-narrow.card { display: flex; flex-direction: column; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
	font: inherit; font-size: .94rem; font-weight: 700; color: var(--text); background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; text-decoration: none;
	box-shadow: var(--shadow-xs); transition: background-color .15s, border-color .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--err); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 46px; font-size: .95rem; }
.btn[disabled], .btn.is-busy { opacity: .65; cursor: progress; }
.btn.is-done { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.form .btn { margin-top: .5rem; align-self: flex-start; }
.form.row .btn, .form .btn-block { margin-top: 0; align-self: stretch; }
button.link { background: none; border: 0; padding: .6rem 0; font: inherit; color: var(--muted); cursor: pointer; }
.icon-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
	border-radius: var(--radius); border: 0; background: transparent; color: var(--faint); cursor: pointer; list-style: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn::-webkit-details-marker { display: none; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: .4rem; margin: 0 0 .5rem; }
.form.row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form.row input { flex: 1 1 180px; }
.fields { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; max-width: 680px; }
.field-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: .94rem; color: var(--text-2); }
label .opt { font-weight: 430; color: var(--muted); }
label.check { font-weight: 430; display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0; color: var(--text); cursor: pointer; }
label.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.hint { font-size: .875rem; color: var(--muted); margin: 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="url"], select, textarea {
	width: 100%; min-height: 44px; padding: .6rem .85rem; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-xs);
	transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }
input[aria-invalid="true"] { border-color: var(--err); }
input[dir="ltr"] { text-align: left; }
input[type="radio"] { accent-color: var(--accent); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; top: 13px; inset-inline-start: 12px; color: var(--faint); pointer-events: none; }
.input-icon input { padding-inline-start: 40px; }

/* ---------- Notices and badges ---------- */
.notice {
	display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px;
	border: 1px solid transparent; font-size: .94rem; line-height: 1.55;
}
.notice > .ic { margin-top: 2px; }
.notice { flex-wrap: wrap; }
.notice-body { flex: 1 1 200px; min-width: 0; }
.notice-body p:last-child { margin: 0; }
.notice-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.notice-error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.notice-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.notice-warn strong { color: var(--warn-strong); }
.notice a { color: inherit; font-weight: 600; text-decoration: underline; }
.notice-action { flex: none; align-self: center; }
.badge {
	display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
	font-size: .8125rem; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: var(--err-bg); color: var(--err); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-plain::before { display: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card > .table-wrap:first-child { margin: -18px -20px; }
.card-flush .table-wrap { margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: right; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--text-2); font-weight: 700; font-size: .875rem; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 7rem; max-width: 16rem; }
td.break { white-space: normal; word-break: break-all; min-width: 9rem; }
td.empty { text-align: center; color: var(--faint); padding: 32px 16px; }
@media (max-width: 480px) { th, td { padding: 10px; } table { font-size: .9rem; } }
tr.dim td { opacity: .55; }
tr.warn-row td { background: var(--warn-bg); }
.cell-site { display: flex; align-items: center; gap: 12px; }
.cell-site > span:not(.site-mark) { display: block; min-width: 0; }
.cell-sub { font-size: .875rem; color: var(--muted); }

/* ---------- Sites ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sites-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
.site-card { margin: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.site-card.is-new { border-color: var(--warn-line); }
.site-card.is-off { background: var(--surface-2); }
.site-top { display: flex; align-items: flex-start; gap: 12px; }
.site-mark {
	width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text);
	display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; flex: none; text-transform: uppercase;
}
.site-mark.small { width: 32px; height: 32px; border-radius: 8px; font-size: .875rem; }
.site-card.is-off .site-mark { background: var(--surface-3); color: var(--faint); }
.site-title { flex: 1; min-width: 0; }
.site-title h2 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.site-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: .875rem; color: var(--muted); }
.site-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin: 0; }
.site-card.is-off .site-stats { background: var(--surface-3); }
.site-stats dt { font-size: .8125rem; color: var(--faint); }
.site-stats dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; }
.site-stats dd.small { font-size: .94rem; font-weight: 500; padding-top: 3px; }
.site-hint { margin: 0; font-size: .9rem; color: var(--warn); }
.site-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: auto; }
.id-chip { font-size: .8125rem; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.id-chip code { color: var(--text-2); background: var(--surface-3); border-radius: 6px; padding: 2px 8px; word-break: normal; }
.add-card {
	min-height: 0; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 24px;
	display: flex; flex-direction: column; justify-content: center; gap: 12px;
}
.add-card h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.add-card .plus { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.empty-state { text-align: center; padding: 32px 20px; }
.empty-state .auth-icon { margin: 0 auto 1rem; }
.empty-state p { color: var(--muted); max-width: 420px; margin-left: auto; margin-right: auto; }

/* Dropdown menu (details/summary: works without JavaScript) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--surface-3); color: var(--text); }
.menu-pop {
	position: absolute; top: calc(100% + 6px); inset-inline-end: 0; width: 250px; z-index: 15;
	background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-pop form { margin: 0; }
.menu-item {
	display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: transparent;
	border-radius: 6px; font: inherit; font-size: .9rem; color: var(--text-2); cursor: pointer; text-align: right; text-decoration: none;
}
.menu-item:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.menu-item.danger { color: var(--err); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.menu-form { padding: 8px 8px 6px; display: flex; flex-direction: column; gap: 6px; }
.menu-form label { font-size: .8125rem; }
.menu-form .btn { align-self: flex-start; }

/* ---------- Steps and credentials ---------- */
.stepper { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; font-size: .9rem; color: var(--faint); }
.stepper li { display: flex; align-items: center; gap: 10px; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: .875rem; font-weight: 600; }
.stepper .done { color: var(--muted); }
.stepper .done .step-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepper .done .step-dot .ic { width: 15px; height: 15px; stroke-width: 2.5; }
.stepper [aria-current="step"] { color: var(--text); font-weight: 600; }
.stepper [aria-current="step"] .step-dot { border-color: var(--accent); color: var(--accent-text); }
.step-line { width: 40px; height: 2px; border-radius: 2px; background: var(--line-strong); }
.step-line.done { background: var(--accent); }
.steps { list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before {
	content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
	font-size: .875rem; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 1px;
}
.steps[start="3"] { counter-reset: s 2; }
.creds { margin: 0 0 1rem; display: flex; flex-direction: column; gap: 12px; }
.creds dt { font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text-2); }
.creds dd {
	margin: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius);
	background: var(--surface-2); padding: 4px; padding-inline-start: 12px;
}
.creds dd.secret { border-color: #fec84b; background: var(--warn-bg); }
.creds code { flex: 1; min-width: 0; font-size: .9rem; color: var(--text); text-align: left; word-break: break-all; padding: 6px 0; }
.creds .btn { flex: none; }
.cred-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.confirm-row { border-top: 1px solid var(--line-soft); margin-top: 22px; padding-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.confirm-row label.check { margin: 0; }
.confirm-msg { width: 100%; margin: 0; font-size: .9rem; color: var(--err); }
details { margin: .5rem 0; }
summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: .94rem; }
.details-block { border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 16px; }
.details-block summary { color: var(--text-2); }
.details-block[open] summary { margin-bottom: 12px; }
.wp-shot { margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f0f0f1; }
.wp-bar { display: flex; gap: 5px; padding: 8px 10px; background: #1d2327; }
.wp-bar i { width: 8px; height: 8px; border-radius: 50%; background: #50575e; }
.wp-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.wp-row { display: flex; gap: 8px; align-items: center; }
.wp-label { height: 7px; width: 22%; background: #dcdcde; border-radius: 4px; }
.wp-title { height: 8px; width: 40%; background: #c3c4c7; border-radius: 4px; }
.wp-input { flex: 1; height: 22px; background: #fff; border: 1.5px solid #4338ca; border-radius: 4px; }
.wp-btns { display: flex; gap: 6px; margin-top: 4px; }
.wp-btn { height: 22px; width: 72px; background: #2271b1; border-radius: 4px; }
.wp-btn.alt { width: 60px; background: #fff; border: 1px solid #2271b1; }
.help-line { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); padding: 4px 6px; }

/* ---------- Facts (definition lists) ---------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.25rem; margin: 0 0 1rem; font-size: .94rem; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.actions form { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; font-size: .94rem; }
.plain li { padding: .5rem 0; border-bottom: 1px solid var(--line-soft); }
.plain li:last-child { border-bottom: 0; }
.search { max-width: 520px; margin-bottom: 1rem; }
.site-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }

/* ---------- Buying ---------- */
.packs { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.packs legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; padding: 0; }
.pack {
	position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 16px 18px; cursor: pointer;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
	font-weight: 430; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.pack:hover { border-color: var(--accent-ring); }
.pack:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pack input { position: absolute; inset-inline-end: 18px; top: 20px; width: 20px; height: 20px; margin: 0; }
.pack-name { font-weight: 700; font-size: 1rem; color: var(--text-2); padding-inline-end: 32px; }
.pack-best { position: absolute; top: -12px; inset-inline-start: 20px; background: var(--accent); color: var(--on-accent); font-size: .8125rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pack-checks { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; color: var(--muted); font-weight: 600; }
.pack-checks .num { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); line-height: 1.15; }
.pack-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }
.pack-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pack-price { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pack-per { align-self: flex-start; margin-top: 6px; font-size: .875rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 2px 10px; }
.pack .muted { font-size: .875rem; }
/* Phones (0.6.0): one compact row per package, amount on the right, price on the left */
@media (max-width: 599px) {
	.packs { gap: 10px; }
	.pack { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 14px 16px; }
	.pack-name { grid-column: 1; grid-row: 1; padding-inline-end: 0; }
	.pack-checks { grid-column: 1; grid-row: 2; margin: 0; }
	.pack-checks .num { font-size: 1.6rem; }
	.pack-per { grid-column: 1; grid-row: 3; margin-top: 4px; justify-self: start; }
	.pack-sep { display: none; }
	.pack-price-row { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; gap: 0; margin-inline-end: 34px; }
	.pack > .muted { grid-column: 2; grid-row: 3; text-align: end; margin-inline-end: 34px; }
	.pack input { top: 16px; inset-inline-end: 16px; }
}
.summary { display: flex; flex-direction: column; gap: 12px; }
.summary h2 { margin: 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.sum-row.light { color: var(--muted); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line-soft); padding-top: 12px; font-weight: 600; }
.sum-total .num { font-size: 1.6rem; font-weight: 800; }
.perks { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; font-size: .875rem; color: var(--muted); }
.perks li { display: flex; gap: 8px; align-items: center; }
.perks .ic { color: var(--ok); width: 16px; height: 16px; }

/* ---------- Admin ---------- */
.subnav, .filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--surface-3); border-radius: 10px; width: fit-content; max-width: 100%; }
.subnav a, .filters a { text-decoration: none; color: var(--muted); padding: 6px 14px; border-radius: 7px; font-size: .9rem; font-weight: 600; }
.subnav a:hover, .filters a:hover { color: var(--text); }
.subnav a[aria-current="page"], .filters a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.row-fields { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .row-fields { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.row-fields label { display: flex; flex-direction: column; gap: .3rem; }
.pack-edit h2 { margin-top: 0; }
.card.notice-error { background: var(--err-bg); border-color: var(--err-line); color: var(--text); }
.card.notice-error h2 { color: var(--err); }

/* ---------- Print ---------- */
@media print {
	.side, .side-nav, .foot, .page-actions { display: none !important; }
	body { background: #fff; }
	.card { box-shadow: none; }
}

/* Guest forms: a little more air than inside the app */
.auth-in .form { gap: .5rem; }
.auth-in .form .btn { margin-top: .75rem; }
.toolbar .input-icon { flex: 0 1 340px; }
@media (max-width: 600px) { .toolbar .input-icon { flex: 1 1 100%; } }

/* ---------- Sites list (0.3.1: rows instead of cards, no empty gaps) ---------- */
.add-site { padding: 14px 18px; }
.add-site .form { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.add-site label { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; color: var(--text); flex: none; margin-inline-end: 4px; }
.add-site label .ic { color: var(--accent-text); }
.add-site input[type="text"] { flex: 1 1 260px; width: auto; }
.add-site .form .btn { margin-top: 0; }
.add-site .hint { margin-top: 8px; }
.sites-card { overflow: visible; }
.sites-card .card-head { align-items: center; }
.sites-card .toolbar { margin: 0; gap: 10px; }
.sites-card .toolbar .muted { margin: 0; }
.site-list { list-style: none; margin: 12px 0 0; padding: 0; }
.site-row {
	display: grid; gap: 8px 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-soft);
	grid-template-columns: 32px repeat(3, minmax(0, 1fr));
	grid-template-areas: "mark main main main" ". c1 c2 cid";
	position: relative;
}
.site-row:hover { background: var(--surface-2); }
.site-row:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.site-row > .site-mark { grid-area: mark; align-self: start; }
.site-main { grid-area: main; min-width: 0; }
.site-row .c1 { grid-area: c1; }
.site-row .c2 { grid-area: c2; }
.site-row .cid { grid-area: cid; }
.site-row > .menu { position: absolute; top: 10px; inset-inline-end: 12px; }
.site-row .site-main { padding-inline-end: 40px; }
.site-name { margin: 0; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.site-row.is-off .site-name { color: var(--muted); }
.site-row.is-off .site-mark { background: var(--surface-3); color: var(--faint); }
.site-row .site-meta { margin-top: 4px; }
.site-row .site-hint { margin: 6px 0 0; font-size: .875rem; }
.col-label { display: block; font-size: .875rem; color: var(--muted); }
.col-value { font-weight: 600; }
.site-row .id-chip { gap: 2px; }
.site-row .id-chip .icon-btn { width: 32px; height: 32px; }
.icon-btn.is-done { color: var(--ok); background: var(--ok-bg); }
@media (min-width: 900px) {
	.site-row {
		grid-template-columns: 32px minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) 40px;
		grid-template-areas: "mark main c1 c2 cid menu";
	}
	.site-row > .site-mark { align-self: center; }
	.site-row > .menu { position: relative; top: auto; inset-inline-end: auto; grid-area: menu; justify-self: end; align-self: center; }
	.site-row .site-main { padding-inline-end: 0; }
}

/* Bot protection (0.4.0): a field people never see, and the Turnstile box */
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* no offset: in RTL a far-left box widens the page */
.cf-turnstile { margin: .75rem 0 .25rem; min-height: 65px; }
