/* 智港 香港網址大全 — 單一樣式表，無框架、無外部字型。
   SmartHK web directory — a single stylesheet, no framework, no external fonts. */

/* 主題：深色為預設；data-theme="light" 切淺色（由 localStorage 決定，不再跟隨系統）。
   單一強調色 #f0522d；卡片 1px 邊 + 淡玻璃；背景 1px 網格 ≤ 4%；不用大面積漸變、不用發光。
   Theme: dark by default; data-theme="light" switches (persisted in localStorage; the OS setting
   no longer decides). One accent, #f0522d; 1px card borders with faint glass; a ≤ 4% 1px grid
   on the ground; no large gradients, no glow. */

:root {
	color-scheme: dark;
	--accent: #f0522d;
	--accent-soft: rgba(240, 82, 45, 0.14);
	--bg: #111317;
	--bg-elev: rgba(255, 255, 255, 0.035);
	--bg-sunken: rgba(255, 255, 255, 0.06);
	--bg-panel: #191b21;
	--fg: #ecebe8;
	--fg-muted: #a39d95;
	--fg-faint: #847e76;
	--border: rgba(255, 255, 255, 0.08);
	--border-strong: rgba(255, 255, 255, 0.16);
	--grid: rgba(255, 255, 255, 0.03);
	--shadow: none;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--radius: 12px;
	--radius-sm: 8px;
	--wrap: 1000px;
}

:root[data-theme="light"] {
	color-scheme: light;
	--accent: #f0522d;
	--accent-soft: rgba(240, 82, 45, 0.1);
	--bg: #f6f5f2;
	--bg-elev: rgba(255, 255, 255, 0.72);
	--bg-sunken: rgba(0, 0, 0, 0.045);
	--bg-panel: #ffffff;
	--fg: #1b1a18;
	--fg-muted: #676159;
	--fg-faint: #7d776f;
	--border: rgba(0, 0, 0, 0.09);
	--border-strong: rgba(0, 0, 0, 0.17);
	--grid: rgba(0, 0, 0, 0.035);
	--shadow: 0 1px 2px rgba(28, 26, 24, 0.04), 0 4px 14px rgba(28, 26, 24, 0.05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background-color: var(--bg);
	/* 40px 1px 網格底紋 / the faint 40px grid */
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 40px 40px;
	color: var(--fg);
	font-variant-numeric: tabular-nums;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "PingFang SC", "Noto Sans TC", "Noto Sans SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
	font-size: 15px;
	line-height: 1.6;
	overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

h1, h2, h3 { line-height: 1.3; }

img { max-width: 100%; }

.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 20px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: #fff;
	padding: 8px 14px;
	z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- 頁首 / header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 30;
	background: color-mix(in srgb, var(--bg) 80%, transparent);
	backdrop-filter: saturate(150%) blur(12px);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 58px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 9px;
	flex: none;
}
.brand:hover { color: inherit; }
.brand-logo { border-radius: 8px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: 0.02em; }
.brand-text small { font-size: 10.5px; color: var(--fg-faint); letter-spacing: 0.04em; }

.site-nav {
	display: flex;
	gap: 18px;
	font-size: 14px;
	color: var(--fg-muted);
	margin-left: 10px;
	overflow: hidden;
}
.site-nav a { white-space: nowrap; }

.header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.icon-btn {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: var(--fg-muted);
	width: 34px;
	height: 34px;
	border-radius: 9px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--fg); }
.icon-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

/* 深色顯示月亮、淺色顯示太陽 / moon in dark, sun in light */
.ico-sun { display: none; }
:root[data-theme="light"] .ico-sun { display: block; }
:root[data-theme="light"] .ico-moon { display: none; }

.lang-switch {
	display: flex;
	border: 1px solid var(--border-strong);
	border-radius: 9px;
	overflow: hidden;
}
.lang-link {
	font-size: 12px;
	padding: 5px 8px;
	color: var(--fg-muted);
	border-right: 1px solid var(--border);
	line-height: 1.4;
}
.lang-link:last-child { border-right: 0; }
.lang-link.is-active { background: var(--accent); color: #fff; }
.lang-link.is-active:hover { color: #fff; }

/* ---------- Hero ---------- */

.hero {
	padding: 40px 0 8px;
}
.hero h1 {
	margin: 0 0 8px;
	font-size: 30px;
	letter-spacing: -0.01em;
}
.hero-sub {
	margin: 0;
	max-width: 62ch;
	color: var(--fg-muted);
	font-size: 14.5px;
}
.hero-meta {
	margin: 10px 0 0;
	font-size: 12px;
	font-family: var(--mono);
	color: var(--fg-faint);
}

/* ---------- 分類 chip / category chips ---------- */

.chip-row {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 18px 0;
	margin: 0 -20px;
	padding-left: 20px;
	padding-right: 20px;
	scroll-padding-left: 20px;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--bg-elev);
	color: var(--fg-muted);
	font-size: 13.5px;
	white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}
.chip.is-active:hover { color: #fff; }
.chip-icon { font-size: 15px; line-height: 1; }

/* ---------- 分區 / sections ---------- */

.cat-section { margin: 8px 0 34px; }

.section-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 12px;
}
.section-head h2 {
	margin: 0;
	font-size: 17px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.view-all {
	margin-left: auto;
	font-size: 13px;
	color: var(--fg-muted);
	white-space: nowrap;
}
.view-all:hover { color: var(--accent); }

/* ---------- 卡片 / cards ---------- */

.card-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 10px;
}

.card {
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	transition: border-color 0.15s, transform 0.15s;
}
/* 淡玻璃：支援 backdrop-filter 時才加，否則維持半透明底 / faint glass where supported */
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
	.card, .row-list, .fac-list, .fac-tile, .district-badge, .chip, .fac-name-chip {
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
	}
}
.card:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.card-link {
	display: flex;
	gap: 12px;
	padding: 13px 14px;
	align-items: flex-start;
}
.card-link:hover { color: inherit; }
.card-link:hover .card-name { color: var(--accent); }

.card-body { min-width: 0; display: flex; flex-direction: column; }
.card-name { font-weight: 600; font-size: 14.5px; }
.card-desc {
	color: var(--fg-muted);
	font-size: 13px;
	margin-top: 2px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.card-domain { color: var(--fg-faint); font-size: 11.5px; margin-top: 5px; }

.card-map {
	background: var(--accent-soft);
	border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

/* ---------- 圖示 / icons ---------- */

.icon {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--bg-sunken);
	object-fit: contain;
}

.icon-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: hsl(var(--h, 20) 30% 28%);
	color: hsl(var(--h, 20) 70% 82%);
	font-weight: 700;
	font-size: 17px;
}
:root[data-theme="light"] .icon-fallback {
	background: hsl(var(--h, 20) 62% 88%);
	color: hsl(var(--h, 20) 55% 30%);
}

/* ---------- 3D 熱門商業區 / 3D popular districts ---------- */

.district-section { margin: 8px 0 34px; }

.district-lead {
	margin: -4px 0 14px;
	color: var(--fg-muted);
	font-size: 13.5px;
}

.district-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.district-tile {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: var(--radius);
	overflow: hidden;
	background-color: var(--bg-sunken);
	background-size: cover;
	background-position: center;
	box-shadow: var(--shadow);
	transition: transform 0.15s;
}
a.district-tile:hover { transform: translateY(-2px); color: inherit; }

.district-tile.is-soon {
	filter: grayscale(35%);
	opacity: 0.72;
	cursor: default;
}

.district-tile-gradient {
	background-image: linear-gradient(
		150deg,
		hsl(var(--h, 20) 62% 42%),
		hsl(calc(var(--h, 20) + 40) 58% 24%)
	);
}

.district-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.72) 100%);
}

.district-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	color: #fff;
}
.district-name { font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.district-subtitle { font-size: 12px; color: rgba(255, 255, 255, 0.82); }

.district-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 10.5px;
	line-height: 1.5;
	backdrop-filter: blur(4px);
}

/* ---------- 分類頁列表 / category page list ---------- */

.page-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 10px 0 18px;
}
.page-head h1 {
	margin: 0;
	font-size: 24px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.page-meta { margin: 0; color: var(--fg-faint); font-size: 13px; }

.row-list {
	list-style: none;
	margin: 0 0 40px;
	padding: 0;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.row {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--bg-sunken); }

.row-rank {
	flex: none;
	width: 34px;
	padding-top: 12px;
	color: var(--fg-faint);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	text-align: right;
}
.row .icon { width: 48px; height: 48px; font-size: 20px; }

.row-body { min-width: 0; flex: 1; }
.row-name { font-weight: 600; font-size: 15.5px; }
.row-desc { margin: 3px 0 0; color: var(--fg-muted); font-size: 13.5px; }
.row-meta {
	margin: 7px 0 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.row-domain { color: var(--fg-faint); font-size: 12px; margin-right: 2px; }

.tag {
	font-size: 11px;
	line-height: 1.5;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--bg-sunken);
	color: var(--fg-muted);
	border: 1px solid var(--border);
}

/* ---------- 關於頁 / about ---------- */

.prose { padding-top: 34px; padding-bottom: 40px; max-width: 720px; }
.prose h1 { margin: 0 0 10px; font-size: 26px; }
.prose h2 { margin: 26px 0 6px; font-size: 16px; }
.prose p { margin: 0; color: var(--fg-muted); }
.prose .lede { color: var(--fg); }

/* ---------- 頁尾 / footer ---------- */

.site-footer {
	border-top: 1px solid var(--border);
	margin-top: 20px;
	padding: 22px 0 34px;
	color: var(--fg-faint);
	font-size: 12.5px;
}
.site-footer p { margin: 0; }
.footer-links { margin-top: 6px; }

/* ---------- 學校與醫院 / schools & hospitals ---------- */

.footer-source { margin-top: 6px; color: var(--fg-faint); font-size: 12px; }

.fac-section { margin: 8px 0 34px; }

.fac-tiles {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
}

.fac-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 16px 8px;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	text-align: center;
	transition: border-color 0.15s, transform 0.15s;
}
.fac-tile:hover { border-color: var(--accent); color: inherit; transform: translateY(-1px); }
.fac-tile:hover .fac-tile-name { color: var(--accent); }
.fac-tile-icon { font-size: 24px; line-height: 1.1; }
.fac-tile-name { font-weight: 600; font-size: 14px; }
.fac-tile-count { color: var(--fg-faint); font-size: 12px; font-family: var(--mono); }

.icon-emoji {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	background: var(--bg-sunken);
}

.fac-kind-row { margin-top: 16px; }
.fac-anchor-row { margin-top: 0; padding-top: 0; }
.fac-anchor-row .chip.is-strong { font-weight: 600; border-color: var(--border-strong); }
.fac-nav-links { margin: 18px 0 0; font-size: 13.5px; color: var(--fg-muted); }
.fac-nav-links a:hover { color: var(--accent); }

.fac-filter-label {
	margin: 22px 0 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-faint);
}

.chip-count {
	margin-left: 6px;
	color: var(--fg-faint);
	font-size: 11px;
	font-family: var(--mono);
}
.chip.is-active .chip-count { color: rgba(255, 255, 255, 0.75); }

.fac-group-row { margin-top: 10px; }
.fac-group-row .chip {
	font: inherit;
	cursor: pointer;
	appearance: none;
}

/* 首頁「大專院校」的名稱雲 / the institution-name cloud in the home tertiary block */
.fac-name-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}
.fac-name-chip {
	display: inline-block;
	max-width: 100%;
	padding: 5px 11px;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.35;
}
.fac-name-chip:hover { border-color: var(--accent); color: var(--accent); }
.fac-name-chip.is-university { font-weight: 600; border-color: var(--border-strong); }

/* 大學排名 chip / university ranking chips */
.fac-chip-rank {
	background: var(--accent-soft);
	color: var(--accent);
	font-variant-numeric: tabular-nums;
}
.fac-chip-rank:hover { background: var(--accent); color: #fff; }

.cat-extra-link { margin: 10px 0 0; font-size: 13px; }
.cat-extra-link a { color: var(--accent); }

.fac-search { margin: 16px 0 0; }
.fac-search input {
	width: 100%;
	padding: 10px 14px;
	font: inherit;
	color: var(--fg);
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}
.fac-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.fac-status {
	margin: 14px 0 8px;
	color: var(--fg-faint);
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
}

.fac-list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.fac-row {
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
}
.fac-row:last-child { border-bottom: 0; }
.fac-row:hover { background: var(--bg-sunken); }

.fac-name { margin: 0; font-weight: 600; font-size: 15px; }
.fac-name-en {
	display: block;
	margin-top: 1px;
	font-weight: 400;
	font-size: 12px;
	color: var(--fg-faint);
	text-transform: none;
}
.fac-addr { margin: 4px 0 0; color: var(--fg-muted); font-size: 13px; }
.fac-note { margin: 4px 0 0; color: var(--fg-muted); font-size: 13px; }
.fac-chips { margin: 5px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fac-chip {
	display: inline-block;
	padding: 1px 8px;
	background: var(--bg-sunken);
	border-radius: 999px;
	color: var(--fg-muted);
	font-size: 11.5px;
}
.fac-badge {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 600;
}
.fac-badge-ae { background: var(--accent); color: #fff; }

/* 急症室輪候：跟在急症室徽章後面，由 /live/ae.json 填，未填時 [hidden] 不佔位。
   A&E waits, filled from /live/ae.json; the slot is [hidden] until it has numbers. */
.fac-ae-wait { display: inline-flex; gap: 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.fac-ae-wait[hidden] { display: none; }
.fac-ae-t3 { color: var(--fg); }

.fac-links { margin: 6px 0 0; font-size: 12.5px; color: var(--fg-muted); }
.fac-links a { color: var(--accent); }

.fac-more-wrap { margin: 14px 0 0; text-align: center; }
.fac-more-wrap[hidden] { display: none; }
.fac-more {
	appearance: none;
	font: inherit;
	cursor: pointer;
	padding: 8px 22px;
	color: var(--fg);
	background: var(--bg-elev);
	border: 1px solid var(--border-strong);
	border-radius: 999px;
}
.fac-more:hover { border-color: var(--accent); color: var(--accent); }

.fac-section-head { margin: 30px 0 10px; font-size: 17px; }
.fac-group { margin: 0 0 16px; }
.fac-group-head {
	margin: 16px 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--fg-muted);
}
.fac-group-count {
	margin-left: 8px;
	color: var(--fg-faint);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.fac-source { margin: 26px 0 40px; color: var(--fg-faint); font-size: 12px; }

/* ---------- 手機 / mobile ---------- */

@media (max-width: 720px) {
	.site-nav { display: none; }
	.hero { padding-top: 26px; }
	.hero h1 { font-size: 24px; }
	.card-grid { grid-template-columns: 1fr; }
	.district-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.row { gap: 10px; padding: 12px 12px; }
	.row-rank { width: 26px; padding-top: 10px; font-size: 12px; }
	.row .icon { width: 40px; height: 40px; }
	.wrap { padding: 0 14px; }
	.chip-row { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
	.fac-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
	.fac-tile { padding: 12px 6px; }
	.fac-row { padding: 11px 12px; }
	/* 標題與摘要在窄屏換行，標題不再被壓成一字一行 / heading and lead wrap on narrow screens */
	.page-head { flex-wrap: wrap; gap: 6px 12px; }
	.page-head h1 { flex: none; max-width: 100%; }
}

/* ---------- 實時大盤 / live dashboard ----------
   永遠深色，與頁面主題無關 / always dark, regardless of the page theme */

.live {
	--live-bg: #0b0c10;
	--live-panel: rgba(255, 255, 255, 0.035);
	--live-border: rgba(255, 255, 255, 0.08);
	--live-fg: #eceae6;
	--live-muted: #9a958e;
	--live-faint: #6a655f;
	--live-mono: var(--mono);
	background: var(--live-bg);
	color: var(--live-fg);
	border-bottom: 1px solid var(--live-border);
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
	background-size: 40px 40px;
}
.live a { color: inherit; }
/* 面板內的 display 規則不得蓋過 hidden / display rules inside must not defeat [hidden] */
.live [hidden] { display: none !important; }

.live-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0 10px;
	font-size: 12px;
	color: var(--live-muted);
}
.live-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--live-mono);
	font-size: 11px;
	letter-spacing: 0.12em;
	color: var(--accent);
	font-weight: 600;
}
.live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
	animation: live-breathe 2.4s ease-in-out infinite;
}
.live-title { font-weight: 600; color: var(--live-fg); }
.live-status { margin-left: auto; font-family: var(--live-mono); font-size: 11px; }
.live-status.is-delayed { color: #f5b241; }
.live-status.is-delayed::before { content: "▲ "; }
.live.is-loaded .live-status:empty { display: none; }

@keyframes live-breathe {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.35; }
}

/* 六個面板：≥ 1200px 六欄；820–1200px 每行三個（兩行）；手機橫滑。
   Six panels: six columns ≥ 1200px; three per row (two rows) between 820 and 1200px; horizontal
   snap scroll on mobile. */
.live-strip {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 10px;
	padding-bottom: 18px;
}
@media (max-width: 1199px) {
	.live-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.live-panel {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding: 12px 14px 12px;
	background: var(--live-panel);
	border: 1px solid var(--live-border);
	border-radius: var(--radius);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: border-color 0.15s;
}
a.live-panel:hover { border-color: rgba(255, 255, 255, 0.2); color: inherit; }
a.live-panel:hover .live-link { color: var(--accent); }

.live-panel-title {
	margin: 0 0 2px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--live-muted);
	display: flex;
	align-items: baseline;
	gap: 8px;
}
.live-panel-sub { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--live-faint); }

.live-label { font-size: 11px; color: var(--live-faint); }
.live-value {
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
	font-family: var(--live-mono);
	font-variant-numeric: tabular-nums;
	font-size: 15px;
	line-height: 1.2;
}
.live-value-big { font-size: 26px; font-weight: 500; }
.live-unit { font-size: 11px; color: var(--live-muted); }
.live-num { display: inline-block; }
.live-mono { font-family: var(--live-mono); font-variant-numeric: tabular-nums; }
.live-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.live-foot { margin: auto 0 0; padding-top: 4px; font-size: 11.5px; color: var(--live-muted); }
.live-foot:empty { display: none; }
/* 天氣概況最多三行（英文版較長）/ the weather one-liner is clamped to three lines (English runs long) */
#live-weather-summary {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.live-link { color: var(--live-muted); font-size: 11.5px; }
.live-link:hover { color: var(--accent); }

/* 時鐘與天氣 / clock & weather */
.live-clock-wrap { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.live-clock {
	font-family: var(--live-mono);
	font-variant-numeric: tabular-nums;
	font-size: 30px;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.1;
}
.live-clock-tz { font-family: var(--live-mono); font-size: 11px; color: var(--live-faint); }
.live-weather-main { display: flex; align-items: center; gap: 12px; }
.live-wx-icon { font-size: 30px; line-height: 1; }
.live-weather-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.live-aqhi-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--live-faint);
	align-self: center;
	margin-right: 3px;
}
.live-aqhi-dot.is-low { background: #3fb950; }
.live-aqhi-dot.is-moderate { background: #f5b241; }
.live-aqhi-dot.is-high { background: #f0883e; }
.live-aqhi-dot.is-very-high { background: #e5484d; }
.live-aqhi-dot.is-serious { background: #a371f7; }

/* 港鐵綫路色塊 / MTR line squares */
.live-lines { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 4px; }
.live-line {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 22px;
	border-radius: 5px;
	background: var(--line, #555);
	color: #fff;
	font-family: var(--live-mono);
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
	opacity: 0.92;
}
.live-line.is-unknown { opacity: 0.35; }
.live-line.is-delayed {
	box-shadow: 0 0 0 2px #f0883e;
	animation: live-pulse 1.4s ease-in-out infinite;
}
.live-line-badge {
	position: absolute;
	top: -7px;
	right: -6px;
	padding: 0 4px;
	border-radius: 999px;
	background: #f0883e;
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	line-height: 1.4;
	text-shadow: none;
	font-family: inherit;
}
@keyframes live-pulse {
	0%, 100% { box-shadow: 0 0 0 2px #f0883e; }
	50% { box-shadow: 0 0 0 4px rgba(240, 136, 62, 0.35); }
}

/* 急症室 / A&E */
.live-ae-legend {
	margin: 0;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	font-size: 10px;
	color: var(--live-faint);
}
.live-ae-legend span { width: 58px; text-align: right; }
.live-ae-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.live-ae-row { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.25; }
.live-ae-name { flex: 1; min-width: 0; }
.live-ae-wait { flex: none; display: flex; gap: 6px; font-family: var(--live-mono); font-variant-numeric: tabular-nums; font-size: 10.5px; color: var(--live-muted); }
.live-ae-wait span { width: 58px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-ae-t3 { color: var(--live-fg); }

/* 假期與匯率 / holidays & FX */
.live-hol-name { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.live-hol-meta { margin: 0; font-size: 12px; color: var(--live-muted); display: flex; gap: 8px; }
.live-hol-count { color: var(--accent); }
.live-fx, .live-hol-more { list-style: none; margin: 2px 0 0; padding: 0; }
.live-fx li { display: flex; justify-content: space-between; font-size: 12px; line-height: 1.55; }
.live-fx-code { color: var(--live-muted); font-family: var(--live-mono); }
.live-fx-code small { margin-left: 5px; font-size: 9.5px; color: var(--live-faint); font-family: inherit; }
.live-fx-rate { font-size: 12.5px; }
.live-fx-asof { font-size: 10px; color: var(--live-faint); margin-left: 4px; }
.live-hol-more li { font-size: 12px; color: var(--live-muted); line-height: 1.55; }
.live-hol-more .live-mono { color: var(--live-faint); margin-right: 6px; }

/* 港股 / HK stocks：港股慣例紅升綠跌 / HK convention: red up, green down */
.live-panel-hsi { --up: #e5484d; --down: #3fb950; --flat: var(--live-muted); }
.live-hsi-state { font-weight: 400; letter-spacing: 0; text-transform: none; font-family: var(--live-mono); color: var(--live-faint); }
.live-hsi-state.is-open { color: var(--accent); }
.live-hsi-hero { margin: 0; }
.live-hsi-last { font-size: 26px; font-weight: 500; line-height: 1.15; }
.live-hsi-change { margin: 0; font-size: 12px; white-space: pre; color: var(--flat); }
.is-up > .live-hsi-change { color: var(--up); }
.is-down > .live-hsi-change { color: var(--down); }
.live-spark { display: block; width: 100%; height: 32px; margin: 4px 0 2px; overflow: visible; }
.live-spark-line { fill: none; stroke: var(--flat); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.is-up .live-spark-line { stroke: var(--up); }
.is-down .live-spark-line { stroke: var(--down); }
.live-spark-base { stroke: var(--live-faint); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.live-spark-base[hidden] { display: none; }
.live-hsi-rows { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.live-hsi-rows li { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.live-hsi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--live-muted); }
.live-hsi-row-last { font-size: 12.5px; }
.live-hsi-row-pct { font-size: 11px; min-width: 62px; text-align: right; color: var(--flat); }
.live-hsi-rows li.is-up .live-hsi-row-pct { color: var(--up); }
.live-hsi-rows li.is-down .live-hsi-row-pct { color: var(--down); }

/* 過海隧道 / harbour tunnels */
.live-tun-legend {
	margin: 0;
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	font-size: 10px;
	color: var(--live-faint);
}
.live-tun-legend span { width: 48px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-tun-legend span:last-child { width: 34px; }
.live-tun-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.live-tun-row { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; line-height: 1.25; }
.live-tun-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.live-tun-t {
	flex: none;
	width: 48px;
	display: inline-flex;
	align-items: baseline;
	justify-content: flex-end;
	gap: 4px;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.live-tun-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live-faint); align-self: center; flex: none; }
.live-tun-t.is-green .live-tun-dot { background: #3fb950; }
.live-tun-t.is-amber .live-tun-dot { background: #f5b241; }
.live-tun-t.is-red .live-tun-dot { background: #e5484d; }
.live-tun-t.is-closed .live-tun-dot, .live-tun-t.is-congested .live-tun-dot { background: #e5484d; box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.35); }
.live-tun-t.is-closed, .live-tun-t.is-congested { color: #e5484d; font-weight: 600; }
.live-tun-t.is-na { color: var(--live-faint); }
.live-tun-toll { flex: none; width: 34px; text-align: right; font-size: 12px; color: var(--live-muted); }
.live-tun-row.is-transition .live-tun-toll { color: #f5b241; }
.live-tun-row.is-closed .live-tun-name, .live-tun-row.is-congested .live-tun-name { color: #e5484d; }
.live-tun-tollnote { margin-top: 2px; font-variant-numeric: tabular-nums; }
.live-tun-incident { color: #f5b241; margin-top: 0; }
.live-alert.is-tunnel { background: #5a3d0d; }

/* 六欄時面板只有約 150px 寬：急症室與港股指數列改成兩行（名稱一行、數字一行）。
   At six columns a panel is only ~150px wide: A&E and index rows go two-line (name, then numbers). */
@media (min-width: 1200px) {
	.live-ae-row, .live-hsi-rows li { flex-wrap: wrap; row-gap: 1px; }
	.live-ae-name, .live-hsi-name { flex: 1 0 100%; }
	.live-ae-wait { margin-left: auto; }
	.live-ae-wait span { width: auto; min-width: 52px; }
	.live-ae-legend span { width: auto; min-width: 52px; }
	.live-hsi-row-last { flex: 1; }
	.live-hsi-row-pct { min-width: 0; }
	.live-line { width: 31px; }
	/* 六欄時港股主數字縮一級，避免 25,650.87 折行 / a smaller HSI hero so 25,650.87 does not wrap */
	.live-hsi-last { font-size: 22px; }
	.live-tun-row { flex-wrap: wrap; row-gap: 1px; }
	.live-tun-name { flex: 1 0 100%; }
	.live-tun-t { width: auto; min-width: 44px; margin-left: auto; }
	.live-tun-t + .live-tun-t { margin-left: 0; }
	.live-tun-legend span { width: auto; min-width: 44px; }
	.live-tun-legend span:last-child { min-width: 30px; }
	.live-tun-toll { width: 30px; }
}
/* 警告橫幅 / alert banners */
.live-alerts { position: relative; border-bottom: 1px solid var(--live-border); }
.live-alerts[hidden] { display: none; }
.live-alert {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 9px 56px 9px max(20px, calc((100% - var(--wrap)) / 2 + 20px));
	font-size: 13px;
	color: #fff;
	background: #2a2d34;
}
.live-alert + .live-alert { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.live-alert.is-info { background: #2a2d34; }
.live-alert.is-amber { background: #8a5a00; }
.live-alert.is-red { background: #a3231f; }
.live-alert.is-black { background: #000; border-bottom: 1px solid #444; }
.live-alert.is-mtr { background: #7a3d0d; }
.live-alert-label {
	flex: none;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
}
.live-alert-body { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.live-alert-item { font-weight: 600; }
.live-alert-link { text-decoration: underline; text-underline-offset: 2px; opacity: 0.9; }
.live-alert-link:hover { color: #fff; opacity: 1; }
.live-alert-close {
	position: absolute;
	top: 6px;
	right: max(12px, calc((100% - var(--wrap)) / 2 + 12px));
	appearance: none;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	width: 26px;
	height: 26px;
	border-radius: 7px;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.live-alert-close:hover { background: rgba(0, 0, 0, 0.45); }

@media (prefers-reduced-motion: reduce) {
	.live-dot, .live-line.is-delayed { animation: none; }
}

@media (max-width: 819px) {
	.live-strip {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		margin: 0 -20px;
		padding: 0 20px 16px;
		scroll-padding: 0 20px;
	}
	.live-strip::-webkit-scrollbar { display: none; }
	.live-panel { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; }
}
@media (max-width: 720px) {
	.live-strip { margin: 0 -14px; padding: 0 14px 14px; scroll-padding: 0 14px; }
	.live-alert { padding-left: 14px; padding-right: 48px; }
	.live-alert-close { right: 10px; }
}

/* ---------- ⌘K 命令面板 / command palette ---------- */

.search-pill {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 34px;
	padding: 0 8px 0 10px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--bg-sunken);
	color: var(--fg-muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.search-pill:hover { border-color: var(--border-strong); color: var(--fg); }
.search-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search-pill-key {
	font-family: var(--mono);
	font-size: 10.5px;
	padding: 1px 5px;
	border: 1px solid var(--border);
	border-radius: 5px;
	color: var(--fg-faint);
	background: var(--bg-elev);
}

.palette-overlay {
	position: fixed;
	inset: 0;
	z-index: 60;
	background: rgba(8, 9, 12, 0.55);
	backdrop-filter: blur(3px);
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 8vh 16px 16px;
}
.palette-overlay[hidden] { display: none; }

.palette {
	width: 100%;
	max-width: 640px;
	background: var(--bg-panel);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	display: flex;
	flex-direction: column;
	max-height: 76vh;
	overflow: hidden;
}

.palette-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 10px 10px 14px;
	border-bottom: 1px solid var(--border);
}
.palette-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--fg-faint); stroke-width: 1.8; stroke-linecap: round; }
#palette-input {
	flex: 1;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 16px;
	color: var(--fg);
	min-width: 0;
}
#palette-input::-webkit-search-cancel-button,
#palette-input::-webkit-search-decoration { appearance: none; display: none; }
.palette-loading { font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; }
.palette-loading[hidden] { display: none; }

.palette-body { overflow-y: auto; overscroll-behavior: contain; }
.palette-empty { padding: 18px 16px 20px; color: var(--fg-faint); font-size: 13px; }
.palette-empty p { margin: 0; }
.palette-empty[hidden] { display: none; }
.palette-examples { margin-top: 10px !important; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.palette-example {
	appearance: none;
	font: inherit;
	font-size: 12px;
	padding: 3px 10px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--bg-sunken);
	color: var(--fg-muted);
	cursor: pointer;
}
.palette-example:hover { border-color: var(--accent); color: var(--accent); }
.palette-status { margin: 0; padding: 14px 16px; color: var(--fg-faint); font-size: 13px; }

.palette-group { list-style: none; margin: 0; padding: 4px 0; border-top: 1px solid var(--border); }
.palette-group:first-child { border-top: 0; }
.palette-group-head {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 6px 16px 2px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-faint);
}
.palette-group-count { font-weight: 400; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.palette-more { padding: 2px 16px 6px; font-size: 11.5px; color: var(--fg-faint); }

.palette-item a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 16px;
	color: inherit;
}
.palette-item.is-active a, .palette-item a:hover { background: var(--bg-sunken); color: inherit; }
.palette-item.is-active .palette-name { color: var(--accent); }
.palette-item-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.palette-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-sub { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .icon { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
.palette-chips { flex: none; display: flex; gap: 4px; }
.palette-chip {
	font-size: 11px;
	line-height: 1.5;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--bg-sunken);
	border: 1px solid var(--border);
	color: var(--fg-muted);
	white-space: nowrap;
}
.palette-chip-line {
	font-family: var(--mono);
	font-size: 9.5px;
	font-weight: 700;
	color: #fff;
	background: var(--line, #555);
	border-color: transparent;
	padding: 2px 5px;
}
.palette-chip-login { border-color: var(--accent); color: var(--accent); }
.palette-ext { flex: none; color: var(--fg-faint); font-size: 11px; }
.palette-enter { flex: none; font-family: var(--mono); font-size: 10px; color: var(--fg-faint); visibility: hidden; }
.palette-item.is-active .palette-enter { visibility: visible; }

.palette-hint {
	margin: 0;
	padding: 8px 16px;
	border-top: 1px solid var(--border);
	color: var(--fg-faint);
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
}

/* ⌘K 落點：被 #f-<id> 指到的列亮一下 / the row a #f-<id> anchor points at */
.fac-row:target { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

@media (max-width: 720px) {
	.search-pill { padding: 0 8px; }
	.search-pill-text, .search-pill-key { display: none; }
	.palette-overlay { padding: 0; }
	.palette { max-width: none; max-height: 100%; height: 100%; border-radius: 0; border: 0; }
	.palette-enter { display: none; }
	.palette-chips { display: none; }
}

/* ---------- /api/ 頁與頁腳更新時間 / API page & footer freshness ---------- */

.api-page { max-width: 900px; }
.api-table-wrap { overflow-x: auto; margin: 14px 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
.api-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.api-table th, .api-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.api-table th { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }
.api-table tbody tr:last-child td { border-bottom: 0; }
.api-table td { color: var(--fg-muted); }
.api-path { font-family: var(--mono); font-size: 12.5px; color: var(--fg); white-space: nowrap; }
.api-path:hover { color: var(--accent); }
.api-refresh { font-family: var(--mono); white-space: nowrap; }
.api-code {
	margin: 10px 0 0;
	padding: 12px 14px;
	overflow-x: auto;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.7;
	color: var(--fg);
}
.api-page p a { color: var(--accent); }

.footer-fresh { margin-top: 8px !important; font-size: 11.5px; font-family: var(--mono); color: var(--fg-faint); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-fresh-feeds:empty { display: none; }
.footer-fresh-time { color: var(--fg-muted); }
.footer-fresh-delayed { color: #f5b241; }

/* ---------- 政府電子服務（智方便）/ government e-services (iAM Smart) ----------
   與設施清單同一套語言：1px 邊、淡玻璃、單一強調色；徽章是描邊的 chip，不發光。
   Same language as the facility lists: 1px borders, faint glass, one accent; the badge is an
   outlined chip, no glow. */

.es-list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
	.es-list { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
.es-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 11px 16px;
	border-bottom: 1px solid var(--border);
}
.es-row:last-child { border-bottom: 0; }
.es-row:hover { background: var(--bg-sunken); }
.es-row[hidden] { display: none; }
.es-row:target { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

.es-link { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; color: inherit; }
.es-link:hover { color: inherit; }
.es-link:hover .es-name { color: var(--accent); }
.es-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.es-name { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.es-name-en { margin-top: 1px; font-size: 12px; color: var(--fg-faint); }
.es-desc { margin-top: 2px; color: var(--fg-muted); font-size: 13px; }
.es-meta { margin-top: 3px; color: var(--fg-faint); font-size: 12px; }
.es-ext { flex: none; padding-top: 3px; color: var(--fg-faint); font-size: 12px; }

.es-badge {
	flex: none;
	display: inline-flex;
	align-items: center;
	margin-top: 2px;
	padding: 2px 9px;
	border-radius: 999px;
	border: 1px solid var(--accent);
	color: var(--accent);
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
}
.es-badge:hover { background: var(--accent); color: #fff; }

.es-tag {
	display: inline-block;
	margin-left: 6px;
	padding: 0 6px;
	border-radius: 4px;
	border: 1px solid var(--border-strong);
	color: var(--fg-faint);
	font-family: var(--mono);
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.5;
	vertical-align: 1px;
}

/* 系列摺疊與 PDF 摺疊 / folded series and the PDF block */
.es-series { display: block; padding: 0; }
.es-series > details > summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	padding: 11px 16px;
	cursor: pointer;
	list-style: none;
}
.es-series > details > summary::-webkit-details-marker { display: none; }
.es-series > details > summary::before {
	content: "▸";
	flex: none;
	color: var(--fg-faint);
	font-size: 12px;
}
.es-series > details[open] > summary::before { content: "▾"; }
.es-series > details > summary .es-meta { margin: 0; }
.es-series > details > summary .es-name { flex: 1 1 auto; min-width: 0; }
.es-count {
	margin-left: auto;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--bg-sunken);
	color: var(--fg-muted);
	font-family: var(--mono);
	font-size: 11px;
	white-space: nowrap;
}
.es-sub { list-style: none; margin: 0; padding: 0 0 4px; border-top: 1px solid var(--border); }
.es-sub > .es-row { padding-left: 34px; }

.es-pdf { margin: 14px 0 0; }
.es-pdf > summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--bg-elev);
	color: var(--fg-muted);
	font-size: 13px;
	cursor: pointer;
	list-style: none;
}
.es-pdf > summary::-webkit-details-marker { display: none; }
.es-pdf > summary::before { content: "▸"; color: var(--fg-faint); font-size: 12px; }
.es-pdf[open] > summary::before { content: "▾"; }
.es-pdf > summary:hover { border-color: var(--accent); color: var(--accent); }
.es-pdf > .es-list { margin-top: 10px; }
.es-pdf > .fac-status:empty { display: none; }

/* 精選節 / featured block */
.es-featured { margin: 34px 0; }
.es-teaser { margin-top: 26px; }
.es-topic-row { margin-top: 4px; }
.es-cards .card-domain { font-family: var(--mono); }

/* 部門一覽 / department index */
.es-dept-list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}
.es-dept {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 16px;
	border-bottom: 1px solid var(--border);
	color: inherit;
}
.es-dept-list li:last-child .es-dept { border-bottom: 0; }
.es-dept:hover { background: var(--bg-sunken); color: inherit; }
.es-dept:hover .es-dept-name { color: var(--accent); }
.es-dept-name { font-weight: 600; font-size: 14.5px; min-width: 0; }
.es-dept-name .fac-name-en { display: block; }
.es-dept-count { flex: none; color: var(--fg-faint); font-family: var(--mono); font-size: 12px; white-space: nowrap; }

@media (max-width: 720px) {
	.es-row { flex-wrap: wrap; padding: 11px 12px; }
	.es-link { flex-basis: 100%; }
	.es-badge { margin-left: auto; }
	.es-series > details > summary { padding: 11px 12px; }
	.es-sub > .es-row { padding-left: 26px; }
	.es-dept { flex-wrap: wrap; }
}

/* ---------- 律師與法律服務 / lawyers & legal services ----------
   沿用設施清單的列與 chip；補上「需要」卡、電話熱線、下拉、徽章。
   Reuses the facility rows and chips; adds the need cards, the hotline, selects and badges. */

.lg-needs { grid-template-columns: repeat(3, 1fr); }
.lg-need .card-link { cursor: default; }
.lg-need .card-link:hover .card-name { color: inherit; }
.lg-need .card-desc { -webkit-line-clamp: unset; display: block; overflow: visible; }
.lg-need-links { margin-top: 8px; font-size: 13px; }
.lg-need-links a { color: var(--accent); font-weight: 600; }
.lg-tel {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 10px;
	padding: 10px 12px;
	background: var(--accent-soft);
	border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
	border-radius: var(--radius-sm);
	color: inherit;
}
.lg-tel strong { color: var(--accent); font-family: var(--mono); font-size: 14px; }
.lg-tel span { color: var(--fg-muted); font-size: 12px; }
.lg-tel:hover { border-color: var(--accent); color: inherit; }
.lg-tiles { margin-top: 22px; }
.lg-badge { margin-left: 8px; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; }
.lg-area { border: 1px solid var(--border); background: transparent; }
.lg-site { color: inherit; }
.lg-site:hover { color: var(--accent); }
.lg-site .es-ext { font-size: 11px; }
.lg-select-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.lg-select {
	max-width: 100%;
	padding: 8px 12px;
	font: inherit;
	font-size: 13.5px;
	color: var(--fg);
	background: var(--bg-elev);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
}
.lg-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lg-select-note { color: var(--fg-faint); font-size: 12px; }
.lg-tabs { margin-top: 14px; }
.lg-tabs .chip { font-weight: 600; }
.lg-chambers-grid { margin-bottom: 8px; }
.lg-chambers .card-desc { -webkit-line-clamp: 2; }
.lg-chambers .card-domain { font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
	.lg-needs { grid-template-columns: 1fr; }
}
