/* Smart Transit Search Stage 4. Existing panel + isolated map-focus controls. */
.map-shell > .smart-search-trigger {
  position:absolute;z-index:405;top:92px;right:67px;
  width:44px;height:44px;display:grid;place-items:center;
  border:0;border-radius:13px;background:#fffffff2;color:#236b61;
  box-shadow:0 4px 14px #142d241c;cursor:pointer;
}
.map-shell > .smart-search-trigger svg {width:21px;height:21px}
.map-shell > .smart-search-trigger:hover,.map-shell > .smart-search-trigger.is-active {background:#e7f5ee;color:#145b46}
.map-shell > .smart-search-trigger:focus-visible {outline:3px solid #5aa996;outline-offset:3px}
.smart-search-panel {
  position:absolute;z-index:480;top:91px;right:122px;width:min(388px,calc(100% - 140px));
  max-height:calc(100% - 110px);display:flex;flex-direction:column;overflow:hidden;
  border-radius:21px;border:1px solid #dbe8e3;background:#fffffff8;color:#253e3a;
  box-shadow:0 18px 58px #112d2e39;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
}
.smart-search-panel[hidden] {display:none!important}
.smart-search-head {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 16px 12px}
.smart-search-eyebrow {display:block;color:#537f70;font-size:9px;font-weight:850;letter-spacing:.12em;margin-bottom:3px}
.smart-search-head h2 {font-size:16px;font-weight:850;line-height:1.25;margin:0;letter-spacing:-.4px}
.smart-search-head button {flex:none;width:40px;height:40px;border:1px solid #dce9e4;background:#f3f8f5;border-radius:11px;color:#506b61;font-size:23px;cursor:pointer}
.smart-search-field {display:flex;align-items:center;gap:8px;margin:0 15px 10px;padding:0 10px;min-height:46px;border:1px solid #d5e7df;background:#f6faf8;border-radius:13px}
.smart-search-field:focus-within {border-color:#65ad8f;box-shadow:0 0 0 3px #2d907323}
.smart-search-field>svg {width:19px;height:19px;flex:none;color:#5a8e7d}
.smart-search-field input {flex:1;min-width:0;width:100%;height:44px;background:transparent;border:0;outline:0;color:#17392f;font-size:13px}
.smart-search-field input::-webkit-search-cancel-button {display:none}
.smart-search-field input::placeholder {color:#547267}
.smart-search-field button {flex:none;width:33px;height:33px;background:transparent;border:0;border-radius:10px;color:#5b7970;font-size:21px;cursor:pointer}
.smart-search-field button[hidden],.smart-search-retry[hidden] {display:none!important}
.smart-search-status {margin:0;padding:2px 16px 12px;color:#557165;font-size:11px;line-height:1.4}
.smart-search-status[data-state="loading"] {color:#377d69}
.smart-search-status[data-state="error"] {color:#ab3e43}
.smart-search-status[data-state="warning"] {color:#8c671b}
.smart-search-results {overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c5dcd3 transparent}
.smart-search-group-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0;padding:11px 16px 9px;background:#edf6f1;color:#236854;font-size:10px;letter-spacing:.045em;font-weight:900;position:sticky;top:0;z-index:1;border-top:1px solid #dfece5}
.smart-search-group-heading small {font-size:10px;font-weight:850;color:#266a57;padding:3px 7px;background:#d8ece1;border-radius:8px}
.smart-search-result {display:flex;align-items:center;gap:11px;width:100%;min-height:64px;padding:10px 15px;border:0;border-top:1px solid #e8f0ed;background:transparent;text-align:left;color:inherit;cursor:pointer}
.smart-search-result:hover,.smart-search-result:focus-visible {background:#f0f8f4}
.smart-search-result.is-keyboard-active {background:#e0f3e9;outline:2px solid #50a989;outline-offset:-2px}
.smart-search-highlight {background:#d1efd6;color:#165741;border-radius:4px;padding:0 1px;font-weight:900}
.smart-search-fuzzy {color:#24715d;font-size:10px;font-style:normal;font-weight:750}
.smart-search-more {display:block;width:calc(100% - 30px);margin:10px 15px 13px;padding:12px 10px;min-height:44px;border:1px solid #a7cebc;border-radius:12px;background:#edf8f0;color:#1b7153;font-size:12px;font-weight:850;cursor:pointer}
.smart-search-more:hover,.smart-search-more:focus-visible {background:#daf1e2;outline:2px solid #62af93;outline-offset:1px}
.smart-search-result:focus-visible,.smart-search-head button:focus-visible,.smart-search-field button:focus-visible,.smart-search-retry:focus-visible {outline:3px solid #52aa90;outline-offset:-3px}
.smart-search-result-icons {display:flex;align-items:center;justify-content:center;flex:none;min-width:42px;height:41px;padding:4px;border:1px solid #e2ede7;border-radius:12px;background:#fff;color:#4b7b6d}
.smart-search-result-icons img {max-width:26px;max-height:26px;object-fit:contain}
.smart-search-result-icons img+img {margin-left:-7px;background:#fff;border-radius:50%;border:1px solid #e2ede7}
.smart-search-result-body {display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
.smart-search-result-body strong {font-size:12px;line-height:1.3;font-weight:800;overflow-wrap:anywhere}
.smart-search-result-body span {font-size:10px;color:#526e64;line-height:1.3}
.smart-search-result-arrow {flex:none;color:#478e76;font-size:19px}
.smart-search-retry {min-height:42px;margin:12px 15px 15px;border:1px solid #a1c8ba;background:#edf7f2;border-radius:12px;color:#1f6c55;font-size:12px;font-weight:800;cursor:pointer}
:root[data-theme="dark"] .map-shell > .smart-search-trigger {background:#1d314a;color:#b7e3d3}
:root[data-theme="dark"] .map-shell > .smart-search-trigger:hover,:root[data-theme="dark"] .map-shell > .smart-search-trigger.is-active {background:#254e4d;color:#e4fff4}
:root[data-theme="dark"] .smart-search-panel {background:#14253af7;color:#e7f4f2;border-color:#3a5862;box-shadow:0 19px 54px #020711a4}
:root[data-theme="dark"] .smart-search-eyebrow {color:#87c6ae}
:root[data-theme="dark"] .smart-search-head button {color:#d9ece7;background:#254254;border-color:#40596e}
:root[data-theme="dark"] .smart-search-field {background:#20374a;border-color:#486479}
:root[data-theme="dark"] .smart-search-field:focus-within {border-color:#80cfb3;box-shadow:0 0 0 3px #80cfb322}
:root[data-theme="dark"] .smart-search-field>svg,:root[data-theme="dark"] .smart-search-field button {color:#a5d5c3}
:root[data-theme="dark"] .smart-search-field input {color:#f1fffa}
:root[data-theme="dark"] .smart-search-field input::placeholder {color:#a4b9b8}
:root[data-theme="dark"] .smart-search-status {color:#b3c8ca}
:root[data-theme="dark"] .smart-search-status[data-state="loading"] {color:#96e2c9}
:root[data-theme="dark"] .smart-search-status[data-state="warning"] {color:#ffda88}
:root[data-theme="dark"] .smart-search-status[data-state="error"] {color:#ffb8b7}
:root[data-theme="dark"] .smart-search-result {border-color:#345164}
:root[data-theme="dark"] .smart-search-group-heading {background:#203d47;color:#b6e9d3;border-color:#375961}
:root[data-theme="dark"] .smart-search-group-heading small {background:#29584e;color:#dbfff0}
:root[data-theme="dark"] .smart-search-result:hover,:root[data-theme="dark"] .smart-search-result:focus-visible {background:#254458}
:root[data-theme="dark"] .smart-search-result.is-keyboard-active {background:#28594d;outline-color:#91dbbb}
:root[data-theme="dark"] .smart-search-highlight {background:#357659;color:#f1fff7}
:root[data-theme="dark"] .smart-search-fuzzy {color:#a1e9ca}
:root[data-theme="dark"] .smart-search-more {background:#20473f;color:#ceffe7;border-color:#477869}
:root[data-theme="dark"] .smart-search-more:hover,:root[data-theme="dark"] .smart-search-more:focus-visible {background:#2c5a4b;outline-color:#a4dbca}
:root[data-theme="dark"] .smart-search-result-icons {background:#eff8f3;border-color:#52776d}
:root[data-theme="dark"] .smart-search-result-icons img+img {background:#eff8f3}
:root[data-theme="dark"] .smart-search-result-body span {color:#b6d0ca}
:root[data-theme="dark"] .smart-search-result-arrow {color:#98dac2}
:root[data-theme="dark"] .smart-search-retry {background:#244955;border-color:#578276;color:#d2fff0}
@media(max-width:820px) {
  .map-shell > .smart-search-trigger {top:61px;right:61px;width:44px;height:44px}
  .smart-search-panel {top:62px;left:12px;right:12px;width:auto;max-height:min(70dvh,590px);border-radius:21px}
  .smart-search-result {min-height:66px;padding:11px 13px}
}
@media (prefers-reduced-motion:reduce) {.smart-search-panel,.smart-search-panel * {transition:none!important;animation:none!important}}

/* Tahap 4: selected result and map focus do not change transport colors. */
.smart-search-result.is-selected {background:#e4f5ec;box-shadow:inset 3px 0 0 #248a69}
.smart-search-result.is-selected:focus-visible {outline-color:#238b67}
.smart-map-focus-bar {position:absolute;left:50%;bottom:25px;transform:translateX(-50%);z-index:440;display:flex;align-items:center;gap:15px;justify-content:space-between;width:min(520px,calc(100% - 36px));padding:12px 13px;border:1px solid #b7d9cb;border-radius:18px;background:#f9fffcf7;color:#204d3e;box-shadow:0 12px 34px #112e2640;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.smart-map-focus-bar[hidden] {display:none!important}
.smart-map-focus-info {display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.smart-map-focus-info strong {font-size:13px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smart-map-focus-info>span:last-child {font-size:10px;line-height:1.35;color:#587568}
.smart-map-focus-kicker {font-size:9px;color:#348168;font-weight:900;letter-spacing:.1em}
.smart-map-focus-actions {display:flex;gap:6px;flex-shrink:0}
.smart-map-focus-actions button {min-height:40px;border-radius:11px;border:1px solid #bbd7cb;background:#eef8f2;color:#1a6b51;padding:8px 10px;font:inherit;font-size:11px;font-weight:800;cursor:pointer}
.smart-map-focus-actions button:last-child {background:#236b55;border-color:#236b55;color:#fff}
.smart-map-focus-actions button:hover {filter:brightness(.96)}
.smart-map-focus-actions button:focus-visible {outline:3px solid #71bca0;outline-offset:2px}
/* Search only adds a temporary glow to the existing stop marker element. */
.leaflet-marker-icon.smart-map-stop-selected,.leaflet-interactive.smart-map-stop-selected {filter:drop-shadow(0 0 4px #238fdf) drop-shadow(0 0 8px #5ab0ff)!important}
@media(min-width:821px) {.smart-map-focus-bar {left:18px;transform:none;width:min(350px,calc(100% - 36px));flex-wrap:wrap;gap:9px}.smart-map-focus-info {flex-basis:100%}.smart-map-focus-actions {width:100%}.smart-map-focus-actions button {flex:1}}
:root[data-theme="dark"] .smart-search-result.is-selected {background:#204e43;box-shadow:inset 3px 0 0 #8fd1af}
:root[data-theme="dark"] .smart-map-focus-bar {background:#182e3ef5;color:#ebfff6;border-color:#47746a;box-shadow:0 13px 40px #030b16ad}
:root[data-theme="dark"] .smart-map-focus-kicker {color:#99dbc2}
:root[data-theme="dark"] .smart-map-focus-info>span:last-child {color:#accac2}
:root[data-theme="dark"] .smart-map-focus-actions button {background:#254c46;color:#ddfff1;border-color:#4b7e70}
:root[data-theme="dark"] .smart-map-focus-actions button:last-child {background:#3e9676;border-color:#4baf88;color:#fff}
@media(max-width:820px) {
  .smart-map-focus-bar {bottom:calc(92px + env(safe-area-inset-bottom,0px));width:calc(100% - 24px);padding:10px 11px;flex-wrap:wrap;gap:9px;border-radius:16px}
  .smart-map-focus-info {flex-basis:100%}
  .smart-map-focus-actions {width:100%}
  .smart-map-focus-actions button {flex:1;min-height:44px}
}

/* v50: One search field inside the navigation sidebar. No map-floating search. */
#routeView.is-smart-searching .mode-filters,
#routeView.is-smart-searching .count-row,
#routeView.is-smart-searching #routeList {display:none!important}
#routeView .smart-search-entry {margin-bottom:11px}
#routeView .smart-search-entry input {padding-right:45px}
#routeView .smart-search-entry input::-webkit-search-cancel-button {display:none}
#routeView .smart-search-entry .search-icon {display:block;pointer-events:none;line-height:1}
#routeView .smart-search-clear {position:absolute;right:7px;top:50%;transform:translateY(-50%);width:34px;height:34px;border:0;border-radius:10px;background:transparent;color:#5d766a;font-size:21px;cursor:pointer}
#routeView .smart-search-clear[hidden] {display:none!important}
#routeView .smart-search-clear:hover {background:#e4f3ec;color:#155e49}
#routeView .smart-search-clear:focus-visible {outline:3px solid #62b092;outline-offset:1px}
#routeView .smart-search-panel {
  position:static;z-index:auto;display:block;width:100%;max-height:none;overflow:visible;
  border:1px solid #e0ece5;border-radius:14px;background:#fff;color:var(--ink);
  box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;
}
#routeView .smart-search-status {padding:12px 12px 11px;font-size:11px}
#routeView .smart-search-results {overflow:visible;max-height:none}
#routeView .smart-search-group-heading {padding:10px 12px 8px}
#routeView .smart-search-result {padding:10px 11px;min-height:60px}
#routeView .smart-search-result-icons {min-width:40px}
#routeView .smart-search-more {width:calc(100% - 22px);margin:10px 11px 12px}
#routeView .smart-search-retry {margin:10px 11px 12px}
:root[data-theme="dark"] #routeView .smart-search-panel {background:#182b3c;color:#e7f4f2;border-color:#3b5862;box-shadow:none}
:root[data-theme="dark"] #routeView .smart-search-clear {color:#afd9c9}
:root[data-theme="dark"] #routeView .smart-search-clear:hover {background:#285247;color:#e0fff2}
@media(max-width:820px) {
  #routeView .smart-search-result {min-height:62px}
  #routeView .smart-search-panel {border-radius:13px}
}
