html, body { height: 100%; margin: 0; }

    #app {
      display: grid;
      grid-template-columns: 380px 1fr;
      grid-template-rows: 100vh;
      width: 100vw;
      height: 100vh;
      background: #f6faf8;
    }

    /* Sidebar */
    #sidebar {
      border-right: 1px solid #e5efe9;
      background: linear-gradient(180deg,#ffffff,#fbfdfc);
      font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      display: flex;
      flex-direction: column;
      min-width: 320px;
      overflow: hidden;
    }

    #sidebar header {
      position: sticky;
      top: 0;
      z-index: 5;
      flex: 0 0 auto;
      background: #f2f7f4;
      border-bottom: 1px solid #e5efe9;
      padding: 10px 12px;
      font-weight: 900;
      letter-spacing:.2px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    #results-count { color: #5a7468; font-weight: 900; }

    /* Toggle bar (smaller + simpler labels) */
    #modebar{
      flex: 0 0 auto;
      display:flex;
      gap:10px;
      padding: 10px 12px;
      border-bottom: 1px solid #e5efe9;
      background: rgba(255,255,255,0.98);
    }
    .modebtn{
      flex: 1 1 0;
      appearance:none;
      border: 1px solid #cfe3d9;
      background: #ffffff;
      border-radius: 14px;
      padding: 10px 10px;
      cursor:pointer;
      font-weight: 950;
      color:#0f1a14;
      box-shadow: 0 10px 22px rgba(16,46,33,.08);
      transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
      text-align: center;
      line-height: 1.1;
      font-size: 13px;
    }
    .modebtn:hover{
      transform: translateY(-1px);
      box-shadow: 0 14px 30px rgba(16,46,33,.12);
      background:#fbfffd;
      border-color:#bfe6d2;
    }
    .modebtn.primary{
      border-color:#2f7d55;
      background: linear-gradient(180deg, #369765, #2f7d55);
      color:#ffffff;
      box-shadow: 0 12px 26px rgba(47,125,85,.22);
    }

    /* Filters pane scroll */
    #filters-pane{
      flex: 0 1 auto;
      overflow: auto;
      padding: 10px 12px 12px;
      border-bottom: 1px solid #e5efe9;
      background: rgba(255,255,255,0.98);
      display: none;
    }
    #filters-pane.active{ display:block; }

    .f-grid{ display:grid; gap: 10px; }
    .f-row{ display:grid; grid-template-columns: 1fr; gap: 6px; }
    .f-row label{
      font-size:12px;
      font-weight:950;
      color:#355646;
      display:flex; align-items:center; justify-content:space-between;
      gap: 8px;
    }
    .hint{ font-weight:850; color:#6b7a70; }

    .f-input, .f-select{
      width:100%;
      border:1px solid #dfe6e1;
      background:#fff;
      border-radius: 12px;
      padding: 9px 10px;
      font: 13px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      outline: none;
    }
    .f-input:focus, .f-select:focus{
      border-color:#9fd2bb;
      box-shadow: 0 0 0 3px rgba(47,125,85,.12);
    }

    .f-chips{ display:flex; flex-wrap:wrap; gap:8px; }
    .pill{
      display:inline-flex; align-items:center; gap:8px;
      border:1px solid #dfe6e1;
      background:#fff;
      padding: 7px 9px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 900;
      color:#20543c;
      cursor:pointer;
      user-select:none;
    }
    .pill input{ transform: translateY(1px); cursor:pointer; }
    .pill.on{ border-color:#bfe6d2; background:#f3fbf7; }

    .mini-link{
      font-size:12px; font-weight:950; color:#20543c; cursor:pointer; text-decoration: underline;
      user-select:none;
    }
    .note{
      font-size: 12px;
      color:#6b7a70;
      margin-top: 6px;
    }

    .reset-wrap{
      display:flex;
      gap: 10px;
      align-items:center;
      justify-content: space-between;
      padding-top: 2px;
    }
    .reset-btn{
      appearance:none;
      border:1px solid #dfe6e1;
      background:#ffffff;
      padding: 10px 12px;
      border-radius: 12px;
      cursor:pointer;
      font-weight: 950;
      color:#20543c;
      width: 100%;
      box-shadow: 0 8px 18px rgba(16,46,33,.08);
      transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
    }
    .reset-btn:hover{
      transform: translateY(-1px);
      box-shadow: 0 12px 26px rgba(16,46,33,.12);
      background:#fbfffd;
      border-color:#cfe3d9;
    }

    /* Results pane scroll */
    #results-pane{
      flex: 1 1 auto;
      overflow: hidden;
      display: none;
      background: transparent;
    }
    #results-pane.active{ display:block; }

    #list {
      height: 100%;
      overflow: auto;
      list-style: none;
      padding: 10px 10px 16px;
      margin: 0;
      display: grid;
      gap: 10px;
    }

    .list-item {
      padding: 10px 12px; cursor: pointer;
      display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
      border: 1px solid #e7efe9; border-radius: 12px;
      background: #ffffff;
      box-shadow: 0 4px 12px rgba(16,46,33,.06);
      transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
    }
    .list-item:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(16,46,33,.12); background:#fbfffd; }
    .list-item.active { background: #eef7f2; border-color:#cfe3d9; box-shadow: 0 8px 20px rgba(16,46,33,.12) inset; }

    .name { font-weight: 850; color: #0f1a14; }
    .meta { color: #6b7a70; font-size: 12px; margin-top: 3px; }

    .right-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .chip-mini {
      display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px;
      background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; white-space: nowrap;
    }
    .chip-mini.outdoor { background:#eaffea; border-color:#cfeecf; color:#175d1a; }
    .chip-mini--restaurant { background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
    .chip-mini--lodging { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
    .chip-mini--custom { background:#f5f3ff; border-color:#ddd6fe; color:#5b21b6; }

    .mini-btn {
      appearance: none;
      border: 1px solid #dfe6e1;
      background: #ffffff;
      color: #20543c;
      padding: 6px 8px;
      border-radius: 8px;
      font-weight: 800;
      font-size: 12px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      text-decoration: none;
      cursor: pointer;
      transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
      user-select: none;
    }
    .mini-btn:hover { background:#f3fbf7; border-color:#cfe3d9; box-shadow: 0 6px 16px rgba(16,46,33,.10); transform: translateY(-1px); }
    .mini-btn:disabled{ opacity:.55; cursor:not-allowed; }

    .include-wrap{
      display:flex; align-items:center; gap:6px;
      padding: 6px 8px;
      border: 1px dashed #cfe3d9;
      border-radius: 10px;
      background:#f7fffb;
      font-size: 12px;
      font-weight: 800;
      color:#20543c;
      user-select:none;
      cursor: default;
    }
    .include-wrap input { cursor: pointer; }

    #map { height: 100%; width: 100%; display:block; min-height: 300px; }

    #ai-controls {
      position: absolute; z-index: 10000; right: 12px; top: 12px;
      background: rgba(255,255,255,0.90); border: 1px solid #d7e5dd; padding: 10px 12px; border-radius: 12px;
      font: 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      box-shadow: 0 10px 26px rgba(28,91,63,.18);
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    }
    #ai-controls button {
      padding: 10px 14px; border-radius: 12px; border: 1px solid #2f7d55; cursor: pointer;
      background: linear-gradient(180deg, #369765, #2f7d55);
      color: #fff; font-weight: 650; letter-spacing: .25px;
      box-shadow: 0 8px 18px rgba(47,125,85,.22);
      transition: transform .08s ease, box-shadow .12s ease, filter .2s ease;
      animation: pulse 1.8s ease-in-out infinite;
      white-space: nowrap;
      text-align:center;
      line-height:1.1;
    }
    #ai-controls button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(47,125,85,.28); filter: brightness(1.03); }
    @keyframes pulse { 0%,100% { box-shadow: 0 8px 18px rgba(47,125,85,.22); } 50% { box-shadow: 0 14px 30px rgba(47,125,85,.30); } }
    .spinner { display:none; font-weight: 800; color:#0f1a14; }

    /* Search/Add button: match itinerary style, centered, icon */
    #search-add{
      min-width: 170px;
      display:flex;
      align-items:center;
      justify-content:center;
      gap: 8px;
      font-weight: 750;
    }
    #view-requests{
      padding: 10px 14px;
      border-radius: 12px;
      border: 1px solid #dfe6e1;
      cursor: pointer;
      background: #ffffff;
      color: #20543c;
      font-weight: 850;
      box-shadow: 0 8px 18px rgba(16,46,33,.10);
      transition: transform .08s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
      white-space: nowrap;
    }
    #view-requests:hover{
      transform: translateY(-1px);
      box-shadow: 0 12px 26px rgba(16,46,33,.14);
      background:#fbfffd;
      border-color:#cfe3d9;
    }

    #search-add .ico{
      font-size: 16px;
      line-height: 1;
      transform: translateY(-.5px);
    }

    #banner {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      top: 12px;
      z-index: 10001;
      background: rgba(15,26,20,0.90);
      color: #e7f2ec;
      border: 1px solid rgba(231,242,236,0.25);
      padding: 8px 12px;
      border-radius: 999px;
      font: 13px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      box-shadow: 0 10px 22px rgba(16,46,33,.20);
      display: none;
      max-width: 92%;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .nn-popup { font: 14px/1.25 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
    .nn-popup .title { font-weight: 900; margin-bottom: 4px; }
    .nn-popup .muted { color:#6b7a70; font-size: 12px; }
    .nn-popup .include-row{
      margin-top:10px;
      display:flex; align-items:center; gap:8px;
      padding: 8px 10px;
      border-radius: 12px;
      border: 1px dashed #cfe3d9;
      background:#f7fffb;
      font-weight: 900;
      color:#20543c;
    }
    .nn-popup .include-row input{ transform: translateY(1px); }

    .nn-pin {
      width: 28px;
      height: 28px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      font-weight: 950;
      color: #fff;
      border: 2px solid rgba(255,255,255,0.95);
      box-shadow: 0 10px 22px rgba(16,46,33,.18);
      transform-origin: center;
    }
    .nn-pin.pin-o { background: #2e7d32; }
    .nn-pin.pin-i { background: #7e57c2; }
    .nn-pin.pin-r { background: #f59e0b; }
    .nn-pin.pin-l { background: #3b82f6; }
    .nn-pin.pin-c { background: #7c3aed; }

    @keyframes nnBounce {
      0%   { transform: translateY(0) scale(1); }
      30%  { transform: translateY(-8px) scale(1.05); }
      60%  { transform: translateY(0) scale(1); }
      100% { transform: translateY(-2px) scale(1.02); }
    }
    .nn-pin.nn-active {
      animation: nnBounce 0.65s ease;
      filter: brightness(1.06);
    }

    /* Modal */
    .modal-backdrop{
      position: fixed; inset: 0; z-index: 20000;
      background: rgba(10,18,14,.45);
      display:none;
      align-items: center;
      justify-content: center;
      padding: 18px;
    }
    .modal{
      width: min(860px, 96vw);
      border-radius: 18px;
      background: #ffffff;
      border: 1px solid rgba(0,0,0,.08);
      box-shadow: 0 26px 60px rgba(0,0,0,.22);
      overflow: hidden;
      font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    }
    .modal-h{
      padding: 12px 14px;
      background: #f2f7f4;
      border-bottom: 1px solid #e5efe9;
      display:flex; align-items:center; justify-content:space-between; gap: 10px;
    }
    .modal-h .t{ font-weight: 950; color:#0f1a14; }
    .modal-h .x{
      border: 1px solid #dfe6e1; background:#fff; border-radius: 12px;
      padding: 8px 10px; cursor:pointer; font-weight: 950; color:#20543c;
    }
    .modal-b{ padding: 12px 14px 14px; }

    .modal-top{
      display:flex; gap: 10px; flex-wrap: wrap; align-items: center;
      margin-bottom: 10px;
    }
    .modal-top .grow{ flex: 1 1 340px; }
    .btn{
      appearance:none; border:1px solid #dfe6e1; background:#fff;
      padding: 10px 12px; border-radius: 12px; cursor:pointer;
      font-weight: 950; color:#20543c;
      display:inline-flex; align-items:center; gap:8px;
    }
    .btn.primary{
      border-color:#2f7d55;
      background: linear-gradient(180deg, #369765, #2f7d55);
      color:#fff;
      box-shadow: 0 10px 22px rgba(47,125,85,.22);
    }
    .btn.dark{
      border-color:#111827;
      background: linear-gradient(180deg, #111827, #0b1220);
      color:#fff;
      box-shadow: 0 10px 22px rgba(17,24,39,.20);
    }
    .btn:disabled{ opacity:.6; cursor:not-allowed; }

    .results-box{
      border: 1px solid #e7efe9;
      border-radius: 14px;
      overflow: hidden;
      background:#fff;
    }
    .r-head{
      padding: 10px 12px;
      background:#fbfdfc;
      border-bottom: 1px solid #e7efe9;
      display:flex; align-items:center; justify-content:space-between; gap:10px;
      font-weight: 950;
      color:#0f1a14;
    }
    .r-sub{ font-weight:850; color:#6b7a70; font-size: 12px; }
    .r-list{
      max-height: 360px;
      overflow:auto;
    }
    .r-item{
      padding: 10px 12px;
      border-bottom: 1px solid #eef6f1;
      display:flex; align-items:flex-start; justify-content:space-between; gap: 10px;
    }
    .r-item:last-child{ border-bottom:none; }
    .r-title{ font-weight: 950; }
    .r-meta{ font-size:12px; color:#6b7a70; margin-top: 2px; }
    .r-actions{ display:flex; align-items:center; gap:10px; flex-wrap: wrap; justify-content:flex-end; }
    .sel{
      display:inline-flex; align-items:center; gap:8px;
      border:1px solid #dfe6e1;
      background:#fff;
      padding: 8px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 900;
      color:#20543c;
      cursor:pointer;
      user-select:none;
      white-space: nowrap;
    }
    .sel input{ transform: translateY(1px); cursor:pointer; }
    .sel.on{ border-color:#bfe6d2; background:#f3fbf7; }

    .pillrow{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-top: 10px; }
    .smallnote{ font-size:12px; color:#6b7a70; margin-top: 8px; }

    @media (max-width: 900px) {
      #app { grid-template-columns: 1fr; }
      #sidebar { display: none; }
    }
