/* The browsing screen is quiet; active navigation keeps its existing cockpit. */
body.lumi-refined {
  --lh-paper: #fff;
  --lh-ground: #f4f6f3;
  --lh-ink: #193e36;
  --lh-muted: #677b72;
  --lh-line: #e0e7e1;
  --lh-soft: #f0f4ef;
  --lh-shadow: 0 4px 20px #173d3210;
  background: var(--lh-ground);
  color: var(--lh-ink);
}
.lumi-refined .topbar { height: 72px; padding: 0 28px; border: 0; background: var(--lh-ground); }
.lumi-refined .lumi-brand-mark { width: 36px; height: 36px; border-radius: 12px; font-size: 25px; }
.lumi-refined .brand .lumi-brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.6px; }
.lumi-refined .lumi-brand-name small { font-size: 10px; font-weight: 400; letter-spacing: .3px; margin-top: 2px; color: var(--lh-muted); }
.lumi-refined .topbar .beta { font-size: 11px; }
.lumi-refined .topbar .mall-link { display: flex; align-items: center; gap: 2px; min-height: 44px; font-size: 10px; color: var(--lh-muted); }
.lumi-refined .workspace { height: calc(100dvh - 72px); grid-template-columns: 352px minmax(0, 1fr); gap: 20px; padding: 0 24px 24px; }
.lumi-refined .sidebar { display: flex; flex-direction: column; padding-right: 2px; }
.lumi-refined .sidebar > * { flex-shrink: 0; }
.lumi-refined .sidebar > .lumi-voice-card { order: -2; }
.lumi-refined .sidebar > .search-area { order: -1; }
.lumi-refined .map-stage { border-radius: 24px; border-color: var(--lh-line); box-shadow: var(--lh-shadow); }

/* One search bar and a small rail leave the centre of the map unobstructed. */
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search {
  inset: 16px 16px auto; max-width: 580px; z-index: 65;
}
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search form {
  min-height: 58px; padding: 5px; gap: 3px; border: 1px solid var(--lh-line);
  border-radius: 17px; background: var(--lh-paper); box-shadow: 0 4px 20px #163d3324;
}
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search input {
  font-size: 16px; letter-spacing: -.5px; padding: 11px 8px; color: var(--lh-ink);
}
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search input::placeholder { color: #7b8982; }
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search button { min-height: 44px; border-radius: 12px; }
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search .map-top-search-submit {
  padding: 9px 13px; font-size: 13px; background: #1b5b4b; border: 0;
}
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search .map-top-search-mic {
  display: grid; place-items: center; width: 44px; min-width: 44px; padding: 0;
  font-size: 0; background: var(--lh-soft); color: var(--lh-ink);
}
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search .map-top-search-mic::before { width: 20px; height: 20px; }
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search .map-top-search-mic[aria-pressed=true] { background: #fbe9df; color: #9b4229; }
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search-status {
  max-height: 60px; margin-top: 7px; padding: 8px 12px; border-radius: 12px;
  background: var(--lh-paper); color: var(--lh-muted); box-shadow: var(--lh-shadow); font-size: 11px; line-height: 1.5;
}
.lumi-refined[data-lumi-home=true] #mapStage .map-top-search-results { font-size: 12px !important; min-height: 44px !important; }
.lumi-refined[data-lumi-home=true] #mapStage #fullscreenMap,
.lumi-refined[data-lumi-home=true] #mapStage #centerMap {
  position: absolute; inset: auto 16px 102px auto; width: 44px; height: 44px; min-height: 44px;
  display: grid; place-items: center; padding: 0; gap: 0; font-size: 0;
  background: var(--lh-paper); color: var(--lh-ink); border: 1px solid var(--lh-line);
  border-radius: 14px; box-shadow: var(--lh-shadow); z-index: 45;
}
.lumi-refined[data-lumi-home=true] #mapStage #fullscreenMap { bottom: 154px; }
.lumi-refined[data-lumi-home=true] #mapStage :is(#fullscreenMap, #centerMap)::before { width: 21px; height: 21px; }
.lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-top-right { top: 152px; right: 16px; }
.lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin: 0; border: 1px solid var(--lh-line); border-radius: 14px; box-shadow: var(--lh-shadow); overflow: hidden;
}
.lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-group button { width: 42px; height: 44px; min-height: 44px; border: 0; border-radius: 0; }
.lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-group button + button { border-top: 1px solid var(--lh-line); }
.lumi-refined[data-lumi-home=true] #mapStage .lumi-map-tools {
  inset: auto 16px 32px; transform: none; width: auto; max-width: 480px;
  padding: 5px; gap: 3px; border: 1px solid var(--lh-line); border-radius: 18px;
  background: var(--lh-paper); box-shadow: 0 5px 20px #183f3224; backdrop-filter: none;
}
.lumi-refined[data-lumi-home=true] #mapStage .lumi-map-tools > button {
  flex-direction: row; height: 48px; min-height: 48px; gap: 6px; padding: 7px 4px !important;
  font-size: 11px !important; font-weight: 600; color: var(--lh-ink) !important; border-radius: 12px !important;
}
.lumi-refined[data-lumi-home=true] #mapStage .lumi-map-tools > button::before { width: 19px; height: 19px; }
.lumi-refined[data-lumi-home=true] #mapStage .lumi-map-tools > .lumi-map-more { order: 10; background: var(--lh-soft) !important; }
.lumi-refined #mapStage .lumi-map-tools > .lumi-map-more[hidden] { display: none !important; }
.lumi-refined[data-lumi-home=true] #plaisVoiceLauncher { display: none; }
.lumi-refined[data-lumi-home=true] #mapStage .coverage { bottom: 100px; left: 16px; right: 76px; z-index: 44; font-size: 11px; }
.lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-attrib { max-width: 100%; font-size: 9px !important; line-height: 14px; }
.lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-bottom-right { max-width: 100%; }

/* Place selection takes precedence over browsing tools. */
.lumi-refined[data-lumi-home=true] #mapStage:has(.map-navigation-dock:not([hidden])) .lumi-map-tools {
  top: 152px; right: 76px; bottom: auto; left: 16px; width: auto; max-width: 420px;
}
.lumi-refined[data-lumi-home=true] #mapStage:has(.map-navigation-dock:not([hidden])) :is(#centerMap, #fullscreenMap) { top: 256px; bottom: auto; }
.lumi-refined[data-lumi-home=true] #mapStage:has(.map-navigation-dock:not([hidden])) #fullscreenMap { top: 308px; }
.lumi-refined[data-lumi-home=true] #mapStage .map-navigation-dock { z-index: 68 !important; }

/* Native dialog preserves focus, Escape, full-screen ancestry and original handlers. */
.lumi-refined #lumiMapMenu {
  width: min(440px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 40px));
  margin: auto; padding: 24px; overflow: auto; overscroll-behavior: contain;
  background: var(--lh-paper); color: var(--lh-ink); border: 1px solid var(--lh-line);
  border-radius: 24px; box-shadow: 0 24px 70px #0d2d343b;
}
.lumi-refined #lumiMapMenu::backdrop { background: #102b2766; backdrop-filter: blur(3px); }
.lumi-refined .lumi-menu-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.lumi-refined .lumi-menu-heading p { margin: 0 0 5px; font-size: 11px; color: var(--lh-muted); }
.lumi-refined .lumi-menu-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.8px; }
.lumi-refined .lumi-menu-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--lh-soft); color: var(--lh-ink); }
.lumi-refined .lumi-menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lumi-refined #lumiMapMenu .lumi-menu-grid > button {
  position: static !important; inset: auto !important; transform: none !important;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-width: 0; height: auto; min-height: 86px; margin: 0; padding: 14px 5px;
  border: 1px solid var(--lh-line); border-radius: 16px; background: var(--lh-soft); color: var(--lh-ink);
  box-shadow: none; font: 600 12px/1.4 Arial, 'Malgun Gothic', sans-serif;
}
.lumi-refined #lumiMapMenu .lumi-menu-grid > button::before { width: 24px; height: 24px; }
.lumi-refined #lumiMapMenu .lumi-menu-grid > button[aria-pressed=true] { border-color: #427c67; background: #e0eee5; color: #174e3d; }
.lumi-refined #mapStage #lumiMapMenu .plais-map-compass {
  position: static; inset: auto; display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 6px 16px; width: 100%; max-width: none; padding: 18px 0; margin: 18px 0 0;
  border: 0; border-top: 1px solid var(--lh-line); border-radius: 0; box-shadow: none; background: none; color: var(--lh-ink);
}
.lumi-refined #lumiMapMenu .plais-compass-caption { display: none; }
.lumi-refined #lumiMapMenu .plais-compass-dial { grid-column: 1; grid-row: 1/3; width: 72px; height: 72px; }
.lumi-refined #lumiMapMenu .plais-compass-status { font-size: 12px; line-height: 1.5; color: var(--lh-muted); white-space: normal; }
.lumi-refined #lumiMapMenu .plais-map-compass button { width: auto; min-height: 44px; padding: 8px 12px; border-color: var(--lh-line); background: var(--lh-soft); color: var(--lh-ink); border-radius: 12px; font-size: 12px; }
.lumi-refined #lumiMapMenu .lumi-map-settings {
  position: static; inset: auto; width: 100%; max-width: none; border: 0; border-top: 1px solid var(--lh-line);
  border-radius: 0; background: none; box-shadow: none;
}
.lumi-refined #lumiMapMenu .lumi-map-settings > summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 14px 0; font-size: 13px; color: var(--lh-ink); background: none; }
.lumi-refined #lumiMapMenu .lumi-map-settings-body {
  position: static; width: 100%; max-width: none; max-height: none; padding: 0 0 6px; border: 0;
  border-radius: 0; background: none; box-shadow: none; overflow: visible;
}
.lumi-refined #lumiMapMenu .lumi-map-settings-body button { min-height: 44px !important; font-size: 12px !important; background: var(--lh-soft); color: var(--lh-ink); border: 1px solid var(--lh-line); }
.lumi-refined #lumiMapMenu .lumi-map-settings-body :is(small, .plais-poi-notice) { font-size: 11px; line-height: 1.6; color: var(--lh-muted); }
.lumi-refined #lumiMapMenu .plais-traffic-legend { position: static; inset: auto; max-width: none; margin-top: 12px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--lh-line); border-radius: 0; background: none; box-shadow: none; color: var(--lh-muted); }
.lumi-refined[data-lumi-home=false] #mapStage > .lumi-rest-button::before { display: none; }

/* Calm, compact cards below (beside on desktop) the map. */
.lumi-refined .sidebar .lumi-card { border: 1px solid var(--lh-line); border-radius: 20px; box-shadow: none; margin-bottom: 14px; }
.lumi-refined .sidebar .eyebrow { display: none !important; }
.lumi-refined .sidebar > .lumi-voice-card { background: #19483e; border-color: #19483e; }
.lumi-refined .sidebar .lumi-voice-card .character { min-height: 112px; padding: 14px 18px 12px 14px; gap: 15px; }
.lumi-refined .lumi-voice-card .character #mic { width: 60px; min-height: 88px; gap: 4px; }
.lumi-refined .sidebar .lumi-voice-card .character img { width: 54px; height: 70px; }
.lumi-refined .lumi-voice-card #micLabel { font-size: 10px; padding: 4px 10px; background: #ffffff12; }
.lumi-refined .lumi-voice-card .character b { font-size: 17px; font-weight: 700; letter-spacing: -.5px; }
.lumi-refined .lumi-voice-card .character p { margin: 7px 0 0; font-size: 12px; line-height: 1.6; }
.lumi-refined .lumi-audio-settings > summary { min-height: 44px; padding: 10px 18px; font-size: 11px; }
.lumi-refined .lumi-audio-content #mute { min-height: 44px; margin-bottom: 10px; }
.lumi-refined .lumi-audio-content #testAudio { min-height: 44px; }
.lumi-refined .search-area { padding: 20px 18px 16px; }
.lumi-refined .lumi-section-heading { margin-bottom: 16px; }
.lumi-refined .sidebar .lumi-section-heading :is(h1, h2) { font-size: 17px; font-weight: 700; }
.lumi-refined .search-area .plais-search-purpose { top: 13px; right: 18px; }
.lumi-refined .search-area .plais-search-purpose a { color: var(--lh-muted); }
.lumi-refined .sidebar .search-area .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lumi-refined .search-area .themes button {
  flex-direction: row; align-items: center; justify-content: flex-start; min-height: 46px; padding: 10px 8px;
  gap: 6px; border: 1px solid var(--edge); border-radius: 11px; background: var(--tile); color: var(--accent);
  box-shadow: none; font-size: 11px; font-weight: 500; white-space: normal; letter-spacing: -.6px;
}
/* Keep the original category and saved-place palettes from plais-lumi-design.css. */
.lumi-refined .search-area .themes button::before { width: 18px; height: 18px; color: inherit; }
.lumi-refined .search-area .themes button.selected { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: none; }
.lumi-refined .search-area .themes button:hover { border-color: var(--accent); box-shadow: none; }
.lumi-refined .lumi-places-card { padding: 20px 18px 0; }
.lumi-refined .lumi-places-card .lumi-add-place { min-height: 44px; box-shadow: none; }
.lumi-refined .lumi-places-card .saved-tabs button { min-height: 108px; border: 1px solid var(--place-dark); background: var(--place); color: #fff; box-shadow: none; }
.lumi-refined .lumi-places-card .saved-tabs button:hover { background: var(--place-dark); }
.lumi-refined .lumi-places-card .saved-tabs strong { font-size: 11px; }
.lumi-refined .lumi-places-card .saved-tabs small { font-size: 10px; }
.lumi-refined .sidebar > .lumi-recordings-card { min-height: 94px; padding: 18px; border-color: #153d60; box-shadow: none; }
.lumi-refined .lumi-recordings-card .lumi-recordings-copy strong { font-size: 17px; }
.lumi-refined .lumi-recordings-card .lumi-recordings-icon { width: 44px; height: 48px; box-shadow: none; }
.lumi-refined .sidebar > .plais-recent-card { margin: 0 0 14px; padding: 18px; border: 1px solid var(--lh-line); border-radius: 20px; background: var(--lh-paper); color: var(--lh-ink); }
.lumi-refined .plais-recent-card h2 { font-size: 17px; }
.lumi-refined .plais-recent-card :is(p, small, header button) { color: var(--lh-muted); }
.lumi-refined .sidebar button:focus-visible, .lumi-refined #mapStage button:focus-visible, .lumi-refined summary:focus-visible { outline: 3px solid #ad8843; outline-offset: 3px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .lumi-refined .workspace { grid-template-columns: 320px minmax(0, 1fr); gap: 14px; padding: 0 16px 16px; }
  .lumi-refined .search-area, .lumi-refined .lumi-places-card { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 760px) {
  .lumi-refined .topbar { height: calc(68px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 20px 0; }
  .lumi-refined .topbar .brand { gap: 10px; }
  .lumi-refined .brand .lumi-brand-name { font-size: 17px; }
  .lumi-refined .workspace { height: auto; min-height: 0; padding: 0; gap: 0; }
  .lumi-refined[data-lumi-home=true] .map-stage { height: clamp(500px, 64svh, 640px); min-height: 0; max-height: none; margin: 0 12px; border-radius: 22px; }
  .lumi-refined .sidebar { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .lumi-refined[data-lumi-home=true] #mapStage .map-top-search { inset: 12px 12px auto; }
  .lumi-refined[data-lumi-home=true] #mapStage .map-top-search input { padding-left: 6px; }
  .lumi-refined[data-lumi-home=true] #mapStage .lumi-map-tools { left: 12px; right: 12px; bottom: 34px; }
  .lumi-refined[data-lumi-home=true] #mapStage .lumi-map-tools > button { flex-direction: column; gap: 4px; height: 50px; min-height: 50px; font-size: 10px !important; }
  .lumi-refined[data-lumi-home=true] #mapStage .maplibregl-ctrl-top-right { right: 12px; }
  .lumi-refined[data-lumi-home=true] #mapStage :is(#fullscreenMap, #centerMap) { right: 12px; }
  .lumi-refined #lumiMapMenu { width: 100%; max-width: 100%; max-height: calc(100dvh - 36px - env(safe-area-inset-top)); margin: auto 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; border-bottom: 0; }
  .lumi-refined #lumiMapMenu::before { content: ''; display: block; width: 32px; height: 4px; border-radius: 3px; background: #d3ddd5; margin: -10px auto 18px; }
}
@media (max-width: 360px) {
  .lumi-refined .topbar { padding-left: 16px; padding-right: 16px; }
  .lumi-refined .topbar .mall-link { font-size: 9px; }
  .lumi-refined .sidebar { padding-left: 12px; padding-right: 12px; }
  .lumi-refined .search-area .themes { gap: 6px; }
  .lumi-refined .search-area .themes button { padding: 8px 5px; gap: 4px; font-size: 10px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .lumi-refined[data-lumi-home=true] .map-stage:not(.fullscreen) { height: 440px; max-height: none; }
  .lumi-refined #lumiMapMenu { max-height: calc(100dvh - 24px); }
}
body.lumi-refined[data-map-theme=night] {
  --lh-paper: #18352e; --lh-ground: #102820; --lh-ink: #e0ece4;
  --lh-muted: #aac0b1; --lh-line: #355247; --lh-soft: #244337; --lh-shadow: 0 4px 20px #0003;
}
.lumi-refined[data-map-theme=night] .topbar .brand { color: var(--lh-ink); }
.lumi-refined[data-map-theme=night] #mapStage .map-top-search input::placeholder { color: #adc0b4; }
@media (prefers-reduced-motion: reduce) {
  .lumi-refined button { transition: none; }
}
