/* =====================================================================
   العسكر · نظام التصميم للجوال
   الألوان والخطوط من دليل الهوية 1.0. الزمردي 60% · العاجي 25% · الذهبي 10%.
   قاعدة الهوية: لا ذهبي على خلفية فاتحة (كنص أو شعار)، الذهبي يجي على الزمردي.
   ===================================================================== */

@font-face { font-family: "Amiri"; src: url("../fonts/Amiri-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("../fonts/Amiri-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
	/* Brand palette (05-Colors/colors.css) */
	--emerald: #0e3b30;
	--emerald-dark: #082720;
	--palm: #1f6b55;
	--gold: #c8a45c;
	--gold-light: #ead9ad;
	--ivory: #f6f1e6;
	--brand-muted: #6d6458;
	--brand-line: #e2d6bd;

	/* Day */
	--bg: var(--ivory);
	--surface: #fbf8f1;
	--surface-2: #f1e9d8;
	--ink: var(--emerald);        /* headings */
	--text: #22302b;
	--muted: var(--brand-muted);
	--line: var(--brand-line);
	--hero: var(--emerald);       /* always-dark bands: bar, gate, hero */
	--hero-deep: var(--emerald-dark);
	--hero-ink: var(--gold-light);
	--primary: var(--emerald);
	--primary-ink: var(--ivory);
	--accent: var(--gold);
	--accent-ink: var(--emerald-dark);
	--link: var(--palm);
	--ok: var(--palm);
	--ok-bg: #e4efe8;
	--err: #9b2c2c;
	--err-bg: #f6e3df;
	--focus: var(--gold);
	--shadow: 0 1px 2px rgb(14 59 48 / 6%), 0 6px 20px rgb(14 59 48 / 7%);

	--font-head: "Amiri", "Times New Roman", serif;
	--font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
	--r-sm: 8px;
	--r: 14px;
	--r-lg: 22px;
	--gutter: 16px;
	--bar-h: 60px;
	--tabs-h: 66px;
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-b: env(safe-area-inset-bottom, 0px);
	--stars: url("../img/stars-tile-gold.svg");
	color-scheme: light;
}

/* Night: hand-tuned, emerald-dark ground, gold carries the accents. */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: var(--emerald-dark);
		--surface: #0f3a30;
		--surface-2: #154638;
		--ink: var(--gold-light);
		--text: #efe8d8;
		--muted: #b8ae98;
		--line: #2a5446;
		--hero: #0b3128;
		--hero-deep: #061d18;
		--primary: var(--gold);
		--primary-ink: var(--emerald-dark);
		--link: var(--gold-light);
		--ok: #8fd0b0;
		--ok-bg: #12402f;
		--err: #f0a597;
		--err-bg: #3a1f1b;
		--shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100dvh;
	background: var(--bg);
	color: var(--text);
	font: 400 16px/1.7 var(--font-body);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; color: var(--ink); line-height: 1.35; margin: 0; }
p { margin: 0; }
.alk-ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.alk-center { text-align: center; }
.alk-muted { color: var(--muted); }
.alk-icon { flex: none; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.alk-title { font-size: 28px; }
.alk-h2 { font-size: 22px; }
.alk-lead { color: var(--muted); margin-top: 4px; }
.alk-hint { color: var(--muted); font-size: 14px; line-height: 1.6; }
.alk-big { font-size: 22px; font-weight: 600; color: var(--ink); margin: 4px 0 12px; }
.alk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 14px; }
.alk-meta a { color: inherit; text-decoration: none; }

/* Stars pattern: brand says 5–10% opacity. */
.alk-stars { position: relative; isolation: isolate; }
.alk-stars::before,
.alk-guest::before,
.alk-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--stars) 0 0 / 84px 84px repeat;
	opacity: .08;
	pointer-events: none;
}

/* ---------- App frame ---------- */
.alk-main {
	width: 100%;
	max-width: 560px;
	margin-inline: auto;
	padding: 16px var(--gutter) calc(var(--tabs-h) + var(--safe-b) + 28px);
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.alk-guest .alk-main { padding: 0; max-width: none; }

.alk-bar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--hero);
	padding-top: var(--safe-t);
}
.alk-bar__in {
	max-width: 560px;
	margin-inline: auto;
	height: var(--bar-h);
	padding-inline: 8px 12px;
	display: grid;
	grid-template-columns: 48px 1fr 48px;
	align-items: center;
}
.alk-bar__brand { grid-column: 2; justify-self: center; display: block; }
.alk-bar__logo { height: 40px; width: auto; }
.alk-bar__back { grid-column: 1; grid-row: 1; width: 44px; height: 44px; display: grid; place-items: center; color: var(--gold-light); border-radius: 50%; }
.alk-bar__me { grid-column: 3; grid-row: 1; justify-self: end; text-decoration: none; }
.alk-merlon {
	height: 8px;
	background: url("../img/merlon-strip-gold.svg") 0 0 / auto 8px repeat-x;
	border-top: 1px solid var(--hero);
}

.alk-tabs {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 20;
	display: flex;
	justify-content: center;
	background: var(--surface);
	border-top: 1px solid var(--line);
	padding-bottom: var(--safe-b);
	box-shadow: 0 -6px 20px rgb(14 59 48 / 6%);
}
.alk-tabs__item {
	flex: 1;
	max-width: 112px;
	height: var(--tabs-h);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	position: relative;
}
.alk-tabs__item.is-current { color: var(--ink); font-weight: 600; }
.alk-tabs__item.is-current::before {
	content: "";
	position: absolute;
	top: 0;
	width: 28px;
	height: 3px;
	border-radius: 0 0 3px 3px;
	background: var(--accent);
}

/* ---------- Guest screens (sign-in, join, desktop) ---------- */
.alk-guest { background: var(--hero); color: var(--text); position: relative; isolation: isolate; }
.alk-guest::before { position: fixed; }
.alk-gate {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	max-width: 560px;
	margin-inline: auto;
}
.alk-gate__brand {
	flex: 1 0 auto;
	min-height: 38dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: calc(var(--safe-t) + 32px) var(--gutter) 28px;
	text-align: center;
}
.alk-gate__brand--sm { min-height: 0; flex: 0 0 auto; padding-bottom: 20px; }
.alk-gate--form .alk-sheet { flex: 1 0 auto; }
.alk-gate__logo { width: 132px; }
.alk-gate__brand--sm .alk-gate__logo { width: 72px; }
.alk-gate__tag { font-family: var(--font-head); font-size: 22px; color: var(--gold-light); }

.alk-sheet {
	background: var(--bg);
	border-radius: var(--r-lg) var(--r-lg) 0 0;
	padding: 28px var(--gutter) calc(var(--safe-b) + 28px);
	display: flex;
	flex-direction: column;
	gap: 16px;
	box-shadow: 0 -10px 40px rgb(0 0 0 / 18%);
	position: relative;
}
.alk-sheet::before { /* gold hairline that echoes the emblem's double ring */
	content: "";
	position: absolute;
	inset: 8px 8px auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gold), transparent);
	opacity: .55;
}
.alk-sheet__foot { text-align: center; color: var(--muted); }
.alk-sheet__foot a { font-weight: 600; }
.alk-sheet__note { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }

.alk-login, .alk-phone-change { display: flex; flex-direction: column; gap: 14px; }
.alk-step { display: flex; flex-direction: column; gap: 14px; }
.alk-step__links { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Forms ---------- */
.alk-form { display: flex; flex-direction: column; gap: 16px; }
.alk-form--inline { gap: 12px; margin-top: 12px; }
.alk-field { display: flex; flex-direction: column; gap: 6px; }
.alk-field__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.alk-field__label small { font-weight: 400; color: var(--muted); }
.alk-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.alk-fieldset legend { padding: 0; margin-bottom: 6px; }

.alk-input {
	width: 100%;
	min-height: 52px;
	padding: 12px 14px;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r);
	color: var(--text);
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.alk-input::placeholder { color: var(--muted); opacity: .7; }
.alk-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgb(200 164 92 / 25%); }
.alk-input--phone { font-size: 20px; letter-spacing: .06em; text-align: left; }
.alk-input--phone::placeholder { letter-spacing: .02em; }
.alk-otp {
	font-size: 30px;
	font-weight: 600;
	letter-spacing: .5em;
	text-align: center;
	padding-inline-start: .5em; /* balance the trailing letter-spacing */
	font-variant-numeric: tabular-nums;
}
.alk-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Dropdowns: native picker on phones, a gold chevron on the leading side (left in RTL). */
.alk-select {
	padding-inline-end: 14px;
	padding-inline-start: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c8a45c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	cursor: pointer;
}
.alk-select:disabled { opacity: .55; cursor: not-allowed; }
.alk-place { display: flex; flex-direction: column; gap: 12px; }

/* Phone: [+966 ▾][number], left-to-right like the number. The picker shows the code; the list shows the country too. */
.alk-phone { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.alk-phone__dial {
	position: relative;
	display: flex;
	align-items: center;
	font-size: 18px;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
	padding-inline: 14px 30px;
	background-position: right 10px center;
}
.alk-phone__dial select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.alk-phone__dial:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(200 164 92 / 25%); }

.alk-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alk-seg label { position: relative; }
.alk-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.alk-seg span {
	display: grid;
	place-items: center;
	min-height: 48px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--surface);
	font-weight: 500;
}
.alk-seg input:checked + span { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.alk-seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.alk-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.6; }
.alk-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.alk-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alk-msg { min-height: 0; font-size: 14px; color: var(--err); text-align: center; }
.alk-msg:empty { display: none; }
.alk-msg.is-ok { color: var(--ok); }
.alk-dev {
	font-size: 13px;
	text-align: center;
	padding: 8px 12px;
	border: 1px dashed var(--gold);
	border-radius: var(--r-sm);
	color: var(--muted);
}
.alk-dev b { color: var(--ink); letter-spacing: .2em; font-size: 16px; }

/* ---------- Buttons ---------- */
.alk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 20px;
	border-radius: var(--r);
	border: 1px solid transparent;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: transform .08s, background-color .15s, opacity .15s;
	-webkit-user-select: none;
	user-select: none;
	list-style: none;
}
.alk-btn::-webkit-details-marker { display: none; }
.alk-btn:active { transform: scale(.98); }
.alk-btn[disabled], .alk-btn.is-busy { opacity: .6; pointer-events: none; }
.alk-btn--block { width: 100%; }
.alk-btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; }
.alk-btn--primary { background: var(--primary); color: var(--primary-ink); }
.alk-btn--gold { background: var(--accent); color: var(--accent-ink); }
.alk-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.alk-btn--danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.alk-btn.is-busy::after {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: alk-spin .7s linear infinite;
}
@keyframes alk-spin { to { transform: rotate(360deg); } }

.alk-link {
	background: none;
	border: 0;
	padding: 10px 0;
	min-height: 44px;
	color: var(--link);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	list-style: none;
}
.alk-link::-webkit-details-marker { display: none; }
.alk-link[disabled] { color: var(--muted); font-weight: 400; cursor: default; }

/* ---------- Pieces ---------- */
.alk-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--gold);
	margin-inline: auto;
	width: min(240px, 80%);
}
.alk-divider::before, .alk-divider::after { content: ""; flex: 1; height: 1px; background: var(--gold); opacity: .7; }

.alk-flash {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border-radius: var(--r);
	font-size: 14px;
	line-height: 1.6;
}
.alk-flash--ok { background: var(--ok-bg); color: var(--ok); }
.alk-flash--err { background: var(--err-bg); color: var(--err); }
.alk-flash span { color: var(--text); }

.alk-badge {
	display: inline-flex;
	align-items: center;
	padding: 1px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: var(--surface-2);
	color: var(--ink);
	white-space: nowrap;
}
.alk-badge--gold { background: var(--accent); color: var(--accent-ink); }
.alk-badge--ok { background: var(--ok-bg); color: var(--ok); }

.alk-count {
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	display: inline-grid;
	place-items: center;
	font-size: 12px;
	font-weight: 700;
	background: var(--surface-2);
	color: var(--ink);
}
.alk-count--hot, .alk-admin-card .alk-count { background: var(--accent); color: var(--accent-ink); }

.alk-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	flex: none;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 20px;
	line-height: 1;
	background: var(--emerald);
	color: var(--gold-light);
	box-shadow: inset 0 0 0 2px var(--emerald), inset 0 0 0 3px var(--gold);
}
.alk-avatar--sm { width: 36px; height: 36px; font-size: 17px; background: var(--emerald-dark); box-shadow: inset 0 0 0 1.5px var(--gold); }
.alk-avatar--lg { width: 64px; height: 64px; font-size: 28px; }
.alk-avatar--f { background: var(--palm); box-shadow: inset 0 0 0 2px var(--palm), inset 0 0 0 3px var(--gold-light); }

/* ---------- Cards ---------- */
.alk-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 16px;
	box-shadow: var(--shadow);
}
.alk-card__title { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.alk-card--link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.alk-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--emerald); color: var(--gold); flex: none; }
.alk-card__body { flex: 1; display: flex; flex-direction: column; }
.alk-card__body b { color: var(--ink); }
.alk-card__body small { color: var(--muted); font-size: 13px; }

.alk-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: linear-gradient(160deg, var(--hero), var(--hero-deep));
	color: var(--gold-light);
	border-radius: var(--r-lg);
	padding: 22px 20px 20px;
	border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.alk-hero::after { /* the emblem's inner ring, faint, behind the greeting */
	content: "";
	position: absolute;
	z-index: -1;
	inset-inline-end: -46px;
	top: -46px;
	width: 180px;
	height: 180px;
	background: url("../img/alaskar-emblem-gold.svg") center / contain no-repeat;
	opacity: .14;
}
.alk-hero__hello { color: var(--gold); font-size: 15px; }
.alk-hero__name { font-size: 34px; color: var(--gold-light); line-height: 1.2; }
.alk-hero__full { color: color-mix(in srgb, var(--gold-light) 75%, transparent); font-size: 14px; margin: 2px 0 12px; }

.alk-section-head { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.alk-section-head__rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
[dir="rtl"] .alk-section-head__rule { background: linear-gradient(270deg, var(--line), transparent); }

.alk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 480px) { .alk-grid { grid-template-columns: repeat(3, 1fr); } }
.alk-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 14px 14px;
	min-height: 132px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r);
	text-decoration: none;
	color: var(--text);
	box-shadow: var(--shadow);
	transition: transform .1s, border-color .15s;
}
.alk-tile:active { transform: scale(.98); border-color: var(--gold); }
.alk-tile__icon {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: var(--ink);
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--gold);
	margin-bottom: 6px;
}
.alk-tile__title { font-family: var(--font-head); font-size: 19px; color: var(--ink); line-height: 1.3; }
.alk-tile__desc { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.alk-page-head { display: flex; align-items: center; gap: 14px; padding-top: 4px; }
.alk-page-head__icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	flex: none;
	background: var(--emerald);
	color: var(--gold);
	box-shadow: inset 0 0 0 3px var(--emerald), inset 0 0 0 4px var(--gold);
}

.alk-empty {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 36px 24px;
	color: var(--muted);
	background: var(--surface);
	border-radius: var(--r-sm);
	/* the brand's double frame */
	border: 1.5px solid var(--gold);
	outline: 1px solid var(--gold);
	outline-offset: -8px;
}
.alk-empty--sm { padding: 24px; outline: 0; border: 1px solid var(--line); border-radius: var(--r); }
.alk-empty__emblem img { width: 72px; height: 72px; }
.alk-empty .alk-divider { margin-block: 4px; }

.alk-done { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 12px 0; }
.alk-done__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }

.alk-prose { line-height: 1.8; }
.alk-prose > * + * { margin-top: 12px; }

/* ---------- Profile ---------- */
.alk-id { display: flex; align-items: center; gap: 14px; }
.alk-id .alk-h2 { font-size: 21px; }
.alk-list { list-style: none; margin: 12px 0 0; padding: 0; }
.alk-list__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.alk-list__icon { color: var(--muted); }
.alk-list__main { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.alk-list__main small { flex-basis: 100%; color: var(--muted); font-size: 13px; }

.alk-disclose > summary { list-style: none; }
.alk-disclose > summary::-webkit-details-marker { display: none; }
.alk-disclose[open] > summary.alk-btn { margin-bottom: 4px; }
.alk-disclose .alk-phone-change { margin-top: 12px; }

/* ---------- Members management ---------- */
.alk-add { padding: 0; border: 0; background: none; box-shadow: none; }
.alk-add[open] { padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.alk-add .alk-hint { margin-top: 10px; }

.alk-seg-tabs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	padding: 4px;
	background: var(--surface-2);
	border-radius: var(--r);
}
.alk-seg-tabs a {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	border-radius: 10px;
	color: var(--muted);
	font-weight: 500;
	font-size: 15px;
	text-decoration: none;
}
.alk-seg-tabs a.is-current { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.alk-search { position: relative; display: block; color: var(--muted); }
.alk-search .alk-icon { position: absolute; inset-inline-start: 14px; top: 50%; translate: 0 -50%; }
.alk-search .alk-input { padding-inline-start: 44px; }

.alk-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.alk-member {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.alk-member__head { display: flex; align-items: flex-start; gap: 12px; }
.alk-member__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alk-member__who b { color: var(--ink); font-weight: 600; line-height: 1.5; }
.alk-member__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alk-member__actions form, .alk-member__panel form { display: contents; }
.alk-member__actions .alk-btn { min-height: 46px; }
.alk-member__more { border-top: 1px solid var(--line); margin: 0 -14px -14px; padding: 0 14px; }
.alk-member__more > summary { width: 100%; justify-content: center; color: var(--muted); }
.alk-member__panel { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; }
.alk-member__panel .alk-btn--sm { justify-content: flex-start; }

/* ---------- Desktop block ---------- */
.alk-desktop {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 48px 24px;
	text-align: center;
	color: var(--gold-light);
}
.alk-desktop__logo { width: 150px; }
.alk-divider--gold { color: var(--gold); }
.alk-desktop__title { font-size: 34px; color: var(--gold-light); }
.alk-desktop__lead { color: color-mix(in srgb, var(--gold-light) 80%, transparent); max-width: 34ch; }
.alk-desktop__qr {
	margin-top: 8px;
	padding: 14px;
	background: var(--ivory);
	border-radius: var(--r);
	outline: 1px solid var(--gold);
	outline-offset: 6px;
}
.alk-desktop__qr svg, .alk-desktop__qr img { width: 196px; height: 196px; }
.alk-desktop__url { font-size: 15px; color: var(--gold); margin-top: 8px; }

/* ---------- Legal pages (public, also on desktop) ---------- */
.alk-legal {
	width: 100%;
	max-width: 760px;
	margin-inline: auto;
	background: var(--bg);
	color: var(--text);
	padding: 28px var(--gutter) 40px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.alk-guest .alk-legal { min-height: 100dvh; border-inline: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.alk-legal__head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.alk-legal__emblem img { width: 56px; height: 56px; }
.alk-legal__head .alk-muted { font-size: 13px; }
.alk-legal__body { line-height: 1.85; }
.alk-legal__body h2 { font-size: 21px; margin: 22px 0 6px; }
.alk-legal__body ul, .alk-legal__body ol { margin: 6px 0; padding-inline-start: 22px; }
.alk-legal__body li + li { margin-top: 4px; }
.alk-legal__en { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; border-top: 1px solid var(--line); padding-top: 8px; }
.alk-legal__en h2 { font-family: var(--font-body); font-size: 18px; }
.alk-legal__en p + p { margin-top: 10px; }
.alk-legal__nav, .alk-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13px; }
.alk-legal__nav a[aria-current] { color: var(--ink); font-weight: 600; text-decoration: none; }
.alk-legal-links a { color: var(--muted); }

/* ---------- Notifications ---------- */
.alk-tabs__icon, .alk-tile__icon { position: relative; }
.alk-dot-count {
	position: absolute;
	top: -5px;
	inset-inline-end: -9px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 0 0 2px var(--surface);
}

.alk-push { display: flex; flex-direction: column; gap: 12px; }
.alk-push__row { display: flex; align-items: center; gap: 12px; }
.alk-push__actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.alk-push__actions .alk-link { align-self: center; }
.alk-push.is-on .alk-card__icon { background: var(--ok-bg); color: var(--ok); }

.alk-notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alk-notice {
	display: flex;
	gap: 12px;
	padding: 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r);
	color: var(--text);
	text-decoration: none;
}
.alk-notice.is-new { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); box-shadow: var(--shadow); }
.alk-notice__dot { flex: none; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: transparent; }
.alk-notice.is-new .alk-notice__dot { background: var(--accent); }
.alk-notice__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.6; }
.alk-notice__body b { color: var(--ink); font-weight: 600; }
.alk-notice__body small { color: var(--muted); font-size: 12.5px; }
.alk-notice__body em { font-style: normal; color: var(--ink); font-weight: 600; }

/* ---------- Install as an app ---------- */
.alk-install { display: flex; flex-direction: column; gap: 16px; }
.alk-install__head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.alk-install__icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow), 0 0 0 1px var(--gold); margin-bottom: 6px; }
.alk-install__done { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.alk-install__done b { color: var(--ink); }
.alk-install__one { display: flex; flex-direction: column; gap: 12px; }
.alk-install__note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.7; color: var(--muted); background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; }
.alk-install__note .alk-icon { color: var(--ink); margin-top: 3px; }
.alk-install__note b { color: var(--ink); }
.alk-install .alk-card .alk-hint { margin-top: 10px; }
.alk-install .alk-card .alk-btn { margin-top: 12px; }

.alk-steps { list-style: none; counter-reset: alk-step; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; line-height: 1.8; }
.alk-steps > li { counter-increment: alk-step; position: relative; padding-inline-start: 40px; }
.alk-steps > li::before {
	content: counter(alk-step, arabic-indic);
	position: absolute;
	inset-inline-start: 0;
	top: 1px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--hero);
	color: var(--gold-light);
	font-size: 14px;
	font-weight: 600;
	box-shadow: inset 0 0 0 1px var(--gold);
}
.alk-steps--plain > li::before { content: ""; width: 8px; height: 8px; top: 11px; inset-inline-start: 10px; box-shadow: none; background: var(--gold); }
.alk-steps b { color: var(--ink); }
/* The browser's own button, drawn inline so the member knows what to look for. */
.alk-key { display: inline-grid; place-items: center; width: 30px; height: 30px; vertical-align: middle; border-radius: 8px; background: var(--surface-2); color: var(--link); border: 1px solid var(--line); margin-inline: 2px; }

.alk-nudge { display: flex; align-items: center; gap: 12px; padding: 12px; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.alk-nudge__icon { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.alk-nudge .alk-card__body { min-width: 0; }
.alk-nudge__x { flex: none; width: 36px; height: 44px; margin-inline-start: -6px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; }
.alk-sheet .alk-nudge { box-shadow: none; }

.alk-danger-zone { box-shadow: none; }
.alk-danger-zone[open] { display: flex; flex-direction: column; gap: 12px; }
.alk-danger-zone form { display: flex; flex-direction: column; gap: 12px; }
.alk-link--danger { color: var(--err); width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
