:root {
  --bg: #f4f8ff;
  --surface: rgba(255, 255, 255, 0.78);
  --card: #ffffff;
  --ink: #10182f;
  --muted: #63708d;
  --line: rgba(16, 24, 47, 0.1);
  --blue: #2f6bff;
  --cyan: #33d6ff;
  --mint: #45e1b6;
  --amber: #ffd166;
  --coral: #ff6b6b;
  --violet: #7c5cff;
  --shadow: 0 26px 70px rgba(18, 34, 75, 0.14);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Noto Sans TC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(51, 214, 255, 0.2), transparent 28%),
    radial-gradient(circle at 90% 4%, rgba(124, 92, 255, 0.2), transparent 26%),
    linear-gradient(180deg, #f7fbff 0%, #edf4ff 52%, #f8fbff 100%);
}

button,
input,
select {
  min-width: 0;
  font: inherit;
}

a {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.45;
}

.ambient-a {
  top: 120px;
  left: -160px;
  background: var(--cyan);
}

.ambient-b {
  right: -180px;
  bottom: 20%;
  background: var(--violet);
}

.page-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 20px auto 56px;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 22px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--cyan), var(--mint));
  color: white;
  font-size: 1.35rem;
  box-shadow: 0 16px 26px rgba(47, 107, 255, 0.28);
}

.brand strong,
h1,
h2,
.metric-card strong,
.port-name,
.port-total,
.planner-result strong {
  font-family: "Space Grotesk", "Noto Sans TC", sans-serif;
}

.brand strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.brand small,
.metric-card span,
p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.main-nav {
  display: flex;
  gap: 18px;
  min-width: 0;
}

.main-nav a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--blue);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.refresh-cluster {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.countdown-ring {
  --progress: 100%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--progress), rgba(16, 24, 47, 0.1) 0);
}

.countdown-ring span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.live-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(69, 225, 182, 0.14);
  color: #087c62;
  font-weight: 800;
}

.live-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 7px rgba(69, 225, 182, 0.18);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.port-card:hover,
.camera-card:hover,
.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px rgba(18, 34, 75, 0.16);
}

.button-primary {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
}

.button-light {
  background: white;
  color: var(--ink);
}

.button-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.dark-button {
  background: rgba(16, 24, 47, 0.06);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 26px;
  min-width: 0;
}

main > * {
  min-width: 0;
  max-width: 100%;
}

.mobile-copy,
.mobile-overview,
.mobile-bottom-nav,
.port-card-details {
  display: none;
}

.camera-content-block {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.camera-swipe-hint {
  display: none;
}

.camera-group-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(245, 249, 255, 0.92);
  box-shadow: 0 12px 30px rgba(35, 67, 112, 0.12);
}

.camera-group-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #53627a;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.camera-group-nav button span {
  color: #8da0bd;
  font-size: 0.7rem;
}

.camera-group-nav button.is-active {
  background: linear-gradient(135deg, #315ed0, #4e7ef1);
  color: #fff;
  box-shadow: 0 8px 18px rgba(49, 94, 208, 0.2);
}

.camera-group-nav button.is-active span {
  color: rgba(255, 255, 255, 0.72);
}

.camera-content-block[id] {
  scroll-margin-top: 88px;
}

.camera-rail-switcher {
  display: none;
}

.panel,
.metric-card,
.port-card,
.camera-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 28px;
  padding: 58px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 78% 18%, rgba(51, 214, 255, 0.28), transparent 24%),
    radial-gradient(circle at 88% 72%, rgba(69, 225, 182, 0.18), transparent 24%),
    linear-gradient(135deg, #10182f 0%, #183a7a 55%, #2f6bff 100%);
}

.hero-copy {
  display: grid;
  gap: 20px;
  align-content: center;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--blue);
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  color: white;
  font-size: clamp(2.65rem, 6vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-copy p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.12rem;
  line-height: 1.85;
}

#heroInsight {
  color: #ffffff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-card {
  display: grid;
  gap: 24px;
  align-content: space-between;
  min-width: 0;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.hero-card strong {
  display: block;
  color: white;
  font-size: 2.2rem;
}

.metric-label {
  margin: 0 0 8px;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pulse-ring {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 214, 255, 0.25), rgba(255, 255, 255, 0.06) 62%);
}

.pulse-ring span {
  position: absolute;
  width: 74%;
  height: 74%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  animation: pulse 2.8s ease-in-out infinite;
}

.pulse-ring b {
  max-width: 150px;
  text-align: center;
  font-size: 1.2rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.metric-card strong {
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 390px;
  gap: 22px;
}

.port-panel,
.detail-panel,
.chart-panel,
.planner,
.insight-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head h2,
.planner-copy h2,
.insight-panel h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.section-head p,
.planner-copy p,
.insight-panel p {
  margin: 0;
  line-height: 1.7;
}

.pressure-method-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: -6px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 107, 255, 0.16);
  border-radius: 16px;
  background: rgba(47, 107, 255, 0.06);
}

.pressure-method-note > span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
}

.pressure-method-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.pressure-method-note b {
  color: var(--ink);
}

.filters {
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.06);
}

.filter-chip {
  border: 0;
  padding: 10px 15px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--ink);
  color: white;
}

.mobile-port-jump {
  display: none;
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.port-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
  width: 100%;
  padding: 18px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.port-card > div:not(.port-numbers):not(.bar-group) {
  min-width: 0;
}

.port-card.is-active {
  outline: 2px solid var(--blue);
}

.load-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--mint);
}

.port-card.load-medium .load-dot {
  background: var(--amber);
}

.port-card.load-high .load-dot {
  background: var(--coral);
}

.port-card.load-closed .load-dot {
  background: #9aa6bd;
}

.port-name {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.port-card-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.port-live-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(35, 163, 107, 0.11);
  color: #14724b;
  font-size: 0.7rem;
  font-weight: 900;
}

.port-card.load-medium .port-live-badge {
  background: rgba(217, 154, 0, 0.12);
  color: #8b6200;
}

.port-card.load-high .port-live-badge {
  background: rgba(213, 55, 55, 0.1);
  color: #a52c2c;
}

.port-card.load-closed .port-live-badge {
  background: rgba(149, 163, 184, 0.15);
  color: #566579;
}

.port-summary {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.port-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.port-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.06);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.port-tag-flow {
  background: rgba(47, 107, 255, 0.08);
  color: #31527d;
}

.port-tag-flow::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: #5276a5;
  box-shadow: 0 0 0 3px rgba(82, 118, 165, 0.16);
}

.port-tag-flow.flow-low {
  background: rgba(47, 107, 255, 0.08);
  color: #31527d;
}

.port-tag-flow.flow-medium {
  background: rgba(47, 107, 255, 0.08);
  color: #31527d;
}

.port-tag-flow.flow-medium::before {
  background: #5276a5;
  box-shadow: 0 0 0 3px rgba(82, 118, 165, 0.16);
}

.port-tag-flow.flow-high {
  background: rgba(47, 107, 255, 0.08);
  color: #31527d;
}

.port-tag-flow.flow-high::before {
  background: #5276a5;
  box-shadow: 0 0 0 3px rgba(82, 118, 165, 0.16);
}

.port-tag-flow.flow-severe {
  background: rgba(47, 107, 255, 0.08);
  color: #31527d;
}

.port-tag-flow.flow-severe::before {
  background: #5276a5;
  box-shadow: 0 0 0 3px rgba(82, 118, 165, 0.16);
}

.port-tag-status {
  background: rgba(28, 126, 214, 0.1);
  color: #114d86;
}

.port-tag-counted {
  border: 1px solid rgba(47, 107, 255, 0.22);
  background: rgba(47, 107, 255, 0.08);
  color: #1d4fbd;
}

.port-card.load-high .port-tag-status {
  background: rgba(232, 100, 78, 0.14);
  color: #9c2f1c;
}

.port-card.load-closed .port-tag-status {
  background: rgba(149, 163, 184, 0.16);
  color: #516174;
}

.port-numbers {
  grid-column: 2;
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: rgba(16, 24, 47, 0.04);
  text-align: left;
}

.port-total {
  display: block;
  font-size: 1.02rem;
  font-weight: 900;
}

.port-direction {
  display: block;
  margin-top: 4px;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.45;
}

.bar-group {
  grid-column: 2;
  display: grid;
  gap: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.bar-label,
.bar-value,
.bar-caption {
  color: var(--muted);
}

.bar-label,
.bar-value {
  font-size: 0.76rem;
  font-weight: 800;
}

.bar-caption {
  font-size: 0.74rem;
  line-height: 1.45;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.08);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #23a36b;
}

.bar-fill.flow-low {
  background: #23a36b;
}

.bar-fill.flow-medium {
  background: #d99a00;
}

.bar-fill.flow-high {
  background: #ee7526;
}

.bar-fill.flow-severe {
  background: #d53737;
}

.port-card.load-closed .bar-fill {
  background: linear-gradient(90deg, #c0c7d5, #95a3b8);
}

.detail-panel {
  position: sticky;
  top: 112px;
  align-self: start;
}

.detail-panel h2 {
  margin: 8px 0 12px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.mini-stats div,
.route-note,
.planner-result,
.idea-grid article {
  padding: 16px;
  border-radius: 20px;
  background: rgba(16, 24, 47, 0.05);
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.route-note h3 {
  margin: 0 0 10px;
}

.route-note p {
  margin: 0;
  line-height: 1.75;
}

.data-source {
  color: var(--muted);
  font-size: 0.9rem;
}

.trend-scope-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(47, 107, 255, 0.14);
  border-radius: 8px;
  background: rgba(47, 107, 255, 0.055);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.trend-scope-note span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.12);
  color: #1d4fbd;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.trend-scope-note p {
  margin: 0;
  font-weight: 700;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  min-height: 300px;
  padding-top: 20px;
}

.trend-bar {
  display: grid;
  gap: 10px;
  align-content: end;
  height: 270px;
}

.trend-bar__fill {
  height: max(8px, calc(var(--trend-ratio, 0) * 230px));
  min-height: 18px;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 26px rgba(47, 107, 255, 0.22);
}

.trend-value-compact {
  display: none;
}

.trend-bar strong,
.trend-bar span {
  text-align: center;
}

.trend-bar strong {
  font-size: 0.95rem;
}

.trend-bar span {
  color: var(--muted);
  font-size: 0.82rem;
}

.planner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.28), transparent 28%),
    rgba(255, 255, 255, 0.74);
}

.planner-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.planner-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.planner-form select {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: white;
}

.planner-form .button {
  width: 100%;
}

.location-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.location-tools .button {
  min-width: 170px;
}

.location-tools span {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.planner-result {
  grid-column: 1 / -1;
  line-height: 1.8;
}

.planner-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(47, 107, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.planner-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.planner-summary-card strong {
  display: block;
  font-size: 1.25rem;
}

.planner-summary-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.planner-score {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 78%, rgba(47, 107, 255, 0.14) 0);
  color: var(--ink);
}

.planner-score span {
  font-size: 1.45rem;
  font-weight: 900;
}

.planner-score small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.planner-metrics,
.transport-options,
.planner-notes {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.planner-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-metrics span,
.transport-options > * {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.planner-metrics b,
.transport-options b,
.transport-options strong {
  display: block;
  color: var(--ink);
}

.planner-metrics small,
.transport-options small,
.planner-notes span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.transport-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.transport-options > *.is-selected {
  border: 1px solid rgba(47, 107, 255, 0.28);
  background: rgba(47, 107, 255, 0.08);
}

.transport-options strong {
  margin-top: 3px;
  font-size: 0.95rem;
}

.boarding-guide {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(16, 24, 47, 0.1);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.boarding-guide summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.boarding-guide ol {
  margin: 8px 0 10px;
  padding-left: 20px;
}

.boarding-guide li + li {
  margin-top: 4px;
}

.boarding-guide a {
  display: inline-flex;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.boarding-guide a:hover {
  text-decoration: underline;
}

.planner-notes {
  padding: 12px;
  border-radius: 8px;
  background: rgba(16, 24, 47, 0.04);
}

.rank-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.rank-list b {
  color: var(--ink);
}

.rank-list span {
  color: var(--muted);
}

.media-section {
  display: grid;
  gap: 18px;
}

.media-subhead {
  display: grid;
  gap: 4px;
}

.media-subhead strong {
  color: var(--ink);
  font-size: 1rem;
}

.media-subhead span {
  color: var(--muted);
  line-height: 1.6;
}

.official-camera-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 14px 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(47, 107, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(47, 107, 255, 0.11), rgba(69, 225, 182, 0.1));
}

.official-camera-callout > span,
.official-camera-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
}

.official-camera-callout strong {
  display: block;
  margin-bottom: 3px;
}

.official-camera-callout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.snapshot-rail {
  position: relative;
  isolation: isolate;
}

.snapshot-rail::before,
.snapshot-rail::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 52px;
  pointer-events: none;
  content: "";
}

.snapshot-rail::before {
  left: 0;
  background: linear-gradient(90deg, rgba(220, 239, 255, 0.92), transparent);
}

.snapshot-rail::after {
  right: 0;
  background: linear-gradient(270deg, rgba(220, 239, 255, 0.92), transparent);
}

#snapshotGrid {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px 2px 12px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

#snapshotGrid::-webkit-scrollbar {
  display: none;
}

#snapshotGrid .snapshot-card {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  scroll-snap-align: start;
  border-color: rgba(47, 107, 255, 0.14);
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.08);
}

#snapshotGrid .snapshot-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 24px rgba(47, 107, 255, 0.13);
}

.snapshot-scroll-button {
  position: absolute;
  z-index: 3;
  top: 41%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(47, 107, 255, 0.14);
  border-radius: 50%;
  background: rgba(248, 252, 255, 0.94);
  box-shadow: 0 6px 16px rgba(47, 107, 255, 0.12);
  color: #3f6da8;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.snapshot-scroll-button[hidden] {
  display: none;
}

.snapshot-scroll-button:hover {
  transform: scale(1.08);
  background: rgba(232, 242, 255, 0.98);
  color: #245b9d;
}

.snapshot-scroll-button.is-previous {
  left: -18px;
}

.snapshot-scroll-button.is-next {
  right: -18px;
}

@media (max-width: 1080px) {
  #snapshotGrid .snapshot-card {
    flex: 0 0 min(280px, calc(100vw - 64px));
  }
}

.macau-section {
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(69, 225, 182, 0.16), transparent 28%),
    rgba(255, 255, 255, 0.74);
}

.macau-camera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.macau-camera-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.macau-camera-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px rgba(18, 34, 75, 0.16);
}

.macau-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
}

.macau-video-frame::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(16, 24, 47, 0.08), transparent 45%, rgba(16, 24, 47, 0.22));
  content: "";
}

.macau-video-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: var(--ink);
}

.macau-video-frame span {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.72);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.macau-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(16, 24, 47, 0.2);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.macau-play-button:hover:not(:disabled) {
  background: var(--mint);
}

.macau-play-button::before {
  margin-right: 7px;
  content: "▶";
  font-size: 0.72rem;
}

.macau-play-button:disabled::before {
  display: none;
}

.macau-play-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.macau-camera-card > div:last-child {
  padding: 18px;
}

.macau-camera-card h3 {
  margin: 0 0 8px;
}

.macau-camera-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.camera-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.camera-frame {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  background: #d9e6f8;
}

.camera-frame img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  display: block;
}

.video-frame {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 230px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(16, 24, 47, 0.9), rgba(47, 107, 255, 0.78)),
    #10182f;
  color: white;
}

.video-frame img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
}

.video-frame.has-snapshot {
  background: #10182f;
}

.video-frame.has-snapshot img {
  display: block;
}

.video-frame.is-status-only {
  min-height: 190px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.96)),
    #ffffff;
  color: var(--ink);
}

.video-frame.is-status-only strong {
  color: var(--ink);
  font-size: 1.55rem;
}

.video-frame.is-status-only p {
  color: var(--muted);
}

.video-frame.is-status-only .snapshot-badge {
  background: rgba(47, 107, 255, 0.1);
  color: #1d4db8;
}

.camera-frame span {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.72);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.video-frame strong {
  position: relative;
  z-index: 1;
  max-width: 220px;
  color: white;
  font-size: 1.8rem;
  text-align: center;
}

.video-frame p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
  text-align: center;
}

.video-frame.has-snapshot strong,
.video-frame.has-snapshot p {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(16, 24, 47, 0.72);
}

.camera-card div:last-child {
  padding: 18px;
}

.camera-card h3 {
  margin: 0 0 8px;
}

.camera-card p {
  margin: 0;
  line-height: 1.65;
}

.evidence-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.evidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(47, 107, 255, 0.1);
  color: #1d4db8;
  font-size: 0.76rem;
  font-weight: 900;
}

.evidence-verdict {
  color: var(--ink);
  font-weight: 800;
}

.evidence-meter {
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.08);
}

.evidence-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--cyan), var(--blue));
}

.evidence-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.evidence-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
}

.evidence-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.video-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.official-camera-chip {
  margin-top: 14px;
  background: rgba(47, 107, 255, 0.12);
  color: var(--blue);
}

.official-camera-chip.is-unavailable {
  background: rgba(16, 24, 47, 0.06);
  color: var(--muted);
}

.camera-access-note {
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55 !important;
}

.video-card .video-link {
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  text-decoration: none;
}

.video-card .video-link:hover {
  background: #2058db;
  text-decoration: none;
}

.video-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border-color: rgba(47, 107, 255, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(18, 34, 75, 0.09);
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(47, 107, 255, 0.14);
}

.video-card .video-frame {
  min-height: 0;
  aspect-ratio: 16 / 9;
  padding: 16px;
}

.video-card .video-frame img {
  min-height: 0;
}

.video-card .video-frame.is-status-only {
  min-height: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(51, 214, 255, 0.22), transparent 30%),
    linear-gradient(145deg, #12244a, #245eae);
  color: white;
}

.video-card .video-frame.is-status-only strong,
.video-card .video-frame.is-status-only p {
  color: white;
}

.video-card .video-frame.is-status-only .snapshot-badge {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.camera-card__body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.camera-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.camera-card__heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.camera-access-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(16, 24, 47, 0.06);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.has-official-camera .camera-access-state {
  background: rgba(69, 225, 182, 0.16);
  color: #087c62;
}

.video-card .camera-access-note {
  min-height: 2.8em;
  margin: 0 !important;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55 !important;
}

.video-card .video-link {
  margin-top: 2px;
}

/* Official camera access list */
#cameraGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.video-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  min-height: 142px;
  overflow: hidden;
  border: 1px solid rgba(47, 107, 255, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(18, 34, 75, 0.07);
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(18, 34, 75, 0.11);
}

.video-card .video-frame,
.video-card .video-frame.is-status-only {
  min-height: 142px;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.video-card .video-frame.has-snapshot strong,
.video-card .video-frame.has-snapshot p {
  display: none;
}

.camera-placeholder-icon {
  display: none;
}

.video-card .camera-frame span {
  top: 10px;
  left: 10px;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.video-card .video-frame.is-status-only {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    radial-gradient(circle at 70% 22%, rgba(51, 214, 255, 0.18), transparent 34%),
    #edf5ff;
}

.video-card .video-frame.is-status-only strong {
  display: none;
}

.video-card .video-frame.is-status-only p {
  display: none;
}

.video-card .video-frame.is-status-only .camera-placeholder-icon {
  display: block;
  width: 42px;
  color: #6fa5ef;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.video-card .video-frame.is-status-only .snapshot-badge {
  background: rgba(47, 107, 255, 0.08);
  color: #3268ad;
}

.video-card .camera-card__body {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
}

.video-card .camera-card__heading {
  align-items: flex-start;
}

.video-card .camera-card__heading h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.video-card .camera-access-state {
  padding: 4px 6px;
  background: rgba(16, 24, 47, 0.05);
  color: var(--muted);
  font-size: 0.63rem;
}

.video-card.has-official-camera .camera-access-state {
  background: rgba(69, 225, 182, 0.14);
  color: #087c62;
}

.video-card .camera-access-note {
  min-height: 0;
  margin: 0 !important;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45 !important;
}

.video-card .video-link {
  display: flex !important;
  width: 100%;
  min-height: 38px;
  align-self: end;
  align-items: center !important;
  justify-content: center !important;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(47, 107, 255, 0.2);
  border-radius: 10px;
  background: white;
  color: #245eb7;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.video-card .video-link:hover {
  background: #edf4ff;
  text-decoration: none;
}

@media (max-width: 720px) {
  #cameraGrid {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 124px;
  }

  .video-card .video-frame,
  .video-card .video-frame.is-status-only {
    min-height: 124px;
  }

  .video-card .camera-card__body {
    padding: 11px;
  }
}

/* Mobile task dashboard: authoritative overrides */
@media (max-width: 720px) {
  :root {
    --mobile-gutter: 12px;
    --mobile-nav-height: 72px;
  }

  html {
    scroll-padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 14px);
    background: #edf4fc;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    padding: 0 var(--mobile-gutter);
  }

  .site-header {
    top: 0;
    z-index: 20;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding: 10px var(--mobile-gutter);
    border: 0;
    border-bottom: 1px solid rgba(123, 151, 190, 0.18);
    border-radius: 0 0 18px 18px;
    background: rgba(246, 250, 255, 0.94);
    box-shadow: 0 8px 24px rgba(34, 67, 112, 0.08);
    backdrop-filter: blur(18px);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .brand small,
  .main-nav,
  .header-actions .live-pill,
  .countdown-ring {
    display: none;
  }

  .header-actions,
  .refresh-cluster {
    display: flex;
    grid-column: auto;
    width: auto;
    margin: 0;
  }

  .refresh-cluster .button {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(77, 111, 166, 0.16);
    border-radius: 13px;
    background: white;
    font-size: 0;
    box-shadow: 0 6px 16px rgba(38, 71, 120, 0.08);
  }

  #refreshButton::before {
    content: "↻";
    color: #315ed0;
    font-size: 1.35rem;
    line-height: 1;
  }

  main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
  }

  [data-mobile-view].is-mobile-hidden {
    display: none !important;
  }

  .mobile-copy,
  .mobile-overview,
  .mobile-bottom-nav {
    display: flex;
  }

  .desktop-copy {
    display: none !important;
  }

  .mobile-overview {
    order: -2;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
    background:
      radial-gradient(circle at 92% 0%, rgba(101, 185, 255, 0.18), transparent 35%),
      linear-gradient(145deg, #ffffff, #f4f8ff);
    box-shadow: 0 14px 34px rgba(36, 70, 120, 0.1);
  }

  .mobile-overview__head,
  .mobile-overview__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-overview__head h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
  }

  .mobile-overview__source {
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(16, 171, 129, 0.1);
    color: #08775d;
    font-size: 0.72rem;
    font-weight: 900;
  }

  .mobile-status-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-status-counts > span {
    display: grid;
    min-width: 0;
    padding: 11px 5px 9px;
    border: 1px solid rgba(98, 128, 174, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    text-align: center;
  }

  .mobile-status-counts b {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.35rem;
    line-height: 1;
  }

  .mobile-status-counts small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
  }

  .mobile-status-counts [data-status-count="smooth"] b { color: #07886a; }
  .mobile-status-counts [data-status-count="normal"] b { color: #315ed0; }
  .mobile-status-counts [data-status-count="busy"] b { color: #d88100; }
  .mobile-status-counts [data-status-count="closed"] b { color: #7d8798; }

  .mobile-overview__footer {
    color: #637087;
    font-size: 0.76rem;
  }

  .mobile-overview__footer time {
    flex: 0 0 auto;
    color: #233f78;
    font-weight: 900;
  }

  .hero {
    order: -1;
    display: block;
    padding: 20px 18px;
    border-radius: 20px;
    background:
      radial-gradient(circle at 95% 10%, rgba(93, 210, 255, 0.24), transparent 35%),
      linear-gradient(135deg, #12244a, #245bc8);
    box-shadow: 0 14px 30px rgba(23, 61, 132, 0.18);
  }

  .hero-copy {
    gap: 10px;
  }

  .hero h1 {
    max-width: 300px;
    margin: 0;
    font-size: clamp(1.6rem, 7.5vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
  }

  .hero-copy > .mobile-copy {
    max-width: 31rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
  }

  .hero-actions .button {
    min-width: 0;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .hero-card {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .metric-card {
    min-height: 118px;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(36, 70, 120, 0.07);
  }

  .metric-card strong {
    font-size: 1.25rem;
    line-height: 1.15;
  }

  .metric-card span {
    font-size: 0.72rem;
    line-height: 1.42;
  }

  .dashboard-layout {
    display: block;
  }

  .detail-panel {
    display: none;
  }

  .port-panel,
  .chart-panel,
  .planner,
  .macau-section,
  .insight-panel {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .section-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-head h2,
  .planner-copy h2,
  .insight-panel h2 {
    font-size: 1.45rem;
  }

  .section-head p,
  .planner-copy p,
  .insight-panel p {
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .pressure-method-note {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 12px;
    border-radius: 14px;
  }

  .pressure-method-note p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 0.74rem;
    line-height: 1.5;
  }

  .port-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .port-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 14px;
    border: 1px solid rgba(95, 124, 171, 0.14);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(35, 67, 112, 0.07);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
  }

  .port-card.is-active,
  .port-card.is-expanded {
    outline: none;
    border-color: rgba(49, 94, 208, 0.35);
    box-shadow: 0 10px 26px rgba(40, 76, 145, 0.12);
  }

  .port-card:focus-visible {
    outline: 3px solid rgba(49, 94, 208, 0.2);
    outline-offset: 2px;
  }

  .load-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
  }

  .port-name {
    margin-bottom: 4px;
    font-size: 1rem;
  }

  .port-summary {
    margin: 0;
    font-size: 0.79rem;
    line-height: 1.5;
  }

  .port-tags,
  .bar-group {
    display: none;
  }

  .port-numbers {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    max-width: 88px;
    padding: 8px;
    border-radius: 11px;
    background: #f1f6ff;
    text-align: right;
  }

  .port-total {
    font-size: 0.78rem;
  }

  .port-direction {
    display: none;
  }

  .port-card::after {
    content: "⌄";
    grid-column: 3;
    justify-self: end;
    align-self: end;
    color: #70809b;
    font-size: 1rem;
    transition: transform 160ms ease;
  }

  .port-card.is-expanded::after {
    transform: rotate(180deg);
  }

  .port-card.is-expanded .bar-group {
    display: grid;
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #edf1f7;
  }

  .port-card-details {
    grid-column: 1 / -1;
  }

  .port-card.is-expanded .port-card-details {
    display: grid;
    gap: 12px;
    padding-top: 2px;
  }

  .port-card-details__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .port-card-details__grid > span {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    background: #f5f8fd;
  }

  .port-card-details__grid small {
    color: var(--muted);
    font-size: 0.68rem;
  }

  .port-card-details__grid b {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .port-history-note {
    margin: 0;
    padding: 10px 11px;
    border-left: 3px solid #8ca8df;
    border-radius: 0 10px 10px 0;
    background: #f5f8fd;
    color: #5e6b81;
    font-size: 0.73rem;
    line-height: 1.5;
  }

  .port-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .port-card-actions a,
  .port-card-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
  }

  .port-camera-action {
    background: #eef3ff;
    color: #294fb7;
  }

  .port-route-action {
    background: #315ed0;
    color: #fff;
  }

  .planner-form > .button {
    position: static;
    min-height: 50px;
  }

  .media-section {
    gap: 14px;
  }

  .snapshot-rail,
  #snapshotGrid,
  #cameraGrid,
  .macau-camera-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #snapshotGrid,
  #cameraGrid,
  .macau-camera-grid {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  #snapshotGrid::-webkit-scrollbar,
  #cameraGrid::-webkit-scrollbar,
  .macau-camera-grid::-webkit-scrollbar {
    display: none;
  }

  #snapshotGrid .snapshot-card,
  #cameraGrid .camera-card,
  .macau-camera-grid .macau-camera-card {
    flex: 0 0 min(84vw, 320px);
    scroll-snap-align: start;
  }

  .snapshot-rail::before,
  .snapshot-rail::after,
  .snapshot-scroll-button {
    display: none !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    align-items: stretch;
    justify-content: space-between;
    min-height: var(--mobile-nav-height);
    padding: 7px;
    border: 1px solid rgba(111, 139, 183, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 38px rgba(26, 55, 99, 0.18);
    backdrop-filter: blur(20px);
  }

  .mobile-bottom-nav button {
    display: grid;
    flex: 1 1 0;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 54px;
    padding: 5px 4px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #77849a;
    cursor: pointer;
  }

  .mobile-bottom-nav button span {
    font-size: 1.05rem;
    line-height: 1;
  }

  .mobile-bottom-nav button b {
    font-size: 0.7rem;
  }

  .mobile-bottom-nav button.is-active {
    background: #edf3ff;
    color: #2f59c9;
  }
}

@media (max-width: 380px) {
  :root {
    --mobile-gutter: 8px;
  }

  .mobile-overview,
  .hero,
  .port-panel,
  .chart-panel,
  .planner,
  .macau-section {
    border-radius: 17px;
  }

  .mobile-status-counts {
    gap: 5px;
  }

  .mobile-status-counts > span {
    padding-inline: 3px;
  }

  .mobile-status-counts b {
    font-size: 1.15rem;
  }

  .hero-actions,
  .port-card-actions {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 102px;
  }

  .port-card {
    padding: 12px;
  }
}

.video-link:hover {
  text-decoration: underline;
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.idea-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.error-state {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  .site-header,
  .hero,
  .dashboard-layout,
  .planner {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .header-actions {
    justify-content: space-between;
  }

  .site-header {
    align-items: stretch;
    gap: 14px;
  }

  .header-actions,
  .refresh-cluster {
    flex-wrap: wrap;
  }

  .metrics-grid,
  .camera-grid,
  .macau-camera-grid,
  .idea-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .page-shell {
    width: min(100vw - 20px, 100%);
    margin-top: 10px;
  }

  .site-header {
    top: 8px;
    grid-template-columns: 1fr;
    padding: 12px;
    border-radius: 18px;
  }

  .main-nav {
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .header-actions,
  .refresh-cluster {
    width: 100%;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .header-actions .live-pill {
    width: fit-content;
  }

  .refresh-cluster {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .refresh-cluster .button {
    flex: 1;
    min-width: 150px;
  }

  .hero,
  .port-panel,
  .detail-panel,
  .chart-panel,
  .planner,
  .insight-panel {
    padding: 22px;
  }

  .hero {
    gap: 20px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 2.25rem;
    line-height: 1.06;
    letter-spacing: 0;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 1rem;
    line-height: 1.7;
  }

  .hero-card {
    padding: 20px;
    border-radius: 18px;
  }

  .pulse-ring {
    min-height: 150px;
  }

  .metrics-grid,
  .planner-form,
  .planner-metrics,
  .transport-options {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .port-grid,
  .camera-grid,
  .macau-camera-grid,
  .idea-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 132px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 1.5rem;
  }

  .metric-card span {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .pressure-method-note {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }

  .pressure-method-note > span {
    width: fit-content;
  }

  .snapshot-rail::before,
  .snapshot-rail::after,
  .snapshot-scroll-button {
    display: none;
  }

  #snapshotGrid {
    margin-inline: -2px;
  }

  #snapshotGrid .snapshot-card {
    flex-basis: min(280px, calc(100vw - 64px));
  }

  .planner-summary-card {
    grid-template-columns: 1fr;
  }

  .planner-score {
    width: 78px;
    height: 78px;
  }

  .filters {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
  }

  .filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }

  .trend-chart {
    overflow: visible;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    min-height: 220px;
    padding: 14px 0 8px;
  }

  .trend-bar {
    height: 196px;
    gap: 6px;
    min-width: 0;
  }

  .trend-bar__fill {
    height: max(8px, calc(var(--trend-ratio, 0) * 150px));
    min-height: 8px;
    border-radius: 10px 10px 5px 5px;
    box-shadow: 0 7px 16px rgba(47, 107, 255, 0.16);
  }

  .trend-bar strong,
  .trend-bar > span {
    min-width: 0;
    white-space: nowrap;
  }

  .trend-value-full {
    display: none;
  }

  .trend-value-compact {
    display: inline;
  }

  .trend-bar strong {
    font-size: 0.72rem;
  }

  .trend-bar > span {
    font-size: 0.7rem;
  }
}

@media (max-width: 520px) {
  main {
    gap: 18px;
    margin-top: 18px;
  }

  .page-shell {
    width: min(100vw - 12px, 100%);
    margin-bottom: 28px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 1rem;
  }

  .brand small {
    font-size: 0.78rem;
  }

  .ambient {
    display: none;
  }

  .main-nav {
    justify-content: space-between;
  }

  .main-nav a {
    font-size: 0.92rem;
  }

  .header-actions {
    gap: 8px;
  }

  .countdown-ring {
    width: 44px;
    height: 44px;
  }

  .countdown-ring span {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }

  .live-pill {
    width: auto;
    justify-content: center;
    border-radius: 8px;
  }

  .button {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
  }

  .hero,
  .port-panel,
  .detail-panel,
  .chart-panel,
  .planner,
  .macau-section,
  .insight-panel {
    padding: 18px;
  }

  .section-head h2,
  .planner-copy h2,
  .insight-panel h2 {
    font-size: 1.72rem;
    letter-spacing: 0;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.12;
    letter-spacing: 0;
  }

  .hero-actions .button {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.9rem;
  }

  .trend-chart {
    grid-template-columns: repeat(7, 96px);
    padding-bottom: 8px;
  }

  .metrics-grid {
    gap: 12px;
  }

  .metric-card {
    min-height: auto;
    padding: 18px;
    border-radius: 14px;
  }

  .port-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
  }

  .port-numbers {
    grid-column: 1 / -1;
    text-align: left;
    min-width: 0;
  }

  .bar-group {
    grid-column: 1 / -1;
  }

  .bar-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0;
  }

  .mini-stats div,
  .route-note,
  .planner-result,
  .idea-grid article {
    padding: 13px;
    border-radius: 14px;
  }

  .mini-stats strong {
    font-size: 0.94rem;
    word-break: break-word;
  }

  .mini-stats span {
    font-size: 0.7rem;
  }

  .planner-form {
    gap: 10px;
  }

  .planner-form select {
    min-height: 48px;
    border-radius: 12px;
  }

  .location-tools {
    align-items: stretch;
  }

  .location-tools .button {
    width: 100%;
    min-width: 0;
  }

  .location-tools span {
    flex-basis: 100%;
  }

  .trend-scope-note {
    flex-direction: column;
    gap: 8px;
  }

  .trend-chart {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    min-height: 188px;
  }

  .trend-bar {
    height: 166px;
    gap: 5px;
  }

  .trend-bar__fill {
    height: max(8px, calc(var(--trend-ratio, 0) * 122px));
  }

  .trend-bar strong {
    font-size: 0.66rem;
  }

  .trend-bar > span {
    font-size: 0.64rem;
  }

  .rank-list li {
    grid-template-columns: 1fr;
  }

  .camera-frame,
  .camera-frame img,
  .video-frame,
  .video-frame img {
    min-height: 190px;
  }

  .video-frame {
    padding: 18px;
  }

  .video-frame strong {
    font-size: 1.35rem;
  }

}

@media (max-width: 720px) {
  .media-section,
  .media-section > *,
  .snapshot-rail,
  #snapshotGrid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #snapshotGrid {
    flex-wrap: nowrap;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand small {
    display: none;
  }

  .main-nav {
    grid-column: 1 / -1;
    gap: 8px;
    margin-inline: -4px;
    padding: 4px 4px 2px;
    scroll-padding-inline: 4px;
  }

  .main-nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(47, 107, 255, 0.06);
    font-size: 0.82rem;
  }

  .header-actions {
    display: flex;
    width: auto;
    grid-column: auto;
  }

  .header-actions .live-pill {
    display: none;
  }

  .refresh-cluster {
    width: auto;
    gap: 6px;
  }

  .refresh-cluster .button {
    width: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 0;
  }

  #refreshButton::before {
    content: "↻";
    font-size: 1.25rem;
    line-height: 1;
  }

  .hero {
    gap: 16px;
    padding: 24px 18px 18px;
    border-radius: 22px;
  }

  .hero-copy {
    gap: 14px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(1.9rem, 9vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
  }

  .hero-copy p:not(.eyebrow) {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.92rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .button {
    min-height: 46px;
    padding: 0 10px;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 10px 14px;
    padding: 16px;
    border-radius: 18px;
  }

  .hero-card strong {
    font-size: 1.65rem;
  }

  .hero-card .metric-label {
    margin-bottom: 4px;
    font-size: 0.7rem;
  }

  .pulse-ring {
    width: 92px;
    min-height: 92px;
    justify-self: end;
  }

  .pulse-ring b {
    max-width: 72px;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  #heroInsight {
    grid-column: 1 / -1;
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  main {
    gap: 18px;
    margin-top: 18px;
  }

  .panel,
  .metric-card,
  .port-card,
  .camera-card {
    box-shadow: 0 12px 30px rgba(18, 34, 75, 0.09);
  }

  .port-panel,
  .detail-panel,
  .chart-panel,
  .planner,
  .macau-section,
  .insight-panel {
    border-radius: 20px;
  }

  .section-head {
    gap: 12px;
    margin-bottom: 16px;
  }

  .section-head h2,
  .planner-copy h2,
  .insight-panel h2 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .section-head p,
  .planner-copy p,
  .insight-panel p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .filters {
    width: calc(100% + 4px);
    margin-inline: -2px;
    padding: 4px;
  }

  .filter-chip {
    min-height: 38px;
    padding: 8px 14px;
  }

  .port-card {
    border-radius: 16px;
  }

  .port-summary {
    margin-bottom: 8px;
  }

  .port-tags {
    gap: 6px;
  }

  .port-tag {
    min-height: 25px;
    padding: 0 8px;
    font-size: 0.69rem;
  }

  .port-numbers,
  .route-note,
  .planner-result {
    border-radius: 14px;
  }

  .detail-panel {
    display: grid;
    gap: 12px;
  }

  .detail-panel > .eyebrow,
  .detail-panel > h2,
  .detail-panel > p {
    margin: 0;
  }

  .data-source {
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(47, 107, 255, 0.07);
    font-size: 0.75rem;
  }

  .trend-chart {
    margin-inline: -2px;
    padding-inline: 2px;
  }

  .planner {
    gap: 18px;
  }

  .planner-form > .button {
    min-height: 52px;
    position: sticky;
    bottom: 10px;
    z-index: 4;
    box-shadow: 0 10px 22px rgba(47, 107, 255, 0.22);
  }

  .media-section {
    gap: 14px;
  }

  .media-subhead {
    gap: 3px;
  }

  .media-subhead span {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  #snapshotGrid .snapshot-card {
    flex-basis: min(82vw, 300px);
  }

  .camera-frame,
  .camera-frame img,
  .video-frame,
  .video-frame img {
    min-height: 172px;
  }

  .macau-camera-card {
    border-radius: 18px;
  }
}

/* Final mobile conflict resolution: keep this block last. */
@media (max-width: 720px) {
  .site-header {
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding: 10px var(--mobile-gutter);
    border: 0;
    border-bottom: 1px solid rgba(123, 151, 190, 0.18);
    border-radius: 0 0 18px 18px;
  }

  .main-nav,
  .hero-card,
  .detail-panel {
    display: none;
  }

  #refreshButton::before {
    content: "↻";
  }

  main {
    gap: 14px;
    margin-top: 12px;
  }

  .hero {
    display: block;
    padding: 20px 18px;
    border-radius: 20px;
  }

  .hero h1 {
    max-width: 300px;
    font-size: clamp(1.6rem, 7.5vw, 2rem);
    line-height: 1.1;
  }

  .hero-copy > .mobile-copy {
    display: flex;
    font-size: 0.86rem;
    line-height: 1.55;
    -webkit-line-clamp: initial;
  }

  .port-grid {
    grid-template-columns: 1fr;
  }

  .port-card {
    grid-template-columns: 10px minmax(0, 1fr) minmax(74px, 88px);
    gap: 8px 10px;
    padding: 14px;
    border-radius: 17px;
  }

  .port-card > .load-dot {
    grid-column: 1;
  }

  .port-card > div:not(.port-numbers):not(.bar-group):not(.port-card-details) {
    grid-column: 2;
  }

  .port-numbers {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    min-width: 0;
    max-width: 88px;
    text-align: right;
  }

  .port-card::after {
    grid-column: 3;
  }

  .bar-group,
  .port-card-details {
    grid-column: 1 / -1;
  }

  .planner-form > .button {
    position: static;
    bottom: auto;
  }
}

@media (max-width: 380px) {
  .hero-actions,
  .port-card-actions {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile port list: live-status-first, expandable details second. */
@media (max-width: 720px) {
  .port-card {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    min-height: 94px;
    overflow: hidden;
    padding: 15px 14px 14px 22px;
    border: 1px solid rgba(99, 124, 166, 0.13);
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #fbfdff);
    box-shadow: 0 6px 18px rgba(35, 67, 112, 0.06);
  }

  .port-card > .load-dot {
    position: absolute;
    inset: 10px auto 10px 8px;
    width: 4px;
    height: auto;
    margin: 0;
    border-radius: 999px;
    grid-column: auto;
    grid-row: auto;
  }

  .mobile-port-jump {
    display: grid;
    position: relative;
    gap: 7px;
    margin: -2px 0 14px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .mobile-port-jump::after {
    content: "⌄";
    position: absolute;
    right: 16px;
    bottom: 15px;
    color: #55709e;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
  }

  .mobile-port-jump > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 0 2px;
  }

  .mobile-port-jump b {
    color: #263a59;
    font-size: 0.8rem;
  }

  .mobile-port-jump small {
    color: #7c8aa0;
    font-size: 0.66rem;
  }

  .mobile-port-jump select {
    appearance: none;
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 44px 0 15px;
    border: 1px solid rgba(76, 111, 175, 0.2);
    border-radius: 15px;
    outline: 0;
    background: linear-gradient(135deg, #ffffff, #f6f9ff);
    box-shadow: 0 7px 18px rgba(57, 87, 140, 0.08);
    color: #21314a;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
  }

  .mobile-port-jump select:focus-visible {
    border-color: #315ed0;
    box-shadow: 0 0 0 3px rgba(49, 94, 208, 0.1), 0 7px 18px rgba(57, 87, 140, 0.08);
  }

  .port-card > div:not(.port-numbers):not(.bar-group):not(.port-card-details) {
    grid-column: 1;
    min-width: 0;
  }

  .port-card-heading {
    gap: 7px;
    margin-bottom: 7px;
  }

  .port-name {
    min-width: 0;
    margin: 0;
    color: #18253a;
    font-size: 1rem;
    line-height: 1.25;
  }

  .port-live-badge {
    min-height: 23px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .port-summary {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #66758c;
    font-size: 0.76rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .port-tags {
    display: none;
  }

  .port-numbers {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    align-self: stretch;
    align-content: space-between;
    justify-items: end;
    width: auto;
    min-width: 72px;
    max-width: 94px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-align: right;
  }

  .port-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 29px;
    max-width: 94px;
    padding: 0 9px;
    border-radius: 10px;
    background: #eef4ff;
    color: #3155ad;
    font-size: 0.7rem;
    line-height: 1.25;
    text-align: center;
  }

  .port-card.load-high .port-total {
    background: #fff0ed;
    color: #a13c2a;
  }

  .port-card.load-closed .port-total {
    background: #f0f2f5;
    color: #647083;
  }

  .port-direction {
    display: none;
  }

  .port-numbers::after {
    content: "詳情 ⌄";
    color: #71809a;
    font-size: 0.66rem;
    font-weight: 850;
    letter-spacing: 0.02em;
  }

  .port-card.is-expanded .port-numbers::after {
    content: "收起 ⌃";
    color: #315ed0;
  }

  .port-card::after {
    display: none;
  }

  .port-card.is-active,
  .port-card.is-expanded {
    border-color: rgba(49, 94, 208, 0.28);
    box-shadow: 0 9px 24px rgba(40, 76, 145, 0.1);
  }

  .port-card.is-expanded .bar-group,
  .port-card-details {
    grid-column: 1 / -1;
  }

  .port-card.is-expanded .bar-group {
    margin-top: 2px;
    padding-top: 13px;
    border-top: 1px solid #edf1f7;
  }

  .port-card.is-expanded .port-card-details {
    gap: 10px;
  }

  .port-card-details__grid > span {
    padding: 10px 11px;
    border: 1px solid rgba(99, 124, 166, 0.08);
    background: #f7f9fc;
  }

  .port-history-note {
    border-left-width: 2px;
    background: #f7f9fc;
  }
}

/* Camera-page mobile layout: one spacing and card-width system. */
@media (max-width: 720px) {
  .camera-group-nav {
    top: 8px;
    z-index: 25;
    gap: 5px;
    width: 100%;
    padding: 6px;
    border: 1px solid rgba(102, 133, 178, 0.16);
    border-radius: 16px;
    background: rgba(247, 250, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .camera-group-nav button {
    gap: 5px;
    min-height: 42px;
    padding: 8px 5px;
    border-radius: 11px;
    font-size: 0.75rem;
  }

  .camera-group-nav button span {
    font-size: 0.62rem;
  }

  .media-section {
    gap: 12px;
  }

  .media-section > .section-head {
    margin: 0;
    padding: 16px 4px 6px;
  }

  .media-section > .section-head .button,
  .camera-content-block--macau > .section-head .button {
    width: fit-content;
    min-height: 42px;
  }

  .camera-content-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 12px;
    overflow: hidden;
    padding: 15px;
    border: 1px solid rgba(102, 133, 178, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 26px rgba(35, 67, 112, 0.07);
  }

  .camera-content-block--macau {
    padding: 15px;
  }

  .camera-content-block .media-subhead,
  .camera-content-block--macau > .section-head {
    margin: 0;
  }

  .camera-content-block .media-subhead strong {
    font-size: 1rem;
  }

  .camera-content-block .media-subhead span {
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .camera-content-block .camera-swipe-hint {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 34px;
    margin-top: 5px;
    padding: 6px 11px;
    border: 1px solid rgba(49, 94, 208, 0.2);
    border-radius: 999px;
    background: linear-gradient(135deg, #315ed0, #4e7ef1);
    color: #fff;
    box-shadow: 0 7px 18px rgba(49, 94, 208, 0.22);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
  }

  .camera-content-block .camera-swipe-hint i {
    display: inline-block;
    margin-right: 6px;
    font-size: 1rem;
    font-style: normal;
    animation: camera-swipe-nudge 1.35s ease-in-out infinite;
  }

  .camera-content-block .official-camera-callout {
    margin: 0;
    padding: 12px;
    border-radius: 14px;
  }

  .camera-content-block .snapshot-scroll-button {
    display: none !important;
  }

  .camera-rail-switcher {
    display: grid;
    position: relative;
    grid-template-columns: 44px minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(49, 94, 208, 0.3);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(247, 251, 255, 0.99), rgba(230, 240, 255, 0.98));
    box-shadow: 0 10px 26px rgba(49, 94, 208, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition: border-color 180ms ease, box-shadow 180ms ease;
  }

  .camera-rail-switcher[hidden] {
    display: none;
  }

  .camera-switcher-guide {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 1px 3px 3px;
  }

  .camera-switcher-guide > span {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #315ed0, #5485f5);
    color: #fff;
    box-shadow: 0 6px 14px rgba(49, 94, 208, 0.26);
    font-size: 0.9rem;
    font-weight: 900;
    animation: camera-switcher-cue 1.8s ease-in-out infinite;
  }

  .camera-switcher-guide > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .camera-switcher-guide strong {
    color: #244fba;
    font-size: 0.76rem;
    font-weight: 900;
  }

  .camera-switcher-guide small {
    overflow: hidden;
    color: #71819b;
    font-size: 0.64rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .camera-rail-switcher > button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(49, 94, 208, 0.2);
    border-radius: 14px;
    background: linear-gradient(135deg, #315ed0, #4e7ef1);
    color: #fff;
    box-shadow: 0 7px 16px rgba(49, 94, 208, 0.22);
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .camera-rail-switcher > button:active {
    transform: scale(0.94);
    box-shadow: 0 3px 9px rgba(49, 94, 208, 0.2);
  }

  .camera-rail-switcher label {
    display: grid;
    min-width: 0;
    gap: 3px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid rgba(77, 111, 170, 0.16);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 #fff;
  }

  .camera-rail-switcher label span {
    color: #71819a;
    font-size: 0.62rem;
    font-weight: 800;
  }

  .camera-rail-switcher select {
    width: 100%;
    min-width: 0;
    height: 25px;
    padding: 0 24px 0 0;
    overflow: hidden;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1d2d47;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    text-overflow: ellipsis;
    cursor: pointer;
  }

  .camera-switcher-position {
    min-width: 38px;
    padding: 6px 5px;
    border-radius: 999px;
    background: rgba(49, 94, 208, 0.1);
    color: #315eb8;
    font-size: 0.68rem;
    font-weight: 850;
    text-align: center;
  }

  .camera-rail-switcher.is-engaged {
    border-color: rgba(71, 108, 166, 0.18);
    box-shadow: 0 7px 18px rgba(49, 94, 208, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }

  .camera-rail-switcher.is-engaged .camera-switcher-guide > span {
    animation: none;
  }

  .camera-content-block #snapshotGrid,
  .camera-content-block #cameraGrid,
  .camera-content-block .macau-camera-grid {
    width: 100%;
    padding: 1px 0 8px;
    scroll-padding-inline: 0;
  }

  .camera-content-block #snapshotGrid .snapshot-card,
  .camera-content-block #cameraGrid .camera-card,
  .camera-content-block .macau-camera-grid .macau-camera-card {
    flex: 0 0 calc(100% - 18px);
    width: calc(100% - 18px);
    max-width: calc(100% - 18px);
  }

  .camera-content-block #snapshotGrid .snapshot-card {
    min-height: 0;
  }

  .camera-content-block .snapshot-frame,
  .camera-content-block .snapshot-frame img,
  .camera-content-block .macau-video-frame {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .camera-content-block .snapshot-card > div:last-child,
  .camera-content-block .macau-camera-card > div:last-child {
    padding: 14px;
  }

  .camera-content-block .snapshot-card h3,
  .camera-content-block .macau-camera-card h3 {
    font-size: 1rem;
    line-height: 1.35;
  }

  .camera-content-block .snapshot-card p,
  .camera-content-block .macau-camera-card p {
    font-size: 0.78rem;
    line-height: 1.5;
  }
}

@keyframes camera-swipe-nudge {
  0%, 100% { transform: translateX(-2px); }
  50% { transform: translateX(3px); }
}

@keyframes camera-switcher-cue {
  0%, 100% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .camera-content-block .camera-swipe-hint i,
  .camera-switcher-guide > span {
    animation: none;
  }

  .camera-group-nav button,
  .camera-rail-switcher,
  .camera-rail-switcher > button {
    transition: none;
  }
}
