/* StreetMafia Design V2026 - design system: tokens and reusable components.
   Dark Mafia 2026 is the default; [data-theme="light"] only swaps tokens. */
:root {
	color-scheme: dark;
	--sm-bg: #08080b;
	--sm-bg-glow: rgba(120, 12, 20, .22);
	--sm-surface: #15151a;
	--sm-surface-2: #1d1d23;
	--sm-border: #2b2b32;
	--sm-text: #f5f5f6;
	--sm-muted: #a9a9b1;
	--sm-accent: #e31d2b;
	--sm-accent-hover: #f23543;
	--sm-on-accent: #fff;
	--sm-link: #ff5a66;
	--sm-warn: #f5b40a;
	--sm-ok: #33c463;
	--sm-danger-text: #ff6b75;
	--sm-info-text: #6cb2ff;
	--sm-track: #303038;
	--sm-chrome: #0b0b0f;
	--sm-chrome-text: #f5f5f6;
	--sm-chrome-border: #24242a;
	--sm-shadow: 0 10px 30px rgba(0, 0, 0, .35);
	--sm-radius: 16px;
	--sm-radius-s: 10px;
	--sm-font-display: "Oswald", "Bahnschrift SemiCondensed", "Bahnschrift", "Roboto Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
	--sm-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	--sm-gutter: 16px;
	--sm-gap: 20px;
	--sm-topbar-h: 76px;
	--sm-bottomnav-h: 72px;
}

:root[data-theme="light"] {
	color-scheme: light;
	--sm-bg: #f2f2f4;
	--sm-bg-glow: rgba(227, 29, 43, .06);
	--sm-surface: #fff;
	--sm-surface-2: #f6f6f8;
	--sm-border: #dcdce2;
	--sm-text: #17171b;
	--sm-muted: #575760;
	--sm-accent: #c8141f;
	--sm-accent-hover: #a90f19;
	--sm-link: #b0121c;
	--sm-warn: #a87400;
	--sm-ok: #15803d;
	--sm-danger-text: #b0121c;
	--sm-info-text: #1a5fb4;
	--sm-track: #dedee4;
	--sm-shadow: 0 8px 24px rgba(20, 20, 30, .08);
}

/* Base: undoes the global rules of the legacy stylesheet for the new shell. */
html { height: auto; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body.sm-body {
	height: auto;
	min-height: 100vh;
	margin: 0;
	background: radial-gradient(1200px 500px at 50% -120px, var(--sm-bg-glow), transparent 70%), var(--sm-bg);
	background-attachment: fixed;
	color: var(--sm-text);
	font: 400 15px/1.45 var(--sm-font);
}
.sm-body *, .sm-body *::before, .sm-body *::after { box-sizing: border-box; }
.sm-ui h1, .sm-ui h2, .sm-ui h3, .sm-ui h4 { margin: 0; padding: 0; background: none; line-height: 1.15; text-shadow: none; }
:where(.sm-ui) ul { margin: 0; padding: 0; list-style: none; }
:where(.sm-ui) a { color: inherit; text-decoration: none; }
:where(.sm-ui) a:hover { color: inherit; }
:where(.sm-ui) img { display: block; max-width: 100%; }
:where(.sm-ui) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sm-body :focus-visible { outline: 2px solid var(--sm-warn); outline-offset: 2px; border-radius: 4px; }
.sm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sm-skip { position: fixed; left: 12px; top: -80px; z-index: 300; padding: 10px 16px; border-radius: var(--sm-radius-s); background: var(--sm-accent); color: var(--sm-on-accent) !important; font-weight: 600; }
.sm-skip:focus { top: 12px; }
.sm-icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sm-display { font-family: var(--sm-font-display); font-weight: 600; letter-spacing: .01em; }

/* Card */
.sm-card { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); }
.sm-card__title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px !important; font: 600 24px/1.15 var(--sm-font-display); color: var(--sm-text); }
.sm-card__title .sm-icon { color: var(--sm-accent); width: 28px; height: 28px; }

/* Buttons */
.sm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--sm-radius-s); border: 1px solid var(--sm-border); background: var(--sm-surface-2); color: var(--sm-text); font: 600 16px/1.1 var(--sm-font-display); cursor: pointer; }
.sm-btn:hover { border-color: var(--sm-muted); }
.sm-btn--primary, .sm-ui a.sm-btn--primary { background: var(--sm-accent); border-color: var(--sm-accent); color: var(--sm-on-accent); }
.sm-btn--primary:hover, .sm-ui a.sm-btn--primary:hover { background: var(--sm-accent-hover); border-color: var(--sm-accent-hover); color: var(--sm-on-accent); }

/* Badge */
.sm-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--sm-accent); color: var(--sm-on-accent); font: 700 12px/1 var(--sm-font); }

/* Status bars. Width is set inline (and by the legacy AJAX responses). */
.sm-bar { display: block; height: 8px; border-radius: 4px; background: var(--sm-track); overflow: hidden; }
.sm-bar__fill { display: block; height: 100%; max-width: 100%; border-radius: 4px; background: var(--sm-accent); transition: width .4s ease-in-out; }
.sm-bar__fill--warn { background: var(--sm-warn); }
.sm-bar--unknown .sm-bar__fill { width: 100%; opacity: .55; background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0, 0, 0, .28) 8px 16px); background-size: 200% 100%; animation: sm-stripes 12s linear infinite; }
@keyframes sm-stripes { to { background-position: -200% 0; } }

/* Form controls */
.sm-input, .sm-body select, .sm-body textarea, .sm-body input[type="text"], .sm-body input[type="password"], .sm-body input[type="email"], .sm-body input[type="number"] {
	max-width: 100%;
	min-height: 40px;
	padding: 8px 12px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-s);
	background: var(--sm-surface-2);
	color: var(--sm-text);
	font: 400 15px/1.3 var(--sm-font);
}

/* Tables */
.sm-table { width: 100%; border-collapse: collapse; }
.sm-table th, .sm-table td { padding: 10px 12px; border-bottom: 1px solid var(--sm-border); text-align: left; }
.sm-table th { color: var(--sm-muted); font-weight: 600; }

/* Alerts */
.sm-alert { margin: 0 0 var(--sm-gap); padding: 12px 16px; border: 1px solid var(--sm-border); border-left: 4px solid var(--sm-accent); border-radius: var(--sm-radius-s); background: var(--sm-surface); }
.sm-alert--warn { border-left-color: var(--sm-warn); }
.sm-alert--ok { border-left-color: var(--sm-ok); }

/* Modal: <dialog class="sm-modal"> */
.sm-modal { max-width: min(560px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--sm-border); border-radius: var(--sm-radius); background: var(--sm-surface); color: var(--sm-text); box-shadow: var(--sm-shadow); }
.sm-modal::backdrop, .sm-drawer::backdrop { background: rgba(0, 0, 0, .65); }

/* Theme switch */
.sm-theme { display: inline-flex; padding: 4px; border-radius: 28px; background: rgba(20, 20, 24, .78); border: 1px solid rgba(255, 255, 255, .08); }
.sm-theme__btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: #f5f5f6 !important; }
.sm-theme__btn[aria-pressed="true"] { background: #e31d2b; }

@media (prefers-reduced-motion: reduce) {
	.sm-body *, .sm-body *::before, .sm-body *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
