:root {
  color-scheme: light;
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-soft: #edf5fb;
  --ink: #132238;
  --muted: #66758a;
  --line: #dbe5ee;
  --accent: #1769aa;
  --accent-strong: #0d4f84;
  --accent-soft: #e4f2ff;
  --ok: #16815d;
  --shadow: 0 14px 38px rgba(20, 52, 80, 0.10);
  --radius: 22px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 9999;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mobile-only { display: none; }

.section-shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 800;
  border-bottom: 1px solid rgba(219, 229, 238, .9);
  background: rgba(246, 249, 252, .9);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(calc(100% - 40px), var(--max));
  min-height: 66px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 15px; }
.header-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(22, 129, 93, .10); }

.hero { padding: 84px 0 50px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--accent); font-size: .76rem; font-weight: 850; letter-spacing: .16em; }
h1 { margin: 0; max-width: 850px; font-size: clamp(3rem, 8vw, 6.5rem); line-height: .98; letter-spacing: -.065em; }
.lead { max-width: 690px; margin: 26px 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); }
.demo-note { margin-top: 28px; max-width: 760px; display: flex; gap: 12px; padding: 16px 18px; border: 1px solid #cfe1f2; border-radius: 16px; background: var(--accent-soft); color: #31506c; font-size: .92rem; }
.demo-note strong { flex: 0 0 auto; color: var(--accent-strong); }

.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.75rem); line-height: 1.12; letter-spacing: -.04em; }
.text-button { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; color: var(--accent); font-weight: 750; cursor: pointer; }

.recommendation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 82px; }
.recommendation-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.recommendation-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.rec-icon { font-size: 2rem; }
.score { padding: 5px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--accent-strong); font-size: .76rem; font-weight: 850; }
.recommendation-card h3 { margin: 24px 0 7px; font-size: 1.35rem; line-height: 1.25; }
.recommendation-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card-link { margin-top: 18px; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--accent); font-weight: 780; }
.card-link::after { content: "↗"; }

.map-section { padding: 68px 0 84px; background: #eaf2f8; }
.map-heading-wrap { margin-bottom: 18px; }
.map-title-row { margin-bottom: 16px; }
.count-pill { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #fff; color: var(--muted); font-size: .82rem; font-weight: 760; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
.filter-chip { min-height: 42px; flex: 0 0 auto; padding: 8px 14px; border: 1px solid #cbdce9; border-radius: 999px; background: #fff; color: #44546a; cursor: pointer; }
.filter-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 16px; }
.map-panel, .camera-panel { overflow: hidden; border: 1px solid #d2e0ea; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
#map { width: 100%; min-height: 650px; background: #dceaf4; }
.map-fallback { min-height: 650px; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 20px; }
.camera-panel { display: flex; flex-direction: column; min-height: 650px; max-height: 650px; }
.search-box { padding: 14px; border-bottom: 1px solid var(--line); }
.search-box input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; color: var(--ink); outline: none; }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.camera-list { overflow-y: auto; padding: 8px; }
.camera-item { width: 100%; padding: 14px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; }
.camera-item:hover, .camera-item:focus-visible { background: var(--surface-soft); outline: none; }
.camera-item.is-active { background: var(--accent-soft); }
.camera-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.camera-item strong { display: block; line-height: 1.3; }
.camera-item small { display: block; margin-top: 5px; color: var(--muted); }
.type-tag { font-size: .72rem; padding: 4px 7px; border-radius: 999px; background: #eef2f6; color: #526171; }
.camera-popup { min-width: 220px; }
.camera-popup h3 { margin: 0 0 5px; font-size: 1rem; }
.camera-popup p { margin: 3px 0; color: #5a6979; }
.camera-popup a { display: inline-block; margin-top: 8px; font-weight: 800; color: var(--accent); }

.concept-section { padding: 88px 0 100px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; align-items: start; }
.concept-copy { color: var(--muted); font-size: 1.02rem; }
.concept-copy p:first-child { margin-top: 0; }
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .86rem; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .recommendation-grid { grid-template-columns: 1fr 1fr; }
  .recommendation-card:first-child { grid-column: 1 / -1; }
  .map-layout { grid-template-columns: 1fr; }
  #map { min-height: 470px; }
  .camera-panel { min-height: 430px; max-height: 520px; }
  .concept-section { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 640px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .section-shell, .header-inner { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 58px; }
  .header-meta { font-size: .76rem; }
  .hero { padding: 58px 0 36px; }
  h1 { font-size: clamp(2.85rem, 14vw, 4.2rem); }
  .mobile-only { display: initial; }
  .lead { margin-top: 20px; }
  .demo-note { flex-direction: column; gap: 3px; padding: 14px 15px; }
  .recommendation-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -14px; padding: 0 14px 12px; gap: 12px; }
  .recommendation-card { flex: 0 0 86%; min-height: 222px; scroll-snap-align: start; padding: 20px; }
  .recommendation-card:first-child { grid-column: auto; }
  .map-section { padding-top: 54px; }
  #map { min-height: 390px; border-radius: 0; }
  .map-panel { border-radius: 18px; }
  .camera-panel { min-height: 390px; max-height: 470px; border-radius: 18px; }
  .concept-section { padding: 66px 0 76px; }
  .footer-inner { min-height: 150px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 900;
    min-height: 58px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid rgba(210,224,234,.95);
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 16px 46px rgba(20,52,80,.22);
    backdrop-filter: blur(16px);
  }
  .mobile-nav a, .mobile-nav button {
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 0;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: .7rem;
    cursor: pointer;
  }
  .mobile-nav a span:first-child, .mobile-nav button span:first-child { color: var(--accent); font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


.sources-section { padding: 84px 0 12px; }
.sources-lead { max-width: 760px; margin: -4px 0 20px; color: var(--muted); }
.provider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.provider-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.provider-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.provider-card small { color: var(--muted); }
.provider-card h3 { margin: 2px 0 0; font-size: 1.04rem; line-height: 1.35; }
.provider-card p { margin: 14px 0; color: var(--muted); font-size: .9rem; }
.provider-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: .82rem; }
.provider-meta a { color: var(--accent); font-weight: 780; text-decoration: none; }
.health-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; }
.health-badge.is-ok { background: #e7f7f0; color: #116a4c; }
.health-badge.is-warn { background: #fff3da; color: #8a5c00; }
.health-badge.is-unknown { background: #eef2f6; color: #586879; }

@media (max-width: 640px) {
  .sources-section { padding-top: 60px; }
  .provider-grid { grid-template-columns: 1fr; }
  .provider-card { padding: 17px; }
  .provider-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
}


/* Phase 3A: live public observations */
.live-section { padding: 16px 0 72px; }
.live-lead { max-width: 820px; margin: -4px 0 20px; color: var(--muted); }
.live-observation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.live-observation-card { min-height: 220px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.live-observation-card.is-muted { background: #f8fafc; box-shadow: none; }
.live-observation-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 1.5rem; }
.live-state { padding: 5px 8px; border-radius: 999px; background: #eef2f6; color: var(--muted); font-size: .72rem; font-weight: 800; }
.live-state.is-live { background: #e7f7f0; color: #116a4c; }
.live-observation-card h3 { margin: 22px 0 3px; font-size: 1rem; line-height: 1.35; }
.live-value { margin: 0; font-size: 2.1rem; font-weight: 880; letter-spacing: -.04em; }
.live-value small { margin-left: 4px; color: var(--muted); font-size: .8rem; font-weight: 750; }
.live-label, .live-sub { color: var(--muted); font-size: .82rem; }
.live-sub { min-height: 38px; line-height: 1.45; }
.live-observation-card a { color: var(--accent); font-size: .82rem; font-weight: 780; text-decoration: none; }
.signal-note { margin-top: 12px !important; padding: 9px 10px; border-radius: 10px; background: #f2f7fb; font-size: .76rem !important; line-height: 1.45; }
.signal-note strong { display: block; color: var(--accent-strong); }
.type-tag.has-live-signal { background: #e7f7f0; color: #116a4c; }
@media (max-width: 900px) { .live-observation-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .live-section { padding: 8px 0 54px; }
  .live-observation-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -14px; padding: 0 14px 12px; gap: 12px; }
  .live-observation-card { flex: 0 0 82%; min-height: 205px; scroll-snap-align: start; padding: 18px; }
}


/* Phase 3B: official warning/advisory update cards */
.alert-section { padding-top: 12px; }
.alert-lead { margin: 0 0 18px; color: #5e6b78; line-height: 1.75; }
.alert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.alert-card { min-height: 190px; padding: 18px; border: 1px solid #dce5ee; border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(31, 50, 72, .06); display: flex; flex-direction: column; }
.alert-card.is-special, .alert-card.is-urgent { border-width: 2px; }
.alert-card.is-clear { background: #f9fcff; }
.alert-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 1.2rem; }
.alert-level { font-size: .78rem; font-weight: 700; color: #5b6876; background: #f1f5f8; border-radius: 999px; padding: 5px 9px; }
.alert-card h3 { margin: 0 0 7px; font-size: 1.18rem; }
.alert-card p { margin: 0 0 10px; color: #5f6d7a; line-height: 1.65; }
.alert-card .alert-names { color: #27394a; font-weight: 800; }
.alert-card a { margin-top: auto; font-weight: 700; }
@media (max-width: 900px) {
  .alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .alert-grid { grid-template-columns: 1fr; }
  .alert-card { min-height: 0; }
}

/* Phase 4: server-generated NOW SCORE */
.score-reasons { margin: 10px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }


/* Phase 5E1: full-screen "ながら見" recommendation rotator.
   The site header remains above the viewer (header z=800, viewer z=750).
   Mobile navigation remains above the viewer (mobile-nav z=900). */
.header-watch-button,
.ambient-launch-button {
  min-height: 40px;
  border: 1px solid #bfd5e7;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}
.header-watch-button { padding: 7px 13px; }
.ambient-launch-button { padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; }
.now-heading-actions { display: flex; align-items: center; gap: 10px; }

body.ambient-open { overflow: hidden; }
.ambient-viewer {
  position: fixed;
  z-index: 2500;
  top: 66px;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto 4px;
  background: #071522;
  color: #fff;
}
.ambient-viewer[hidden] { display: none; }
.ambient-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  background: linear-gradient(135deg, #0f3450, #071522 68%);
}
.ambient-backdrop {
  position: absolute;
  inset: -10%;
  z-index: -2;
  opacity: .78;
  background:
    radial-gradient(circle at 17% 25%, rgba(43, 151, 216, .55), transparent 34%),
    radial-gradient(circle at 82% 68%, rgba(30, 91, 135, .48), transparent 38%);
}
.ambient-stage[data-category="river"] .ambient-backdrop,
.ambient-stage[data-category="sea"] .ambient-backdrop { background: radial-gradient(circle at 25% 30%, rgba(35,160,214,.65), transparent 35%), linear-gradient(145deg,#0b3956,#071522 70%); }
.ambient-stage[data-category="road"] .ambient-backdrop { background: radial-gradient(circle at 74% 30%, rgba(219,137,52,.52), transparent 34%), linear-gradient(145deg,#3b2a17,#071522 72%); }
.ambient-stage[data-category="mountain"] .ambient-backdrop,
.ambient-stage[data-category="volcano"] .ambient-backdrop { background: radial-gradient(circle at 22% 28%, rgba(118,158,116,.54), transparent 34%), linear-gradient(145deg,#17382e,#071522 72%); }

.ambient-content {
  width: min(1320px, 100%);
  min-height: min(680px, calc(100vh - 190px));
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}
.ambient-badges { display: flex; gap: 8px; margin-bottom: 18px; }
.ambient-badge { padding: 6px 11px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(255,255,255,.11); font-size: .8rem; font-weight: 850; backdrop-filter: blur(12px); }
.ambient-badge.is-score { background: rgba(255,255,255,.93); color: #12304a; }
.ambient-icon { font-size: clamp(3.2rem, 9vw, 7rem); line-height: 1; filter: drop-shadow(0 12px 32px rgba(0,0,0,.2)); }
.ambient-eyebrow { margin: 24px 0 4px; color: #9ccded; font-size: .8rem; font-weight: 850; letter-spacing: .14em; }
.ambient-title { max-width: 920px; margin: 0; color: #fff; font-size: clamp(2.2rem, 6vw, 5rem); line-height: 1.03; letter-spacing: -.045em; text-wrap: balance; }
.ambient-location { margin: 16px 0 0; color: #c7dceb; font-size: clamp(.95rem, 2vw, 1.18rem); }
.ambient-signal { max-width: 850px; margin: 18px 0 0; color: #fff; font-size: clamp(1rem, 2.2vw, 1.35rem); font-weight: 760; }
.ambient-reasons { max-width: 900px; margin-top: 15px; display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.ambient-reasons span { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.09); color: #d7e7f2; font-size: .82rem; }
.ambient-media { width: min(1180px, 92vw); margin-top: 18px; }
.ambient-external-only { min-height: 98px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(6,17,28,.38); color: #d9e9f3; }
.ambient-external-only > span { font-size: 1.45rem; }
.ambient-external-only small { color: #9fb9cb; }
.ambient-site-media { display: block; width: 100%; max-height: min(62vh, 680px); object-fit: contain; border-radius: 18px; background: #000; }
.ambient-actions { margin-top: 18px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.ambient-official-link { min-height: 46px; display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 999px; background: #fff; color: #0d4f84; font-weight: 850; text-decoration: none; }
.ambient-rights-note { color: #9fb9cb; font-size: .8rem; }

.ambient-controls {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255,255,255,.11);
  background: rgba(5,15,24,.94);
}
.ambient-controls button,
.ambient-speed select {
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
}
.ambient-controls button { min-width: 48px; padding: 7px 13px; font-size: 1.1rem; }
.ambient-controls .ambient-close { min-width: auto; font-size: .85rem; font-weight: 800; }
.ambient-speed { display: flex; align-items: center; gap: 7px; color: #a9c0d0; font-size: .8rem; }
.ambient-speed select { padding: 6px 10px; }
.ambient-speed select option { color: #111; background: #fff; }
.ambient-position { min-width: 58px; color: #a9c0d0; text-align: center; font-size: .82rem; }
.ambient-progress { height: 4px; background: rgba(255,255,255,.12); }
.ambient-progress span { display: block; width: 0; height: 100%; background: #7dc7f2; transition: width .25s linear; }

@media (max-width: 640px) {
  .header-watch-button { display: none; }
  .now-heading-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .ambient-viewer { top: 58px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .ambient-stage { padding: 22px 16px 14px; }
  .ambient-content { min-height: 0; align-content: center; }
  .ambient-title { font-size: clamp(2rem, 10vw, 3.3rem); }
  .ambient-media { margin-top: 16px; }
  .ambient-external-only { min-height: 78px; }
  .ambient-controls { min-height: 62px; padding: 7px 8px; gap: 6px; overflow-x: auto; justify-content: flex-start; }
  .ambient-controls button { min-width: 44px; }
  .ambient-speed span { display: none; }
  .ambient-position { margin-left: auto; }
  .ambient-rights-note { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-progress span { transition: none; }
}


/* Phase 5E1R1 — smooth ながら見 transition.
   Only the stage content/backdrop moves; menus and controls stay fixed. */
.ambient-content,
.ambient-backdrop {
  transition:
    opacity .45s ease,
    transform .45s cubic-bezier(.22,.61,.36,1),
    filter .45s ease;
  will-change: opacity, transform;
}
.ambient-stage.is-switching-out .ambient-content {
  opacity: 0;
  transform: translateY(8px) scale(.992);
  filter: blur(2px);
}
.ambient-stage.is-switching-out .ambient-backdrop {
  opacity: .34;
  transform: scale(1.025);
}
.ambient-stage.is-switching-in .ambient-content {
  opacity: 0;
  transform: translateY(-6px) scale(.994);
  filter: blur(1px);
}
.ambient-stage.is-switching-in .ambient-backdrop {
  opacity: .34;
  transform: scale(1.02);
}
@media (prefers-reduced-motion: reduce) {
  .ambient-content,
  .ambient-backdrop {
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }
}


/* Phase 6B — runtime stale-safety UI. */
.ops-status-banner {
  width: min(calc(100% - 40px), var(--max));
  margin: 12px auto 0;
  padding: 12px 16px;
  border: 1px solid #e2c46c;
  border-radius: 14px;
  background: #fff7d9;
  color: #6e5510;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}
.ops-status-banner[data-tone="stale"] {
  border-color: #e3a8a8;
  background: #fff0f0;
  color: #7d2e2e;
}
.ops-status-banner[hidden] { display: none; }

.status-dot.is-warn {
  background: #c48a14;
  box-shadow: 0 0 0 4px rgba(196,138,20,.12);
}
.status-dot.is-stale {
  background: #b34848;
  box-shadow: 0 0 0 4px rgba(179,72,72,.12);
}
.count-pill.is-stale,
.score.is-stale {
  background: #fff0f0;
  color: #8f3636;
}
.recommendation-card.is-stale-state {
  grid-column: 1 / -1;
  min-height: 190px;
  border-style: dashed;
  box-shadow: none;
}


/* ================================================================
   Phase 6E / IMJ19 — one-screen dashboard
   Visible UI = category / map / current recommendations only.
   Weather, alerts, provider health and operational details stay as
   hidden runtime inputs except for a compact stale-warning banner.
   ================================================================ */

html,
body.dashboard-page {
  height: 100%;
}

body.dashboard-page {
  margin: 0;
  overflow: hidden;
  background: #f4f8fb;
}

.dashboard-page .site-header {
  height: 58px;
  min-height: 58px;
  position: relative;
  z-index: 3000;
}

.dashboard-page .header-inner {
  height: 58px;
  max-width: 1600px;
  padding: 0 14px;
}

.dashboard-page .brand {
  font-size: 1.08rem;
  gap: 8px;
}

.dashboard-page .brand-mark {
  font-size: .9rem;
}

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

.header-list-button,
.dashboard-primary-button,
.dashboard-secondary-button,
.dashboard-rec-list-open {
  border: 1px solid #d8e2e9;
  background: #fff;
  color: #183142;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}

.header-list-button,
.dashboard-page .header-watch-button {
  min-height: 36px;
  padding: 0 13px;
}

.runtime-status-hooks,
.runtime-support {
  display: none !important;
}

.compact-ops-banner:not([hidden]) {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  z-index: 3500;
  padding: 7px 12px;
  border-radius: 0 0 10px 10px;
  font-size: .78rem;
  box-shadow: 0 4px 16px rgba(20,45,60,.12);
}

.dashboard-main {
  height: calc(100dvh - 58px);
  min-height: 0;
  padding: 0;
}

.dashboard-shell {
  width: min(1600px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 315px;
  gap: 10px;
  min-height: 0;
}

.dashboard-sidebar,
.dashboard-map,
.dashboard-recommendations {
  min-width: 0;
  min-height: 0;
  border: 1px solid #e1e8ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(26,59,75,.06);
  overflow: hidden;
}

.dashboard-sidebar {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-sidebar-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 3px 8px;
  border-bottom: 1px solid #edf2f5;
}

.dashboard-sidebar-title strong {
  font-size: .98rem;
}

.dashboard-count {
  color: #667b89;
  font-size: .72rem;
  white-space: nowrap;
}

.dashboard-filter-list {
  display: grid;
  gap: 5px;
  align-content: start;
}

.dashboard-filter-list .filter-chip {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: .82rem;
  margin: 0;
}

.dashboard-sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 7px;
}

.dashboard-primary-button,
.dashboard-secondary-button {
  min-height: 40px;
  font-size: .82rem;
}

.dashboard-primary-button {
  background: #0f5d83;
  border-color: #0f5d83;
  color: #fff;
}

.dashboard-map {
  position: relative;
}

.dashboard-map #map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #aad3df;
}

.dashboard-map .leaflet-control-container {
  font-size: .82rem;
}

.dashboard-map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  background: #eef5f8;
}

.dashboard-recommendations {
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.dashboard-recommendation-head {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}

.dashboard-recommendation-head h1 {
  margin: 0;
  font-size: 1rem;
  line-height: 1;
}

.dashboard-refresh {
  color: #6a7d89;
  font-size: .68rem;
  white-space: nowrap;
}

.dashboard-recommendation-grid {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-recommendation-grid .dashboard-rec-card {
  min-height: 0;
  padding: 11px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  overflow: hidden;
}

.dashboard-rec-main {
  min-height: 0;
}

.dashboard-rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.dashboard-rec-icon {
  font-size: 1rem;
}

.dashboard-rec-card .score {
  font-size: .68rem;
  padding: 3px 7px;
}

.dashboard-rec-card h3 {
  margin: 0;
  font-size: .88rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-rec-card p {
  margin: 4px 0 0;
  color: #6a7b86;
  font-size: .7rem;
  line-height: 1.25;
}

.dashboard-rec-link,
.dashboard-rec-list-open {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 0 10px;
  border-radius: 8px;
  font-size: .72rem;
  text-decoration: none;
}

.camera-drawer {
  position: fixed;
  top: 58px;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  z-index: 4200;
  background: #fff;
  box-shadow: -10px 0 35px rgba(19,46,61,.18);
  padding: 12px;
  overflow: hidden;
}

.camera-drawer[hidden],
.camera-drawer-backdrop[hidden] {
  display: none !important;
}

.camera-drawer-head {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.camera-drawer-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef3f6;
  font-size: 1.2rem;
  cursor: pointer;
}

.camera-drawer-search {
  display: block;
  margin: 4px 0 9px;
}

.camera-drawer-list {
  height: calc(100% - 96px);
  overflow: auto;
}

.camera-drawer-backdrop {
  position: fixed;
  inset: 58px 0 0;
  z-index: 4100;
  border: 0;
  background: rgba(18,36,48,.24);
  cursor: default;
}

.dashboard-page.camera-drawer-open {
  overflow: hidden;
}

/* Remove old long-page presentation from the visible surface. */
.dashboard-page .hero,
.dashboard-page .alert-section,
.dashboard-page .live-section,
.dashboard-page .sources-section,
.dashboard-page .concept-section,
.dashboard-page .site-footer,
.dashboard-page .section-heading-row,
.dashboard-page .demo-note,
.dashboard-page .lead,
.dashboard-page .eyebrow {
  display: none !important;
}

@media (min-width: 901px) {
  .dashboard-page .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .dashboard-shell {
    grid-template-columns: 170px minmax(0,1fr) 270px;
  }

  .dashboard-sidebar {
    padding: 10px 8px;
  }

  .dashboard-filter-list .filter-chip {
    min-height: 36px;
    font-size: .75rem;
  }
}

@media (max-width: 900px) {
  body.dashboard-page {
    overflow: hidden;
  }

  .dashboard-page .site-header,
  .dashboard-page .header-inner {
    height: 54px;
    min-height: 54px;
  }

  .dashboard-header-actions .header-list-button {
    display: none;
  }

  .dashboard-page .header-watch-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: .74rem;
  }

  .compact-ops-banner:not([hidden]) {
    top: 54px;
  }

  .dashboard-main {
    height: calc(100dvh - 54px - 60px);
  }

  .dashboard-shell {
    padding: 6px;
    gap: 6px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) 30vh;
  }

  .dashboard-sidebar {
    padding: 6px;
    border-radius: 10px;
    display: block;
    overflow: hidden;
  }

  .dashboard-sidebar-title,
  .dashboard-sidebar-actions {
    display: none;
  }

  .dashboard-filter-list {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dashboard-filter-list::-webkit-scrollbar {
    display: none;
  }

  .dashboard-filter-list .filter-chip {
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    padding: 5px 9px;
    font-size: .7rem;
  }

  .dashboard-map,
  .dashboard-recommendations {
    border-radius: 10px;
  }

  .dashboard-recommendations {
    padding: 7px;
  }

  .dashboard-recommendation-head {
    height: 29px;
  }

  .dashboard-recommendation-head h1 {
    font-size: .86rem;
  }

  .dashboard-refresh {
    font-size: .62rem;
  }

  .dashboard-recommendation-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 76%;
    grid-template-columns: none;
    grid-template-rows: 1fr;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .dashboard-recommendation-grid::-webkit-scrollbar {
    display: none;
  }

  .dashboard-rec-card {
    scroll-snap-align: start;
  }

  .dashboard-rec-card h3 {
    font-size: .8rem;
    -webkit-line-clamp: 1;
  }

  .dashboard-rec-card p {
    font-size: .64rem;
  }

  .dashboard-rec-link {
    min-height: 27px;
  }

  .camera-drawer {
    top: 54px;
    bottom: 60px;
    width: 100%;
  }

  .camera-drawer-backdrop {
    inset: 54px 0 60px;
  }

  .dashboard-mobile-nav {
    height: 60px;
    z-index: 5000;
  }

  .ambient-viewer {
    bottom: 60px !important;
  }
}

@media (max-height: 720px) and (min-width: 901px) {
  .dashboard-shell {
    padding: 6px;
    gap: 6px;
  }

  .dashboard-sidebar {
    padding: 8px;
  }

  .dashboard-filter-list .filter-chip {
    min-height: 32px;
    padding: 4px 8px;
  }

  .dashboard-rec-card {
    padding: 8px;
  }
}


/* ================================================================
   Phase 6F / IMJ20 — zoom-aware camera clustering
   Nationwide view uses compact count circles instead of thousands
   of overlapping map pins. Individual cameras appear as small dots.
   ================================================================ */

.map-cluster-icon-wrap {
  background: transparent;
  border: 0;
}

.map-cluster-icon {
  width: 100%;
  height: 100%;
  min-width: 36px;
  min-height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 3px solid rgba(255,255,255,.94);
  background: rgba(20,105,154,.92);
  color: #fff;
  font-weight: 700;
  font-size: .72rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(20,52,70,.24);
}

.map-cluster-digits-3,
.map-cluster-digits-4,
.map-cluster-digits-5 {
  font-size: .66rem;
}

.map-camera-dot {
  stroke: #fff;
  fill: #1678b5;
  filter: drop-shadow(0 1px 2px rgba(18,56,76,.25));
}

.dashboard-map .leaflet-marker-icon.map-cluster-icon-wrap {
  background: transparent;
}

@media (max-width: 900px) {
  .map-cluster-icon {
    min-width: 32px;
    min-height: 32px;
    border-width: 2px;
    font-size: .66rem;
  }
}


/* ================================================================
   Phase 6G / IMJ21 — final dashboard density polish
   ================================================================ */

@media (min-width: 901px) {
  .dashboard-shell {
    grid-template-columns: 190px minmax(0, 1fr) 290px;
  }

  .dashboard-sidebar-actions {
    display: none !important;
  }

  .dashboard-recommendation-grid {
    grid-template-rows: repeat(3, minmax(132px, auto));
    align-content: start;
  }

  .dashboard-recommendation-grid .dashboard-rec-card {
    min-height: 132px;
    max-height: 165px;
  }

  .dashboard-rec-card .card-link::after {
    margin-left: 6px;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .dashboard-shell {
    grid-template-columns: 165px minmax(0, 1fr) 265px;
  }

  .dashboard-recommendation-grid .dashboard-rec-card {
    min-height: 122px;
    max-height: 150px;
  }
}


/* Phase 6K-R1 — visual AI core + live UX corrections */
@media (min-width: 901px) {
  .dashboard-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 14px;
    padding-right: 14px;
  }
}
.dashboard-rec-card.has-thumb {
  display: grid;
  grid-template-columns: 112px minmax(0,1fr);
  grid-template-rows: 1fr auto;
  column-gap: 10px;
}
.dashboard-rec-thumb {
  grid-row: 1 / span 2;
  margin: 0;
  min-width: 0;
}
.dashboard-rec-thumb img {
  display: block;
  width: 112px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  background: #e6eef2;
}
.dashboard-rec-thumb figcaption {
  margin-top: 4px;
  font-size: .56rem;
  color: #6d7d87;
  line-height: 1.2;
}
.dashboard-rec-visual {
  margin-top: 5px !important;
  font-size: .67rem !important;
  line-height: 1.25;
  color: #315b70 !important;
}
.ambient-visual-figure {
  width: min(920px, 86vw);
  margin: 0 auto;
}
.ambient-visual-figure figcaption {
  margin-top: 8px;
  color: #c4d9e4;
  font-size: .72rem;
}
.camera-item-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:6px;
  padding:2px 6px 2px 2px;
  border-radius:12px;
}
.camera-item-row:hover,.camera-item-row:focus-within,.camera-item-row.is-active {
  background:var(--surface-soft);
}
.camera-item-link {
  padding:8px 9px;
  border:1px solid #d5e1e8;
  border-radius:9px;
  background:#fff;
  color:#0f5d83;
  font-size:.72rem;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
@media (max-width: 600px) {
  .camera-item-row { grid-template-columns:minmax(0,1fr); padding:3px; }
  .camera-item-link { justify-self:stretch; text-align:center; margin:0 8px 8px; }
  .dashboard-rec-card.has-thumb { grid-template-columns: 92px minmax(0,1fr); }
  .dashboard-rec-thumb img { width:92px; height:66px; }
}


/* ================================================================
   Phase 6L / IMJ26 — approved IMJ12-look dashboard
   ================================================================ */
:root {
  --imj-navy:#082f55;
  --imj-navy-2:#0c3d69;
  --imj-blue:#1577dd;
  --imj-border:#dce5eb;
  --imj-bg:#eef3f7;
}
body.dashboard-page.imj12-look { background:var(--imj-bg); overflow:hidden; color:#142432; }
.imj12-header { height:66px !important; min-height:66px !important; background:linear-gradient(90deg,#062c4d,#0a3b67); border:0; box-shadow:0 1px 5px rgba(5,30,52,.24); }
.imj12-header .header-inner { width:100%; max-width:none; height:66px !important; min-height:66px !important; padding:0 18px; display:flex; align-items:center; gap:14px; }
.header-menu-button { border:0; background:transparent; color:#fff; font-size:1.32rem; width:32px; height:38px; cursor:pointer; }
.imj12-brand { color:#fff !important; text-decoration:none; display:flex; min-width:165px; }
.imj12-brand .brand-text { display:grid; line-height:1.05; }
.imj12-brand strong { font-size:1.05rem; letter-spacing:.02em; }
.imj12-brand small { margin-top:4px; font-size:.62rem; color:#c9dded; font-weight:500; }
.imj12-desktop-nav { margin:0 auto; gap:4px; }
.header-nav-link { min-height:40px; padding:0 16px; border:0 !important; border-radius:6px; background:transparent !important; color:#f5fbff !important; font-weight:700; font-size:.82rem; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.header-nav-link:hover,.header-nav-link:focus-visible { background:rgba(255,255,255,.12) !important; }
.header-last-update { color:#d7e6f2; font-size:.68rem; display:flex; align-items:center; gap:5px; white-space:nowrap; }
.header-last-update strong { color:#fff; font-size:.72rem; }
.header-last-update button { width:30px; height:30px; border:1px solid rgba(255,255,255,.22); border-radius:6px; background:rgba(255,255,255,.08); color:#fff; font-size:1rem; cursor:pointer; }
.dashboard-main { height:calc(100dvh - 66px); padding:10px 12px 12px; }
.imj12-dashboard { width:100%; max-width:none; height:100%; padding:0; margin:0; grid-template-columns:230px minmax(0,1fr) 300px; gap:10px; }
.imj12-sidebar,.imj12-map-panel,.imj12-latest { border:1px solid var(--imj-border); border-radius:6px; background:#fff; box-shadow:0 1px 4px rgba(27,55,73,.06); }
.imj12-sidebar { padding:0; gap:0; overflow:auto; }
.sidebar-block { padding:14px 14px 15px; border-bottom:1px solid #e8eef2; }
.sidebar-block:last-child { border-bottom:0; }
.sidebar-block h2 { margin:0 0 10px; font-size:.82rem; color:#0b5d9c; }
.dashboard-filter-list { display:grid; gap:2px; }
.dashboard-filter-list .filter-chip { min-height:38px; padding:7px 5px; border:0; border-radius:5px; background:#fff; display:flex; align-items:center; justify-content:space-between; color:#243544; }
.dashboard-filter-list .filter-chip:hover { background:#f2f7fb; }
.dashboard-filter-list .filter-chip[aria-pressed="true"] { background:#e9f3ff; color:#075eae; }
.filter-label { display:flex; align-items:center; gap:7px; min-width:0; }
.filter-icon { width:20px; height:20px; border-radius:4px; display:grid; place-items:center; font-size:.72rem; color:#fff; background:#2583df; }
.filter-road .filter-icon { background:#f49a22; }.filter-volcano .filter-icon{background:#38aa61}.filter-jcg .filter-icon{background:#8a59c6}.filter-now .filter-icon{background:#df4545}
.dashboard-filter-list .filter-chip strong { font-size:.72rem; font-variant-numeric:tabular-nums; color:#536879; }
.prefecture-select-wrap select { width:100%; min-height:42px; border:1px solid #d7e1e8; border-radius:5px; background:#fff; padding:0 10px; color:#243544; font:inherit; font-size:.78rem; }
.system-status-list { display:grid; gap:10px; }
.system-status-list > div { display:grid; grid-template-columns:16px minmax(0,1fr) auto; align-items:center; gap:6px; font-size:.73rem; }
.system-check { color:#29b05a; font-size:.68rem; }
.system-status-list strong { font-size:.68rem; color:#188f49; }.system-status-list strong.is-warn{color:#c37415}.system-status-list strong.is-pending{color:#768896}
.system-last-update { margin:14px 0 0; padding-top:11px; border-top:1px solid #edf1f4; color:#6c7e8a; font-size:.65rem; text-align:center; }
.imj12-map-panel { display:grid; grid-template-rows:auto minmax(0,1fr); position:relative; overflow:hidden; }
.dashboard-map-head { padding:14px 16px 10px; background:#fff; border-bottom:1px solid #e4ebf0; }
.map-heading { display:grid; grid-template-columns:1fr; align-items:start; justify-items:start; gap:2px; margin-bottom:10px; }
.map-heading > span { font-size:.86rem; font-weight:700; }.map-heading strong{display:block;font-size:1.03rem;line-height:1.15;color:#1b2833}.map-heading strong span{font-size:1.36rem}
.map-stat-row { display:flex; flex-wrap:wrap; gap:7px; }
.map-stat-button { min-width:74px; min-height:48px; border:0; border-radius:5px; padding:6px 10px; color:#fff; display:grid; align-content:center; gap:2px; background:#2179dc; cursor:pointer; }
.map-stat-button span { font-size:.64rem; font-weight:700; }.map-stat-button strong{font-size:.8rem}.stat-road{background:#f29a1f}.stat-volcano{background:#38ad5c}.stat-jcg{background:#8e5bc6}.stat-now{background:#e04444}
.map-stat-button[aria-pressed="true"] { outline:3px solid rgba(24,96,156,.18); outline-offset:2px; }
.map-canvas-wrap { min-height:0; position:relative; }.imj12-map-panel #map{height:100%; width:100%; min-height:0;}
.imj12-map-legend { position:absolute; right:12px; bottom:12px; z-index:480; width:132px; padding:10px 11px; border:1px solid #d7e1e7; border-radius:5px; background:rgba(255,255,255,.94); box-shadow:0 1px 4px rgba(27,55,73,.10); display:grid; gap:6px; color:#304655; font-size:.62rem; pointer-events:none; }
.imj12-map-legend strong { margin-bottom:1px; color:#203747; font-size:.68rem; }
.imj12-map-legend span { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.legend-dot { width:9px; height:9px; border-radius:50%; background:#2179dc; box-shadow:0 0 0 1px rgba(0,0,0,.06); }
.legend-dot.is-road{background:#f29a1f}.legend-dot.is-volcano{background:#38ad5c}.legend-dot.is-jcg{background:#8e5bc6}.legend-dot.is-now{background:#e04444}
.imj12-latest { padding:0; display:grid; grid-template-rows:52px minmax(0,1fr); overflow:hidden; }
.imj12-latest .dashboard-recommendation-head { height:auto; padding:0 12px; border-bottom:1px solid #e5ecf0; }
.imj12-latest .dashboard-recommendation-head h1 { font-size:.84rem; color:#173247; }
.latest-all-button { border:0; background:transparent; color:#1268b4; font-weight:700; font-size:.68rem; cursor:pointer; }
.imj12-latest .dashboard-recommendation-grid { padding:4px 8px 8px; display:grid; grid-template-columns:1fr; grid-template-rows:repeat(4,minmax(0,1fr)); gap:0; overflow:auto; }
.imj12-latest .dashboard-rec-card { min-height:0; max-height:none; padding:9px 4px; border:0; border-bottom:1px solid #e9eef2; border-radius:0; box-shadow:none; display:grid; grid-template-columns:100px minmax(0,1fr); grid-template-rows:auto; gap:9px; background:#fff; }
.imj12-latest .dashboard-rec-card:last-child { border-bottom:0; }
.dashboard-rec-thumb { grid-row:auto; margin:0; position:relative; align-self:start; }
.dashboard-rec-thumb img,.dashboard-rec-thumb.is-placeholder { width:100px; height:68px; object-fit:cover; border-radius:4px; background:linear-gradient(145deg,#d9e7ef,#edf3f6); display:grid; place-items:center; }
.dashboard-rec-thumb.is-placeholder span { font-size:1.35rem; opacity:.65; }
.dashboard-rec-thumb figcaption { display:none; }
.dashboard-rec-main { min-width:0; display:block; }.dashboard-rec-meta{display:flex; justify-content:space-between; align-items:center; gap:5px; margin-bottom:3px}
.rec-category { display:inline-flex; align-items:center; min-height:19px; padding:0 6px; border-radius:4px; background:#1676d8; color:#fff; font-size:.6rem; font-weight:700; }.rec-category.is-mlit_road{background:#f0931c}.rec-category.is-jma_volcano{background:#36a65a}.rec-category.is-jcg_mics{background:#8759bf}
.imj12-latest .dashboard-rec-card .score { font-size:.59rem; padding:2px 5px; background:#eef6ff; color:#1267ae; }
.imj12-latest .dashboard-rec-card h3 { margin:0; font-size:.78rem; line-height:1.2; -webkit-line-clamp:1; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; display:block; }
.imj12-latest .dashboard-rec-card p { margin:3px 0 0; font-size:.64rem; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.dashboard-rec-time,.dashboard-rec-ai { display:block; margin-top:3px; font-size:.58rem; color:#5f7380; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.imj12-latest .dashboard-rec-link { margin-top:4px; min-height:0; padding:0; background:transparent; border:0; color:#1268b4; font-size:.62rem; justify-content:flex-start; }
.imj12-latest .dashboard-rec-link::after { margin-left:4px; }
.camera-drawer { top:66px; bottom:0; }
.camera-drawer-backdrop { inset:66px 0 0; }

@media (max-width:1100px) and (min-width:901px) {
 .imj12-dashboard { grid-template-columns:195px minmax(0,1fr) 270px; }
 .imj12-latest .dashboard-rec-card { grid-template-columns:82px minmax(0,1fr); }.dashboard-rec-thumb img,.dashboard-rec-thumb.is-placeholder{width:82px;height:60px}
}

@media (min-width:901px) { .imj12-mobile-nav{display:none !important;} }

@media (max-width:900px) {
 body.dashboard-page.imj12-look { overflow:hidden; padding-bottom:0; }
 .imj12-header,.imj12-header .header-inner { height:58px !important; min-height:58px !important; }
 .imj12-header .header-inner { padding:0 10px; gap:7px; }
 .header-menu-button { width:28px; font-size:1.1rem; order:3; margin-left:auto; }.imj12-brand{min-width:0; flex:1; order:1}.imj12-brand strong{font-size:.94rem}.imj12-brand small{font-size:.55rem}
 .imj12-desktop-nav,.header-last-update{display:none !important;}
 .imj12-mobile-nav { position:fixed !important; top:58px !important; bottom:auto !important; left:0; right:0; height:42px !important; z-index:5000; display:grid !important; grid-template-columns:repeat(4,1fr); background:#fff; border-bottom:1px solid #dce5eb; box-shadow:0 1px 4px rgba(27,55,73,.08); }
 .imj12-mobile-nav a,.imj12-mobile-nav button { border:0; border-right:1px solid #e6edf1; background:#fff; color:#213b50; display:flex; align-items:center; justify-content:center; gap:5px; font-size:.67rem; font-weight:700; text-decoration:none; }
 .dashboard-main { height:calc(100dvh - 100px); margin-top:42px; padding:5px; }
 .imj12-dashboard { display:grid; grid-template-columns:1fr; grid-template-rows:minmax(0,55%) minmax(0,45%); gap:5px; }
 .imj12-sidebar { display:none !important; }
 .imj12-map-panel,.imj12-latest { border-radius:5px; }
 .dashboard-map-head { padding:7px 9px 6px; }
 .map-heading { margin-bottom:5px; gap:1px; }.map-heading>span{font-size:.70rem}.map-heading strong{font-size:.70rem}.map-heading strong span{font-size:.96rem}
 .map-stat-row { gap:4px; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }.map-stat-row::-webkit-scrollbar{display:none}
 .map-stat-button { min-width:64px; min-height:39px; padding:4px 7px; flex:0 0 auto; }.map-stat-button span{font-size:.56rem}.map-stat-button strong{font-size:.68rem}
 .imj12-latest { grid-template-rows:34px minmax(0,1fr); }
 .imj12-latest .dashboard-recommendation-head { padding:0 8px; }.imj12-latest .dashboard-recommendation-head h1{font-size:.72rem}
 .imj12-latest .dashboard-recommendation-grid { display:grid; grid-template-columns:1fr; grid-template-rows:none; grid-auto-flow:row; grid-auto-rows:100px; gap:0; overflow-y:auto; overflow-x:hidden; padding:2px 6px 6px; scroll-snap-type:none; }
 .imj12-latest .dashboard-rec-card { scroll-snap-align:none; height:auto; min-height:0; padding:6px 2px; border:0; border-bottom:1px solid #e5ecf0; border-radius:0; grid-template-columns:82px minmax(0,1fr); background:#fff; }
 .imj12-latest .dashboard-rec-card:last-child{border-bottom:0}
 .dashboard-rec-thumb img,.dashboard-rec-thumb.is-placeholder{width:82px;height:58px}
 .imj12-map-legend{display:none}
 .camera-drawer { top:100px; bottom:0; width:100%; }.camera-drawer-backdrop{inset:100px 0 0}.ambient-viewer{bottom:0 !important}
}

/* Phase 6M / IMJ33 — viewport-balanced desktop map height */
@media (min-width: 901px) and (orientation: portrait) {
  .dashboard-main {
    height: min(calc(100dvh - 66px), clamp(720px, 82vw, 960px));
    max-height: calc(100dvh - 66px);
  }
  .imj12-dashboard,
  .imj12-sidebar,
  .imj12-map-panel,
  .imj12-latest { height: 100%; }
}
@media (min-width: 901px) and (max-width: 1200px) and (orientation: portrait) {
  .imj12-dashboard { grid-template-columns: 180px minmax(0,1fr) 250px; }
}

/* IMJ_MAP_008 mobile map/latest split selected from IMJ_MAP_007_RO */
@media (max-width: 640px) {
  .imj12-dashboard {
    grid-template-rows: minmax(0, 66%) minmax(0, 34%) !important;
  }
}


/* IMJ_INT_016 user-acceptance fixes */
.imj12-header .header-menu-button { display: none !important; }
.ambient-viewer:not([data-current-view-mode="1"]) #ambientClose { display: none !important; }
body.ambient-open .leaflet-control-container { visibility: hidden !important; pointer-events: none !important; }
@media (max-width: 900px) {
  .ambient-media { width: min(96vw, 900px); }
  .ambient-site-media { max-height: min(56vh, 560px); }
}


/* IMJ_INT_017 acceptance UX fixes */
.dashboard-map-fallback[hidden] {
  display: none !important;
  pointer-events: none !important;
}

@media (min-width: 901px) {
  .imj12-latest .dashboard-rec-card.has-thumb {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    padding: 8px 6px !important;
  }
  .imj12-latest .dashboard-rec-card.has-thumb .dashboard-rec-thumb {
    width: 100% !important;
    align-self: stretch !important;
    margin: 0 !important;
  }
  .imj12-latest .dashboard-rec-card.has-thumb .dashboard-rec-thumb img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    max-height: 126px;
    object-fit: cover;
    border-radius: 5px;
  }
  .imj12-latest .dashboard-rec-card.has-thumb .dashboard-rec-main {
    width: 100% !important;
    min-width: 0;
  }
}


/* IMJ_INT_018 — opt-in focus/Pomodoro-style BGM */
.ambient-controls .ambient-music-toggle {
  min-width: 104px;
  padding-inline: 11px;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}
.ambient-controls .ambient-music-toggle.is-on,
.ambient-controls .ambient-music-toggle[aria-pressed="true"] {
  background: rgba(125,199,242,.20);
  border-color: rgba(125,199,242,.72);
  box-shadow: inset 0 0 0 1px rgba(125,199,242,.18);
}
@media (max-width: 640px) {
  .ambient-controls .ambient-music-toggle {
    min-width: 92px;
    padding-inline: 8px;
    font-size: .75rem;
  }
}


/* IMJ_INT_018R1 — map/data clarity */
.dashboard-count-pair {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
  gap: 2px;
}
.dashboard-count-pair strong {
  font-variant-numeric: tabular-nums;
}
.dashboard-count-pair small,
.map-total-mapped {
  color: #667b8b;
  font-size: .64rem;
  font-weight: 750;
}
#mapTotalCount {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.map-total-registered {
  font-weight: 850;
}
.imj-region-label-icon {
  pointer-events: none !important;
  background: transparent !important;
  border: 0 !important;
}
.imj-region-label-icon span {
  display: block;
  width: 72px;
  text-align: center;
  color: #173e5b;
  font-size: 13px;
  font-weight: 900;
  line-height: 22px;
  letter-spacing: .04em;
  text-shadow:
    -2px -2px 0 rgba(255,255,255,.92),
     2px -2px 0 rgba(255,255,255,.92),
    -2px  2px 0 rgba(255,255,255,.92),
     2px  2px 0 rgba(255,255,255,.92),
     0 0 5px rgba(255,255,255,.95);
}
.imj12-latest .camera-current-view::after {
  content: none !important;
  display: none !important;
}
@media (max-width: 900px) {
  .dashboard-count-pair small { font-size: .58rem; }
  .imj-region-label-icon span { font-size: 11px; }
}

/* IMJ_INT_021: live-video ambient viewer */
.ambient-live-wrap{width:100%;max-width:1100px;margin:0 auto;aspect-ratio:16/9;background:#000;border-radius:12px;overflow:hidden;box-shadow:0 14px 44px rgba(0,0,0,.34)}
.ambient-live-frame{display:block;width:100%;height:100%;border:0;background:#000}
@media (max-width:720px){.ambient-live-wrap{width:100%;border-radius:8px}}


/* IMJ_INT_024 — public surfaces are LIVE-only; static camera images remain in control room. */
.dashboard-rec-card.has-live-preview { display:block; overflow:hidden; }
.dashboard-live-thumb { width:100%; aspect-ratio:16/9; background:#07111b; border-radius:10px; overflow:hidden; margin-bottom:8px; }
.dashboard-live-thumb iframe { display:block; width:100%; height:100%; border:0; background:#000; pointer-events:none; }
.dashboard-live-placeholder { min-height:90px; display:flex; align-items:center; justify-content:center; font-size:1.6rem; background:#edf4f7; border-radius:10px; margin-bottom:8px; }
.dashboard-rec-card.is-warning-priority { outline:2px solid #e94b35; outline-offset:-2px; }
.warning-priority-badge { display:inline-flex; align-items:center; min-height:20px; padding:2px 7px; border-radius:999px; background:#c9362b; color:#fff; font-size:.64rem; font-weight:850; }
.live-preview-open { border:0; cursor:pointer; font:inherit; }
.dashboard-count-pair strong { white-space:nowrap; }
.dashboard-count-pair small { white-space:nowrap; }

/* ================================================================
   IMJ_INT_029 — dashboard information architecture / warning UX
   - recommendations are not a camera category
   - nationwide view stays clustered at quarter-step zooms
   - header spare space carries three verified LIVE recommendations
   ================================================================ */

.sidebar-heading-row{display:flex;align-items:flex-start;justify-content:space-between;gap:6px;margin-bottom:9px}
.sidebar-heading-row h2{margin:0!important}
.sidebar-help{max-width:112px;color:#728592;font-size:.52rem;line-height:1.25;text-align:right}

.warning-block{background:#fffaf6}
.warning-sidebar-meta{font-size:.58rem;color:#a44b22;font-weight:700;white-space:nowrap}
.warning-sidebar-list{display:grid;gap:6px}
.warning-sidebar-item{width:100%;border:1px solid #f0d0c3;border-radius:6px;background:#fff;display:grid;grid-template-columns:auto 1fr;gap:2px 6px;padding:7px 8px;text-align:left;color:#243544;font:inherit}
.warning-sidebar-item strong{grid-column:1/-1;color:#c43c20;font-size:.62rem;line-height:1.1}
.warning-sidebar-item span{font-size:.72rem;font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.warning-sidebar-item small{font-size:.56rem;color:#667b89;align-self:center;text-align:right;white-space:nowrap}
.warning-sidebar-item.is-available{cursor:pointer;border-color:#efb19d;background:#fff5f0}
.warning-sidebar-item.is-available:hover,.warning-sidebar-item.is-available:focus-visible{outline:2px solid rgba(207,70,36,.18);outline-offset:1px}
.warning-sidebar-item.is-available small{color:#b73b1f;font-weight:700}
.warning-sidebar-item.is-unavailable{opacity:.86}
.warning-sidebar-clear{display:flex;align-items:center;gap:6px;color:#607583;font-size:.65rem;padding:3px 1px}
.warning-sidebar-clear span:first-child{color:#2d9a59;font-weight:900}

.dashboard-map-head{display:grid;grid-template-columns:minmax(270px,310px) minmax(0,1fr);gap:16px;align-items:stretch;padding:10px 12px 9px}
.map-head-summary{min-width:0;display:flex;flex-direction:column;justify-content:center}
.map-heading{margin-bottom:7px}
.map-heading>span{font-size:.76rem}
.map-heading strong{font-size:.86rem}
.map-heading strong span{font-size:1rem}
.map-stat-row{gap:5px;flex-wrap:nowrap}
.map-stat-button{min-width:58px;min-height:43px;padding:5px 7px}
.map-stat-button span{font-size:.58rem}.map-stat-button strong{font-size:.68rem}
.dashboard-count-pair small{font-size:.50rem!important}

.top-recommendation-strip{min-width:0;border-left:1px solid #e7edf1;padding-left:14px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:5px}
.top-recommendation-strip-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.top-recommendation-strip-head>div:first-child{display:flex;align-items:baseline;gap:8px;min-width:0}
.top-recommendation-strip-head strong{font-size:.72rem;color:#18364c;white-space:nowrap}
.top-recommendation-strip-head small{font-size:.54rem;color:#6a7e8c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-recommendation-arrows{display:flex;gap:4px}
.top-recommendation-arrows button{width:27px;height:24px;border:1px solid #d4e0e7;border-radius:5px;background:#fff;color:#1b669e;font-weight:800;cursor:pointer;line-height:1}
.top-recommendation-arrows button:hover,.top-recommendation-arrows button:focus-visible{background:#edf6fc;outline:none}
.top-recommendation-grid{min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;align-items:stretch;overflow:hidden}
.top-rec-card{min-width:0;height:62px;border:1px solid #dfe7ec;border-radius:6px;background:#f8fbfd;display:grid;grid-template-columns:98px minmax(0,1fr);overflow:hidden;box-shadow:0 1px 2px rgba(25,55,75,.05)}
.top-rec-card.is-warning-priority{border-color:#f0a185;box-shadow:0 0 0 1px rgba(224,78,42,.08)}
.top-rec-media{position:relative;width:98px;height:62px;padding:0;border:0;background:#07111b;overflow:hidden;cursor:pointer}
.top-rec-media iframe{position:absolute;inset:0;width:100%;height:100%;border:0;pointer-events:none;background:#07111b}
.top-rec-overlay{position:absolute;left:4px;bottom:4px;max-width:90px;padding:2px 4px;border-radius:3px;background:rgba(3,25,42,.75);color:#fff;font-size:.46rem;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.top-rec-card.is-warning-priority .top-rec-overlay{background:rgba(181,48,24,.88)}
.top-rec-copy{min-width:0;padding:7px 6px;display:flex;flex-direction:column;justify-content:center;gap:3px}
.top-rec-copy strong{font-size:.63rem;color:#18364c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-rec-copy small{font-size:.49rem;color:#667d8b;white-space:nowrap}
.top-rec-empty{grid-column:1/-1;display:grid;place-items:center;color:#728592;font-size:.62rem;border:1px dashed #dce5eb;border-radius:6px;background:#fbfdfe}
.top-recommendation-grid.is-next .top-rec-card{animation:imjTopRecNext .26s ease-out}
.top-recommendation-grid.is-prev .top-rec-card{animation:imjTopRecPrev .26s ease-out}
@keyframes imjTopRecNext{from{opacity:.35;transform:translateX(18px)}to{opacity:1;transform:translateX(0)}}
@keyframes imjTopRecPrev{from{opacity:.35;transform:translateX(-18px)}to{opacity:1;transform:translateX(0)}}

.imj12-latest .dashboard-recommendation-head{display:flex;align-items:center;justify-content:space-between;gap:6px}
.imj12-latest .dashboard-recommendation-head>div{min-width:0;display:grid;gap:1px}
.imj12-latest .dashboard-recommendation-head h1{margin:0}
.live-list-basis{font-size:.50rem;color:#6b7f8c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@media (max-width:1250px) and (min-width:901px){
  .dashboard-map-head{grid-template-columns:245px minmax(0,1fr);gap:10px}
  .top-rec-card{grid-template-columns:72px minmax(0,1fr)}
  .top-rec-media{width:72px}
  .top-rec-overlay{max-width:66px}
  .top-rec-copy{padding:6px 5px}
}

@media (max-width:900px){
  .dashboard-map-head{display:block;padding:7px 9px 6px}
  .top-recommendation-strip{display:none}
  .warning-block{display:none}
  .map-stat-row{gap:4px;overflow-x:auto}
  .map-stat-button{min-width:64px}
}
.top-rec-open{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;padding:0;cursor:pointer;z-index:2}
.top-rec-open:focus-visible{outline:3px solid rgba(255,255,255,.95);outline-offset:-4px}


/* ================================================================
   IMJ_INT_030 — compact recommendation strip + sidebar summary
   + no-blank background refresh presentation
   ================================================================ */

.camera-summary-block{padding-top:10px!important;padding-bottom:9px!important}
.camera-summary-block .map-heading{display:grid;gap:3px;margin:0 0 7px}
.camera-summary-block .map-heading>span{font-size:.70rem;font-weight:800;color:#18364c}
.camera-summary-block .map-heading strong{display:flex;flex-wrap:wrap;gap:4px 7px;align-items:baseline;font-size:.65rem;color:#506777}
.camera-summary-block .map-total-registered{font-size:.80rem;font-weight:900;color:#132f45}
.camera-summary-block .map-total-mapped{font-size:.62rem;font-weight:800;color:#6d8190}
.camera-summary-block .map-stat-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;overflow:visible}
.camera-summary-block .map-stat-button{min-width:0;min-height:39px;padding:4px 5px}
.camera-summary-block .map-stat-button span{font-size:.55rem}
.camera-summary-block .map-stat-button strong{font-size:.61rem}
.camera-summary-block .dashboard-count-pair{display:grid;line-height:1.05}
.camera-summary-block .dashboard-count-pair small{font-size:.45rem!important}
.camera-summary-help{margin:6px 0 0;color:#728592;font-size:.50rem;line-height:1.25}

.dashboard-map-head{display:block;padding:7px 10px 8px}
.top-recommendation-strip{border-left:0;padding-left:0;gap:5px}
.top-recommendation-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.top-rec-card{height:104px;display:grid;grid-template-columns:1fr;grid-template-rows:62px 42px;border-radius:6px}
.top-rec-media{width:100%;height:62px}
.top-rec-overlay{display:none}
.top-rec-copy{padding:4px 6px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:5px;row-gap:1px;align-content:center}
.top-rec-copy strong{font-size:.58rem;grid-column:1/-1}
.top-rec-copy .top-rec-region{font-size:.46rem;color:#738896;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.top-rec-copy .top-rec-reason{font-size:.46rem;color:#1c6a98;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.top-rec-card.is-warning-priority .top-rec-reason{color:#c64025}
.top-recommendation-strip-head strong{font-size:.70rem}
.top-recommendation-strip-head small{font-size:.50rem}

@media (max-width:1250px) and (min-width:901px){
  .dashboard-map-head{display:block}
  .top-recommendation-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
  .top-rec-card{grid-template-columns:1fr;grid-template-rows:54px 42px;height:96px}
  .top-rec-media{width:100%;height:54px}
  .top-rec-copy{padding:3px 4px}
}

.room-screen img,
.dashboard-live-thumb iframe,
.top-rec-media iframe{transition:opacity .12s linear}


/* ================================================================
   IMJ_INT_031 — visual polish: five large reasoned recommendations,
   category-integrated counts, tighter Japan overview, BGM choices.
   ================================================================ */
.category-summary{font-size:.53rem;color:#536b7a;font-weight:800;white-space:nowrap}
.category-summary-help{margin:-3px 0 7px;color:#7a8d99;font-size:.48rem;line-height:1.2}

.dashboard-map-head{padding:8px 10px 10px}
.top-recommendation-strip-head{margin-bottom:2px}
.top-recommendation-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.top-rec-card{height:auto;min-height:178px;display:flex;flex-direction:column;border-radius:8px;background:#f8fbfd}
.top-rec-media{width:100%;height:auto;aspect-ratio:16/9;flex:0 0 auto;background:#07111b}
.top-rec-media iframe{object-fit:cover}
.top-rec-copy{min-width:0;padding:7px 8px 8px;display:block}
.top-rec-title-row{display:flex;align-items:baseline;justify-content:space-between;gap:6px;margin-bottom:4px}
.top-rec-title-row strong{font-size:.65rem;color:#18364c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.top-rec-title-row .top-rec-region{font-size:.48rem;color:#7b8e99;flex:0 0 auto}
.top-rec-reason{font-size:.74rem;line-height:1.16;font-weight:950;color:#0b5f92;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-rec-card.is-warning-priority .top-rec-reason{color:#c33420}
.top-rec-basis{display:block;margin-top:3px;font-size:.46rem;color:#718591;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-rec-card.is-warning-priority{box-shadow:0 0 0 2px rgba(221,75,43,.15)}
.top-recommendation-strip-head strong{font-size:.78rem}
.top-recommendation-strip-head small{font-size:.52rem}
@media (max-width:1250px) and (min-width:901px){
  .top-rec-card{height:auto;min-height:155px;display:flex}
  .top-rec-media{height:auto;width:100%;aspect-ratio:16/9}
  .top-rec-copy{padding:5px 6px 6px}
  .top-rec-reason{font-size:.66rem}
}

.ambient-music-select{display:inline-flex;align-items:center;gap:5px;color:#d5e5ef;font-size:.69rem}
.ambient-music-select select{min-height:34px;border:1px solid rgba(255,255,255,.18);border-radius:7px;background:#132535;color:#fff;padding:0 26px 0 8px;font:inherit}


/* IMJ_INT_031R1 — make the dynamic recommendation reason intentionally prominent. */
.top-rec-copy .top-rec-reason{
  display:block;
  margin-top:2px;
  padding:4px 6px;
  border-radius:5px;
  background:#e8f4fb;
  color:#075c8e;
  font-size:13px;
  line-height:1.22;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:left;
}
.top-rec-card.is-warning-priority .top-rec-copy .top-rec-reason{
  background:#fff0eb;
  color:#bd351f;
}
@media (max-width:1250px) and (min-width:901px){
  .top-rec-copy .top-rec-reason{font-size:12px;padding:3px 5px}
}

/* ================================================================
   IMJ_INT_034R2 — user screenshot follow-up
   1) Short desktop: never let the map legend spill over the recommendation strip.
   2) Small mobile: keep ambient controls inside the viewport without horizontal scroll.
   ================================================================ */
@media (min-width: 901px) and (max-height: 800px) {
  .imj12-map-legend { display: none !important; }
}

@media (max-width: 640px) {
  .ambient-controls {
    display: grid !important;
    grid-template-columns: 42px 42px 42px minmax(0, 1fr) auto;
    grid-template-rows: 42px 42px;
    gap: 5px 6px !important;
    min-height: 94px !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    justify-content: stretch !important;
    align-items: stretch !important;
  }
  #ambientPrev { grid-column: 1; grid-row: 1; }
  #ambientToggle { grid-column: 2; grid-row: 1; }
  #ambientNext { grid-column: 3; grid-row: 1; }
  .ambient-speed {
    grid-column: 4;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    gap: 0;
  }
  .ambient-speed span { display: none !important; }
  .ambient-speed select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 22px 0 7px;
    font-size: .73rem;
  }
  .ambient-position {
    grid-column: 5;
    grid-row: 1;
    min-width: 66px;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: .70rem;
  }
  .ambient-music-select {
    grid-column: 1 / 4;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }
  .ambient-music-select > span { display: none; }
  .ambient-music-select select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 22px 0 7px;
    font-size: .70rem;
  }
  .ambient-controls .ambient-music-toggle {
    grid-column: 4;
    grid-row: 2;
    width: 100%;
    min-width: 0 !important;
    height: 42px;
    padding: 0 6px !important;
    font-size: .70rem !important;
    white-space: nowrap;
  }
  .ambient-home {
    grid-column: 5;
    grid-row: 2;
    min-width: 66px !important;
    width: auto;
    height: 42px;
    padding: 0 7px !important;
    font-size: .70rem !important;
    line-height: 1.1;
    white-space: nowrap;
    writing-mode: horizontal-tb !important;
    word-break: keep-all;
  }
  #ambientClose { display: none !important; }
}


/* IMJ_INT_034R3 — mobile TOP: keep recommendations hidden, keep other-LIVE distinct,
   and render LIVE thumbnails at a true 16:9 instead of clipping them into 100px rows. */
@media (max-width: 900px) {
  .top-recommendation-strip { display: none !important; }

  .imj12-latest .dashboard-recommendation-grid {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: min(70vw, 280px) !important;
    grid-template-columns: none !important;
    grid-template-rows: minmax(0, 1fr) !important;
    grid-auto-rows: unset !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 5px 8px 8px !important;
    scroll-snap-type: x mandatory !important;
    overscroll-behavior-x: contain;
    align-items: stretch;
  }

  .imj12-latest .dashboard-rec-card.has-live-preview {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 6px !important;
    gap: 4px !important;
    border: 1px solid #e4ebef !important;
    border-radius: 8px !important;
    background: #fff !important;
    overflow: hidden !important;
    scroll-snap-align: start;
  }

  .imj12-latest .dashboard-live-thumb {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    flex: 0 0 auto !important;
    margin: 0 0 3px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #07111b !important;
  }

  .imj12-latest .dashboard-live-thumb iframe {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
  }

  .imj12-latest .dashboard-rec-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .imj12-latest .dashboard-rec-card h3 {
    margin: 1px 0 0 !important;
    font-size: .76rem !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .imj12-latest .dashboard-rec-card p,
  .imj12-latest .dashboard-rec-time {
    font-size: .58rem !important;
    line-height: 1.15 !important;
  }

  .imj12-latest .dashboard-rec-link {
    margin-top: 2px !important;
    font-size: .58rem !important;
  }
}

/* IMJ_INT_034R3R1 — mobile LIVE rail card-fit correction.
   R3 correctly uses true 16:9 media and excludes the reserved recommendation IDs, but its 70vw card
   makes the 16:9 media taller than the existing mobile rail. Keep the proven 66/34 map/LIVE split,
   use compact 16:9 swipe cards, and show only the camera title below the media on mobile. */
@media (max-width: 900px) {
  .imj12-latest .dashboard-recommendation-grid {
    grid-auto-columns: min(44vw, 176px) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-items: stretch !important;
  }

  .imj12-latest .dashboard-rec-card.has-live-preview {
    height: 100% !important;
    min-height: 0 !important;
    padding: 4px !important;
    gap: 2px !important;
  }

  .imj12-latest .dashboard-live-thumb {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  .imj12-latest .dashboard-rec-main {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .imj12-latest .dashboard-rec-meta,
  .imj12-latest .dashboard-rec-card p,
  .imj12-latest .dashboard-rec-time,
  .imj12-latest .dashboard-rec-ai,
  .imj12-latest .dashboard-rec-link {
    display: none !important;
  }

  .imj12-latest .dashboard-rec-card h3 {
    display: block !important;
    margin: 2px 1px 0 !important;
    font-size: .66rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}


/* SEO/Uchiwa related service */
.related-service {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(8, 47, 85, .12);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: .72rem;
  line-height: 1.35;
}
.related-service span {
  color: #64748b;
}
.related-service a {
  color: #0b5ea8;
  font-weight: 700;
  text-decoration: none;
}
.related-service a:hover,
.related-service a:focus-visible {
  text-decoration: underline;
}


/* IMJ_INT_037 — category-linked LIVE catalog, desktop ambient queue, mobile fit/grid. */
.rec-category.is-tourism-live { background:#7a4fb3; }

@media (min-width: 901px) {
  .ambient-viewer {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr) auto 4px;
  }
  .ambient-stage { grid-column:1; grid-row:1; }
  .ambient-controls { grid-column:1 / -1; grid-row:2; }
  .ambient-progress { grid-column:1 / -1; grid-row:3; }
  .ambient-queue-panel {
    grid-column:2; grid-row:1; min-height:0; display:grid; grid-template-rows:auto auto minmax(0,1fr);
    background:#0b1c29; border-left:1px solid rgba(255,255,255,.12); color:#fff;
  }
  .ambient-queue-panel[hidden] { display:none !important; }
  .ambient-viewer[data-current-view-mode="1"] { grid-template-columns:minmax(0,1fr); }
  .ambient-viewer[data-current-view-mode="1"] .ambient-stage { grid-column:1; }
  .ambient-queue-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:14px 14px 8px; }
  .ambient-queue-head strong { font-size:.95rem; }
  .ambient-queue-head span { color:#9fb9cb; font-size:.72rem; }
  .ambient-category-select { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; padding:0 14px 10px; color:#a9c0d0; font-size:.72rem; }
  .ambient-category-select select { min-width:0; height:36px; border:1px solid rgba(255,255,255,.18); border-radius:9px; background:#132b3c; color:#fff; padding:0 30px 0 9px; }
  .ambient-category-select select option { color:#111; background:#fff; }
  .ambient-queue-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 10px 12px; display:grid; align-content:start; gap:7px; }
  .ambient-queue-item { width:100%; min-width:0; display:grid; grid-template-columns:92px minmax(0,1fr); gap:8px; align-items:center; padding:6px; border:1px solid rgba(255,255,255,.10); border-radius:9px; background:rgba(255,255,255,.055); color:#fff; text-align:left; cursor:pointer; }
  .ambient-queue-item:hover,.ambient-queue-item:focus-visible { background:rgba(255,255,255,.11); outline:none; }
  .ambient-queue-thumb { width:92px; aspect-ratio:16/9; overflow:hidden; border-radius:6px; background:#000; }
  .ambient-queue-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
  .ambient-queue-copy { min-width:0; display:grid; gap:2px; }
  .ambient-queue-copy small { color:#7dc7f2; font-size:.62rem; font-weight:850; }
  .ambient-queue-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.76rem; }
  .ambient-queue-copy em { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#9fb9cb; font-size:.60rem; font-style:normal; }
  .ambient-queue-empty { margin:10px; color:#9fb9cb; font-size:.78rem; }

  .imj12-latest .dashboard-recommendation-grid {
    display:grid !important; grid-template-columns:1fr !important; grid-template-rows:none !important; grid-auto-flow:row !important;
    grid-auto-rows:max-content !important; gap:8px !important; overflow-y:auto !important; overflow-x:hidden !important;
    padding:6px 8px 10px !important; align-content:start !important; scroll-snap-type:none !important;
  }
  .imj12-latest .dashboard-rec-card.has-live-preview {
    display:block !important; height:auto !important; min-height:0 !important; padding:7px !important; border:1px solid #e2e9ed !important; border-radius:8px !important; background:#fff !important; overflow:visible !important;
  }
  .imj12-latest .dashboard-live-thumb { width:100% !important; height:auto !important; aspect-ratio:16/9 !important; margin:0 0 6px !important; border-radius:6px !important; overflow:hidden !important; background:#07111b !important; }
  .imj12-latest .dashboard-live-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
  .imj12-latest .dashboard-rec-card h3 { margin:3px 0 1px !important; font-size:.74rem !important; line-height:1.2 !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}

@media (max-width: 900px) {
  .ambient-viewer { top:100px !important; grid-template-columns:1fr !important; }
  .ambient-queue-panel { display:none !important; }
  .ambient-stage { padding:8px 10px 8px !important; overflow-y:auto !important; place-items:start center !important; }
  .ambient-content { min-height:0 !important; align-content:start !important; padding-top:2px; }
  .ambient-badges { margin-bottom:5px !important; }
  .ambient-icon { font-size:2.25rem !important; }
  .ambient-eyebrow { margin:6px 0 2px !important; font-size:.64rem !important; }
  .ambient-title { font-size:clamp(1.75rem,8.5vw,2.6rem) !important; line-height:1.02 !important; }
  .ambient-location { margin-top:6px !important; font-size:.78rem !important; }
  .ambient-signal { margin-top:8px !important; font-size:.88rem !important; }
  .ambient-reasons { margin-top:7px !important; gap:5px !important; }
  .ambient-reasons span { padding:4px 7px !important; font-size:.66rem !important; }
  .ambient-media { width:min(96vw,720px) !important; margin-top:8px !important; }
  .ambient-actions { margin-top:8px !important; gap:7px !important; }
  .ambient-official-link { min-height:40px !important; padding:7px 14px !important; font-size:.80rem !important; }
  .ambient-rights-note { font-size:.65rem !important; }

  .imj12-latest .dashboard-recommendation-grid {
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; grid-template-rows:none !important; grid-auto-flow:row !important;
    grid-auto-columns:unset !important; grid-auto-rows:max-content !important; gap:6px !important; overflow-y:auto !important; overflow-x:hidden !important;
    padding:5px 6px 8px !important; scroll-snap-type:none !important; overscroll-behavior-y:contain; align-content:start !important;
  }
  .imj12-latest .dashboard-rec-card.has-live-preview {
    display:block !important; width:100% !important; height:auto !important; min-height:0 !important; padding:4px !important; gap:0 !important;
    border:1px solid #e4ebef !important; border-radius:7px !important; background:#fff !important; overflow:hidden !important;
  }
  .imj12-latest .dashboard-live-thumb { width:100% !important; height:auto !important; aspect-ratio:16/9 !important; margin:0 !important; border-radius:5px !important; overflow:hidden !important; background:#07111b !important; }
  .imj12-latest .dashboard-live-thumb img { display:block !important; width:100% !important; height:100% !important; object-fit:cover !important; }
  .imj12-latest .dashboard-rec-main { min-width:0; overflow:hidden; }
  .imj12-latest .dashboard-rec-meta,.imj12-latest .dashboard-rec-card p,.imj12-latest .dashboard-rec-time,.imj12-latest .dashboard-rec-ai,.imj12-latest .dashboard-rec-link { display:none !important; }
  .imj12-latest .dashboard-rec-card h3 { display:block !important; margin:3px 1px 1px !important; font-size:.64rem !important; line-height:1.15 !important; white-space:nowrap !important; overflow:hidden !important; text-overflow:ellipsis !important; }
}


/* IMJ041: ambient nationwide weather background + prominent current-place forecast */
.ambient-weather-layer{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden;opacity:.96}
.ambient-weather-map{position:absolute;inset:-2%;background:transparent;opacity:.33;filter:saturate(.82) contrast(.92);transform:scale(1.02)}
.ambient-weather-map::after{content:"";position:absolute;inset:0;z-index:500;background:linear-gradient(180deg,rgba(7,21,34,.10),rgba(7,21,34,.54) 68%,rgba(7,21,34,.86));pointer-events:none}
.ambient-weather-map .leaflet-control-container{display:none!important}
.ambient-weather-map .leaflet-tile-pane{filter:saturate(.62) brightness(.75)}
.ambient-weather-map-caption{position:absolute;top:14px;right:16px;z-index:700;display:grid;gap:1px;min-width:150px;padding:9px 11px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(5,20,31,.46);backdrop-filter:blur(9px);text-align:right;color:#dff2ff;box-shadow:0 8px 28px rgba(0,0,0,.12)}
.ambient-weather-map-caption strong{font-size:.78rem;letter-spacing:.08em}
.ambient-weather-map-caption span{font-size:.68rem;color:#9fd4f3}
.ambient-weather-map-caption small{font-size:.52rem;color:#8ca9bb}
.ambient-weather-marker{background:transparent!important;border:0!important}
.ambient-weather-marker-inner{display:grid;justify-items:center;gap:0;min-width:44px;padding:3px 5px;border:1px solid rgba(255,255,255,.16);border-radius:9px;background:rgba(5,22,35,.58);box-shadow:0 5px 16px rgba(0,0,0,.18);color:#fff;backdrop-filter:blur(5px);white-space:nowrap}
.ambient-weather-marker-inner b{font-size:1.18rem;line-height:1.05;filter:drop-shadow(0 2px 3px rgba(0,0,0,.28))}
.ambient-weather-marker-inner span{font-size:.54rem;font-weight:850;line-height:1.15}
.ambient-location-weather-row{width:min(1180px,96%);margin-top:13px;display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap}
.ambient-location-weather-row .ambient-location{margin:0;color:#d7e7f2;font-size:clamp(1rem,2vw,1.2rem);font-weight:760}
.ambient-weather-now{display:grid;grid-template-columns:auto auto;grid-template-areas:"main metrics" "source source";align-items:center;gap:3px 13px;min-width:min(520px,92vw);padding:9px 14px;border:1px solid rgba(255,255,255,.20);border-radius:15px;background:rgba(5,20,32,.62);box-shadow:0 10px 34px rgba(0,0,0,.18);backdrop-filter:blur(12px);color:#fff;text-align:left}
.ambient-weather-main{grid-area:main;display:flex;align-items:center;gap:8px;min-width:0}
.ambient-weather-icon{font-size:clamp(1.9rem,3.2vw,2.8rem);line-height:1}
.ambient-weather-main strong{font-size:clamp(1.05rem,2.1vw,1.55rem);line-height:1.05;max-width:330px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ambient-weather-metrics{grid-area:metrics;display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;font-size:clamp(.88rem,1.6vw,1.08rem);font-weight:850}
.ambient-weather-metrics span{padding:4px 7px;border-radius:8px;background:rgba(255,255,255,.09);white-space:nowrap}
.ambient-weather-now small{grid-area:source;color:#94bdd5;font-size:.62rem;text-align:right}
.ambient-weather-now.is-loading{opacity:.72}
.ambient-weather-now.is-unavailable .ambient-weather-main strong{font-size:.92rem;color:#bad0de}
.ambient-viewer[data-current-view-mode="1"] .ambient-weather-layer,.ambient-viewer[data-current-view-mode="1"] .ambient-weather-now{display:none!important}
@media(max-width:720px){
  .ambient-weather-map{opacity:.24;inset:-8% -28% -4%}
  .ambient-weather-map-caption{top:6px;right:7px;min-width:0;padding:5px 7px;border-radius:8px}
  .ambient-weather-map-caption strong{font-size:.62rem}.ambient-weather-map-caption span{font-size:.52rem}.ambient-weather-map-caption small{display:none}
  .ambient-location-weather-row{width:100%;margin-top:4px;gap:5px;display:grid;justify-items:center}
  .ambient-location-weather-row .ambient-location{font-size:.78rem;max-width:96%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ambient-weather-now{min-width:0;width:min(96vw,560px);padding:5px 8px;border-radius:10px;gap:2px 7px}
  .ambient-weather-icon{font-size:1.42rem}.ambient-weather-main strong{font-size:.82rem;max-width:170px}
  .ambient-weather-metrics{gap:4px;font-size:.68rem}.ambient-weather-metrics span{padding:2px 4px}
  .ambient-weather-now small{font-size:.50rem}
}


/* IMJ042: ambient desktop polish — brighter background, right-side map, left title, two weather tiles */
.ambient-viewer{background:#9ed5f6;}
.ambient-stage{background:linear-gradient(135deg,#aee1fb 0%,#8fccef 46%,#72b9e3 100%);}
.ambient-backdrop{opacity:.92;background:radial-gradient(circle at 16% 22%, rgba(255,255,255,.52), transparent 28%),radial-gradient(circle at 26% 75%, rgba(82,177,232,.24), transparent 33%),radial-gradient(circle at 84% 28%, rgba(255,255,255,.38), transparent 24%);}
.ambient-content{width:min(1240px,100%);min-height:min(680px,calc(100vh - 188px));align-content:start;justify-items:center;padding-top:8px;}
.ambient-badges{margin-bottom:10px;}
.ambient-icon{font-size:clamp(2.6rem,5vw,4.6rem);filter:drop-shadow(0 8px 22px rgba(36,90,129,.18));}
.ambient-stage{place-items:start center !important;padding:20px clamp(22px,3vw,34px) 32px !important;background:linear-gradient(180deg,#98d8fb 0%,#64b7e8 34%,#0d3154 100%) !important;}
.ambient-content{position:relative;z-index:2;padding-top:8px !important;}
.ambient-hero-row{width:min(1180px,100%) !important;display:grid !important;grid-template-columns:minmax(300px,420px) minmax(340px,420px) !important;gap:26px !important;align-items:center !important;justify-content:space-between !important;margin-top:6px !important;}
.ambient-title-panel{text-align:center !important;justify-self:center !important;min-width:0;}
.ambient-eyebrow{margin:0 0 8px !important;color:#f3fbff !important;text-shadow:0 1px 0 rgba(16,54,84,.18) !important;}
.ambient-title{max-width:none !important;color:#fff !important;text-align:center !important;text-shadow:0 3px 16px rgba(19,77,117,.22) !important;font-size:clamp(3.2rem,5.3vw,5.6rem) !important;line-height:1 !important;overflow-wrap:anywhere !important;}
.ambient-location{margin:10px 0 0 !important;color:#ecf8ff !important;font-size:clamp(1rem,1.9vw,1.28rem) !important;font-weight:760 !important;text-align:center !important;text-shadow:0 2px 10px rgba(16,54,84,.16) !important;}
.ambient-signal{max-width:1120px !important;margin:10px 0 0 !important;color:#f7fdff !important;font-size:clamp(.72rem,1.05vw,.9rem) !important;font-weight:700 !important;text-shadow:0 1px 8px rgba(12,57,90,.14) !important;}
.ambient-media{width:min(1060px,86vw) !important;margin-top:12px !important;margin-bottom:18px !important;}
.ambient-site-media{max-height:min(52vh,580px) !important;box-shadow:0 18px 36px rgba(8,50,78,.24) !important;}
.ambient-weather-layer{opacity:1 !important;z-index:1 !important;pointer-events:none !important;}
.ambient-weather-map{display:block !important;left:auto !important;right:3.2% !important;top:10% !important;bottom:16% !important;width:min(31vw,500px) !important;inset:auto 3.2% 16% auto !important;border-radius:28px !important;overflow:hidden !important;opacity:.72 !important;filter:saturate(.96) contrast(.98) brightness(1.14) !important;transform:none !important;box-shadow:0 20px 42px rgba(23,84,121,.16) !important;border:1px solid rgba(255,255,255,.24) !important;}
.ambient-weather-map::after{background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(141,206,243,.10) 58%,rgba(73,148,196,.16)) !important;}
.ambient-weather-map .leaflet-tile-pane{filter:saturate(.84) brightness(1.12) !important;opacity:.96 !important;}
.ambient-weather-map-caption{top:14px !important;right:14px !important;min-width:150px !important;border:1px solid rgba(255,255,255,.42) !important;background:rgba(218,242,255,.74) !important;color:#11486e !important;box-shadow:0 10px 26px rgba(23,84,121,.12) !important;}
.ambient-weather-map-caption strong{color:#17587f !important;}
.ambient-weather-map-caption span{color:#2b739f !important;}
.ambient-weather-map-caption small{color:#4e7f9d !important;}
.ambient-weather-marker-inner{border:1px solid rgba(255,255,255,.5) !important;background:rgba(227,246,255,.92) !important;box-shadow:0 5px 18px rgba(39,113,159,.16) !important;color:#184664 !important;backdrop-filter:blur(4px) !important;}
.ambient-weather-now{width:100% !important;min-width:0 !important;display:grid !important;grid-template-columns:1fr !important;gap:12px !important;background:transparent !important;border:0 !important;box-shadow:none !important;padding:0 !important;backdrop-filter:none !important;align-items:stretch !important;justify-self:end !important;}
.ambient-weather-card{display:grid !important;gap:8px !important;align-content:center !important;justify-items:center !important;min-height:106px !important;padding:12px 14px !important;border:1px solid rgba(255,255,255,.52) !important;border-radius:18px !important;background:rgba(242,251,255,.84) !important;box-shadow:0 14px 34px rgba(29,98,142,.14) !important;backdrop-filter:blur(10px) !important;text-align:center !important;}
.ambient-weather-card-main,.ambient-weather-card-sub{grid-template-rows:auto auto auto !important;}
.ambient-weather-main{justify-content:center !important;align-items:center !important;gap:10px !important;text-align:center !important;}
.ambient-weather-icon{font-size:clamp(2rem,2.8vw,2.6rem) !important;}
.ambient-weather-main strong{max-width:none !important;color:#123e5d !important;font-size:clamp(1rem,1.45vw,1.26rem) !important;white-space:normal !important;line-height:1.2 !important;text-align:center !important;word-break:keep-all !important;}
.ambient-weather-metrics,.ambient-weather-extra{display:flex !important;flex-wrap:wrap !important;justify-content:center !important;gap:8px !important;}
.ambient-weather-metrics span,.ambient-weather-extra span{padding:6px 9px !important;border-radius:10px !important;background:rgba(117,194,236,.16) !important;color:#184664 !important;white-space:nowrap !important;}
.ambient-weather-now small{grid-area:auto !important;text-align:center !important;font-size:.64rem !important;color:#427395 !important;}
.ambient-location-weather-row{display:contents !important;}
@media (min-width:901px){
  .ambient-stage{padding-bottom:34px !important;}
}
@media (max-width:900px){
  .ambient-stage{background:linear-gradient(180deg,#9fd7f6 0%,#73b9e2 100%) !important;}
  .ambient-content{padding-top:2px !important;}
  .ambient-hero-row{width:100% !important;grid-template-columns:1fr !important;gap:8px !important;margin-top:0 !important;}
  .ambient-title-panel{text-align:center !important;justify-self:center !important;}
  .ambient-title{font-size:clamp(1.8rem,9vw,2.7rem) !important;text-align:center !important;}
  .ambient-location{text-align:center !important;font-size:.82rem !important;}
  .ambient-signal{margin-top:6px !important;font-size:.72rem !important;}
  .ambient-weather-now{grid-template-columns:1fr 1fr !important;gap:6px !important;justify-self:stretch !important;}
  .ambient-weather-card{min-height:0 !important;padding:7px 8px !important;border-radius:12px !important;gap:5px !important;}
  .ambient-weather-main strong{font-size:.76rem !important;line-height:1.08 !important;}
  .ambient-weather-icon{font-size:1.4rem !important;}
  .ambient-weather-metrics,.ambient-weather-extra{gap:4px !important;font-size:.62rem !important;}
  .ambient-weather-metrics span,.ambient-weather-extra span{padding:3px 5px !important;}
  .ambient-weather-now small{font-size:.50rem !important;}
  .ambient-weather-map{opacity:.28 !important;inset:7% -18% 14% auto !important;width:min(74vw,420px) !important;right:-6% !important;left:auto !important;top:7% !important;bottom:14% !important;border-radius:18px !important;}
  .ambient-media{margin-bottom:6px !important;}
  .ambient-site-media{max-height:min(42vh,420px) !important;}
}


/* IMJ043R1 — production visual correction after browser evidence. */
@media (min-width:901px){
  .ambient-stage{
    background:linear-gradient(180deg,#b9eaff 0%,#8bd4f7 48%,#63bbe9 100%) !important;
    padding:18px clamp(22px,3vw,34px) 18px !important;
  }
  .ambient-content{padding-top:4px !important;}
  .ambient-hero-row{
    width:min(900px,100%) !important;
    grid-template-columns:minmax(280px,350px) minmax(360px,410px) !important;
    justify-content:center !important;
    gap:34px !important;
  }
  .ambient-title-panel{justify-self:center !important;text-align:center !important;}
  .ambient-weather-now{
    grid-template-areas:none !important;
    grid-template-columns:1fr !important;
    grid-template-rows:none !important;
    grid-auto-flow:row !important;
    grid-auto-columns:auto !important;
    grid-auto-rows:auto !important;
    justify-self:center !important;
    width:100% !important;
    max-width:410px !important;
  }
  .ambient-weather-card{
    grid-template-areas:none !important;
    grid-template-columns:1fr !important;
    grid-template-rows:auto !important;
    justify-items:center !important;
    text-align:center !important;
    min-height:96px !important;
    padding:11px 14px !important;
  }
  .ambient-weather-main,.ambient-weather-metrics{
    grid-area:auto !important;
    width:100% !important;
    justify-content:center !important;
    justify-self:center !important;
    text-align:center !important;
  }
  .ambient-weather-main strong{word-break:keep-all !important;overflow-wrap:normal !important;text-align:center !important;}
  .ambient-weather-extra{width:100% !important;justify-content:center !important;}
  .ambient-weather-now small{width:100% !important;text-align:center !important;}
  .ambient-weather-map{
    display:block !important;
    right:2.2% !important;
    left:auto !important;
    top:9% !important;
    bottom:11% !important;
    width:min(29vw,455px) !important;
    opacity:.82 !important;
    filter:saturate(1.02) contrast(.98) brightness(1.16) !important;
    border:1px solid rgba(255,255,255,.42) !important;
    box-shadow:0 18px 40px rgba(28,105,151,.16) !important;
  }
  .ambient-weather-map .leaflet-tile-pane{filter:saturate(.90) brightness(1.13) !important;opacity:1 !important;}
  .ambient-media{width:min(940px,78vw) !important;margin-top:10px !important;margin-bottom:6px !important;}
  .ambient-site-media{max-height:min(46vh,520px) !important;}
  .ambient-signal{margin-top:7px !important;font-size:clamp(.70rem,.95vw,.84rem) !important;}
  .ambient-reasons{margin-top:7px !important;}
  .ambient-actions{margin-top:8px !important;}
}


/* IMJ043R2 — resolve remaining desktop lower clipping from R1 browser geometry. */
@media (min-width:901px){
  .ambient-content{padding-top:0 !important;}
  .ambient-badges{margin-bottom:5px !important;}
  .ambient-icon{font-size:clamp(2.2rem,3.8vw,3.5rem) !important;}
  .ambient-hero-row{margin-top:2px !important;gap:28px !important;}
  .ambient-weather-now{gap:8px !important;}
  .ambient-weather-card{min-height:78px !important;padding:8px 12px !important;gap:6px !important;}
  .ambient-weather-main strong{font-size:clamp(.94rem,1.28vw,1.14rem) !important;line-height:1.16 !important;}
  .ambient-weather-icon{font-size:clamp(1.7rem,2.25vw,2.25rem) !important;}
  .ambient-weather-metrics,.ambient-weather-extra{font-size:.78rem !important;gap:6px !important;}
  .ambient-weather-metrics span,.ambient-weather-extra span{padding:4px 7px !important;}
  .ambient-weather-now small{font-size:.58rem !important;}
  .ambient-signal{margin-top:5px !important;}
  .ambient-reasons{margin-top:5px !important;}
  .ambient-reasons span{padding:4px 7px !important;font-size:.72rem !important;}
  .ambient-media{
    width:min(660px,56vw,calc((100dvh - 550px) * 1.7778)) !important;
    max-width:100% !important;
    margin-top:7px !important;
    margin-bottom:4px !important;
  }
  .ambient-live-wrap{width:100% !important;max-width:none !important;aspect-ratio:16/9 !important;}
  .ambient-actions{margin-top:5px !important;}
}


/* IMJ044 — private mouse-driven ambient layout editor (?layout=1). */
body.ambient-layout-editing .ambient-viewer{overflow:visible!important;}
body.ambient-layout-editing .ambient-stage{overflow:visible!important;}
body.ambient-layout-editing .ambient-title-panel,
body.ambient-layout-editing .ambient-weather-now,
body.ambient-layout-editing .ambient-media{
  outline:2px dashed rgba(255,255,255,.92)!important;
  outline-offset:4px!important;
  cursor:move!important;
  touch-action:none!important;
  position:relative;
  z-index:30!important;
}
body.ambient-layout-editing .ambient-title-panel::before,
body.ambient-layout-editing .ambient-weather-now::before,
body.ambient-layout-editing .ambient-media::before{
  position:absolute;top:-24px;left:0;padding:3px 7px;border-radius:999px;background:rgba(2,37,62,.86);color:#fff;font:700 11px/1.2 system-ui,sans-serif;pointer-events:none;white-space:nowrap;z-index:9999;
}
body.ambient-layout-editing .ambient-title-panel::before{content:'地名：ドラッグ移動 / ホイール拡大縮小';}
body.ambient-layout-editing .ambient-weather-now::before{content:'天気：ドラッグ移動 / ホイール幅変更';}
body.ambient-layout-editing .ambient-media::before{content:'動画：ドラッグ移動 / ホイール拡大縮小';}
body.ambient-layout-editing .ambient-media iframe{pointer-events:none!important;}
body.ambient-layout-editing .ambient-weather-layer{pointer-events:auto!important;z-index:1!important;}
body.ambient-layout-editing .ambient-weather-map{pointer-events:auto!important;cursor:grab!important;outline:2px dashed rgba(255,255,255,.7)!important;outline-offset:2px!important;}
body.ambient-layout-editing .ambient-weather-map:active{cursor:grabbing!important;}
body.ambient-layout-editing .ambient-title-panel{transform:translate(var(--layout-title-x,0px),var(--layout-title-y,0px)) scale(var(--layout-title-scale,1))!important;transform-origin:center!important;}
body.ambient-layout-editing .ambient-weather-now{width:var(--layout-weather-width,410px)!important;max-width:none!important;transform:translate(var(--layout-weather-x,0px),var(--layout-weather-y,0px))!important;}
body.ambient-layout-editing .ambient-media{width:var(--layout-video-width,660px)!important;max-width:none!important;transform:translate(var(--layout-video-x,0px),var(--layout-video-y,0px))!important;}
body.ambient-layout-editing #ambientOfficialLink{transform:translate(var(--layout-official-x,0px),var(--layout-official-y,0px))!important;z-index:4!important;pointer-events:auto!important;}
body.ambient-layout-editing .ambient-weather-map{left:var(--layout-map-left,auto)!important;right:var(--layout-map-right,2.2%)!important;top:var(--layout-map-top,9%)!important;bottom:var(--layout-map-bottom,11%)!important;width:var(--layout-map-width,min(29vw,455px))!important;height:var(--layout-map-height,auto)!important;opacity:var(--layout-map-opacity,.82)!important;}
body.ambient-layout-editing .ambient-stage.layout-bg-override{background:var(--layout-bg-color)!important;}
.ambient-layout-panel{position:fixed;left:16px;top:82px;z-index:100000;width:300px;max-height:calc(100vh - 110px);overflow:auto;padding:12px;border:1px solid rgba(255,255,255,.28);border-radius:14px;background:rgba(5,27,44,.94);box-shadow:0 18px 50px rgba(0,0,0,.28);color:#fff;font:13px/1.35 system-ui,sans-serif;backdrop-filter:blur(14px);}
.ambient-layout-panel *{box-sizing:border-box;}
.ambient-layout-panel h2{margin:0 0 5px;font-size:16px;}
.ambient-layout-panel p{margin:0 0 9px;color:#b9d7e9;font-size:11px;}
.ambient-layout-panel label{display:grid;grid-template-columns:88px minmax(0,1fr) 48px;gap:7px;align-items:center;margin:7px 0;}
.ambient-layout-panel input[type=range]{width:100%;}
.ambient-layout-panel input[type=color]{width:100%;height:32px;border:0;padding:0;background:transparent;}
.ambient-layout-panel output{text-align:right;color:#d9f2ff;font-variant-numeric:tabular-nums;font-size:11px;}
.ambient-layout-panel .layout-row{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:8px;}
.ambient-layout-panel button{min-height:34px;border:1px solid rgba(255,255,255,.17);border-radius:9px;background:#173c55;color:#fff;font-weight:700;cursor:pointer;padding:6px 8px;}
.ambient-layout-panel button:hover{background:#22536f;}
.ambient-layout-panel textarea{width:100%;min-height:102px;margin-top:8px;padding:7px;border:1px solid rgba(255,255,255,.14);border-radius:8px;background:#071b29;color:#d7effd;font:10px/1.35 ui-monospace,Consolas,monospace;resize:vertical;}
.ambient-layout-panel .layout-color-row{grid-template-columns:88px minmax(0,1fr) 58px;}
.ambient-layout-panel .layout-check{display:flex;grid-template-columns:none;gap:7px;align-items:center;}
.ambient-layout-panel .layout-check input{margin:0;}
.ambient-layout-panel .layout-note{margin-top:8px;padding:7px;border-radius:8px;background:rgba(255,255,255,.07);color:#c9e2f0;font-size:10px;}
@media(max-width:900px){.ambient-layout-panel{width:min(92vw,320px);left:4vw;top:108px;max-height:calc(100vh - 130px);}}


/* IMJ046 — accepted user JSON fixed into normal desktop ambient view. */
@media (min-width:901px) {
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-title-panel {
    transform:translate(-60px,3px) scale(1)!important;
    transform-origin:center!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-now {
    width:560px!important;max-width:none!important;
    transform:translate(27px,4px)!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-media {
    width:min(900px,max(360px,calc((100dvh - 500px) * 1.7778)))!important;
    max-width:min(900px,calc(100vw - 360px))!important;
    transform:translate(43px,-3px)!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) #ambientOfficialLink {
    transform:translate(0px,0px)!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-map {
    left:0px!important;right:auto!important;top:0px!important;bottom:auto!important;
    width:2260px!important;height:1131px!important;opacity:0.42!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-stage.layout-bg-override {
    background:var(--layout-bg-color)!important;
  }
}

/* IMJ046R1: short-desktop safety keeps approved 900px target but caps effective video width so the player never runs under controls. */


/* IMJ046R2: short-height desktop compaction. The approved schema-1 layout stays canonical;
   only the effective <=780px-high desktop presentation is compacted so video + official link
   remain above the fixed controls. Mobile and ?layout=1 editor are excluded. */
@media (min-width:901px) and (max-height:820px) {
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-content {
    padding-top:0!important;
    min-height:0!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-badges {
    margin-bottom:1px!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-icon {
    font-size:2rem!important;
    line-height:.9!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-hero-row {
    margin-top:0!important;
    gap:16px!important;
    align-items:center!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-title {
    font-size:clamp(2.35rem,4vw,3.45rem)!important;
    line-height:.94!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-location {
    margin-top:3px!important;
    font-size:.84rem!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-now {
    gap:5px!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-card {
    min-height:54px!important;
    padding:5px 8px!important;
    gap:2px!important;
    border-radius:12px!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-icon {
    font-size:1.45rem!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-main strong {
    font-size:.82rem!important;
    line-height:1.05!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-metrics,
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-extra {
    gap:3px!important;
    font-size:.62rem!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-metrics span,
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-extra span {
    padding:2px 4px!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-weather-now small {
    font-size:.48rem!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-signal,
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-reasons {
    display:none!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-media {
    width:min(560px,max(420px,calc((100dvh - 450px) * 1.7778)))!important;
    max-width:min(560px,calc(100vw - 360px))!important;
    margin-top:3px!important;
    margin-bottom:0!important;
    transform:translate(43px,-34px)!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-actions {
    margin-top:0!important;
    transform:translateY(-54px)!important;
  }
  body.ambient-layout-fixed:not(.ambient-layout-editing) .ambient-rights-note {
    display:none!important;
  }
}
