:root {
  --ink: #11345f;
  --muted: #5d7694;
  --line: #d8e9fb;
  --panel: rgba(255, 255, 255, 0.95);
  --green: #1478e8;
  --red: #dc2626;
  --purple: #7c3aed;
  --amber: #d97706;
  --bg: #eef7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Prompt, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

button,
input,
textarea {
  font: inherit;
}

strong,
b,
h1,
h2,
h3 {
  font-weight: 600;
}

.public-app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: relative;
  z-index: 10;
  min-height: 126px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 740px 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(16, 33, 28, 0.08);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.brand-copy {
  min-width: 0;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
}

.brand h1 span {
  color: var(--green);
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.header-actions {
  position: absolute;
  top: 22px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-link {
  width: 118px;
  min-height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid #b8dcff;
  border-radius: 20px;
  background: rgba(246, 251, 255, 0.92);
  color: #0a66d8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(20, 120, 232, 0.13);
}

.about-link svg {
  width: 24px;
  height: 24px;
}

.line-alert-link {
  width: 232px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  padding: 6px 10px 6px 5px;
  border: 1px solid #78dd9a;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 24%, rgba(34, 197, 94, 0.18), transparent 48%),
    linear-gradient(135deg, rgba(238, 255, 246, 0.98), rgba(255, 255, 255, 0.96));
  color: #087c3b;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(22, 163, 74, 0.15);
}

.line-alert-link img {
  grid-row: 1 / 3;
  width: 84px;
  height: 70px;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  transform: translateX(-4px);
}

.line-alert-link span,
.line-alert-link small {
  min-width: 0;
}

.line-alert-link span {
  align-self: end;
  line-height: 1.12;
}

.line-alert-link small {
  align-self: start;
  color: #159447;
  font-size: 0.69rem;
  font-weight: 500;
  line-height: 1.2;
}

.system-link {
  width: 252px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 6px 10px 6px 6px;
  border: 1px solid #b8dcff;
  border-radius: 20px;
  background:
    radial-gradient(circle at 18% 20%, rgba(44, 201, 255, 0.18), transparent 48%),
    #fff;
  color: #0a66d8;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(20, 120, 232, 0.16);
}

.system-link img {
  grid-row: 1 / 3;
  width: 84px;
  height: 70px;
  object-fit: contain;
  transform: translate(-7px, 2px);
}

.system-link span,
.system-link small {
  min-width: 0;
}

.system-link span {
  align-self: end;
  line-height: 1.1;
}

.system-link small {
  align-self: start;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.2;
}

.mfu-header-logo {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mfu-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.province-switch {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  padding-top: 0;
}

.province-switch button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid #d9e8f7;
  border-radius: 999px;
  background: rgba(246, 251, 255, 0.72);
  color: #7d93ab;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.province-switch button.active {
  background: #1478e8;
  border-color: #1478e8;
  color: #fff;
}

.main-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 14px;
  padding: 14px;
}

.landing-risk-strip {
  margin: 12px 14px 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #b8dcff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(20, 120, 232, 0.11);
}

.landing-tmd-tools {
  margin: 8px 14px 0;
  display: grid;
  grid-template-columns: minmax(160px, max-content) minmax(170px, 260px);
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px dashed rgba(17, 52, 95, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.68rem;
  width: fit-content;
  max-width: calc(100% - 28px);
}

.landing-tmd-tools > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.landing-tmd-tools strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.landing-tmd-tools span,
.landing-tmd-tools small {
  overflow-wrap: anywhere;
}

.landing-tmd-opacity {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-weight: 500;
}

.landing-tmd-opacity input {
  width: 100%;
}

.landing-tmd-rain-only {
  filter: saturate(1.2) contrast(1.08) drop-shadow(0 0 3px rgba(34, 197, 94, 0.38));
}

.landing-risk-strip strong {
  display: block;
  font-size: 0.98rem;
}

.landing-risk-strip span {
  color: var(--muted);
  font-size: 0.76rem;
}

.landing-risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: visible;
  padding-bottom: 0;
}

.landing-risk-pill {
  flex: 0 1 170px;
  min-width: 148px;
  max-width: 190px;
  display: grid;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid #d8e9fb;
  border-left: 4px solid var(--purple);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  line-height: 1.18;
}

.landing-risk-pill.watch {
  border-left-color: var(--red);
}

.landing-risk-pill b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.76rem;
}

.landing-risk-pill small {
  color: var(--muted);
  font-size: 0.62rem;
}

.empty-inline {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--muted);
}

.public-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #2b2f30;
  color: #f4f6f5;
}

.footer-logo {
  display: flex;
  align-items: center;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

.footer-logo img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
}

.footer-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.footer-copy strong {
  font-size: clamp(0.94rem, 1.2vw, 1.14rem);
  line-height: 1.25;
  white-space: nowrap;
}

.footer-copy span {
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(0.76rem, 1.05vw, 0.88rem);
  font-weight: 400;
}

.footer-partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}

.footer-partners img {
  width: min(410px, 30vw);
  max-height: 66px;
  object-fit: contain;
  object-position: center;
}

.map-card,
.action-panel > section,
.quick-actions {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(16, 33, 28, 0.1);
}

.map-card {
  position: relative;
  min-height: 400px;
  overflow: hidden;
}

#publicMap {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.map-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 500;
  max-width: min(560px, calc(100% - 28px));
  padding: 9px 12px;
  border: 1px solid rgba(217, 226, 222, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.93);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.action-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin: 14px 14px 0;
  padding: 10px;
}

.action-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.action-button.active,
.action-button:hover {
  border-color: #1478e8;
  background: #1478e8;
  color: #fff;
}

.action-button.report {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.action-button.locate {
  border-color: #b8dcff;
  background: #eef7ff;
  color: #0a66d8;
}

.action-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.summary-card {
  padding: 14px;
}

.summary-card strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.summary-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.summary-metrics span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
}

.summary-metrics b {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.mascot-card {
  min-height: 164px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 18%, rgba(44, 201, 255, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(230, 245, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.mascot-card img {
  width: 158px;
  max-width: 100%;
  justify-self: end;
  object-fit: contain;
  transform: translate(8px, 4px);
  filter: drop-shadow(0 14px 24px rgba(20, 120, 180, 0.2));
}

.mascot-copy {
  min-width: 0;
}

.mascot-copy span {
  display: inline-flex;
  margin-bottom: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0a66d8;
  font-size: 0.68rem;
  font-weight: 600;
}

.mascot-copy strong {
  display: block;
  color: #0b4ca3;
  font-size: 0.98rem;
  line-height: 1.25;
}

.mascot-copy p {
  margin: 6px 0 0;
  color: #52708f;
  font-size: 0.76rem;
  line-height: 1.45;
}

.mascot-locate-button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  justify-content: center;
  border-color: #9fd3ff;
  background: #1478e8;
  color: #fff;
  box-shadow: 0 10px 20px rgba(20, 120, 232, 0.18);
}

.mascot-locate-button:hover,
.mascot-locate-button.active {
  border-color: #0a66d8;
  background: #0a66d8;
  color: #fff;
}

.result-card {
  min-height: 260px;
  overflow: hidden;
}

.result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.result-title h2 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.2;
}

.ghost-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}

.overview-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.overview-button svg {
  width: 15px;
  height: 15px;
}

.result-list {
  max-height: calc(100vh - 440px);
  min-height: 210px;
  overflow: auto;
  padding: 10px;
}

.empty-note {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 0.82rem;
  line-height: 1.45;
}

.list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

button.list-item {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.list-item:hover {
  border-color: rgba(10, 102, 216, 0.36);
  box-shadow: 0 8px 18px rgba(10, 102, 216, 0.09);
}

.list-item b {
  font-size: 0.86rem;
  line-height: 1.3;
}

.list-item span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.group-card {
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 10px;
  background: #fff;
}

.group-card.purple {
  border-left-color: var(--purple);
}

.group-card.red {
  border-left-color: var(--red);
}

.district-zoom {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #10211c;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.district-zoom span {
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.25;
}

.district-zoom small {
  flex: 0 0 auto;
  color: #0a66d8;
  font-size: 0.68rem;
  font-weight: 500;
}

.district-zoom:hover span {
  color: #0a66d8;
}

.tambon-line {
  display: grid;
  gap: 3px;
  padding: 7px 0;
  border-top: 1px solid #eef3f1;
}

.tambon-line:first-of-type {
  border-top: 0;
}

.tambon-line b {
  color: #0a66d8;
  font-size: 0.8rem;
}

.tambon-line p,
.group-card p {
  margin: 0;
  color: #243b35;
  font-size: 0.78rem;
  line-height: 1.55;
}

.tambon-line small {
  color: var(--muted);
  font-size: 0.68rem;
}

.result-item,
.result-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.result-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.result-item strong,
.result-item small {
  display: block;
}

.result-item strong {
  font-size: 0.88rem;
}

.result-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.result-item em {
  color: var(--green);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.risk-dot {
  width: 10px;
  height: 38px;
  border-radius: 999px;
  background: var(--green);
}

.risk-dot.purple {
  background: var(--purple);
}

.risk-dot.red {
  background: var(--red);
}

.risk-dot.orange {
  background: var(--amber);
}

.result-group {
  margin-bottom: 10px;
  overflow: hidden;
}

.result-group h3 {
  margin: 0;
  padding: 10px;
  background: #f8fbfa;
  font-size: 0.86rem;
}

.result-group p {
  margin: 0;
  padding: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.station-marker,
.village-marker,
.report-marker,
.user-marker {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(16, 33, 28, 0.28);
  color: #fff;
  font-weight: 600;
}

.station-marker {
  background: #0ea5e9;
}

.village-marker.risk {
  background: var(--purple);
}

.village-marker.watch {
  background: var(--red);
}

.report-marker {
  background: #b91c1c;
}

.user-marker {
  background: #1478e8;
}

.public-marker {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--marker-color, #1478e8);
  box-shadow: 0 8px 20px rgba(16, 33, 28, 0.33);
  color: #fff;
  font-weight: 600;
  line-height: 1;
}

.public-marker .marker-symbol {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.public-marker svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.public-marker.station {
  border-color: #f8fafc;
}

.public-marker.radar-confirmed::after {
  content: "⚡";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #facc15;
  color: #7c2d12;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
}

.public-marker.village {
  border-color: #fff7ed;
}

.public-marker.report {
  border-color: #fee2e2;
}

.public-marker.user {
  border-color: #d1fae5;
}

.public-popup {
  min-width: 180px;
}

.public-popup h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 0.95rem;
}

.public-popup p {
  margin: 4px 0;
  color: var(--muted);
}

.public-popup strong {
  display: block;
  margin-top: 6px;
}

.popup-photo {
  display: block;
  width: 180px;
  max-height: 160px;
  margin-top: 8px;
  object-fit: cover;
  border-radius: 8px;
}

.leaflet-popup-content {
  font-family: Prompt, sans-serif;
}

.report-dialog {
  width: min(480px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(16, 33, 28, 0.25);
}

.about-dialog {
  width: min(820px, calc(100vw - 28px));
}

.about-dialog form {
  max-height: min(82vh, 760px);
}

.about-content {
  max-height: min(58vh, 520px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.about-content p {
  margin: 0;
  color: #24415f;
  font-size: 0.9rem;
  line-height: 1.75;
}

.about-contact {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6fbff;
}

.about-contact h3 {
  margin: 0;
  color: #0a66d8;
  font-size: 1rem;
}

.about-contact a {
  color: #0a66d8;
}

.report-dialog form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.dialog-head h2,
.dialog-note {
  margin: 0;
}

.dialog-note,
.dialog-status {
  color: var(--muted);
  font-size: 0.82rem;
}

.icon-button,
.secondary-button,
.submit-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
}

.secondary-button,
.submit-button {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.secondary-button {
  background: #f8fbfa;
  color: var(--green);
}

.submit-button {
  background: #1478e8;
  color: #fff;
}

@media (max-width: 1180px) {
  .topbar {
    padding-right: 18px;
  }

  .header-actions {
    position: static;
    width: 100%;
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
}

@media (max-width: 960px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .public-app {
    width: 100%;
    overflow-x: hidden;
  }

  .main-layout {
    display: block;
    width: 100%;
    max-width: 100vw;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
  }

  .brand {
    order: 1;
    width: 100%;
    align-self: stretch;
    padding-right: 92px;
  }

  .header-actions {
    order: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px;
    gap: 8px;
    margin: 0;
  }

  .province-switch {
    margin-top: 12px;
    padding-top: 0;
  }

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

  .landing-risk-strip {
    grid-template-columns: 1fr;
    margin: 10px;
    max-width: calc(100vw - 20px);
    overflow: hidden;
  }

  .landing-tmd-tools {
    grid-template-columns: 1fr;
    margin: 8px 10px 0;
    max-width: calc(100vw - 20px);
    overflow: hidden;
    width: auto;
  }

  .landing-risk-list {
    max-width: 100%;
  }

  .line-alert-link,
  .system-link {
    display: grid;
    width: 100%;
    min-height: 76px;
    border-radius: 16px;
    box-shadow: 0 12px 26px rgba(20, 120, 232, 0.12);
  }

  .mfu-header-logo {
    width: 56px;
    height: 76px;
    align-self: stretch;
    padding: 0;
  }

  .about-link {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    min-height: 34px;
    flex-direction: row;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    box-shadow: 0 8px 18px rgba(20, 120, 232, 0.12);
  }

  .about-link svg {
    width: 15px;
    height: 15px;
  }

  .line-alert-link {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 6px 8px 6px 5px;
    font-size: 0.7rem;
  }

  .line-alert-link img {
    width: 60px;
    height: 58px;
    border-radius: 12px;
  }

  .line-alert-link small {
    font-size: 0.58rem;
  }

  .system-link {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 6px 8px 6px 5px;
    font-size: 0.7rem;
  }

  .system-link img {
    width: 62px;
    height: 58px;
    transform: translate(-5px, 2px);
  }

  .system-link small {
    font-size: 0.58rem;
  }

  .main-layout {
    padding: 10px;
  }

  .map-card,
  #publicMap {
    min-height: clamp(280px, 38vh, 360px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .action-panel {
    margin-top: 10px;
  }

  .result-list {
    max-height: none;
  }

  .mascot-card {
    grid-template-columns: minmax(0, 1fr) 124px;
  }

  .mascot-card img {
    width: 136px;
  }

  .public-footer {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .footer-logo {
    padding-right: 14px;
  }

  .footer-copy strong {
    white-space: normal;
  }

  .footer-partners {
    grid-column: 1 / -1;
    justify-content: center;
    padding-left: 0;
    border-left: 0;
  }

  .footer-partners img {
    width: min(320px, 100%);
    max-height: 64px;
    object-position: center;
  }
}

@media (max-width: 560px) {
  .topbar,
  .quick-actions,
  .main-layout,
  .landing-risk-strip,
  .landing-tmd-tools {
    max-width: 100vw;
  }

  .landing-risk-pill {
    min-width: 138px;
    max-width: calc(50vw - 16px);
  }

  .map-card,
  #publicMap {
    min-height: clamp(260px, 42vh, 340px);
  }
  .brand img {
    width: 48px;
    height: 48px;
  }

  .province-switch,
  .summary-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .province-switch {
    display: grid;
  }

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

  .mascot-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .mascot-card img {
    width: 126px;
    justify-self: center;
    grid-row: 1;
    transform: none;
  }

  .public-footer {
    align-items: start;
  }

  .footer-logo img {
    width: 46px;
    height: 46px;
  }

  .footer-copy strong {
    font-size: 0.95rem;
  }
}
