	:root {
		--bg: #0f1115;
		--panel: #171a21;
		--panel-2: #1f2430;
		--text: #e7ecf3;
		--muted: #aab4c2;
		--accent: #6ea8fe;
		--border: #30374a;
		--good: #2ea043;
		--warn: #d29922;
		--bad: #f85149;
	}
	* { box-sizing: border-box; }
	body {
		margin: 0;
		font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
		background: var(--bg);
		color: var(--text);
		overflow-x: hidden;
	}
	a { color: var(--accent); }
	button, select, input, textarea {
		font: inherit;
	}
	button {
		background: var(--panel-2);
		color: var(--text);
		border: 1px solid var(--border);
		border-radius: 8px;
		padding: 8px 12px;
		cursor: pointer;
	}
	button:hover { border-color: var(--accent); }
	button:disabled { opacity: 0.45; cursor: not-allowed; }
	input[type="text"], textarea, select {
		width: 100%;
		background: #0f131a;
		color: var(--text);
		border: 1px solid var(--border);
		border-radius: 8px;
		padding: 8px 10px;
	}
	textarea { min-height: 90px; }
	.wrap {
		max-width: 1200px;
		margin: 0 auto;
		padding: clamp(12px, 3vw, 16px);
		width: 100%;
	}
	.grid > *, .stack > *, .panel, .round-card, .details, .summary-box, .checkline {
		min-width: 0;
	}
	.grid {
		display: grid;
		gap: 16px;
	}
	@media (min-width: 1000px) {
		.grid-2 {
			grid-template-columns: 1.1fr 0.9fr;
		}
	}
	.panel {
		background: var(--panel);
		border: 1px solid var(--border);
		border-radius: 14px;
		padding: 16px;
	}
	h1, h2, h3 {
		margin: 0 0 12px 0;
	}
	h1 { font-size: 1.6rem; }
	h2 { font-size: 1.2rem; }
	h3 { font-size: 1rem; }
	.small, .muted {
		color: var(--muted);
		font-size: 0.92rem;
	}
	.row {
		display: flex;
		gap: 10px;
		flex-wrap: wrap;
		align-items: center;
	}
	.row > * { flex: 0 0 auto; }
	.row.grow > * { flex: 1 1 220px; }
	.badge {
		display: inline-block;
		padding: 4px 8px;
		border-radius: 999px;
		background: var(--panel-2);
		border: 1px solid var(--border);
		font-size: 0.85rem;
	}
	.ok { color: #8ddb98; }
	.warn { color: #f2cc60; }
	.err { color: #ff9b95; }
	table {
		width: 100%;
		border-collapse: collapse;
	}
	th, td {
		padding: 8px 6px;
		border-bottom: 1px solid var(--border);
		text-align: left;
		vertical-align: top;
	}
	th { color: var(--muted); font-weight: 600; }
	.codebox {
		font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
		word-break: break-all;
		overflow-wrap: anywhere;
		background: #0d1117;
		border: 1px solid var(--border);
		border-radius: 10px;
		padding: 10px;
	}
	.roster-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 8px;
	}
	.checkline {
		display: flex;
		align-items: center;
		gap: 8px;
		background: var(--panel-2);
		border: 1px solid var(--border);
		border-radius: 10px;
		padding: 8px 10px;
	}
	.round-card {
		background: var(--panel-2);
		border: 1px solid var(--border);
		border-radius: 12px;
		padding: 12px;
		margin-top: 10px;
	}
	.match-row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(60px, auto) minmax(0, 1fr) minmax(140px, 1.2fr);
		gap: 8px;
		align-items: center;
		padding: 8px 0;
		border-bottom: 1px solid rgba(255,255,255,0.05);
	}
	.match-row:last-child { border-bottom: 0; }
	.vs { text-align: center; color: var(--muted); }
	.stack { display: grid; gap: 10px; }
	.details {
		margin-top: 10px;
		padding: 10px;
		background: #10141b;
		border: 1px solid var(--border);
		border-radius: 10px;
	}
	.hidden { display: none !important; }
	.summary-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
		gap: 10px;
	}
	.summary-box {
		background: var(--panel-2);
		border: 1px solid var(--border);
		border-radius: 10px;
		padding: 10px;
	}
	.right { text-align: right; }
	.center { text-align: center; }
	select.slim { max-width: 190px; }
	.notice {
		padding: 10px;
		border-radius: 10px;
		border: 1px solid var(--border);
		background: #0d1117;
	}

	#standingsPanel th:not(:nth-child(2)),
	#standingsPanel td:not(:nth-child(2)) {
		text-align: center;
	}
	#standingsPanel th:nth-child(2),
	#standingsPanel td:nth-child(2) {
		text-align: left;
	}
	.standings-header-mobile { display: none; }
	.dropped-player-name {
		text-decoration: line-through;
		opacity: 0.6;
		text-decoration-thickness: 2px;
	}
	@media (max-width: 720px) {
		h1 { font-size: 1.35rem; }
		h2 { font-size: 1.08rem; }
		.panel {
			padding: 12px;
			border-radius: 12px;
		}
		.roster-grid {
			grid-template-columns: 1fr;
		}
		.summary-grid {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
		.row {
			gap: 8px;
		}
		.row.grow > * {
			flex: 1 1 100%;
		}
		.row > button {
			flex: 1 1 100%;
		}
		.match-row {
			grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
			gap: 6px 8px;
			padding: 8px 0;
		}
		.match-row > div:nth-child(1),
		.match-row > div:nth-child(3) {
			overflow: hidden;
		}
		.match-row > div:nth-child(1) {
			text-align: right;
		}
		.match-row > div:nth-child(3) {
			text-align: left;
		}
		.match-row > div:nth-child(1) strong,
		.match-row > div:nth-child(3) strong {
			display: block;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.match-row .vs {
			display: block;
			text-align: center;
		}
		.match-row > div:nth-child(4) {
			grid-column: 1 / -1;
			width: 100%;
			margin-top: 2px;
		}
		select.slim {
			max-width: none;
		}
		th, td {
			padding: 7px 5px;
			font-size: 0.9rem;
		}
		.standings-header-full { display: none; }
		.standings-header-mobile { display: inline; }
		.player-id-inline { display: none; }
	}

	body.app-dialog-open {
		overflow: hidden;
	}
	.app-dialog-overlay {
		position: fixed;
		inset: 0;
		z-index: 9999;
		display: flex;
		align-items: center;
		justify-content: center;
		padding:
			max(16px, env(safe-area-inset-top, 0px))
			max(16px, env(safe-area-inset-right, 0px))
			max(16px, env(safe-area-inset-bottom, 0px))
			max(16px, env(safe-area-inset-left, 0px));
		background: rgba(0, 0, 0, 0.72);
		-webkit-backdrop-filter: blur(2px);
		backdrop-filter: blur(2px);
	}
	.app-dialog {
		width: min(100%, 420px);
		background: var(--panel);
		border: 1px solid var(--border);
		border-radius: 14px;
		padding: 16px;
		box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	}
	.app-dialog-title {
		font-size: 1rem;
		font-weight: 700;
		margin: 0 0 10px 0;
	}
	.app-dialog-message {
		line-height: 1.45;
		white-space: pre-wrap;
		word-break: break-word;
	}
	.app-dialog-actions {
		display: flex;
		justify-content: flex-end;
		gap: 10px;
		margin-top: 16px;
		flex-wrap: wrap;
	}
	.app-dialog-actions button {
		min-width: 96px;
	}
	@media (max-width: 720px) {
		.app-dialog {
			width: 100%;
			border-radius: 12px;
			padding: 14px;
		}
		.app-dialog-actions {
			display: grid;
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
		.app-dialog-actions.app-dialog-actions-single {
			grid-template-columns: 1fr;
		}
	}

