:root {
	--fh-blue: #1665c0;
	--fh-blue-d: #0d4c94;
	--fh-blue-l: #e8f1fb;
	--ink: #16202c;
	--ink-2: #5a6b7b;
	--line: #dde5ee;
	--bg: #eef3f9;
	--card: #ffffff;
	--ok: #1e9e57;
	--no: #d23b3b;
	--warn: #b8790a;
	--radius: 14px;
	--shadow: 0 6px 24px rgba(20, 45, 80, .09);
	font-synthesis-weight: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

.wrap {
	max-width: 520px;
	margin: 0 auto;
}

.wrap.wide { max-width: 780px; }

/* ---- brand header ---- */
.brand {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 8px 4px 20px;
}

.brand .logo {
	width: 54px;
	height: 54px;
	object-fit: contain;
	flex: none;
	border-radius: 10px;
}

.brand-text h1 {
	margin: 0;
	font-size: 1.15rem;
	letter-spacing: .1px;
}

.brand-text p {
	margin: 2px 0 0;
	color: var(--ink-2);
	font-size: .9rem;
}

.eyebrow {
	margin: 0 0 3px !important;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--fh-blue-d) !important;
}

/* ---- top line: back link + language switch ---- */
.topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 28px;
	margin: 0 4px 10px;
}

.back {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: .9rem;
	font-weight: 600;
	color: var(--fh-blue-d);
	text-decoration: none;
}
.back:hover { text-decoration: underline; }

.lang-switch {
	display: inline-flex;
	flex: none;
	margin-left: auto;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
}
.lang-switch button {
	background: #fff;
	color: var(--ink-2);
	border: 0;
	border-radius: 0;
	padding: 5px 12px;
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button.active { background: var(--fh-blue); color: #fff; }
.lang-switch button:not(.active):hover { background: var(--fh-blue-l); }

/* ---- dashboard feature panels ---- */
.panels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.panel {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 18px;
	text-decoration: none;
	color: var(--ink);
	transition: transform .06s, box-shadow .12s, border-color .12s;
}
.panel:hover {
	border-color: var(--fh-blue);
	box-shadow: 0 12px 30px rgba(20, 45, 80, .13);
	transform: translateY(-1px);
}
.panel:active { transform: translateY(0); }

.panel.disabled {
	cursor: default;
	background: #f2f5f9;
}
.panel.disabled:hover {
	border-color: var(--line);
	box-shadow: var(--shadow);
	transform: none;
}
.panel.disabled .p-icon { background: #e3e9ef; color: var(--ink-2); }
.panel.disabled .p-title { color: var(--ink-2); }

.p-icon {
	flex: none;
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: var(--fh-blue-l);
	color: var(--fh-blue-d);
}
.p-icon svg { width: 26px; height: 26px; }

.p-body { flex: 1; min-width: 0; }
.p-title { display: block; font-weight: 700; font-size: 1rem; }
.p-desc { display: block; margin-top: 3px; color: var(--ink-2); font-size: .86rem; }

.p-go {
	flex: none;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--ink-2);
}

.p-badge {
	flex: none;
	font-size: .72rem;
	font-weight: 700;
	color: var(--ink-2);
	background: #e3e9ef;
	border-radius: 999px;
	padding: 4px 11px;
	white-space: nowrap;
}

/* ---- card ---- */
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 20px;
	margin-bottom: 16px;
}

.card h2 {
	margin: 0 0 12px;
	font-size: 1.02rem;
}

label {
	display: block;
	font-weight: 600;
	font-size: .9rem;
	margin-bottom: 6px;
}

.row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

input[type="text"], input:not([type]), input[type="search"], textarea, select {
	width: 100%;
	font: inherit;
	color: var(--ink);
	background: #fff;
	border: 1.5px solid var(--line);
	border-radius: 10px;
	padding: 12px 14px;
	outline: none;
	transition: border-color .12s, box-shadow .12s;
}

select { cursor: pointer; }

#plate {
	flex: 1 1 200px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	font-size: 1.1rem;
	font-weight: 600;
}

.flat-input {
	max-width: 160px;
	text-transform: uppercase;
	font-weight: 600;
}

input:focus, textarea:focus, select:focus {
	border-color: var(--fh-blue);
	box-shadow: 0 0 0 3px rgba(22, 101, 192, .15);
}

textarea {
	resize: vertical;
	min-height: 92px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: .5px;
}

button {
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border: 0;
	border-radius: 10px;
	padding: 12px 20px;
	background: var(--fh-blue);
	color: #fff;
	transition: background .12s, transform .04s;
}

button:hover { background: var(--fh-blue-d); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: .6; cursor: progress; }

.hint {
	margin: 10px 0 0;
	color: var(--ink-2);
	font-size: .82rem;
}

.share {
	text-align: center;
	margin: 4px 0 16px;
}

.share-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	background: #fff;
	color: #128a3e;
	border: 1.5px solid #b7e6c8;
	border-radius: 999px;
	padding: 10px 20px 10px 12px;
}
.share-btn:hover { background: #e9faf0; border-color: #25D366; }
.share-icon { width: 24px; height: 24px; flex: none; }

.install {
	text-align: center;
	margin: 4px 0 10px;
}

.install #install {
	background: #fff;
	color: var(--fh-blue-d);
	border: 1.5px solid var(--fh-blue);
	padding: 11px 22px;
}
.install #install:hover { background: var(--fh-blue-l); }

.install-hint {
	text-align: center;
	margin: 8px 0 0;
	color: var(--ink-2);
	font-size: .82rem;
}
.install-hint.ios { margin: 0 0 10px; }

.foot {
	text-align: center;
	margin: 8px 0 0;
	font-size: .88rem;
}

.credit {
	text-align: center;
	margin: 18px 0 0;
	font-size: .76rem;
}
.credit a {
	color: var(--ink-2);
	text-decoration: none;
}
.credit a:hover { color: var(--fh-blue-d); text-decoration: underline; }

a { color: var(--fh-blue-d); }

/* ---- verify result ---- */
.result {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px dashed var(--line);
	text-align: center;
}

.badge {
	width: 104px;
	height: 104px;
	margin: 4px auto 10px;
}

.badge svg { width: 100%; height: 100%; display: block; }

.result.ok .verdict { color: var(--ok); }
.result.no .verdict { color: var(--no); }

.verdict {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: .3px;
}

.plate-echo {
	margin: 6px 0 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 2px;
	color: var(--ink);
}

.flat-badge {
	display: inline-block;
	margin: 10px 0 0;
	padding: 5px 14px;
	border-radius: 999px;
	background: var(--ok-bg, #e6f6ec);
	color: var(--ok);
	font-weight: 700;
	font-size: .92rem;
}

.flat-badge a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.v-phone {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- games ---- */
.game-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	margin-bottom: 10px;
	background: var(--fh-blue-l);
	border: 1px solid transparent;
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
	font-weight: 700;
	transition: transform .06s, border-color .12s;
}
.game-row:last-child { margin-bottom: 0; }
.game-row:hover { border-color: var(--fh-blue); transform: translateY(-1px); }
.game-row:active { transform: translateY(0); }
.game-row .g-name { flex: 1; min-width: 0; }
.game-row .g-play {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: .8rem;
	font-weight: 700;
	color: #fff;
	background: var(--fh-blue);
	border-radius: 999px;
	padding: 6px 13px;
	white-space: nowrap;
}

.complaint-alert-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 16px;
	background: var(--warn);
	color: #fff;
	font-weight: 700;
	font-size: .95rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
	animation: complaint-alert-pulse 1.2s ease-in-out infinite;
}

.complaint-alert-banner .cab-text {
	display: flex;
	align-items: center;
	gap: 8px;
}

.complaint-alert-banner a,
.complaint-alert-banner button {
	background: rgba(255, 255, 255, .2);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 999px;
	padding: 5px 14px;
	font-weight: 700;
	font-size: .85rem;
	cursor: pointer;
	text-decoration: none;
}

.complaint-alert-banner a:hover,
.complaint-alert-banner button:hover {
	background: rgba(255, 255, 255, .32);
}

@keyframes complaint-alert-pulse {
	0%, 100% { filter: brightness(1); }
	50% { filter: brightness(1.15); }
}

.advice {
	margin: 8px 0 0;
	color: var(--ink-2);
	font-size: .92rem;
}

/* ---- admin ---- */
.admin-nav {
	display: flex;
	gap: 8px;
	margin: 0 4px 16px;
}
.admin-nav-item {
	padding: 8px 16px;
	border-radius: 999px;
	border: 1.5px solid var(--line);
	background: #fff;
	color: var(--ink-2);
	font-weight: 700;
	font-size: .88rem;
	text-decoration: none;
}
.admin-nav-item:hover { border-color: var(--fh-blue); color: var(--fh-blue-d); }
.admin-nav-item.active { background: var(--fh-blue); border-color: var(--fh-blue); color: #fff; }

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: -4px 0 14px;
	font-size: .88rem;
	color: var(--ink-2);
}

.who { font-weight: 600; color: var(--ink); word-break: break-all; }

.link {
	background: none;
	color: var(--fh-blue-d);
	padding: 6px 8px;
	border-radius: 8px;
}
.link:hover { background: var(--fh-blue-l); }
.link.danger { color: var(--no); }
.link.danger:hover { background: #fdecec; }

.filebtn {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	font-size: .92rem;
	color: var(--fh-blue-d);
	background: var(--fh-blue-l);
	border-radius: 10px;
	padding: 12px 16px;
	cursor: pointer;
}
.filebtn:hover { background: #dbe9f9; }

.msg {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: .9rem;
	background: var(--fh-blue-l);
	color: var(--fh-blue-d);
}
.msg.err { background: #fdecec; color: #a62828; }

.listhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}
.listhead h2 { margin: 0; }
.listhead #search { width: auto; flex: 1 1 180px; max-width: 260px; padding: 9px 12px; }

.count { color: var(--ink-2); font-weight: 500; font-size: .9rem; }

.tablewrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }

th, td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

th {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .6px;
	color: var(--ink-2);
}

tbody tr:last-child td { border-bottom: 0; }

td.mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	letter-spacing: 1px;
}
td.dim { color: var(--ink-2); }

.row-actions {
	display: flex;
	gap: 4px;
	white-space: nowrap;
}

.inline-edit {
	width: auto;
	min-width: 90px;
	padding: 6px 9px;
	font-size: .85rem;
}
.plate-edit {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	min-width: 140px;
}

.pill {
	padding: 5px 12px;
	border-radius: 999px;
	font-size: .8rem;
	font-weight: 700;
}
.pill.on { background: #e6f6ec; color: var(--ok); }
.pill.off { background: #fdecec; color: var(--no); }
.pill:hover { filter: brightness(.97); }

.empty {
	text-align: center;
	color: var(--ink-2);
	padding: 24px 0 8px;
	font-size: .92rem;
}

#login { min-height: 320px; margin-top: 8px; }

/* ---- complaints: submit form ---- */
.vis-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 6px;
}
.vis-opt {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
	font-size: .92rem;
	cursor: pointer;
}
.vis-opt input { flex: none; margin-top: 3px; width: auto; }

/* ---- complaints: public board ---- */
.c-item {
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
}
.c-item:last-child { border-bottom: 0; }

.c-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.c-cat {
	font-weight: 700;
	font-size: .86rem;
	color: var(--fh-blue-d);
}

.c-status {
	flex: none;
	padding: 3px 11px;
	border-radius: 999px;
	font-size: .76rem;
	font-weight: 700;
	white-space: nowrap;
}
.c-status.st-open { background: var(--fh-blue-l); color: var(--fh-blue-d); }
.c-status.st-progress { background: #fdf1de; color: var(--warn); }
.c-status.st-resolved { background: #e6f6ec; color: var(--ok); }

.c-desc {
	margin: 8px 0 0;
	font-size: .92rem;
	white-space: pre-wrap;
	word-break: break-word;
}

.c-date {
	margin: 6px 0 0;
	color: var(--ink-2);
	font-size: .8rem;
}

/* ---- complaints: admin ---- */
.filters {
	margin-bottom: 12px;
}
.filters select { width: auto; flex: 1 1 160px; padding: 9px 12px; font-size: .9rem; }

.status-sel {
	width: auto;
	padding: 6px 10px;
	font-size: .84rem;
	font-weight: 700;
	border-radius: 999px;
	border-color: transparent;
}
.status-sel.st-open { background: var(--fh-blue-l); color: var(--fh-blue-d); }
.status-sel.st-progress { background: #fdf1de; color: var(--warn); }
.status-sel.st-resolved { background: #e6f6ec; color: var(--ok); }

.hint-row td {
	padding: 4px 12px 10px;
	border-bottom: 1px solid var(--line);
	color: var(--ink-2);
	font-size: .78rem;
	font-style: italic;
	white-space: normal;
}

.desc-text {
	display: block;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---- complaint detail overlay ---- */
.overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
/* [hidden] and .overlay{display:flex} are equal specificity - without this,
   the later .overlay rule wins the cascade and the element never hides. */
.overlay[hidden] { display: none; }

.overlay-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 26, 41, .5);
}

.overlay-card {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	padding: 24px 22px 20px;
}

.overlay-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 999px;
	background: var(--fh-blue-l);
	color: var(--ink-2);
	font-size: 1.3rem;
	line-height: 1;
	display: grid;
	place-items: center;
}
.overlay-close:hover { background: #dbe9f9; color: var(--fh-blue-d); }

.overlay-card h2 {
	margin: 0 26px 6px 0;
	font-size: 1.08rem;
}

.overlay-meta {
	margin: 0 0 14px;
	font-size: .82rem;
	color: var(--ink-2);
}
.overlay-meta .pill { margin-right: 6px; }

.overlay-desc {
	margin: 0 0 18px;
	padding-top: 14px;
	border-top: 1px dashed var(--line);
	white-space: pre-wrap;
	word-break: break-word;
	font-size: .95rem;
	line-height: 1.55;
}

.overlay-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}
.overlay-actions label { margin: 0; font-size: .82rem; }
.overlay-actions select { width: auto; flex: 1 1 140px; }
.overlay-actions .danger { margin-left: auto; }

@media (max-width: 380px) {
	#plate { flex-basis: 100%; }
	.row button { flex: 1; }
}
