/* ttSchweizer custom theme based on 2026-06-21 design mockups */
:root {
	--bg: #f4f5f7;
	--surface: #ffffff;
	--ink: #16181d;
	--muted: #6b7280;
	--faint: #9aa1ab;
	--line: #e6e8ec;
	--line-strong: #d3d7de;
	--accent: #f97316;
	--accent-ink: #fff;
	--accent-soft: #fff1e6;
	--accent-text: #b4530a;
	--win: #22c55e;
	--win-bg: #f0fdf4;
	--loss: #ef4444;
	--loss-bg: #fef2f2;
	--open-bg: #fff7ed;
	--open-border: #fed7aa;
	--open-text: #9a3412;
	--open-text-strong: #c2410c;
	--future: #fafbfc;
	--bye-bg: #fef3c7;
	--bye: #92400e;
	--info-bg: #eff6ff;
	--info: #1e40af;
	--success-bg: #dcfce7;
	--success: #15803d;
	--warning-bg: #fef3c7;
	--warning: #92400e;
	--error-bg: #fee2e2;
	--error: #b91c1c;
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
	--shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
	--shadow-lg:
		0 12px 32px rgba(16, 24, 40, 0.18), 0 4px 12px rgba(16, 24, 40, 0.08);
	--radius: 12px;
	--radius-sm: 10px;
}

/* ===== Dark theme ===== */
body.tt-theme-dark {
	--bg: #0b0d12;
	--surface: #14171f;
	--ink: #f2f4f8;
	--muted: #9aa2b2;
	--faint: #6b7285;
	--line: #242936;
	--line-strong: #303544;
	--accent: #fb923c;
	--accent-ink: #10121a;
	--accent-soft: rgba(251, 146, 60, 0.15);
	--accent-text: #fdba74;
	--win: #4ade80;
	--win-bg: rgba(74, 222, 128, 0.12);
	--loss: #f87171;
	--loss-bg: rgba(248, 113, 113, 0.12);
	--open-bg: rgba(251, 146, 60, 0.12);
	--open-border: rgba(251, 146, 60, 0.45);
	--open-text: #fdba74;
	--open-text-strong: #ffedd5;
	--future: rgba(255, 255, 255, 0.03);
	--bye-bg: rgba(250, 204, 21, 0.12);
	--bye: #facc15;
	--info-bg: rgba(96, 165, 250, 0.12);
	--info: #60a5fa;
	--success-bg: rgba(74, 222, 128, 0.12);
	--success: #4ade80;
	--warning-bg: rgba(250, 204, 21, 0.12);
	--warning: #facc15;
	--error-bg: rgba(248, 113, 113, 0.12);
	--error: #f87171;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
	--shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
	--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35);
}
body.tt-theme-dark .brand .dot {
	box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.25);
}
body.tt-theme-dark .matrix thead th {
	background: #1a1e28;
}
body.tt-theme-dark .matrix th.s,
body.tt-theme-dark .matrix td.s {
	background: #14171f;
}
body.tt-theme-dark .matrix tbody tr:hover td.s {
	background: #1c2030;
}
body.tt-theme-dark .matrix tbody tr:hover td {
	background: #1a1e28;
}
body.tt-theme-dark .tcard {
	background: #10131a;
}
body.tt-theme-dark .seg {
	background: #1f232e;
}
body.tt-theme-dark .seg button.on {
	background: #2a2f3c;
	color: var(--ink);
}
body.tt-theme-dark .pbar {
	background: #262b38;
}
body.tt-theme-dark .m-tab {
	background: #1a1e28;
}
body.tt-theme-dark .m-tab.on {
	background: var(--ink);
	color: #10121a;
}
body.tt-theme-dark .m-tab.on .badge {
	background: var(--accent);
	color: var(--accent-ink);
}
body.tt-theme-dark .m-appbar .m-round-nav {
	background: var(--accent);
}
body.tt-theme-dark .rrow {
	background: var(--surface);
}
body.tt-theme-dark .rrow.r1 {
	border-color: var(--accent);
}
body.tt-theme-dark .rr-rank {
	background: #242936;
}
body.tt-theme-dark .rrow.r1 .rr-rank {
	background: var(--accent);
	color: var(--accent-ink);
}
body.tt-theme-dark input.big,
body.tt-theme-dark .inp {
	background: #0f1218;
	border-color: var(--line-strong);
	color: var(--ink);
}
body.tt-theme-dark .inp:focus {
	outline-color: var(--accent);
	border-color: var(--accent);
}
body.tt-theme-dark .form-control input[type="text"],
body.tt-theme-dark .form-control input[type="email"],
body.tt-theme-dark .form-control input[type="password"],
body.tt-theme-dark .form-control input[type="date"],
body.tt-theme-dark .form-control input[type="search"],
body.tt-theme-dark .form-control input[type="number"],
body.tt-theme-dark .form-control textarea,
body.tt-theme-dark .form-control select {
	background: #0f1218;
	border-color: var(--line-strong);
	color: var(--ink);
}
body.tt-theme-dark .form-control input:focus,
body.tt-theme-dark .form-control textarea:focus,
body.tt-theme-dark .form-control select:focus {
	outline-color: var(--accent);
	border-color: var(--accent);
}
body.tt-theme-dark .filter-bar input[type="search"],
body.tt-theme-dark .filter-bar input[type="date"],
body.tt-theme-dark .search input {
	background: #0f1218;
	border-color: var(--line-strong);
	color: var(--ink);
}
body.tt-theme-dark .status.entwurf {
	background: #1f232e;
	color: var(--ink);
}
body.tt-theme-dark .summary {
	background: rgba(251, 146, 60, 0.1);
	border-color: rgba(251, 146, 60, 0.3);
}

body.tt-theme-dark .rcard {
	background: var(--surface);
}
body.tt-theme-dark .rcard.done {
	background: #0f1513;
}
body.tt-theme-dark .rcard.open {
	background: #18141b;
}
body.tt-theme-dark .mode-tabs .tab {
	background: #1a1e28;
	border-color: var(--line-strong);
}
body.tt-theme-dark .mode-tabs .tab.active {
	background: rgba(251, 146, 60, 0.15);
	color: var(--accent-text);
	border-color: var(--accent);
}
body.tt-theme-dark .table th {
	background: #1a1e28;
}
body.tt-theme-dark .table tbody tr:nth-child(even) {
	background: #181b24;
}
body.tt-theme-dark .btn:hover {
	background: #242936;
	color: var(--ink);
}
body.tt-theme-dark .btn.ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ink);
}
body.tt-theme-dark .btn.danger-outline:hover {
	background: rgba(248, 113, 113, 0.15);
}
body.tt-theme-dark .nav a:hover {
	background: #1a1e28;
}
body.tt-theme-dark .nav a.active {
	background: rgba(251, 146, 60, 0.15);
}
body.tt-theme-dark .app.nav-collapsed .nav a::after {
	background: var(--surface);
	color: var(--ink);
	border: 1px solid var(--line-strong);
}
body.tt-theme-dark .pill.active {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}

/* ===== Club theme (red/white) ===== */
body.tt-theme-club {
	--bg: #faf4f4;
	--surface: #ffffff;
	--ink: #1f0808;
	--muted: #8a4b4b;
	--faint: #b87878;
	--line: #f0dede;
	--line-strong: #e5c5c5;
	--accent: #c81d25;
	--accent-ink: #fff;
	--accent-soft: #ffe8e8;
	--accent-text: #9b111e;
	--win: #16a34a;
	--win-bg: #f0fdf4;
	--loss: #b91c1c;
	--loss-bg: #fee2e2;
	--open-bg: #fff5f5;
	--open-border: #f5c6c6;
	--open-text: #9b111e;
	--open-text-strong: #c81d25;
	--future: #fffbfb;
	--bye-bg: #fff0f0;
	--bye: #991b1b;
	--info-bg: #eff6ff;
	--info: #1e40af;
	--success-bg: #fee2e2;
	--success: #b91c1c;
	--warning-bg: #fff0f0;
	--warning: #991b1b;
	--error-bg: #ffe4e4;
	--error: #7f1d1d;
	--shadow: 0 1px 2px rgba(80, 6, 6, 0.05), 0 1px 3px rgba(80, 6, 6, 0.04);
	--shadow-md: 0 4px 14px rgba(80, 6, 6, 0.08);
	--shadow-lg:
		0 12px 32px rgba(80, 6, 6, 0.14), 0 4px 12px rgba(80, 6, 6, 0.08);
}
body.tt-theme-club .brand .dot {
	background: var(--accent);
	box-shadow: 0 0 0 4px #ffdada;
}
body.tt-theme-club .matrix thead th {
	background: #fff8f8;
}
body.tt-theme-club .matrix th.s,
body.tt-theme-club .matrix td.s {
	background: #fff8f8;
}
body.tt-theme-club .matrix tbody tr:hover td.s {
	background: #fff0f0;
}
body.tt-theme-club .tcard {
	background: #fff8f8;
}
body.tt-theme-club .seg {
	background: #fff0f0;
}
body.tt-theme-club .seg button.on {
	background: #fff;
}
body.tt-theme-club .pbar {
	background: #ffeaea;
}
body.tt-theme-club .pbar i {
	background: var(--accent);
}
body.tt-theme-club .m-appbar .m-round-nav {
	background: var(--accent);
}
body.tt-theme-club .m-tab.on {
	background: var(--accent);
	color: var(--accent-ink);
}
body.tt-theme-club .m-tab.on .badge {
	background: var(--accent-ink);
	color: var(--accent);
}
body.tt-theme-club .rrow.r1 {
	border-color: var(--accent);
}
body.tt-theme-club .cell.win .sets {
	color: var(--win);
}
body.tt-theme-club .rrow.r3 .rr-rank {
	background: #fecaca;
	color: #7f1d1d;
}
body.tt-theme-club .rr-rank {
	background: #fff0f0;
	color: var(--muted);
}
body.tt-theme-club .rrow.r1 .rr-rank {
	background: var(--accent);
	color: var(--accent-ink);
}
body.tt-theme-club .summary {
	background: #fff0f0;
	border-color: #f5c6c6;
}
body.tt-theme-club .rcard.done {
	background: #fffafa;
}
body.tt-theme-club .rcard.open {
	background: #fff8f8;
}
body.tt-theme-club .mode-tabs .tab.active {
	background: var(--accent-soft);
	color: var(--accent-text);
	border-color: var(--accent);
}
body.tt-theme-club .table th {
	background: #fff8f8;
}
body.tt-theme-club .table tbody tr:nth-child(even) {
	background: #fffbfb;
}
body.tt-theme-club .nav a:hover {
	background: #fff5f5;
}
body.tt-theme-club .nav a.active {
	background: var(--accent-soft);
}
body.tt-theme-club .app.nav-collapsed .nav a::after {
	background: var(--surface);
	color: var(--accent-text);
	border: 1px solid var(--line-strong);
}

* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	height: 100%;
}
body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	color: var(--ink);
	background: var(--bg);
	font-size: 14px;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}
.num,
.sets,
.rank,
.ttr,
.rhead,
.opp {
	font-variant-numeric: tabular-nums;
}

/* ---------------- Layout ---------------- */
.app {
	display: grid;
	grid-template-columns: 236px 1fr;
	min-height: 100vh;
}
.app.no-sidebar {
	display: block;
}
.app.nav-collapsed {
	grid-template-columns: 64px 1fr;
}
.app.nav-collapsed .sidebar {
	width: 64px;
	padding: 18px 10px;
	align-items: center;
	overflow: visible;
	z-index: 100000;
}
.app.nav-collapsed .brand-row {
	width: 100%;
	justify-content: center;
}
.app.nav-collapsed .brand-row .brand {
	display: none;
}
.app.nav-collapsed .tcard {
	display: none;
}
.app.nav-collapsed .side-foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 0;
	margin-top: auto;
}
.app.nav-collapsed .side-foot .theme-toggle > span {
	display: none;
}
.app.nav-collapsed .side-foot .theme-toggle .seg {
	flex-direction: column;
	gap: 6px;
	align-items: center;
}
.app.nav-collapsed .tt-theme-btn {
	width: 26px;
	height: 26px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
	display: inline-grid;
	place-items: center;
	background: var(--surface);
}
.app.nav-collapsed .tt-theme-btn .lbl {
	display: none;
}
.app.nav-collapsed .tt-theme-btn .swatch {
	width: 14px;
	height: 14px;
}
.app.nav-collapsed .tt-theme-btn.on {
	box-shadow: 0 0 0 2px var(--accent);
}
.app.nav-collapsed .user-menu {
	width: auto;
}
.app.nav-collapsed .user-menu summary.user {
	padding: 0;
	justify-content: center;
}
.app.nav-collapsed .user-menu summary.user > *:not(.ava) {
	display: none;
}
.app.nav-collapsed .user-menu summary.user .ava {
	width: 32px;
	height: 32px;
	font-size: 14px;
}
.app.nav-collapsed .user-dropdown {
	left: calc(100% + 8px);
	right: auto;
	top: 0;
	bottom: auto;
	min-width: 140px;
}
.app.nav-collapsed .nav {
	width: 100%;
}
.app.nav-collapsed .nav-groups {
	width: 100%;
	gap: 10px;
}
.app.nav-collapsed .nav-heading {
	display: none;
}
.app.nav-collapsed .nav-section + .nav-section {
	border-top: 1px solid var(--line);
	padding-top: 10px;
}
.app.nav-collapsed .nav a {
	justify-content: center;
	padding: 10px 0;
	position: relative;
	overflow: visible;
}
.app.nav-collapsed .nav a .ic {
	width: auto;
	font-size: 18px;
}
.app.nav-collapsed .nav a .nav-label {
	display: none;
}
.app.nav-collapsed .nav a.active::before {
	left: -10px;
}
.app.nav-collapsed .nav a::after {
	content: attr(data-label);
	position: absolute;
	left: calc(100% + 8px);
	top: 50%;
	transform: translateY(-50%);
	background: var(--ink);
	color: #fff;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
	z-index: 100001;
}
.app.nav-collapsed .nav a:hover::after {
	opacity: 1;
}

.sidebar {
	background: var(--surface);
	border-right: 1px solid var(--line);
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	position: sticky;
	top: 0;
	height: 100vh;
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none;
	color: var(--ink);
}
.brand .dot {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--accent);
	display: grid;
	place-items: center;
	color: #fff;
	font-size: 13px;
	box-shadow: 0 0 0 4px var(--accent-soft);
}
.brand small {
	display: block;
	font-weight: 500;
	color: var(--muted);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.brand-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.brand-row .brand {
	flex: 1;
	min-width: 0;
}
.nav-toggle {
	padding: 4px 6px;
}

.tcard {
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 12px;
	background: #fbfbfd;
}
.tcard .tn {
	font-weight: 600;
	font-size: 13px;
}
.tcard .ts {
	color: var(--muted);
	font-size: 12px;
	margin-top: 2px;
}

.nav {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.nav-groups {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.nav-section {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.nav-section + .nav-section {
	border-top: 1px solid var(--line);
	padding-top: 14px;
}
.nav-heading {
	padding: 0 10px 2px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--faint);
}
.nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	color: var(--muted);
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 500;
	position: relative;
}
.nav a .ic {
	width: 18px;
	color: var(--faint);
	text-align: center;
}
.nav a:hover {
	background: #f4f5f7;
	color: var(--ink);
}
.nav a.active {
	background: var(--accent-soft);
	color: var(--accent-text);
}
.nav a.active::before {
	content: "";
	position: absolute;
	left: -16px;
	top: 6px;
	bottom: 6px;
	width: 3px;
	border-radius: 3px;
	background: var(--accent);
}

.side-foot {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.theme-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 12px;
	color: var(--muted);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 6px 8px;
}
.seg {
	display: inline-flex;
	align-items: center;
	background: #f0f1f4;
	border-radius: 7px;
	padding: 2px;
}
.seg button {
	border: 0;
	background: transparent;
	font-size: 10px;
	padding: 3px 6px;
	border-radius: 5px;
	cursor: pointer;
	color: var(--muted);
	line-height: 1;
}
.seg button.on {
	background: #fff;
	color: var(--ink);
	box-shadow: var(--shadow);
}
.tt-theme-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.tt-theme-btn .swatch {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
	display: inline-block;
	flex-shrink: 0;
	vertical-align: middle;
}
.tt-theme-btn .swatch.light {
	background: #fff;
}
.tt-theme-btn .swatch.dark {
	background: #1f232e;
	border-color: #3b4252;
}
.tt-theme-btn .swatch.club {
	background: #c81d25;
	border-color: #9b111e;
}
.user {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 12.5px;
}
.ava {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #c7d2fe;
	color: #3730a3;
	display: grid;
	place-items: center;
	font-weight: 600;
	font-size: 12px;
	flex-shrink: 0;
}

.main {
	padding: 22px 28px 60px;
	overflow: auto;
	min-width: 0;
}

/* ---------------- Topbar (dashboard / tournament) ---------------- */
.topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}
.topbar h1 {
	margin: 0;
	font-size: 21px;
	letter-spacing: -0.02em;
}
.topbar .sub {
	color: var(--muted);
	font-size: 13px;
	margin-top: 3px;
}
.topbar .sub b {
	color: var(--ink);
	font-weight: 600;
}
.topbar .breadcrumb {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--muted);
	margin-top: 2px;
}
.topbar .breadcrumb a {
	color: var(--muted);
	text-decoration: none;
}
.topbar .breadcrumb a:hover {
	color: var(--accent-text);
	text-decoration: underline;
}
.topbar .breadcrumb .bc-sep {
	color: var(--faint);
}
.actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.btn.disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

.global-topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
	padding: 12px 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.global-topbar .brand {
	font-size: 16px;
}
.global-topbar .topbar-right {
	display: flex;
	align-items: center;
	gap: 14px;
}
.global-topbar .theme-toggle {
	border: 0;
	padding: 0;
}
.global-topbar .theme-toggle > span {
	display: none;
}
.global-topbar .tt-theme-btn {
	padding: 4px;
	border-radius: 50%;
}
.global-topbar .tt-theme-btn .lbl {
	display: none;
}
.global-topbar .tt-theme-btn .swatch {
	width: 14px;
	height: 14px;
}

/* ---------------- Buttons ---------------- */
.btn {
	appearance: none;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 13px;
	border-radius: 9px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	box-shadow: var(--shadow);
	text-decoration: none;
}
.btn:hover {
	background: #fafbfc;
}
.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}
.btn.primary:hover {
	filter: brightness(0.96);
}
.btn.ghost {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	color: var(--muted);
}
.btn.ghost:hover {
	background: #f0f1f4;
	color: var(--ink);
}
.btn.danger {
	background: var(--error-bg);
	border-color: var(--error);
	color: var(--error);
}
.btn.danger:hover {
	filter: brightness(0.96);
}
.btn.danger-outline {
	background: transparent;
	border-color: var(--error);
	color: var(--error);
}
.btn.danger-outline:hover {
	background: var(--error-bg);
}
.btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}
.btn[disabled]:hover {
	background: var(--surface);
	filter: none;
}
.btn.small {
	padding: 6px 11px;
	font-size: 12px;
}
.round-actions {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.round-action.btn.small {
	padding: 4px 10px;
	font-size: 11px;
	line-height: 1.2;
	border-radius: 7px;
}
.matrix-card.round-card .matrix-scroll {
	overflow: visible;
}
.round-card .matrix {
	table-layout: fixed;
}
.round-card .matrix td {
	height: 36px;
}
.round-card .matrix th:nth-child(1),
.round-card .matrix td:nth-child(1) {
	width: 52px;
}
.round-card .matrix th:nth-child(2),
.round-card .matrix td:nth-child(2) {
	width: 35%;
	min-width: 120px;
}
.round-card .matrix th:nth-child(3),
.round-card .matrix td:nth-child(3) {
	width: 35%;
	min-width: 120px;
}
.round-card .matrix th:nth-child(4),
.round-card .matrix td:nth-child(4) {
	width: 72px;
}
.round-card .matrix th:nth-child(5),
.round-card .matrix td:nth-child(5) {
	width: auto;
	white-space: nowrap;
}

.progress {
	font-size: 12px;
	color: var(--muted);
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.pbar {
	width: 120px;
	height: 6px;
	background: #e9ebef;
	border-radius: 6px;
	overflow: hidden;
}
.pbar i {
	display: block;
	height: 100%;
	background: var(--accent);
}

/* ---------------- Dashboard ---------------- */
.wrap {
	max-width: 1180px;
	margin: 0 auto;
}
.wrap.wide {
	max-width: none;
}
.hello {
	margin-bottom: 18px;
}
.hello h1 {
	margin: 0;
	font-size: 22px;
	letter-spacing: -0.02em;
}
.hello p {
	color: var(--muted);
	margin: 4px 0 0;
	font-size: 14px;
}

.stats {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 22px;
}
.stat {
	flex: 1;
	min-width: 130px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 14px;
	box-shadow: var(--shadow);
}
.stat .val {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--ink);
}
.stat.accent .val {
	color: var(--accent-text);
}
.stat .lab {
	font-size: 12px;
	color: var(--muted);
	margin-top: 2px;
}

.bar-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.bar-row h2 {
	margin: 0;
	font-size: 16px;
}
.search {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	border-radius: 9px;
	padding: 7px 11px;
	min-width: 220px;
	max-width: 320px;
}
.search input {
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 13px;
	outline: none;
	width: 100%;
}
.search .ic {
	color: var(--faint);
	font-size: 15px;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
	gap: 16px;
}
.tc {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
	box-shadow: var(--shadow);
	transition:
		transform 0.12s,
		box-shadow 0.12s;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.tc:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}
.tc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.status {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 3px 8px;
	border-radius: 999px;
}
.status.laufend {
	background: var(--accent-soft);
	color: var(--accent-text);
}
.status.fertig {
	background: var(--win-bg);
	color: var(--win);
}
.status.entwurf {
	background: #eef0f3;
	color: #4b5563;
}
.tc-date {
	font-size: 12px;
	color: var(--muted);
}
.tc-title {
	font-size: 16px;
	font-weight: 700;
}
.tc-sub {
	font-size: 12px;
	color: var(--muted);
}
.tc-stats {
	display: flex;
	gap: 12px;
	font-size: 12px;
	color: var(--muted);
	flex-wrap: wrap;
}
.tc-bar {
	height: 5px;
	background: #e9ebef;
	border-radius: 6px;
	overflow: hidden;
}
.tc-bar i {
	display: block;
	height: 100%;
	border-radius: 6px;
}
.tc-bar i.laufend {
	background: var(--accent);
}
.tc-bar i.fertig {
	background: var(--win);
}
.tc-bar i.entwurf {
	background: var(--faint);
}
.tc-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 12px;
	color: var(--muted);
	margin-top: auto;
	padding-top: 6px;
}
.tc-open {
	color: var(--accent-text);
	font-weight: 700;
	text-decoration: none;
}
.tc-open:hover {
	text-decoration: underline;
}

.import-tile {
	border: 1.5px dashed var(--line-strong);
	border-radius: var(--radius);
	padding: 24px 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	color: var(--muted);
	cursor: pointer;
	transition:
		border-color 0.12s,
		color 0.12s;
	background: var(--surface);
}
.import-tile:hover {
	border-color: var(--accent);
	color: var(--accent-text);
}
.import-tile .ic {
	font-size: 32px;
}
.import-tile strong {
	color: var(--ink);
}

/* ---------------- click-TT import ---------------- */
.clicktt-import-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 18px;
}
.clicktt-card-head {
	display: flex;
	align-items: center;
	gap: 12px;
}
.clicktt-icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--accent-soft);
	color: var(--accent-text);
	font-size: 18px;
	font-weight: 700;
	position: relative;
}
.clicktt-icon.download-icon::before {
	content: "";
	width: 2px;
	height: 15px;
	background: currentColor;
	border-radius: 2px;
	position: absolute;
	top: 10px;
}
.clicktt-icon.download-icon::after {
	content: "";
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	position: absolute;
	top: 20px;
	transform: rotate(45deg);
}
.clicktt-icon.key-icon::before {
	content: "";
	width: 12px;
	height: 12px;
	border: 2px solid currentColor;
	border-radius: 50%;
	position: absolute;
	left: 10px;
	top: 11px;
}
.clicktt-icon.key-icon::after {
	content: "";
	width: 18px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	position: absolute;
	left: 20px;
	top: 24px;
	transform: rotate(-42deg);
	box-shadow: 5px 0 0 currentColor;
}
.clicktt-search {
	width: 100%;
	max-width: none;
}
.clicktt-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.ct-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 11px;
	border: 1px solid var(--line);
	background: var(--surface);
	box-shadow: var(--shadow);
	cursor: pointer;
	transition:
		border-color 0.12s,
		box-shadow 0.12s,
		background-color 0.12s,
		transform 0.12s;
}
.ct-row:hover {
	border-color: var(--accent);
	box-shadow: var(--shadow-md);
	transform: translateY(-1px);
}
.ct-row.sel {
	background: var(--accent-soft);
	border-color: #fed7aa;
}
.ct-row .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.ct-radio {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid var(--line-strong);
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	transition: border-color 0.12s;
}
.ct-row.sel .ct-radio {
	border-color: var(--accent);
}
.ct-row.sel .ct-radio::after {
	content: "";
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--accent);
}
.ct-main {
	flex: 1;
	min-width: 0;
}
.ct-title {
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--ink);
	overflow-wrap: anywhere;
}
.ct-meta {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 2px;
	font-size: 12px;
	color: var(--muted);
}
.creds-ok {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: var(--success-bg);
	border: 1px solid #bbf7d0;
	border-radius: 11px;
	font-size: 12.5px;
	color: var(--success);
}
.creds-ok .re {
	margin-left: auto;
}
.status-line {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.status-check {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	background: var(--success);
	position: relative;
	flex: 0 0 auto;
}
.status-check::after {
	content: "";
	width: 7px;
	height: 4px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	position: absolute;
	left: 4px;
	top: 4px;
	transform: rotate(-45deg);
}
.autofill {
	padding: 14px;
	border: 1px dashed var(--line-strong);
	border-radius: 12px;
	background: #fafbfc;
}
.autofill .lab {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--faint);
	font-weight: 700;
	margin-bottom: 10px;
}
.autofill .fields {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}
.autofill .f {
	font-size: 12px;
}
.autofill .f .k {
	color: var(--muted);
	margin-bottom: 2px;
}
.autofill .f .v {
	color: var(--ink);
	font-weight: 600;
}
.clicktt-import-form {
	margin-top: 4px;
}
body.tt-theme-dark .autofill {
	background: #10131a;
}
body.tt-theme-dark .ct-row.sel {
	background: rgba(251, 146, 60, 0.15);
	border-color: rgba(251, 146, 60, 0.45);
}
body.tt-theme-dark .creds-ok {
	background: rgba(74, 222, 128, 0.12);
	border-color: rgba(74, 222, 128, 0.35);
}
@media (max-width: 640px) {
	.autofill .fields {
		grid-template-columns: 1fr;
	}
}

/* ---------------- click-TT result upload ---------------- */
.clicktt-result-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.clicktt-result-status {
	display: flex;
	align-items: center;
	gap: 14px;
}
.clicktt-result-status .row-ico {
	width: 42px;
	height: 42px;
	border-radius: 11px;
	background: var(--accent-soft);
	color: var(--accent-text);
	display: grid;
	place-items: center;
	font-size: 20px;
	flex: 0 0 auto;
}
.clicktt-result-status .row-ico.ok {
	background: var(--success-bg);
	color: var(--success);
}
.clicktt-result-status .row-main {
	flex: 1;
	min-width: 0;
}
.clicktt-result-status .row-title {
	font-weight: 700;
	font-size: 15px;
}
.clicktt-result-status .row-meta {
	font-size: 12px;
	color: var(--muted);
	margin-top: 1px;
}
.report {
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
}
.report.success {
	border-color: #bbf7d0;
	background: var(--success-bg);
}
.report.info {
	border-color: #bfdbfe;
	background: var(--info-bg);
}
.report-row {
	display: flex;
	padding: 12px 14px;
	font-size: 13px;
	align-items: flex-start;
	gap: 12px;
}
.report-label {
	font-weight: 600;
	color: var(--muted);
	flex: 0 0 auto;
}
.report-value {
	color: var(--ink);
	flex: 1;
	word-break: break-word;
}
.clicktt-save-form {
	padding-top: 8px;
}
body.tt-theme-dark .report.success {
	border-color: rgba(74, 222, 128, 0.35);
	background: rgba(74, 222, 128, 0.12);
}
body.tt-theme-dark .report.info {
	border-color: rgba(96, 165, 250, 0.35);
	background: rgba(96, 165, 250, 0.12);
}
@media (max-width: 640px) {
	.clicktt-result-status {
		align-items: flex-start;
		flex-wrap: wrap;
	}
}

/* ---------------- Modals ---------------- */
.modal-toggle {
	display: none;
}
.modal {
	visibility: hidden;
	opacity: 0;
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(16, 24, 40, 0.35);
	transition: opacity 0.15s ease;
}
.modal-toggle:checked + .modal {
	visibility: visible;
	opacity: 1;
}
.modal-box {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 18px;
	max-width: 32rem;
	box-shadow: var(--shadow-lg);
}
.modal-box.wide {
	max-width: 42rem;
}
.modal-title {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 12px;
}
.result-modal-head {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}
.result-modal-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.result-modal-title-row .modal-title {
	margin-bottom: 0;
}
.result-modal-mode-row {
	display: flex;
	justify-content: flex-start;
}
.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}
.modal-error {
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13px;
	margin-bottom: 12px;
}
.validation-list {
	list-style: disc;
	padding-left: 1.2em;
	font-size: 13px;
	color: var(--ink);
}
.validation-list li {
	margin-bottom: 6px;
}
body.tt-theme-dark .validation-list {
	color: var(--ink);
}

/* ---------------- Flash / Error ---------------- */
.flash-toast {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 100;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-end;
}
.flash-toast .alert {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	box-shadow: var(--shadow-lg);
	font-size: 13px;
	max-width: 320px;
	cursor: pointer;
}
.flash-toast .alert.info {
	border-left: 4px solid var(--info);
}
.flash-toast .alert.success {
	border-left: 4px solid var(--success);
}
.flash-toast .alert.warning {
	border-left: 4px solid var(--warning);
}
.flash-toast .alert.error {
	border-left: 4px solid var(--error);
	color: var(--error);
}

/* ---------------- Round pills ---------------- */
.roundnav {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}
.pill {
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: 999px;
	padding: 6px 13px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--muted);
	display: inline-flex;
	gap: 6px;
	align-items: center;
	text-decoration: none;
}
.pill.done {
	color: var(--win);
}
.pill.done .mk {
	color: var(--win);
}
.pill.active {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}
.pill.locked {
	opacity: 0.55;
	cursor: not-allowed;
}
.roundnav .sep {
	color: var(--faint);
	margin: 0 6px;
}
.jumpbar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

/* ---------------- Matrix ---------------- */
.work {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 2px;
}

.matrix-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	position: relative;
	z-index: 1;
}
.matrix-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 13px 16px;
	border-bottom: 1px solid var(--line);
	gap: 16px;
	flex-wrap: wrap;
}
.matrix-head h2 {
	margin: 0;
	font-size: 14px;
}
.matrix-scroll {
	overflow: auto;
}
table.matrix {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	font-size: 13px;
}
.matrix th,
.matrix td {
	padding: 0 11px;
	height: 42px;
	border-bottom: 1px solid var(--line);
	border-right: 1px solid var(--line);
	white-space: nowrap;
}
.matrix thead th {
	position: sticky;
	top: 0;
	background: #fbfbfd;
	z-index: 3;
	font-size: 11px;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	height: 34px;
}
.matrix th.rhead {
	text-align: center;
	font-size: 12px;
}
.matrix th.rhead.done {
	color: var(--ink);
}
.matrix th.rhead.now {
	color: var(--accent);
}
.matrix tbody tr:hover td {
	background: #fafbff;
}
.matrix td.rank {
	font-weight: 700;
	color: var(--muted);
	text-align: center;
	width: 46px;
}
.matrix tr:nth-child(1) td.rank {
	color: #b4530a;
}
.matrix td.name {
	font-weight: 600;
	width: 188px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.matrix td.ttr {
	color: var(--muted);
	text-align: right;
	width: 56px;
}
.matrix th.s,
.matrix td.s {
	position: sticky;
	z-index: 2;
	background: #fbfbfd;
}
.matrix td.s {
	background: var(--surface);
}
.matrix tbody tr:hover td.s {
	background: #f4f6fb;
}
.col-rank {
	left: 0;
}
.col-name {
	left: 46px;
}
.col-ttr {
	left: 234px;
}
.matrix thead th.col-rank,
.matrix thead th.col-name,
.matrix thead th.col-ttr {
	z-index: 4;
}
.matrix th:last-child,
.matrix td:last-child {
	border-right: 0;
}
.matrix td.num {
	text-align: center;
	color: var(--muted);
	width: 48px;
}
.matrix td.num.strong {
	color: var(--ink);
	font-weight: 700;
}

.cell {
	text-align: center;
	width: 108px;
	cursor: pointer;
	padding: 4px 6px;
}
.cell .chip {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	border-radius: 7px;
	padding: 3px 9px;
	justify-content: center;
	line-height: 1.1;
}
.cell .opp {
	font-size: 12px;
	font-weight: 600;
	max-width: 74px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cell .sets {
	font-size: 13px;
	font-weight: 800;
}
#matrix .matrix-head {
	padding: 10px 14px;
}
#matrix table.matrix {
	font-size: 12.5px;
}
#matrix .matrix th,
#matrix .matrix td {
	padding: 0 8px;
	height: 32px;
}
#matrix .matrix thead th {
	font-size: 10px;
	height: 28px;
}
#matrix .cell {
	width: 94px;
	padding: 2px 4px;
}
#matrix .cell .chip {
	padding: 2px 7px;
	gap: 5px;
}
#matrix .cell .opp {
	font-size: 11px;
	max-width: 62px;
}
#matrix .cell .sets {
	font-size: 12px;
}
.cell.win .chip {
	background: var(--win-bg);
}
.cell.win .opp {
	color: var(--win);
}
.cell.win .sets {
	color: var(--win);
}
.cell.loss .chip {
	background: var(--loss-bg);
}
.cell.loss .opp {
	color: var(--loss);
}
.cell.loss .sets {
	color: var(--loss);
}
.cell.open .chip {
	background: var(--open-bg);
	border: 1px dotted var(--open-border);
}
.cell.open .opp {
	color: var(--open-text);
}
.cell.open .sets {
	color: var(--open-text-strong);
}
.cell.future {
	background: var(--future);
	cursor: default;
}
.cell.bye {
	cursor: default;
}
.cell.bye .chip {
	background: var(--bye-bg);
	border: 1px dashed #f59e0b;
}
.cell.bye .opp {
	color: var(--bye);
}
.cell.editing .chip {
	box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.cell-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.legend {
	display: flex;
	gap: 14px;
	font-size: 11.5px;
	color: var(--muted);
	flex-wrap: wrap;
	align-items: center;
}
.legend > span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.sample {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	border-radius: 6px;
	padding: 2px 7px;
	min-width: 34px;
	justify-content: center;
}
.sample .o {
	font-size: 11px;
	font-weight: 600;
}
.sample .s {
	font-size: 12px;
	font-weight: 800;
}
.sample.win {
	background: var(--win-bg);
}
.sample.win .o {
	color: #3f8f5b;
}
.sample.win .s {
	color: var(--win);
}
.sample.loss {
	background: var(--loss-bg);
}
.sample.loss .o {
	color: #b5565b;
}
.sample.loss .s {
	color: var(--loss);
}
.sample.open {
	background: var(--open-bg);
	border: 1px dashed var(--open-border);
}
.sample.open .o {
	color: var(--open-text);
}
.sample.open .s {
	color: var(--open-text-strong);
}
.sample.bye {
	background: var(--bye-bg);
	border: 1px dashed #f59e0b;
}
.sample.bye .o {
	color: var(--bye);
}
.sample.fut {
	background: var(--future);
	border: 1px dashed var(--line-strong);
	min-width: 34px;
	height: 16px;
}

.matrix-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 11px 16px;
	border-top: 1px solid var(--line);
	font-size: 12px;
	color: var(--muted);
	gap: 12px;
	flex-wrap: wrap;
}

.vertical-text {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	display: inline-block;
	white-space: nowrap;
	letter-spacing: 0.02em;
}

/* ---------------- Rail ---------------- */
.rail {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
}
.rail-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 11px 13px;
	border-bottom: 1px solid var(--line);
	flex-shrink: 0;
}
.rh-t {
	font-weight: 700;
	font-size: 14px;
}
.rh-s {
	font-size: 11.5px;
	color: var(--muted);
	margin-top: 1px;
}
.rail-list {
	overflow: visible;
	padding: 9px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 9px;
}
.rcard {
	border: 1px solid var(--line);
	border-radius: 9px;
	padding: 7px 9px;
	background: #fff;
}
.rcard.done {
	background: #fafffe;
}
.rcard.open {
	border-style: dashed;
	background: #fffafa;
}
.rcard.active {
	border-left: 3px solid var(--accent);
	background: #fff;
}
.c-top {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
	color: var(--muted);
	margin-bottom: 6px;
}
.c-top .tisch {
	font-weight: 700;
	color: var(--ink);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 10.5px;
}
.c-top .ok {
	margin-left: auto;
	color: var(--win);
	font-weight: 700;
}
.c-top .now {
	margin-left: auto;
	color: var(--accent-text);
	font-weight: 700;
}
.c-top .now2 {
	margin-left: auto;
	color: var(--muted);
	font-weight: 600;
}
.c-top .x {
	cursor: pointer;
	color: var(--faint);
	font-size: 15px;
	line-height: 1;
	margin-left: 4px;
}
.c-line {
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.c-line .res {
	font-weight: 800;
	margin: 0 6px;
	color: var(--ink);
	font-size: 14px;
}
.c-line .lo {
	color: var(--muted);
	font-size: 11.5px;
}
.c-line .vs2 {
	color: var(--faint);
	font-weight: 600;
	font-size: 11px;
}
.rcard .versus {
	margin: 4px 0 10px;
}
.versus {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 5px;
}
.side {
	text-align: center;
}
.side .nm {
	font-weight: 700;
	font-size: 12px;
	line-height: 1.3;
	min-height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.side .rt {
	font-size: 10px;
	color: var(--muted);
}
.vs {
	color: var(--faint);
	font-weight: 700;
	font-size: 11px;
}
.side.a .nm {
	color: var(--ink);
}
.side.b .nm {
	color: var(--accent);
}
.sets-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
}
.sets-table th,
.sets-table td {
	text-align: center;
	padding: 4px 2px;
	border-bottom: 1px solid var(--line);
}
.sets-table th {
	font-size: 9px;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 600;
}
.sets-table .pn {
	font-weight: 600;
	color: var(--muted);
	text-align: left;
	padding-left: 2px;
}
.inp {
	width: 38px;
	text-align: center;
	border: 1px solid var(--line-strong);
	border-radius: 5px;
	height: 24px;
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	color: var(--ink);
	background: #fff;
}
.inp:focus {
	outline: 2px solid var(--accent);
	border-color: var(--accent);
}
.summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 6px;
	padding: 6px 8px;
	background: var(--open-bg);
	border-radius: 7px;
	border: 1px solid #fed7aa;
}
.summary .big {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -0.02em;
}
.summary .big .a,
.summary .big .b {
	color: var(--muted);
}
.summary .tag {
	font-size: 10px;
	color: var(--accent-text);
	font-weight: 600;
}
.c-foot {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-top: 6px;
}
.rail-foot {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	border-top: 1px solid var(--line);
	font-size: 11px;
	color: var(--muted);
	line-height: 1.4;
	flex-shrink: 0;
}
.rail-head-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.input-mode-seg {
	display: inline-flex;
	background: #f0f1f4;
	border-radius: 7px;
	padding: 2px;
}
.input-mode-seg button {
	border: 0;
	background: transparent;
	font-size: 11px;
	padding: 3px 8px;
	border-radius: 5px;
	cursor: pointer;
	color: var(--muted);
}
.input-mode-seg button.on {
	background: #fff;
	color: var(--ink);
	box-shadow: var(--shadow);
}
body.tt-theme-dark .input-mode-seg {
	background: #1f232e;
}
body.tt-theme-dark .input-mode-seg button.on {
	background: #2a2f3c;
	color: var(--ink);
}
.hidden {
	display: none !important;
}
.mode-tabs {
	display: flex;
	gap: 3px;
	margin: 6px 0 4px;
}
.mode-tabs .tab {
	flex: 1;
	border: 1px solid var(--line-strong);
	background: #fff;
	color: var(--muted);
	font: inherit;
	font-size: 10.5px;
	font-weight: 600;
	padding: 3px 4px;
	border-radius: 5px;
	cursor: pointer;
}
.mode-tabs .tab.active {
	background: var(--accent-soft);
	color: var(--accent-text);
	border-color: var(--accent);
}
.mode-body {
	animation: fadeIn 0.12s ease;
}
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.quick-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}
.quick-row label {
	font-size: 10.5px;
	color: var(--muted);
	font-weight: 600;
}
.quick-row .final-score {
	width: 58px;
	text-align: center;
}
.quick-games {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
}
.quick-games .game {
	font-size: 10.5px;
	padding: 4px 5px;
}
.rcard .form-control label {
	font-size: 10.5px;
	color: var(--muted);
	font-weight: 600;
	display: block;
	margin-bottom: 3px;
}
.rcard .compact-text {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ---------------- Forms ---------------- */
.form-control {
	margin-bottom: 12px;
}
.form-control label,
.label-text {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: 4px;
}
.form-control input[type="text"],
.form-control input[type="email"],
.form-control input[type="password"],
.form-control input[type="date"],
.form-control input[type="search"],
.form-control input[type="number"],
.form-control textarea,
.form-control select {
	width: 100%;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
	font-size: 13px;
	color: var(--ink);
	background: #fff;
}
.form-control input:focus,
.form-control textarea:focus,
.form-control select:focus {
	outline: 2px solid var(--accent);
	border-color: var(--accent);
}
.form-control input:disabled,
.form-control textarea:disabled,
.form-control select:disabled {
	background: var(--fill);
	color: var(--muted);
	cursor: not-allowed;
	opacity: 0.85;
}
.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 18px;
}
.player-builder {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 12px;
	background: color-mix(in srgb, var(--fill) 55%, #fff);
}
.player-builder-head {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}
.player-draft-list {
	border: 1px dashed var(--line-strong);
	border-radius: 10px;
	background: #fff;
	margin-bottom: 10px;
	min-height: 48px;
	overflow: hidden;
}
.player-empty {
	color: var(--muted);
	font-size: 13px;
	padding: 14px;
}
.player-draft-table {
	display: grid;
	gap: 1px;
	background: var(--line);
}
.player-draft-row {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(64px, auto)) auto;
	align-items: center;
	gap: 8px;
	padding: 8px;
	background: #fff;
	font-size: 12px;
}
.player-draft-name {
	font-weight: 700;
	color: var(--ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.player-add-panel {
	margin-top: 10px;
	border: 1px solid var(--line-strong);
	border-radius: 12px;
	padding: 12px;
	background: #fff;
	box-shadow: var(--shadow-sm);
}
.player-add-panel.hidden {
	display: none;
}
.form-error {
	min-height: 18px;
	margin: 2px 0 0;
	color: var(--danger);
	font-size: 12px;
	font-weight: 600;
}
@media (max-width: 640px) {
	.player-draft-row {
		grid-template-columns: 1fr 1fr;
	}
	.player-draft-name {
		grid-column: 1 / -1;
	}
}
.help-callout {
	background: var(--info-bg);
	border: 1px solid var(--info);
	border-radius: 9px;
	padding: 12px 14px;
	color: var(--info);
	font-size: 13px;
}
.max-w-3xl {
	max-width: 48rem;
}

/* ---------------- Print Spielerzettel ---------------- */
.print-page {
	background: #f4f5f7;
	min-height: 100vh;
	padding: 20px;
}
.print-toolbar {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
	padding: 12px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: -20px -20px 20px;
}
.desk {
	max-width: 720px;
	margin: 0 auto;
}
.sheet {
	width: 210mm;
	min-height: 297mm;
	background: #fff;
	margin: 0 auto;
	padding: 12mm;
	box-shadow: var(--shadow-lg);
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(3, 1fr);
	gap: 6mm;
}
.slip {
	border: 1.5px solid #111;
	border-radius: 3px;
	padding: 4mm 5mm;
	display: flex;
	flex-direction: column;
}
.slip-head {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	gap: 3mm;
	border-bottom: 1px solid #111;
	padding-bottom: 2mm;
	margin-bottom: 2mm;
}
.th-name {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #333;
}
.th-round {
	font-weight: 700;
	font-size: 14px;
	text-align: center;
}
.th-date {
	font-size: 10px;
	color: #333;
}
.th-table {
	background: #111;
	color: #fff;
	padding: 1px 7px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
}
.matchup {
	text-align: center;
	margin: 3mm 0 4mm;
}
.pname {
	font-size: 15px;
	font-weight: 700;
}
.gegen {
	font-style: italic;
	font-size: 12px;
	color: #444;
	margin: 0 2mm;
}
table.sets {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
	margin-bottom: 3mm;
}
table.sets th,
table.sets td {
	border-bottom: 1px dotted #111;
	padding: 1.5mm 1mm;
	text-align: left;
}
table.sets th {
	font-weight: 600;
}
table.sets td.c-satz {
	width: 14mm;
}
table.sets td.c-sieg {
	width: 22mm;
}
table.sets tr:last-child td {
	border-bottom: 1.5px solid #111;
}
.slip-foot {
	margin-top: auto;
	font-size: 11px;
	display: flex;
	align-items: center;
	gap: 2mm;
}
.slip-foot .line {
	flex: 1;
	border-bottom: 1px solid #111;
	height: 0;
	min-width: 20mm;
}
.slip-foot .short {
	flex: 0 0 14mm;
}

@media print {
	.print-toolbar {
		display: none !important;
	}
	.print-page {
		padding: 0;
		background: #fff;
	}
	.desk {
		max-width: none;
		padding: 0;
	}
	.sheet {
		width: 210mm;
		min-height: 297mm;
		margin: 0;
		padding: 0;
		box-shadow: none;
		grid-template-rows: auto auto auto;
		gap: 4mm;
	}
	.slip {
		break-inside: avoid;
		border: 1.2pt solid #000;
	}
	.th-table {
		background: #000 !important;
		color: #fff !important;
	}
	table.sets th,
	table.sets td {
		border-bottom-color: #000;
	}
	table.sets tr:last-child td {
		border-bottom: 1.2pt solid #000;
	}
}
@page {
	size: A4 portrait;
	margin: 8mm;
}

/* ---------------- Auth ---------------- */
.auth-card {
	max-width: 380px;
	margin: 60px auto 0;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px;
	box-shadow: var(--shadow-lg);
}
.auth-card h1 {
	margin: 0 0 18px;
	font-size: 20px;
}
.auth-card .hint {
	font-size: 12px;
	color: var(--muted);
	margin-top: 4px;
}
.auth-link {
	color: var(--accent-text);
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}
.auth-link:hover {
	text-decoration: underline;
}

/* ---------------- Utility ---------------- */
.text-muted {
	color: var(--muted);
}
.text-faint {
	color: var(--faint);
}
.text-sm {
	font-size: 12px;
}
.text-xs {
	font-size: 11px;
}
.font-semibold {
	font-weight: 600;
}
.font-bold {
	font-weight: 700;
}
.flex {
	display: flex;
}
.items-center {
	align-items: center;
}
.justify-between {
	justify-content: space-between;
}
.gap-2 {
	gap: 8px;
}
.gap-3 {
	gap: 12px;
}
.mt-auto {
	margin-top: auto;
}
.mt-2 {
	margin-top: 8px;
}
.mt-3 {
	margin-top: 12px;
}
.mb-3 {
	margin-bottom: 12px;
}
.w-full {
	width: 100%;
}
.mx-auto {
	margin-left: auto;
	margin-right: auto;
}
.text-center {
	text-align: center;
}

.alert {
	padding: 12px 14px;
	border-radius: 9px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
}
.alert.success {
	background: var(--success-bg);
	border-color: var(--success);
	color: var(--success);
}
.alert.info {
	background: var(--info-bg);
	border-color: var(--info);
	color: var(--info);
}
.alert.warning {
	background: var(--warning-bg);
	border-color: var(--warning);
	color: var(--warning);
}
.alert.error {
	background: var(--error-bg);
	border-color: var(--error);
	color: var(--error);
}
.text-lg {
	font-size: 16px;
}
.text-xl {
	font-size: 18px;
}
.text-2xl {
	font-size: 20px;
}
.text-3xl {
	font-size: 24px;
}
.space-y-2 > * + * {
	margin-top: 8px;
}
.space-y-4 > * + * {
	margin-top: 16px;
}
.space-y-6 > * + * {
	margin-top: 24px;
}
.mb-2 {
	margin-bottom: 8px;
}
.mb-4 {
	margin-bottom: 16px;
}
.mt-4 {
	margin-top: 16px;
}

/* Card / table helpers used by edit & final-results screens */
.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}
.card-body {
	padding: 22px;
}
.card-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px;
}
.card-actions {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}
.textarea {
	width: 100%;
	min-height: 320px;
	border: 1px solid var(--line-strong);
	border-radius: 9px;
	padding: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	resize: vertical;
}
.textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.table-wrap {
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
}
.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.table th,
.table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}
.table th {
	background: #f9fafb;
	font-weight: 600;
	font-size: 12px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.table tbody tr:last-child td {
	border-bottom: 0;
}
.table tbody tr:nth-child(even) {
	background: #fafbfc;
}
.link {
	color: var(--accent-text);
	font-weight: 600;
	text-decoration: none;
}
.link:hover {
	text-decoration: underline;
}
.tag {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 6px;
	background: var(--accent-soft);
	color: var(--accent-text);
	font-size: 12px;
	font-weight: 600;
}
.tag.success {
	background: var(--success-bg);
	color: var(--success);
}
.tag.error {
	background: var(--error-bg);
	color: var(--error);
}
.tag.warning {
	background: var(--warning-bg);
	color: var(--warning);
}
.tag.info {
	background: var(--info-bg);
	color: var(--info);
}
.tag.large {
	padding: 6px 12px;
	font-size: 13px;
}

/* ---------------- Mobile tournament view ---------------- */
.mobile-view {
	display: none;
}
.mobile-sidebar,
.mobile-sidebar-backdrop {
	display: none;
}
@media (max-width: 768px) {
	.app {
		display: block;
	}
	.sidebar,
	.global-topbar {
		display: none;
	}
	.main {
		padding: 0;
		overflow: visible;
		min-width: 0;
	}
	.topbar,
	.roundnav,
	.work {
		display: none !important;
	}
	.mobile-view {
		display: flex;
		flex-direction: column;
		min-height: 100vh;
		background: var(--bg);
	}

	.mobile-sidebar {
		display: flex;
		flex-direction: column;
		gap: 16px;
		position: fixed;
		top: 0;
		left: 0;
		width: 260px;
		height: 100vh;
		background: var(--surface);
		border-right: 1px solid var(--line);
		padding: 16px;
		z-index: 200;
		transform: translateX(-100%);
		transition: transform 0.2s ease;
	}
	.mobile-sidebar.open {
		transform: translateX(0);
	}
	.mobile-sidebar-backdrop {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.35);
		z-index: 199;
	}
	.mobile-sidebar-backdrop.open {
		display: block;
	}
	.mobile-sidebar .ms-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.mobile-sidebar .ms-head .brand {
		font-size: 15px;
	}
	.mobile-sidebar .nav {
		margin-top: 8px;
	}

	.m-appbar {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 10px 14px 12px;
		background: var(--surface);
		border-bottom: 1px solid var(--line);
	}
	.m-appbar .m-menu {
		font-size: 22px;
		color: var(--muted);
		width: 26px;
		cursor: pointer;
	}
	.m-appbar .m-title {
		font-weight: 800;
		font-size: 15px;
		line-height: 1.15;
	}
	.m-appbar .m-sub {
		font-size: 12px;
		color: var(--muted);
	}
	.m-appbar .m-round-nav {
		margin-left: auto;
		display: inline-flex;
		align-items: center;
		gap: 4px;
		background: var(--accent);
		color: #fff;
		border-radius: 999px;
		padding: 2px;
	}
	.m-appbar .m-round {
		font-weight: 800;
		font-size: 12px;
		padding: 2px 8px;
	}
	.m-appbar .m-rnav-btn {
		display: grid;
		place-items: center;
		width: 22px;
		height: 22px;
		border-radius: 50%;
		color: #fff;
		text-decoration: none;
		font-size: 16px;
		line-height: 1;
	}
	.m-appbar .m-rnav-btn.disabled {
		opacity: 0.5;
	}

	.m-tabs {
		display: flex;
		background: var(--surface);
		padding: 8px 14px;
		gap: 6px;
		border-bottom: 1px solid var(--line);
	}
	.m-tab {
		flex: 1;
		text-align: center;
		padding: 9px 0;
		border-radius: 9px;
		font-weight: 700;
		font-size: 13px;
		color: var(--muted);
		background: #f4f5f7;
		cursor: pointer;
		border: 0;
		font: inherit;
	}
	.m-tab.on {
		background: var(--ink);
		color: #fff;
	}
	.m-tab .badge {
		display: inline-grid;
		place-items: center;
		background: var(--accent);
		color: #fff;
		font-size: 10px;
		min-width: 16px;
		height: 16px;
		border-radius: 999px;
		padding: 0 4px;
		margin-left: 4px;
		font-weight: 800;
	}
	.m-tab.on .badge {
		background: #fff;
		color: var(--ink);
	}

	.m-body {
		flex: 1;
		overflow: auto;
		padding: 12px 12px 16px;
	}
	.m-mini {
		font-size: 12px;
		color: var(--muted);
		text-align: center;
		margin-bottom: 10px;
	}
	.m-mini b {
		color: var(--ink);
		font-weight: 600;
	}

	.rrow {
		display: flex;
		align-items: center;
		gap: 9px;
		background: var(--surface);
		border: 1px solid var(--line);
		border-radius: 11px;
		padding: 9px 11px;
		margin-bottom: 6px;
		box-shadow: var(--shadow);
	}
	.rrow.r1 {
		border-color: var(--accent);
	}
	.rrow.r3 .rr-rank {
		background: #fde68a;
		color: #92400e;
	}
	.rr-rank {
		width: 24px;
		height: 24px;
		border-radius: 7px;
		display: grid;
		place-items: center;
		font-weight: 800;
		font-size: 13px;
		background: #eef0f3;
		color: var(--muted);
		font-variant-numeric: tabular-nums;
	}
	.rrow.r1 .rr-rank {
		background: var(--accent);
		color: #fff;
	}
	.rr-name {
		flex: 1;
		font-weight: 600;
		font-size: 14px;
	}
	.rr-name small {
		display: block;
		font-weight: 500;
		color: var(--faint);
		font-size: 11px;
	}
	.rr-s {
		font-weight: 800;
		font-size: 16px;
		width: 22px;
		text-align: center;
		font-variant-numeric: tabular-nums;
	}
	.rr-b {
		font-size: 11px;
		color: var(--muted);
		width: 22px;
		text-align: center;
		font-variant-numeric: tabular-nums;
	}
	.form-dots {
		display: inline-flex;
		gap: 3px;
	}
	.form-dots .dot {
		width: 8px;
		height: 8px;
		border-radius: 50%;
		display: inline-block;
	}
	.dot.d-w {
		background: var(--win);
	}
	.dot.d-l {
		background: var(--loss);
	}
	.dot.d-f {
		background: var(--bye);
	}

	.mcard {
		background: var(--surface);
		border: 1px solid var(--line);
		border-radius: 14px;
		padding: 11px 13px;
		margin-bottom: 9px;
		box-shadow: var(--shadow);
	}
	.mcard.active {
		border-left: 3px solid var(--accent);
	}
	.mcard.done {
		background: #fafffe;
	}
	.mcard.open {
		border-style: dashed;
		cursor: pointer;
	}
	.mc-top {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-bottom: 7px;
	}
	.mc-tisch {
		font-weight: 800;
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.05em;
	}
	.mc-now {
		margin-left: auto;
		font-size: 11px;
		font-weight: 700;
		color: var(--accent-text);
	}
	.mc-ok {
		margin-left: auto;
		font-size: 11px;
		font-weight: 700;
		color: var(--win);
	}
	.mc-offen {
		margin-left: auto;
		font-size: 11px;
		font-weight: 600;
		color: var(--muted);
	}
	.mc-vs,
	.mc-line {
		font-size: 14px;
		margin-bottom: 8px;
	}
	.mc-vs .v,
	.mc-line .v {
		color: var(--muted);
		margin: 0 5px;
	}
	.mc-line .res {
		font-weight: 800;
		margin: 0 5px;
		font-size: 15px;
		color: var(--muted);
	}

	.mcard .setrows {
		display: none;
	}
	.mcard.active .setrows {
		display: block;
	}
	.setrow {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-bottom: 7px;
	}
	.sr-n {
		flex: 1;
		font-size: 12px;
		color: var(--muted);
		font-weight: 600;
	}
	.sr-dp {
		color: var(--faint);
		font-weight: 800;
	}
	input.big {
		width: 58px;
		height: 42px;
		border: 1.5px solid var(--line-strong);
		border-radius: 9px;
		background: #fff;
		text-align: center;
		font: inherit;
		font-size: 17px;
		font-weight: 700;
		color: var(--ink);
		font-variant-numeric: tabular-nums;
	}
	input.big:focus {
		outline: 2.5px solid var(--accent);
		border-color: var(--accent);
	}
	.mc-sum {
		display: none;
		align-items: center;
		justify-content: space-between;
		background: #fff7ed;
		border: 1px solid #fed7aa;
		border-radius: 10px;
		padding: 9px 12px;
		margin: 4px 0 11px;
	}
	.mcard.active .mc-sum {
		display: flex;
	}
	.big-score {
		font-size: 20px;
		font-weight: 800;
		letter-spacing: -0.02em;
		font-variant-numeric: tabular-nums;
	}
	.win-tag {
		font-size: 11.5px;
		font-weight: 700;
		color: var(--accent-text);
	}
	.save-btn {
		display: none;
		width: 100%;
		border: 0;
		background: var(--accent);
		color: #fff;
		font: inherit;
		font-weight: 700;
		font-size: 15px;
		padding: 13px;
		border-radius: 12px;
		box-shadow: 0 4px 12px rgba(249, 115, 22, 0.32);
		cursor: pointer;
	}
	.mcard.active .save-btn {
		display: block;
	}

	.mcard .mode-tabs {
		display: flex;
		gap: 4px;
		margin: 2px 0 10px;
	}
	.mcard .mode-tabs .tab {
		flex: 1;
		text-align: center;
		padding: 6px 2px;
		border-radius: 8px;
		font-weight: 700;
		font-size: 12px;
		color: var(--muted);
		background: #f4f5f7;
		border: 0;
		font: inherit;
		cursor: pointer;
	}
	.mcard .mode-tabs .tab.active {
		background: var(--ink);
		color: #fff;
	}
	.mcard .mode-body {
		margin-bottom: 6px;
	}
	.mcard .mode-body.hidden {
		display: none;
	}
	.mcard .sets-table {
		display: none;
	}
	.mcard.active .sets-table {
		display: table;
		width: 100%;
	}
	.mcard .sets-table th {
		font-size: 11px;
		color: var(--muted);
		padding: 4px 2px;
	}
	.mcard .sets-table td {
		padding: 5px 2px;
	}
	.mcard .quick-row {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-bottom: 10px;
	}
	.mcard .quick-row label {
		font-size: 12px;
		color: var(--muted);
		font-weight: 600;
	}
	.mcard .quick-games {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 6px;
	}
	.mcard .form-control label {
		font-size: 12px;
		color: var(--muted);
		font-weight: 600;
		display: block;
		margin-bottom: 5px;
	}
	.mcard .compact-text {
		width: 100%;
		font-family:
			ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	}

	.m-bottom {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 11px 14px;
		background: var(--surface);
		border-top: 1px solid var(--line);
		font-size: 12px;
		color: var(--muted);
	}
	.m-bottom b {
		color: var(--ink);
	}
	.m-bottom .pbar {
		flex: 1;
		height: 5px;
		background: #eef0f3;
		border-radius: 5px;
		overflow: hidden;
	}
	.m-bottom .pbar i {
		display: block;
		height: 100%;
		background: var(--accent);
	}
	.m-pane {
		display: none;
	}
	.m-pane.on {
		display: block;
	}
	.mcard .mc-vs {
		display: none;
	}
	.mcard.active .mc-vs {
		display: block;
	}
	.mcard.active .mc-line {
		display: none;
	}
	.mobile-rail-foot {
		padding: 8px 0 16px;
	}
	.mobile-rail-foot .btn {
		width: 100%;
	}
	.m-mini-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		flex-wrap: wrap;
	}
}

/* ---------------- User menu ---------------- */
.user-menu {
	position: relative;
}
.user-menu summary {
	list-style: none;
	cursor: pointer;
}
.user-menu summary::-webkit-details-marker {
	display: none;
}
.user-menu summary .chev {
	margin-left: auto;
	color: var(--faint);
	font-size: 11px;
}
.user-dropdown {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: var(--shadow-lg);
	padding: 6px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.user-dropdown a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--ink);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
}
.user-dropdown a:hover {
	background: var(--bg);
}
.global-topbar .user-menu summary {
	padding: 4px 6px;
	border-radius: 8px;
}
.global-topbar .user-menu summary:hover {
	background: #f0f1f4;
}
.global-topbar .user-dropdown {
	bottom: auto;
	top: calc(100% + 6px);
	left: auto;
	right: 0;
	min-width: 150px;
}

/* ---------------- Tournament cards clickable ---------------- */
.tc-clickable {
	position: relative;
	text-decoration: none;
	color: inherit;
}
a.tc-clickable {
	color: inherit;
}
a.tc-clickable:hover .tc-title {
	color: var(--accent-text);
}
.tc-link {
	display: block;
	text-decoration: none;
	color: inherit;
}
.tc-link:hover .tc-title {
	color: var(--accent-text);
}
.tc-disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.tc-foot .btn.ghost.small {
	color: var(--muted);
}
.tc-foot .btn.ghost.small:hover {
	color: var(--error);
	background: var(--error-bg);
}

/* ---------------- Empty state ---------------- */
.empty-state {
	background: var(--surface);
	border: 1.5px dashed var(--line-strong);
	border-radius: var(--radius);
	padding: 48px 24px;
	text-align: center;
	color: var(--muted);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.empty-state .empty-title {
	font-weight: 700;
	font-size: 16px;
	color: var(--ink);
}

/* ---------------- Landing page ---------------- */
.landing-body {
	min-height: 100vh;
	display: grid;
	place-items: center;
	background: var(--bg);
	padding: 24px;
}
.landing-hero {
	max-width: 520px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}
.landing-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-weight: 700;
	font-size: 20px;
	color: var(--ink);
	text-decoration: none;
}
.landing-brand .dot {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--accent);
	display: grid;
	place-items: center;
	color: #fff;
	font-size: 14px;
	box-shadow: 0 0 0 5px var(--accent-soft);
}
.landing-brand small {
	display: block;
	font-weight: 500;
	color: var(--muted);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.landing-hero h1 {
	margin: 0;
	font-size: 34px;
	line-height: 1.15;
	letter-spacing: -0.02em;
}
.landing-hero p {
	margin: 0;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.5;
}
.landing-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin-top: 8px;
}

/* ---------------- Score tooltip ---------------- */
.score-tip {
	position: relative;
	cursor: help;
}
.score-tip::after {
	content: attr(data-games);
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--ink);
	color: var(--surface);
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
	z-index: 100001;
}
.matrix tbody tr:last-child .score-tip::after {
	top: auto;
	bottom: calc(100% + 6px);
}
.score-tip:hover::after {
	opacity: 1;
}
.score-tip.show-tip::after {
	opacity: 1;
}

/* ---------------- Modal view mode ---------------- */
.inline {
	display: inline-block;
}
.tag.small {
	padding: 1px 6px;
	font-size: 11px;
}
.view-mode .mode-body {
	opacity: 0.75;
}
.view-mode .mode-tabs {
	opacity: 0.75;
}

/* ---------------- Overview filters ---------------- */
.filter-bar {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}
.filter-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.filter-group label {
	font-size: 12px;
	color: var(--muted);
	font-weight: 500;
}
.filter-bar input[type="search"] {
	min-width: 220px;
}
.filter-bar input[type="date"] {
	min-width: 150px;
}

/* ---------------- QTTR / live TTR (DTTR) ---------------- */
.ttr-live {
	font-weight: 700;
	color: var(--ink);
}
.delta {
	font-size: 11px;
	font-weight: 700;
	margin-left: 2px;
	padding: 0 4px;
	border-radius: 4px;
}
.delta.up {
	color: #15803d;
}
.delta.down {
	color: #b91c1c;
}
.inline-form {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-wrap: nowrap;
}
.inline-form .inline-input {
	padding: 2px 4px;
	font-size: 12px;
	border: 1px solid var(--border, #ccc);
	border-radius: 4px;
}
.inline-form .hint {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 11px;
	color: var(--muted, #888);
}
.inline-form .hint input[type="checkbox"] {
	margin: 0;
}
.muted {
	color: var(--muted, #888);
}
.matrix-foot {
	padding: 10px 14px;
	font-size: 12px;
	color: var(--muted, #888);
	border-top: 1px solid var(--border, #eee);
	display: flex;
	flex-direction: column;
	gap: 2px;
}
