/* =========================================================
   KampungKey v2.0.0 — tool-page components.
   Page-specific styling for the individual tools (HDB town pages,
   COE, Traffic Incidents, Check Car Plate, Travel Times, the HDB
   Resale Price Checker tabs, HDB Carpark Info, Map Search, the
   search-limit popup). Carried over from v1.34 and re-pointed at the
   v2.0.0 design tokens in style.css, so every tool picks up the new
   palette, type and dark mode without its own markup changing.
   ========================================================= */

/* v2.0.0 — the glass pages' colour blobs now start below the new page
   hero instead of behind it. */
.am-tt-bg, .am-hci-bg, .am-ms-bg { top: 280px !important; }

/* =========================================================
   HDB Resale Prices by Town — hub grid (v1.33.51)
   Glassy square tiles, 6 per row, on a soft gradient backdrop so the
   frosted-glass effect (translucent fill + backdrop-filter blur) actually
   has something to blur against, in both light and dark mode.
   ========================================================= */
.hdb-town-hub-wrap {
	position: relative;
	overflow: hidden;
	margin-top: 1.75rem;
	padding: 2rem;
	border-radius: var(--am-radius);
	background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-primary-dark) 60%, var(--am-ink) 100%);
}
.hdb-town-hub-wrap::before,
.hdb-town-hub-wrap::after {
	content: '';
	position: absolute;
	width: 280px;
	height: 280px;
	border-radius: 50%;
	filter: blur(70px);
	opacity: .32;
	pointer-events: none;
}
.hdb-town-hub-wrap::before { background: var(--am-accent); top: -100px; left: -70px; }
.hdb-town-hub-wrap::after { background: var(--am-gold); bottom: -110px; right: -70px; }

.hdb-town-hub-grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1rem;
}
.hdb-town-tile {
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .3rem;
	padding: .75rem .5rem;
	text-align: center;
	color: #fff;
	text-decoration: none;
	background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.3);
	border-radius: 16px;
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	box-shadow: 0 4px 18px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.28);
	transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.hdb-town-tile:hover,
.hdb-town-tile:focus-visible {
	background: rgba(255,255,255,.22);
	transform: translateY(-4px) scale(1.03);
	box-shadow: 0 12px 28px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.35);
	color: #fff;
	text-decoration: none;
}
.hdb-town-tile-icon { font-size: 1.7rem; line-height: 1; opacity: .92; }
.hdb-town-tile-name {
	font-family: var(--am-font-display);
	font-weight: 800;
	font-size: 1rem;
	line-height: 1.25;
	letter-spacing: -.01em;
}
@media (max-width: 1080px) { .hdb-town-hub-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 680px) {
	.hdb-town-hub-wrap { padding: 1.25rem; }
	.hdb-town-hub-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
	.hdb-town-tile-name { font-size: .85rem; }
}
@media (max-width: 420px) { .hdb-town-hub-grid { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================
   HDB Resale Prices by Town — single-town detail view (v1.33.52)
   Same visual family as the hub grid above: a small back pill, a
   glass-tinted hero for the heading, real stat cards for the headline
   numbers, and a cleanly bordered table instead of a bare unstyled one.
   ========================================================= */
.hdb-town-back {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .45rem .9rem;
	border-radius: 999px;
	background: var(--am-bg-soft);
	border: 1px solid var(--am-border);
	color: var(--am-text);
	font-size: .88rem;
	font-weight: 600;
	transition: background .15s ease, transform .15s ease;
}
.hdb-town-back:hover { background: var(--am-border); text-decoration: none; transform: translateX(-2px); }

.hdb-town-hero {
	display: flex;
	align-items: center;
	gap: .85rem;
	margin: 1.25rem 0 1.5rem;
	padding: 1.5rem 1.75rem;
	border-radius: var(--am-radius);
	background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-primary-dark) 65%, var(--am-ink) 100%);
	color: #fff;
}
.hdb-town-hero-icon {
	flex: 0 0 auto;
	width: 52px; height: 52px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.7rem;
	border-radius: 14px;
	background: rgba(255,255,255,.16);
	border: 1px solid rgba(255,255,255,.3);
}
.hdb-town-hero h1 { margin: 0; color: #fff; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }

.hdb-town-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.hdb-town-stat-card {
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	padding: 1.1rem 1rem;
	text-align: center;
	box-shadow: var(--am-shadow-sm);
}
.hdb-town-stat-number {
	font-family: var(--am-font-display);
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--am-primary);
	letter-spacing: -.01em;
}
.hdb-town-stat-number.is-up { color: var(--am-success-text); }
.hdb-town-stat-number.is-down { color: var(--am-error-text); }
.hdb-town-stat-label { color: var(--am-text-muted); font-size: .82rem; margin-top: .35rem; }

.hdb-town-summary-wrap {
	display: flex;
	justify-content: center;
	text-align: center;
	margin: 0 0 1.5rem;
	padding: 1.4rem 1.75rem;
	border-radius: var(--am-radius);
	background: var(--am-bg-soft);
	border: 1px solid var(--am-border);
}
.hdb-town-summary {
	margin: 0 auto;
	max-width: 62ch;
	font-family: var(--am-font-display);
	font-size: 1.12rem;
	line-height: 1.55;
	color: var(--am-text);
}

.hdb-town-trend-wrap {
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	overflow: hidden;
	margin: 1rem 0 1.5rem;
	box-shadow: var(--am-shadow-sm);
}
.hdb-town-trend-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hdb-town-trend-table th, .hdb-town-trend-table td { padding: .7rem 1rem; text-align: left; }
.hdb-town-trend-table th {
	background: var(--am-bg-soft);
	color: var(--am-text-muted);
	font-weight: 700;
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .03em;
}
.hdb-town-trend-table td:nth-child(2), .hdb-town-trend-table td:nth-child(3),
.hdb-town-trend-table th:nth-child(2), .hdb-town-trend-table th:nth-child(3) { text-align: right; }
.hdb-town-trend-table tbody tr { border-top: 1px solid var(--am-border); }
.hdb-town-trend-table tbody tr:nth-child(even) { background: var(--am-bg-soft); }

.hdb-town-related { margin-top: 2rem; }
.hdb-town-related h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.hdb-town-related-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.hdb-town-chip {
	padding: .5rem 1rem;
	border-radius: 999px;
	background: var(--am-bg-soft);
	border: 1px solid var(--am-border);
	color: var(--am-text);
	font-size: .9rem;
	font-weight: 600;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.hdb-town-chip:hover {
	background: var(--am-primary);
	border-color: var(--am-primary);
	color: #fff;
	text-decoration: none;
	transform: translateY(-2px);
}

@media (max-width: 780px) {
	.hdb-town-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
	.hdb-town-hero { flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1.25rem; }
	.hdb-town-trend-wrap { overflow-x: auto; }
}

/* v1.31.0 — EV Charging Points result-list buttons (template-ev-charging.php
   inlines its own layout/colors so the rest of its styling isn't here, but
   the hover affordance for a clickable result card is a plain reusable rule). */
.am-ev-result:hover { border-color: var(--am-primary, var(--am-primary)); }

/* =========================================================
   COE "Latest bidding results" cards (v1.31.36, template-coe.php)
   "Can you make the latest bidding results look better? It is very
   dull and not appealing." Replaces the plain .am-service-card usage
   with a dedicated card that carries a per-category accent colour
   (the same PALETTE used by the trend chart just above it, so the two
   sections read as one colour-coded system), a category icon, a
   larger price, and a light quota-fill bar. Colour is applied via the
   --am-coe-accent custom property set inline per card, the same
   "PHP picks the value, CSS does the drawing" pattern as the rest of
   this theme's per-item accents.
   ========================================================= */
.am-coe-results-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.am-coe-result-card {
	position: relative;
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-top: 4px solid var(--am-coe-accent, var(--am-primary));
	border-radius: var(--am-radius);
	padding: 1.5rem 1.25rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: .3rem;
	transition: box-shadow .15s ease, transform .15s ease;
}
.am-coe-result-card:hover { box-shadow: var(--am-shadow-md); transform: translateY(-3px); }
.am-coe-result-card__icon {
	width: 44px; height: 44px;
	border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.4rem;
	background: color-mix(in srgb, var(--am-coe-accent, var(--am-primary)) 14%, var(--am-bg-soft));
	margin-bottom: .2rem;
}
.am-coe-result-card__label {
	font-weight: 700;
	font-size: .85rem;
	letter-spacing: .02em;
	color: var(--am-coe-accent, var(--am-primary));
	text-transform: uppercase;
}
.am-coe-result-card__desc {
	font-size: .72rem;
	color: var(--am-text-muted);
	line-height: 1.35;
	min-height: calc(1.35em * 2);
	display: flex;
	align-items: center;
}
.am-coe-result-card__premium {
	font-size: 2rem;
	font-weight: 800;
	margin: .2rem 0 0;
	color: var(--am-text);
}
.am-coe-result-card__stats {
	width: 100%;
	margin-top: .5rem;
	padding-top: .6rem;
	border-top: 1px solid var(--am-border);
	font-size: .78em;
	color: var(--am-text-muted);
}
.am-coe-result-card__bar {
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: var(--am-bg-soft);
	margin-top: .65rem;
	overflow: hidden;
}
.am-coe-result-card__bar-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--am-coe-accent, var(--am-primary));
}
/* color-mix() has broad modern support but no IE/older-Safari fallback;
   a plain tinted background keeps the icon chip visible either way. */
@supports not (background: color-mix(in srgb, red 10%, blue)) {
	.am-coe-result-card__icon { background: var(--am-bg-soft); }
}

/**
 * v1.33.27 — Traffic Incidents page. Same "coloured left accent + icon
 * chip" language as .am-coe-result-card above, adapted to a left-to-right
 * list row (one incident per row) rather than a centered stat card, since
 * an incident is a message to read, not a headline number.
 */
.am-incident-card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: .9rem;
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-left: 4px solid var(--am-incident-accent, var(--am-primary));
	border-radius: var(--am-radius);
	padding: 1rem 1.1rem;
	margin-bottom: .75rem;
}
.am-incident-card__icon {
	flex: 0 0 auto;
	width: 38px; height: 38px;
	border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.2rem;
	background: color-mix(in srgb, var(--am-incident-accent, var(--am-primary)) 14%, var(--am-bg-soft));
}
@supports not (background: color-mix(in srgb, red 10%, blue)) {
	.am-incident-card__icon { background: var(--am-bg-soft); }
}
.am-incident-card__body { flex: 1 1 auto; min-width: 0; }
.am-incident-card__type {
	display: inline-block;
	font-weight: 700;
	font-size: .72rem;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--am-incident-accent, var(--am-primary));
	margin-bottom: .2rem;
}
.am-incident-card__message { font-size: .95rem; line-height: 1.45; color: var(--am-text); word-break: break-word; }
.am-incident-card__meta { font-size: .78em; color: var(--am-text-muted); margin-top: .3rem; }

.am-incident-summary {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem .9rem;
	margin: 0 0 1.5rem;
}
.am-incident-summary__pill {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	background: var(--am-bg-soft);
	border: 1px solid var(--am-border);
	border-radius: 999px;
	padding: .35rem .8rem;
	font-size: .82rem;
	font-weight: 600;
	color: var(--am-text);
}
.am-incident-summary__pill span.am-incident-summary__dot {
	width: 9px; height: 9px; border-radius: 50%;
	background: var(--am-incident-accent, var(--am-primary));
	display: inline-block;
}

/* =========================================================
   COE "Look up a month" results table (v1.32.2, template-coe.php)
   "The search results look very ugly. Can you display it in a more
   professional way?" Was a bare, unstyled <table> with no card, no
   striping, and the round number repeated on every single row. Now a
   proper card: rows group under a "Bidding Exercise N" divider instead of
   repeating the round number, each category gets a coloured dot reusing
   the SAME per-category palette as the trend chart / result cards above
   (one consistent colour system for the whole page), and the Premium
   column — the number people came here for — is the visually loudest
   thing in the row.
   ========================================================= */
.am-coe-month-results {
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	box-shadow: var(--am-shadow-sm);
	overflow: hidden;
}
.am-coe-month-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.am-coe-month-table th,
.am-coe-month-table td { padding: .7rem 1rem; }
.am-coe-month-table thead th {
	background: var(--am-bg-soft);
	text-align: left;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-size: .72rem;
	font-weight: 700;
	color: var(--am-text-muted);
	border-bottom: 1px solid var(--am-border);
	white-space: nowrap;
}
.am-coe-month-table th.am-text-right,
.am-coe-month-table td.am-text-right { text-align: right; }
.am-coe-month-table tbody tr:not(.am-coe-round-row) { border-bottom: 1px solid var(--am-border); transition: background .12s ease; }
.am-coe-month-table tbody tr:last-child { border-bottom: none; }
.am-coe-month-table tbody tr:not(.am-coe-round-row):nth-of-type(even) { background: var(--am-bg-soft); }
.am-coe-month-table tbody tr:not(.am-coe-round-row):hover { background: color-mix(in srgb, var(--am-primary) 8%, var(--am-surface)); }
.am-coe-round-row td {
	background: var(--am-bg-soft);
	border-bottom: 1px solid var(--am-border);
	border-top: 1px solid var(--am-border);
	font-weight: 700;
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--am-text-muted);
}
.am-coe-round-row:first-child td { border-top: none; }
.am-coe-category-badge { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.am-coe-category-dot {
	width: .65rem; height: .65rem;
	border-radius: 50%;
	background: var(--am-coe-dot, var(--am-primary));
	flex-shrink: 0;
}
.am-coe-month-premium { font-weight: 800; font-size: 1.02rem; }
@supports not (background: color-mix(in srgb, red 10%, blue)) {
	.am-coe-month-table tbody tr:not(.am-coe-round-row):hover { background: var(--am-bg-soft); }
}

/* =========================================================
   Check Car Plate (v1.32.0, template-check-car-plate.php)
   ========================================================= */
.am-carplate-teaser {
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	padding: 1.5rem;
	text-align: center;
}
.am-carplate-plate {
	display: inline-block;
	font-family: var(--am-font-display, inherit);
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: .04em;
	background: #fff;
	color: #111;
	border: 3px solid #111;
	border-radius: 6px;
	padding: .4rem 1rem;
	margin-bottom: 1.25rem;
}
.am-carplate-teaser-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
}
.am-carplate-stat { display: flex; flex-direction: column; gap: .35rem; align-items: center; }
.am-carplate-stat__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--am-text-muted); }
.am-carplate-stat__value { font-size: 1.1rem; font-weight: 700; }
.am-carplate-kabbalah-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem; height: 2.4rem;
	border-radius: 50%;
	background: var(--am-bg-soft);
	color: var(--am-primary);
	font-size: 1.3rem;
}
.am-carplate-badge {
	display: inline-block;
	padding: .25rem .75rem;
	border-radius: 999px;
	font-size: .95rem;
}
.am-carplate-badge--good { background: var(--am-success-bg); color: var(--am-success-text); }
.am-carplate-badge--bad { background: var(--am-error-bg); color: var(--am-error-text); }
.am-carplate-badge--neutral { background: var(--am-bg-soft); color: var(--am-text-muted); }
.am-carplate-section { margin-bottom: 1.5rem; }
.am-carplate-section h3 { font-size: 1rem; margin-bottom: .5rem; }

/* Reusable "cover the results, prompt sign-up" paywall pattern — real
   content is rendered (via am_carplate_render_full_result(), the same
   helper the unlocked view uses, so the two can never drift apart) but
   visually blurred and non-interactive until an approved member views it,
   with a CTA overlaid on top. First use is Check Car Plate's fuller
   breakdown; written generically enough (.am-gated-preview) to reuse for
   any future "free teaser, sign up for the rest" content. */
.am-gated-preview { position: relative; }
.am-gated-preview__content {
	filter: blur(5px);
	user-select: none;
	pointer-events: none;
}
.am-gated-preview__cta {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1.5rem;
	background: rgba(255,255,255,.72);
	border-radius: var(--am-radius);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-gated-preview__cta { background: rgba(10,14,26,.8); }
}
:root[data-theme="dark"] .am-gated-preview__cta { background: rgba(10,14,26,.8); }

/* =========================================================
   Estimated Travel Times — glassmorphism accordion
   ("The website looks too lengthy. Redesign it to a more
   glassy look and allow the user to expand to show the full
   list.") Collapsed-by-default per-expressway accordions (same
   grid-template-rows trick as the FAQ accordion above) instead
   of one long always-visible page of tables, each panel a frosted
   "glass" surface, with segments laid out as a dense card grid
   (4 columns desktop / 2 columns mobile as of v1.33.17 — see that
   version's note further down; originally 8/3 in v1.33.16, cut
   down after the wider cards were confirmed cropping long route
   names on the live site) rather than a tall single-column table
   — both changes aimed at the same "too lengthy" complaint from
   two different angles.
   ========================================================= */
.am-tt-page { position: relative; }
/* Soft blurred colour blobs behind the page, using the theme's own
   palette — needed for the frosted-glass panels below to actually read
   as "glass" rather than plain translucent grey on a flat background. */
.am-tt-bg {
	position: absolute;
	inset: -1rem -1rem auto -1rem;
	height: 480px;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
.am-tt-bg::before,
.am-tt-bg::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: .3;
}
.am-tt-bg::before { width: 420px; height: 420px; background: var(--am-primary-light); top: -140px; left: -100px; }
.am-tt-bg::after { width: 380px; height: 380px; background: var(--am-gold); top: -100px; right: -120px; }
.am-tt-content { position: relative; z-index: 1; }

.am-tt-glass {
	background: rgba(255,255,255,.55);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	backdrop-filter: blur(16px) saturate(160%);
	border: 1px solid rgba(255,255,255,.45);
	box-shadow: var(--am-shadow-sm);
	border-radius: var(--am-radius);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-tt-glass { background: rgba(14,20,36,.6); border-color: rgba(255,255,255,.08); }
}
:root[data-theme="dark"] .am-tt-glass { background: rgba(14,20,36,.6); border-color: rgba(255,255,255,.08); }

.am-tt-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	flex-wrap: wrap;
	margin: 0 auto 1.25rem;
	max-width: 900px;
}
.am-tt-toolbar-btn {
	padding: .5rem 1.1rem;
	font-family: var(--am-font-display);
	font-weight: 700;
	font-size: .85rem;
	color: var(--am-text);
	cursor: pointer;
	border-radius: 999px;
}
.am-tt-toolbar-btn:hover { background: rgba(255,255,255,.75); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-tt-toolbar-btn:hover { background: rgba(255,255,255,.08); }
}
:root[data-theme="dark"] .am-tt-toolbar-btn:hover { background: rgba(255,255,255,.08); }

.am-tt-expressway { max-width: 900px; margin: 0 auto 1rem; }
.am-tt-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border: 1px solid rgba(255,255,255,.45);
	text-align: left;
	cursor: pointer;
}
.am-tt-toggle-title {
	display: flex;
	align-items: baseline;
	gap: .6rem;
	font-family: var(--am-font-display);
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--am-text);
}
.am-tt-toggle-meta { font-weight: 500; font-size: .78rem; color: var(--am-text-muted); }
.am-tt-toggle-icon {
	flex-shrink: 0;
	width: 26px; height: 26px;
	border-radius: 50%;
	background: rgba(255,255,255,.6);
	display: flex; align-items: center; justify-content: center;
	font-size: 1rem;
	transition: transform .25s ease, background .2s ease, color .2s ease;
}
.am-tt-toggle[aria-expanded="true"] .am-tt-toggle-icon { transform: rotate(45deg); background: var(--am-accent); color: #fff; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-tt-toggle-icon { background: rgba(255,255,255,.1); }
}
:root[data-theme="dark"] .am-tt-toggle-icon { background: rgba(255,255,255,.1); }

.am-tt-panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .3s ease;
}
.am-tt-toggle[aria-expanded="true"] + .am-tt-panel { grid-template-rows: 1fr; }
.am-tt-panel-inner { overflow: hidden; }
.am-tt-panel-body { padding: 1rem 1.25rem 1.25rem; }

.am-tt-direction { margin-bottom: 1rem; }
.am-tt-direction:last-child { margin-bottom: 0; }
.am-tt-direction-label {
	margin: 0 0 .5rem;
	font-size: .82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--am-text-muted);
}

/* v1.33.17 — "the words are cropped... if 8 columns are too small, make
   it 4 for desktop and 2 for mobile." 8/3 columns (v1.33.16) left barely
   80px per card, and this dataset's real route names run long
   ("KJE/PIE INTERCHANGE(JALAN BAHAR FLYOVER)") — a single-line
   white-space:nowrap + ellipsis truncated most of them down to a few
   characters ("LOWER DEL…"), confirmed directly against the live page.
   Fewer, wider columns (4/2) plus a 2-line clamp (below) instead of a
   1-line ellipsis gives route names real room to actually read. */
.am-tt-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: .55rem;
}
@media (max-width: 780px) {
	.am-tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.am-tt-segment {
	padding: .6rem .7rem;
	display: flex;
	flex-direction: column;
	gap: .3rem;
	font-size: .8rem;
	line-height: 1.3;
	border-radius: 10px;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.am-tt-segment:hover { transform: translateY(-2px); box-shadow: var(--am-shadow-md); background: rgba(255,255,255,.85); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-tt-segment:hover { background: rgba(255,255,255,.12); }
}
:root[data-theme="dark"] .am-tt-segment:hover { background: rgba(255,255,255,.12); }
.am-tt-segment-route {
	color: var(--am-text);
	/* v1.33.17 — a 2-line clamp (not a 1-line nowrap+ellipsis) so a long
	   route name gets a real second line before it's ever cut off, and
	   only the rare name that's STILL too long past two lines loses
	   anything at all. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
}
.am-tt-segment-time { font-weight: 800; color: var(--am-primary); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-tt-segment-time { color: var(--am-primary-light); }
}
:root[data-theme="dark"] .am-tt-segment-time { color: var(--am-primary-light); }

@media (max-width: 480px) {
	.am-tt-toggle-title { flex-wrap: wrap; }
	.am-tt-panel-body { padding: .85rem .9rem 1rem; }
}

/* v1.33.22 — Traffic Images lightbox. "do not allow the user to open the
   image and open in a new tab. Only create a popup with the image
   expanded according to the screen size so it works for both desktop
   and mobile." Replaces the old <a target="_blank"> (straight to the
   raw, time-limited presigned S3 link — see v1.33.21) with an in-page
   enlarged view. Sized with vw/vh so one set of rules fits both a phone
   and a desktop monitor, no separate mobile/desktop variants needed. */
.am-ti-photo-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	appearance: none;
	font: inherit;
	text-align: left;
}
.am-ti-photo-btn:focus-visible {
	outline: 2px solid var(--am-primary);
	outline-offset: 2px;
	border-radius: 8px;
}
.am-ti-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(10, 15, 25, .88);
	padding: 1.25rem;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	cursor: zoom-out;
}
.am-ti-lightbox.is-open { display: flex; }
.am-ti-lightbox-img {
	max-width: 95vw;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
	cursor: default;
	margin-bottom: 0; /* overrides the shared .am-ti-photo inline margin used in the grid */
}
.am-ti-lightbox-caption {
	color: #fff;
	margin: .85rem 0 0;
	text-align: center;
	font-size: .95em;
	max-width: 90vw;
	cursor: default;
}
.am-ti-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.am-ti-lightbox-close:hover,
.am-ti-lightbox-close:focus-visible {
	background: rgba(255, 255, 255, .24);
	outline: none;
}
body.am-ti-lightbox-open { overflow: hidden; } /* keep the page from scrolling behind the overlay, especially on mobile */
@media (max-width: 480px) {
	.am-ti-lightbox { padding: .75rem; }
	.am-ti-lightbox-close { top: .5rem; right: .5rem; width: 38px; height: 38px; font-size: 1.4rem; }
}

/* Search-limit sign-up popup (v1.33.54) — same fixed full-screen overlay
   pattern as the Traffic Images lightbox above, used for the "you're out of
   free searches" message so it interrupts the page as a real popup instead
   of an inline banner. See inc/class-am-search-limit.php's render_banner()
   (server-rendered pages) and assets/js/theme.js's showLimitModal() (Bus/
   EV Charging's AJAX-driven results). */
.am-limit-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(10, 15, 25, .72);
	padding: 1.25rem;
	align-items: center;
	justify-content: center;
}
.am-limit-modal-overlay.is-open { display: flex; }
.am-limit-modal {
	position: relative;
	max-width: 480px;
	width: 100%;
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	box-shadow: var(--am-shadow-md);
	padding: 2rem 1.75rem 1.75rem;
}
.am-limit-modal .am-notice { margin: 0; }
.am-limit-modal-close {
	position: absolute;
	top: .6rem;
	right: .75rem;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: var(--am-bg-soft);
	color: var(--am-text-muted);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.am-limit-modal-close:hover,
.am-limit-modal-close:focus-visible {
	background: var(--am-border);
	color: var(--am-text);
	outline: none;
}
body.am-limit-modal-open { overflow: hidden; }
@media (max-width: 480px) {
	.am-limit-modal { padding: 1.75rem 1.25rem 1.5rem; }
}

/* ==========================================================
   HDB Resale Price Checker page — tabbed layout (v1.33.23)
   Wei Yun: "looks messy and i wont want to stay at the page any
   longer." The 3 tools (search / overview / compare) used to render
   one after another on a single very long page. These rules turn
   them into CSS-only radio-button tabs — one tool visible at a time,
   inside its own card — with no JS dependency at all: the inputs are
   visually hidden but still keyboard/click operable via their <label>,
   and :checked + the general sibling combinator does the showing and
   hiding. See page-templates/template-hdb-resale-checker.php.
   ========================================================== */
.hdb-tabs-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hdb-tabs-bar {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	margin-bottom: 1.75rem;
	border-bottom: 1px solid var(--am-border);
}
.hdb-tabs-btn {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .8rem 1.15rem;
	border-radius: 10px 10px 0 0;
	font-weight: 700;
	font-size: .95rem;
	color: var(--am-text-muted);
	cursor: pointer;
	border: 1px solid transparent;
	border-bottom: none;
	transform: translateY(1px);
	transition: color .15s ease, background .15s ease;
}
.hdb-tabs-icon { font-size: 1.05rem; line-height: 1; }
.hdb-tabs-btn:hover { color: var(--am-text); background: var(--am-bg-soft); }
.hdb-tabs-input:focus-visible + .hdb-tabs-bar label,
.hdb-tabs-input:focus-visible ~ .hdb-tabs-bar label {
	outline: 2px solid var(--am-primary);
	outline-offset: 2px;
}

.hdb-tabs-panel {
	display: none;
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	box-shadow: var(--am-shadow-sm);
	padding: 1.75rem clamp(1.25rem, 4vw, 2.25rem) 2.25rem;
}
.hdb-tabs-panel-title { margin: 0 0 .35rem; }
.hdb-tabs-panel-desc { color: var(--am-text-muted); margin: 0 0 1.5rem; max-width: 640px; }

#hdb-tab-search:checked ~ .hdb-tabs-bar label[for="hdb-tab-search"],
#hdb-tab-overview:checked ~ .hdb-tabs-bar label[for="hdb-tab-overview"],
#hdb-tab-compare:checked ~ .hdb-tabs-bar label[for="hdb-tab-compare"] {
	color: var(--am-primary);
	background: var(--am-surface);
	border-color: var(--am-border);
	box-shadow: 0 -2px 0 var(--am-primary) inset;
}

#hdb-tab-search:checked ~ .hdb-tabs-panels #hdb-panel-search,
#hdb-tab-overview:checked ~ .hdb-tabs-panels #hdb-panel-overview,
#hdb-tab-compare:checked ~ .hdb-tabs-panels #hdb-panel-compare {
	display: block;
}

/* No-JS fallback: if a browser doesn't support :checked + sibling
   combinators at all (essentially none in practice), .hdb-tabs-panel's
   base "display: none" above would hide every tool with nothing to
   reveal them — so a plain <noscript> isn't the right guard here.
   Rather than risk that, everything CSS-needs is plain CSS3 supported
   by every current and legacy browser this site needs to support. */

@media (max-width: 640px) {
	.hdb-tabs-bar { border-bottom: none; gap: .4rem; }
	.hdb-tabs-btn {
		flex: 1 1 auto;
		justify-content: center;
		text-align: center;
		border-radius: 10px;
		border: 1px solid var(--am-border);
		transform: none;
	}
	#hdb-tab-search:checked ~ .hdb-tabs-bar label[for="hdb-tab-search"],
	#hdb-tab-overview:checked ~ .hdb-tabs-bar label[for="hdb-tab-overview"],
	#hdb-tab-compare:checked ~ .hdb-tabs-bar label[for="hdb-tab-compare"] {
		box-shadow: none;
		background: var(--am-primary);
		color: #fff;
		border-color: var(--am-primary);
	}
}

/* =========================================================
   HDB Carpark Information — glassmorphism cards (v1.33.33)
   ("Set the page to display the information using icons and
   words. Make it look modern with glassy look.") Same frosted-
   glass technique as Estimated Travel Times' "am-tt-*" block
   above (blurred colour-blob background + translucent/blurred
   panels) but under its own "am-hci-*" names so this page's
   layout can't accidentally pick up an am-tt-* rule tuned for a
   different page's specific structure (accordions, grid columns,
   etc. — this page has neither).
   ========================================================= */
.am-hci-page { position: relative; }
.am-hci-bg {
	position: absolute;
	inset: -1rem -1rem auto -1rem;
	height: 480px;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
.am-hci-bg::before,
.am-hci-bg::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: .3;
}
.am-hci-bg::before { width: 420px; height: 420px; background: var(--am-primary-light); top: -140px; left: -100px; }
.am-hci-bg::after { width: 380px; height: 380px; background: var(--am-gold); top: -100px; right: -120px; }
.am-hci-content { position: relative; z-index: 1; }

.am-hci-glass {
	background: rgba(255,255,255,.55);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	backdrop-filter: blur(16px) saturate(160%);
	border: 1px solid rgba(255,255,255,.45);
	box-shadow: var(--am-shadow-sm);
	border-radius: var(--am-radius);
	transition: transform .2s ease, box-shadow .2s ease;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-hci-glass { background: rgba(14,20,36,.6); border-color: rgba(255,255,255,.08); }
}
:root[data-theme="dark"] .am-hci-glass { background: rgba(14,20,36,.6); border-color: rgba(255,255,255,.08); }

.am-hci-search-wrap { max-width: 640px; margin: 0 auto 1.5rem; padding: 1.25rem 1.5rem; }
.am-hci-search-wrap form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.am-hci-search-wrap .am-field { flex: 1 1 260px; margin: 0; }

.am-hci-meta { text-align: center; color: var(--am-text-muted); font-size: .88em; margin: 0 auto .75rem; }
.am-hci-footer-note { text-align: center; color: var(--am-text-muted); font-size: .8em; margin-top: 2.5rem; line-height: 1.6; }
.am-hci-footer-note a { color: var(--am-primary); font-weight: 600; }

.am-hci-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1rem;
	margin: 1.5rem 0;
}

.am-hci-card { padding: 1.35rem 1.5rem; }
.am-hci-card:hover { transform: translateY(-3px); box-shadow: var(--am-shadow-md); }

.am-hci-card-title {
	margin: 0 0 .15rem;
	font-family: var(--am-font-display);
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--am-text);
	line-height: 1.3;
}
.am-hci-card-code {
	margin: 0 0 .9rem;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--am-text-muted);
	text-transform: uppercase;
}

.am-hci-facts { display: flex; flex-direction: column; gap: .55rem; }
.am-hci-fact { display: flex; align-items: center; gap: .55rem; }
.am-hci-fact-icon {
	flex-shrink: 0;
	width: 30px; height: 30px;
	border-radius: 50%;
	background: rgba(255,255,255,.6);
	display: flex; align-items: center; justify-content: center;
	font-size: 1rem;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-hci-fact-icon { background: rgba(255,255,255,.1); }
}
:root[data-theme="dark"] .am-hci-fact-icon { background: rgba(255,255,255,.1); }
.am-hci-fact-text { font-size: .88rem; color: var(--am-text); line-height: 1.35; }
.am-hci-fact-muted .am-hci-fact-text { color: var(--am-text-muted); }

@media (max-width: 640px) {
	.am-hci-grid { grid-template-columns: 1fr; }
	.am-hci-search-wrap form { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   Address & Map Search — glassmorphism (v1.33.34)
   ("Design something that is user-friendly, modern glassy
   look and easy to navigate.") Same frosted-glass technique
   as the "am-tt-*"/"am-hci-*" blocks above, under its own
   "am-ms-*" names.
   ========================================================= */
.am-ms-page { position: relative; }
.am-ms-bg {
	position: absolute;
	inset: -1rem -1rem auto -1rem;
	height: 480px;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
.am-ms-bg::before,
.am-ms-bg::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: .3;
}
.am-ms-bg::before { width: 420px; height: 420px; background: var(--am-primary-light); top: -140px; left: -100px; }
.am-ms-bg::after { width: 380px; height: 380px; background: var(--am-gold); top: -100px; right: -120px; }
.am-ms-content { position: relative; z-index: 1; }

.am-ms-glass {
	background: rgba(255,255,255,.55);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	backdrop-filter: blur(16px) saturate(160%);
	border: 1px solid rgba(255,255,255,.45);
	box-shadow: var(--am-shadow-sm);
	border-radius: var(--am-radius);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .am-ms-glass { background: rgba(14,20,36,.6); border-color: rgba(255,255,255,.08); }
}
:root[data-theme="dark"] .am-ms-glass { background: rgba(14,20,36,.6); border-color: rgba(255,255,255,.08); }

.am-ms-search-wrap { max-width: 640px; margin: 0 auto 1.5rem; padding: 1.25rem 1.5rem; }
.am-ms-search-wrap form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.am-ms-search-wrap .am-field { flex: 1 1 260px; margin: 0; }

.am-ms-meta { text-align: center; color: var(--am-text-muted); font-size: .88em; margin: 0 auto .75rem; }
.am-ms-footer-note { text-align: center; color: var(--am-text-muted); font-size: .8em; margin-top: 2.5rem; line-height: 1.6; }

.am-ms-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 1rem;
	max-width: 1100px;
	margin: 0 auto 1rem;
	align-items: start;
}
@media (max-width: 820px) {
	.am-ms-layout { grid-template-columns: 1fr; }
}

.am-ms-filters { padding: 1.25rem 1.4rem; }
.am-ms-filters-title {
	margin: 0 0 .75rem;
	font-family: var(--am-font-display);
	font-weight: 800;
	font-size: 1rem;
	color: var(--am-text);
}
.am-ms-filters form { display: flex; flex-direction: column; gap: .6rem; }
.am-ms-check {
	display: flex;
	align-items: center;
	gap: .5rem;
	font-size: .9rem;
	color: var(--am-text);
	cursor: pointer;
}
.am-ms-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--am-primary); flex-shrink: 0; }
.am-ms-check-icon { font-size: 1rem; }
.am-ms-filter-submit { width: 100%; text-align: center; margin-top: .4rem; }

.am-ms-map-wrap { padding: .6rem; overflow: hidden; }
#am-ms-map { height: 480px; width: 100%; border-radius: calc(var(--am-radius) - 6px); }
@media (max-width: 820px) {
	#am-ms-map { height: 360px; }
}

.am-ms-pin {
	width: 28px; height: 28px;
	border-radius: 50% 50% 50% 0;
	background: var(--am-ms-pin-color, var(--am-primary));
	transform: rotate(-45deg);
	display: flex; align-items: center; justify-content: center;
	box-shadow: var(--am-shadow-sm);
	border: 2px solid #fff;
	font-size: .95rem;
}
.am-ms-pin-center {
	width: 34px; height: 34px;
	background: var(--am-accent);
	font-size: 1.2rem;
}
/* The icon glyph itself must sit upright — only the pin's teardrop shape rotates. */
.am-ms-pin > * { transform: rotate(45deg); }

.am-ms-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: .85rem;
	max-width: 1100px;
	margin: 1.5rem auto 0;
}
.am-ms-loc-card {
	padding: 1rem 1.15rem;
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	border-left: 3px solid var(--am-ms-accent, var(--am-primary));
}
.am-ms-loc-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; margin-top: .1rem; }
.am-ms-loc-name { margin: 0 0 .2rem; font-family: var(--am-font-display); font-weight: 700; font-size: .95rem; color: var(--am-text); line-height: 1.3; }
.am-ms-loc-meta { margin: 0; font-size: .8rem; color: var(--am-text-muted); }
.am-ms-loc-address { margin: .2rem 0 0; font-size: .78rem; color: var(--am-text-muted); }

@media (max-width: 640px) {
	.am-ms-search-wrap form { flex-direction: column; align-items: stretch; }
	.am-ms-grid { grid-template-columns: 1fr; }
}
