#tpb-app, .tpb-login {
	direction: ltr;
	text-align: left;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	color: #1d2327;
	max-width: 1280px;
	margin: 24px auto;
	padding: 16px;
	background: #fff;
	color-scheme: light;
	border-radius: 8px;
}
.tpb-login { max-width: 420px; }
.tpb-login input[type="text"], .tpb-login input[type="password"] { width: 100%; padding: 8px; }
.tpb-login .button-primary, .tpb-login input[type="submit"] { padding: 8px 18px; cursor: pointer; }

#tpb-app h2 { margin: 0; font-size: 24px; }
#tpb-app h3 { margin: 0 0 12px; font-size: 18px; }
.tpb-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.tpb-top-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.tpb-muted { color: #646970; font-size: 13px; margin: 6px 0; }
.tpb-error { color: #b32d2e; }

.tpb-hard { background: #fcf0f1; border: 2px solid #d63638; border-radius: 6px; padding: 10px 12px; margin: 16px 0; }
#tpb-app .tpb-hard h3 { color: #b32d2e; margin: 0 0 6px; }
.tpb-hard .tpb-table td { background: #fff; }

.tpb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.tpb-stat { background: #f6f7f7; border-radius: 6px; padding: 10px; text-align: center; }
.tpb-stat b { display: block; font-size: 24px; }
.tpb-stat span { font-size: 12px; color: #646970; }
.tpb-stat-alert { background: #fcf0f1; color: #b32d2e; }

.tpb-btn { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px solid #c3c4c7; background: #fff; border-radius: 4px; cursor: pointer; margin: 2px; color: #1d2327; }
.tpb-btn:hover { background: #f0f0f1; }
.tpb-primary { background: #2271b1; border-color: #2271b1; color: #fff; }
.tpb-primary:hover { background: #135e96; }
.tpb-danger { color: #b32d2e; border-color: #e0a3a4; }

.tpb-form { border: 1px solid #dcdcde; border-radius: 6px; padding: 16px; margin: 12px 0; background: #fff; }
.tpb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tpb-field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.tpb-field input, .tpb-field select { width: 100%; box-sizing: border-box; padding: 7px; border: 1px solid #c3c4c7; border-radius: 4px; font: inherit; }
.tpb-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0; }
.tpb-check { font-size: 14px; }

.tpb-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 4px; border-bottom: 2px solid #dcdcde; }
.tpb-tab { font: inherit; font-size: 14px; padding: 8px 14px; border: 0; background: none; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; color: #1d2327; }
.tpb-tab.active { border-bottom-color: #2271b1; font-weight: 600; }

.tpb-table-wrap { overflow-x: auto; }
.tpb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tpb-table th, .tpb-table td { padding: 8px; border-bottom: 1px solid #e0e0e0; vertical-align: top; text-align: left; }
.tpb-table th { background: #f6f7f7; font-size: 12px; text-transform: uppercase; color: #50575e; }
.tpb-overdue td { background: #fff5f5; }
.tpb-note { font-size: 12px; color: #646970; }
.tpb-actions { white-space: nowrap; }
.tpb-empty { color: #646970; padding: 16px 0; }

.tpb-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; margin-top: 2px; }
.tpb-red { background: #d63638; color: #fff; }
.tpb-amber { background: #f0a020; color: #fff; }
.tpb-yellow { background: #fcf3c7; color: #6b5300; }
.tpb-green { background: #e6f4ea; color: #1e6b34; }
.tpb-tag { display: inline-block; font-size: 11px; background: #f0f0f1; border-radius: 3px; padding: 1px 6px; margin: 1px; }
.tpb-tag-red { background: #fcf0f1; color: #b32d2e; font-weight: 600; }

#tpb-app h4 { margin: 14px 0 6px; font-size: 15px; }
.tpb-picker { display: grid; gap: 6px; }
.tpb-group { border: 1px solid #dcdcde; border-radius: 6px; background: #fbfbfc; }
.tpb-group summary { cursor: pointer; padding: 8px 12px; font-weight: 600; }
.tpb-count { font-weight: 400; color: #2271b1; font-size: 13px; }
.tpb-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 16px; padding: 4px 12px 10px; }
.tpb-item { font-size: 14px; padding: 3px 0; }
.tpb-irr { display: block; margin-left: 22px; font-size: 12px; color: #b32d2e; }
.tpb-warn { background: #d63638; color: #fff; font-weight: 600; border-radius: 4px; padding: 8px 12px; margin: 10px 0; }
.tpb-inj { list-style: none; margin: 0; padding: 0; }
.tpb-inj li { margin: 0 0 3px; }
.tpb-inj .tpb-next { font-weight: 600; }

@media (max-width: 600px) {
	.tpb-actions { white-space: normal; }
	.tpb-items { grid-template-columns: 1fr; }
}

/* Navigation */
.tpb-nav { display: flex; gap: 6px; margin: 12px 0 4px; flex-wrap: wrap; }
.tpb-navbtn { font: inherit; font-size: 14px; padding: 7px 16px; border: 1px solid #c3c4c7; background: #f6f7f7; border-radius: 18px; cursor: pointer; color: #1d2327; }
.tpb-navbtn.active { background: #1d2327; border-color: #1d2327; color: #fff; }
.tpb-field textarea { width: 100%; box-sizing: border-box; padding: 7px; border: 1px solid #c3c4c7; border-radius: 4px; font: inherit; }

/* Pilot reason + notices */
.tpb-reason { background: #fcf9e8; border: 1px solid #e6d27a; border-radius: 6px; padding: 10px 12px; margin: 10px 0; }
.tpb-reason p { margin: 0 0 8px; font-size: 14px; }
.tpb-warn-soft { background: #fcf9e8; border: 1px solid #e6d27a; border-radius: 4px; padding: 8px 12px; font-size: 14px; }
.tpb-instruct { background: #f0f6fc; border-left: 4px solid #2271b1; padding: 8px 12px; font-size: 14px; }
.tpb-help { font-size: 14px; margin: 8px 0; }
.tpb-help summary { cursor: pointer; color: #2271b1; }
.tpb-inv { font-size: 14px; padding-left: 18px; }
.tpb-inv li { margin-bottom: 8px; }
.tpb-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.tpb-range .tpb-field { width: 170px; }
.tpb-narrow { max-width: 560px; }

/* Expert ranking */
.tpb-rank { list-style: none; margin: 12px 0; padding: 0; }
.tpb-rank-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid #dcdcde; border-radius: 6px; background: #fff; padding: 10px 12px; margin-bottom: 6px; cursor: grab; font-size: 14px; }
.tpb-rank-item.dragging { opacity: .4; }
.tpb-rank-num { flex: 0 0 32px; height: 32px; border-radius: 50%; background: #2271b1; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tpb-rank-body { flex: 1; }
.tpb-rank-move { display: flex; flex-direction: column; }
.tpb-btn[disabled] { opacity: .35; cursor: default; }
