/* La Strada — shared map-host chrome (M4-1)
   Loaded on poi.html + map.html m2host canary.
   MODULE_VERSION: 20260828_m4_1_map_host_shared_chrome_v1 */

.map-route-edit-btn .btn-short,
    .map-route-edit-btn .btn-full {
      display: inline !important;
    }

.map-overlay-toolbar {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 1004;
    }

.btn-full { display: none; }

.btn-short { display: inline; }

.map-poi-search {
      position: absolute;
      top: 10px;
      right: 72px;
      z-index: 1005;
      pointer-events: auto;
      display: flex;
      gap: 0;
      width: min(360px, calc(100% - 320px));
      min-width: 220px;
      max-width: calc(100% - 84px);
      align-items: stretch;
      border: 2px solid transparent;
      border-radius: 10px;
      background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(90deg, #007B3E 0 33.33%, #fff 33.33% 66.66%, #C8102E 66.66% 100%) border-box;
      box-shadow: 0 2px 6px rgba(0,0,0,0.18);
      overflow: hidden;
    }

.map-poi-search input {
      flex: 1;
      min-width: 0;
      min-height: 36px;
      border: none;
      background: transparent;
      color: var(--dark);
      border-radius: 8px 0 0 8px;
      padding: 10px 12px;
      font-size: 16px;
      line-height: 1.25;
      font-weight: 600;
      outline: none;
      appearance: none;
      -webkit-appearance: none;
    }

.map-poi-search input::placeholder {
      color: rgba(0,0,0,0.5);
    }

.map-poi-search input:focus {
      background: transparent;
    }

.map-poi-search button {
      appearance: none;
      border: none;
      border-left: 1px solid rgba(0,0,0,0.12);
      background: transparent;
      color: var(--dark);
      border-radius: 0 8px 8px 0;
      padding: 7px 12px;
      font-weight: 800;
      font-size: 15px;
      cursor: pointer;
      transition: background 0.15s;
      white-space: nowrap;
    }

.map-poi-search input:focus + button {
      background: transparent;
    }

.map-poi-search button:hover {
      background: rgba(0,0,0,0.06);
    }

.map-poi-search-results {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      z-index: 1006;
      width: 100%;
      max-width: 100%;
      max-height: 260px;
      overflow-y: auto;
      overflow-x: hidden;
      border: 1.5px solid rgba(255,255,255,0.28);
      background: rgba(12,12,12,0.95);
      border-radius: 10px;
      box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    }

.map-poi-search-results[hidden] {
      display: none;
    }

.map-search-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      color: #fff;
      cursor: pointer;
    }

.map-search-item:last-child {
      border-bottom: 0;
    }

.map-search-item:hover {
      background: rgba(255,255,255,0.08);
    }

.map-search-icon {
      width: 18px;
      text-align: center;
      opacity: 0.95;
      flex-shrink: 0;
    }

.map-search-text {
      flex: 1;
      min-width: 0;
    }

.map-search-label {
      font-size: 12px;
      font-weight: 700;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

.map-search-meta {
      font-size: 11px;
      opacity: 0.78;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

.map-search-sheet-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.34);
      z-index: 10000021;
    }

.map-search-sheet-backdrop[hidden] { display: none; }

.map-search-sheet {
      position: fixed;
      left: 10px;
      right: 10px;
      bottom: max(10px, env(safe-area-inset-bottom, 0px));
      z-index: 10000022;

      /* Citrushab: brand #FFD600 → #FFFAD9 (15% mix), solid színek opacity nélkül */
      background:
        repeating-linear-gradient(
          -28deg,
          #ffffff 0px,
          #ffffff 34px,
          #FFFAD9 34px,
          #FFFAD9 68px
        );

      color: #0a0a0a;
      border-radius: 2px;
      box-shadow:
        0 1px 0 rgba(0,0,0,0.06),
        0 18px 48px -12px rgba(0,0,0,0.25),
        0 6px 16px -8px rgba(0,0,0,0.18);
      padding: 18px 22px 16px;
      overflow: hidden;
    }

.map-search-sheet[hidden] { display: none; }

.map-search-sheet::before,
    .map-search-sheet::after {
      content: '';
      position: absolute;
      top: 0; bottom: 0;
      width: 6px;
      z-index: 2;
      pointer-events: none;
    }

.map-search-sheet::before { left: 0;  background: #009246; }

.map-search-sheet::after  { right: 0; background: #ce2b37; }

.map-search-sheet-title,
    .map-search-sheet-meta,
    .map-search-sheet-coords,
    .map-search-sheet-actions {
      position: relative;
      z-index: 1;
      margin-left: 6px;
      margin-right: 6px;
    }

.map-search-sheet-title {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.25rem;
      font-weight: 400;
      line-height: 1.15;
      letter-spacing: 0.025em;
      color: #0a0a0a;
      margin-bottom: 2px;
    }

input.map-search-sheet-title {
      appearance: none;
      -webkit-appearance: none;
      width: 100%;
      border: none;
      background: transparent;
      padding: 2px 6px 3px 0;
      outline: none;
      border-bottom: 1px dashed transparent;
      transition: border-color 0.18s, background 0.18s;
      cursor: text;
    }

input.map-search-sheet-title:hover {
      border-bottom-color: rgba(0,0,0,0.18);
    }

input.map-search-sheet-title:focus {
      border-bottom-color: rgba(0,146,70,0.55);
      background: rgba(255,255,255,0.65);
    }

.map-search-sheet-meta {
      font-family: 'Barlow Condensed', sans-serif;
      font-size: 0.78rem;
      font-weight: 600;
      line-height: 1.3;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: #555;
      margin-bottom: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

.map-search-sheet-coords {
      display: flex;
      align-items: stretch;
      gap: 0;
      margin-bottom: 14px;
      border: 1px solid rgba(0,0,0,0.18);
      background: #ffffff;
      border-radius: 2px;
    }

.map-search-sheet-coords[hidden] { display: none; }

.map-search-sheet-coord-input {
      flex: 1;
      min-width: 0;
      height: 38px;
      padding: 0 14px;
      border: none;
      background: transparent;
      color: #0a0a0a;
      font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
      font-size: 0.95rem;
      font-weight: 500;
      letter-spacing: 0.01em;
      font-variant-numeric: tabular-nums;
      outline: none;
    }

.map-search-sheet .map-search-sheet-coord-copy,
    .map-search-sheet-coord-copy {
      appearance: none;
      height: 38px;
      padding: 0 18px;
      border: none;
      border-left: 1px solid rgba(0,0,0,0.12);
      border-radius: 0;
      background: #0a0a0a;
      color: #ffffff;
      font-family: 'Barlow Condensed', sans-serif;
      font-weight: 700;
      font-size: 0.78rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.15s, color 0.15s;
    }

.map-search-sheet .map-search-sheet-coord-copy:hover:not(:disabled),
    .map-search-sheet-coord-copy:hover:not(:disabled) {
      background: #2a2a2a;
      color: #ffffff;
    }

.map-search-sheet-coord-copy:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

.map-search-sheet-actions {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-areas:
        "start next via dest"
        "delete delete close close";
      gap: 6px;
    }

.map-search-sheet .map-search-sheet-btn {
      appearance: none;
      width: 100%;
      min-height: 48px;
      border-radius: 2px;
      background: #0a0a0a;
      border: 1.5px solid currentColor;
      color: #aaaaaa;
      font-family: 'Barlow Condensed', sans-serif;
      font-weight: 700;
      font-size: 0.82rem;
      line-height: 1.1;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 10px 6px 8px;
      text-align: center;
      cursor: pointer;
      transition: background 0.18s, color 0.18s, border-color 0.18s;
      position: relative;
    }

.map-search-sheet .map-search-sheet-btn::before {
      content: '';
      display: block;
      width: 8px;
      height: 8px;
      margin: 0 auto 6px;
      border-radius: 50%;
      background: currentColor;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="start"],
    .map-search-sheet .map-search-sheet-btn[data-sheet-role="next"],
    .map-search-sheet .map-search-sheet-btn[data-sheet-role="via"],
    .map-search-sheet .map-search-sheet-btn[data-sheet-role="dest"] {
      font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
      font-weight: 400;
      font-size: 1.05rem;
      letter-spacing: 0.12em;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="start"]  { grid-area: start;  color: #00B554; }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="next"]   { grid-area: next;   color: #4FB3FF; }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="via"]    { grid-area: via;    color: #FFC72C; }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="dest"]   { grid-area: dest;   color: #FF5A5F; }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="start"]:hover:not(:disabled) {
      background: #009246;
      border-color: #009246;
      color: #ffffff;
      -webkit-text-stroke: 0;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="next"]:hover:not(:disabled) {
      background: #2176AE;
      border-color: #2176AE;
      color: #ffffff;
      -webkit-text-stroke: 0;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="via"]:hover:not(:disabled) {
      background: #C68A0E;
      border-color: #C68A0E;
      color: #ffffff;
      -webkit-text-stroke: 0;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="dest"]:hover:not(:disabled) {
      background: #ce2b37;
      border-color: #ce2b37;
      color: #ffffff;
      -webkit-text-stroke: 0;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="start"]:hover:not(:disabled)::before,
    .map-search-sheet .map-search-sheet-btn[data-sheet-role="next"]:hover:not(:disabled)::before,
    .map-search-sheet .map-search-sheet-btn[data-sheet-role="via"]:hover:not(:disabled)::before,
    .map-search-sheet .map-search-sheet-btn[data-sheet-role="dest"]:hover:not(:disabled)::before {
      background: #ffffff;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="delete"] {
      grid-area: delete;
      background: #ffffff;
      border: 1px solid rgba(206, 43, 55, 0.45);
      color: #ce2b37;
      min-height: 38px;
        font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
        font-weight: 400;
        font-size: 1rem;
        letter-spacing: 0.12em;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="delete"]::before { display: none; }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="delete"]:hover:not(:disabled) {
      background: #ce2b37;
      border-color: #ce2b37;
      color: #ffffff;
    }

.map-search-sheet .map-search-sheet-btn.map-search-sheet-close {
      grid-area: close;
      background: #ffffff;
      border: 1px solid rgba(0,0,0,0.25);
      color: #0a0a0a;
      min-height: 38px;
      font-size: 0.78rem;
      letter-spacing: 0.12em;
    }

.map-search-sheet .map-search-sheet-btn.map-search-sheet-close::before { display: none; }

.map-search-sheet .map-search-sheet-btn.map-search-sheet-close:hover:not(:disabled) {
      background: #0a0a0a;
      border-color: #0a0a0a;
      color: #ffffff;
    }

.map-search-sheet .map-search-sheet-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

.map-search-sheet .map-search-sheet-btn:disabled:hover {
      background: #0a0a0a;
    }

.map-search-sheet .map-search-sheet-btn[data-sheet-role="delete"]:disabled:hover {
      background: #ffffff;
      border-color: rgba(206, 43, 55, 0.45);
      color: #ce2b37;
    }

.map-search-sheet .map-search-sheet-btn.map-search-sheet-close:disabled:hover {
      background: #ffffff;
      border-color: rgba(0,0,0,0.25);
      color: #0a0a0a;
    }

body.map-full .map-search-sheet-backdrop {
      z-index: 10000070 !important;
    }

body.map-full .map-search-sheet,
    body.map-full .map-dock-body .map-search-sheet {
      left: 10px !important;
      right: 10px !important;
      top: auto !important;
      bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
      transform: none !important;
      width: auto !important;
      min-width: 0 !important;
      max-width: none !important;
      z-index: 10000080 !important;
    }

@media (hover: hover) and (pointer: fine) {
      body:not(.map-full) .map-search-sheet-backdrop { background: transparent; }
      body:not(.map-full) .map-search-sheet {
        left: 50%;
        right: auto;
        top: 72px;
        bottom: auto;
        transform: translateX(-50%);
        width: auto;
        min-width: 460px;
        max-width: 620px;
        padding: 16px 22px 14px;
      }
      /* PC + teljes térkép (body.map-full): a global !important szabály teljes
         szélessé teszi a sheet-et — itt felülírjuk kompakt, középre lebegő
         panelre, hogy ne fedje el a térkép közepét. Méret felére csökkentve
         (~400px max), feszes tipográfiával. */
      body.map-full .map-search-sheet,
      body.map-full .map-dock-body .map-search-sheet {
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        min-width: 360px !important;
        max-width: 400px !important;
        padding: 10px 14px 10px !important;
      }
      .map-search-sheet-title { font-size: 0.92rem; margin-bottom: 0; line-height: 1.1; }
      input.map-search-sheet-title { padding: 1px 4px 2px 0; }
      .map-search-sheet-meta  { font-size: 0.62rem; margin-bottom: 7px; letter-spacing: 0.14em; }
      .map-search-sheet-coords { margin-bottom: 8px; }
      .map-search-sheet-coord-input { height: 28px; font-size: 0.78rem; padding: 0 10px; }
      .map-search-sheet .map-search-sheet-coord-copy,
      .map-search-sheet-coord-copy { height: 28px; font-size: 0.62rem; padding: 0 10px; letter-spacing: 0.1em; }
      .map-search-sheet-actions { gap: 4px; }
      .map-search-sheet .map-search-sheet-btn {
        min-height: 34px;
        font-size: 0.66rem;
        padding: 6px 2px 4px;
        letter-spacing: 0.04em;
        border-width: 1px;
      }
      .map-search-sheet .map-search-sheet-btn::before {
        width: 5px;
        height: 5px;
        margin: 0 auto 3px;
      }
      .map-search-sheet .map-search-sheet-btn[data-sheet-role="start"],
      .map-search-sheet .map-search-sheet-btn[data-sheet-role="next"],
      .map-search-sheet .map-search-sheet-btn[data-sheet-role="via"],
      .map-search-sheet .map-search-sheet-btn[data-sheet-role="dest"] {
        font-size: 0.78rem;
        letter-spacing: 0.06em;
      }
      .map-search-sheet .map-search-sheet-btn[data-sheet-role="delete"],
      .map-search-sheet .map-search-sheet-btn.map-search-sheet-close {
        min-height: 26px;
        font-size: 0.62rem;
        letter-spacing: 0.08em;
      }
    }

@media (max-width: 420px) {
      .map-search-sheet-actions {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
          "start next"
          "via dest"
          "delete close";
      }
    }

.map-search-toast {
      position: fixed;
      left: 50%;
      bottom: 84px;
      transform: translateX(-50%) translateY(12px);
      background: rgba(20,20,20,0.94);
      color: #fff;
      padding: 10px 14px;
      border-radius: 8px;
      font-size: 13px;
      line-height: 1.2;
      z-index: 9999;
      opacity: 0;
      transition: opacity 0.2s ease, transform 0.2s ease;
      pointer-events: none;
    }

.map-search-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

.route-preferences {
      position: absolute;
      top: 52px;
      left: 12px;
      z-index: 1005;
      width: min(330px, calc(100% - 24px));
      background: #fff !important;
      border: 2px solid #fff !important;
      outline: 2px solid #111 !important;
      border-radius: 0 !important;
      padding: 8px 9px;
      color: #111 !important;
      display: none;
      box-shadow: 0 8px 20px rgba(0,0,0,0.35);
      font-family: 'Barlow', sans-serif;
      max-height: min(62vh, 420px);
      overflow-y: auto;
    }

.route-preferences.show {
      display: block;
    }

.route-preferences h3 {
      margin: 0 0 4px;
      font-family: 'Barlow Condensed', sans-serif;
      font-size: 0.92rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      color: #111 !important;
    }

.route-preferences .pref-group {
      border-top: 1px solid rgba(0,0,0,0.2);
      padding-top: 5px;
      margin-top: 5px;
    }

.route-preferences .pref-group h4 {
      margin: 0 0 3px;
      font-size: 0.8rem;
      font-weight: 700;
      color: #111 !important;
    }

.route-preferences label {
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 2px 0;
      font-size: 0.78rem;
      color: #111 !important;
    }

.route-preferences input[type="checkbox"],
    .route-preferences input[type="radio"] {
      accent-color: #2d8f4f;
    }

.route-preferences .pref-actions {
      margin-top: 7px;
      display: flex;
      gap: 6px;
      justify-content: flex-end;
    }

.route-preferences .btn {
      background: #fff !important;
      color: #111 !important;
      border: 2px solid #111 !important;
      border-radius: 0 !important;
    }

.route-preferences .btn:hover {
      background: #f2f2f2 !important;
    }

body.map-closed .route-preferences { display: none; }

body.map-role-sheet-open #routeWorkspaceDock,
  body.map-role-sheet-open #loadedRoutesPanel,
  body.map-role-sheet-open .loaded-routes-panel,
  body.map-role-sheet-open .lrp-context-menu,
  body.map-role-sheet-open .reorder-wrap {
    display: none !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }

body.map-full.map-role-sheet-open #mapSearchSheetBackdrop {
    background: transparent !important;
    pointer-events: none !important;
  }
