/* ============ THEME TOKENS ============
   Every colour in this file resolves through one of these. Nothing below
   should contain a raw hex or rgba() — if you need a new colour, add a token
   here and give it a value in BOTH themes, or light mode silently inherits a
   dark value and something becomes unreadable.

   These are the Accelerate palette, matching college-materials, which is the
   reference implementation of the club's design system (see DESIGN.md).
   Black, crimson, white. The tokens keep their original names so the 500 lines
   below did not have to change.

   Dark is the default and the original design. Light is an override applied
   via [data-theme], set by app.js from the saved preference or from
   prefers-color-scheme. The club's system is dark-only, but this app shipped a
   working light theme with a toggle, and deleting a feature to match a brand
   document is not a restyle — so light is rethemed rather than removed.

   Contrast: every text/background pairing here was measured against WCAG 2.1
   AA, in both themes. The light accent is much darker than the dark-theme
   crimson because #ee3b44 is only 3.9:1 on white and fails as a text colour. */

:root{
    /* Surfaces */
    --ink:#0a0a0a;          /* page background behind everything */
    --map-bg:#050506;       /* shown while tiles load */
    --panel:#131317;        /* panels, menus, toolbars */
    --panel-2:#16161a;      /* inset surfaces: buttons, inputs, chips */
    --line:#2b2b33;         /* borders and dividers */

    /* Text */
    --text-bright:#ffffff;  /* headings, emphasised text */
    --text:#f2f3f5;         /* body text */
    --text-dim:#9ca0a6;     /* labels, secondary text */
    --link:#c3c7cd;

    /* Brand */
    --accent:#ee3b44;
    --accent-hover:#ff5c63;
    --on-accent:#0a0a0a;    /* text ON an accent fill — must contrast with it */
    --accent-2:#f5a03c;     /* the rocket's flame, for a second signal */
    --danger:#ff8a6b;       /* borders only; kept clear of the crimson accent */
    --warn:#e8c547;

    /* Accent washes, derived from --accent at low alpha */
    --accent-tint:rgba(238,59,68,0.12);
    --accent-tint-strong:rgba(238,59,68,0.18);
    --accent-border:rgba(238,59,68,0.35);

    /* Depth */
    --shadow:rgba(0,0,0,0.45);
    --shadow-lg:rgba(0,0,0,0.55);
    --shadow-xl:rgba(0,0,0,0.65);
    --overlay:rgba(5,5,6,0.7);
    --attribution-bg:rgba(19,19,23,0.85);

    /* The logo is drawn for a dark field. On dark it needs no plate; on light
       it gets one, because its white outlines disappear on a white panel. */
    --brand-plate:transparent;

    /* The three voices of the design system. Panels are dense UI, so body text
       is Space Grotesk and anything quoting a machine — coordinates, counts,
       file paths — is JetBrains Mono. */
    --font-display:"Anton","Arial Narrow","Helvetica Neue",sans-serif;
    --font-body:"Space Grotesk",system-ui,-apple-system,"Segoe UI",sans-serif;
    --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

    font-family: var(--font-body);
  }

  /* Light theme. The map is satellite imagery either way, so the panels are
     what changes; --map-bg stays dark because it sits under the tiles. */
  :root[data-theme="light"]{
    --ink:#f2f3f5;
    --map-bg:#c9d2d8;
    --panel:#ffffff;
    --panel-2:#f2f3f5;
    --line:#d6d8dd;

    --text-bright:#0a0a0a;
    --text:#1e1f24;
    --text-dim:#5c6169;
    --link:#8a1620;

    /* The dark-theme crimson #ee3b44 is only 3.9:1 on white — unusable as
       text. This value was picked by measuring, not by eye: it has to clear
       4.5:1 in four places at once — as text on --panel, on --panel-2, on its
       own --accent-tint wash behind .status-pill, and as the background under
       white --on-accent text. */
    --accent:#b81d2b;
    --accent-hover:#8f141f;
    --on-accent:#ffffff;
    --accent-2:#8a4b12;
    --danger:#a33417;
    --warn:#6f5600;

    --accent-tint:rgba(184,29,43,0.10);
    --accent-tint-strong:rgba(184,29,43,0.16);
    --accent-border:rgba(184,29,43,0.40);

    --shadow:rgba(10,10,10,0.12);
    --shadow-lg:rgba(10,10,10,0.16);
    --shadow-xl:rgba(10,10,10,0.22);
    --overlay:rgba(10,10,10,0.45);
    --attribution-bg:rgba(255,255,255,0.88);
    --brand-plate:#0a0a0a;
  }
  *{ box-sizing:border-box; }
  html,body{ margin:0; height:100%; background:var(--ink); overflow:hidden; }
  #map{ position:absolute; inset:0; z-index:0; background:var(--map-bg); }

  /* ============ ACCESSIBILITY ============ */

  /* Available to screen readers, invisible on screen. Used for the page h1 and
     for the labels on controls whose purpose is obvious visually (the
     Directions selects, the modal inputs) but which were otherwise unnamed. */
  .visually-hidden{
    position:absolute; width:1px; height:1px; margin:-1px; padding:0;
    overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0;
  }

  /* The map swallows a lot of tab stops, so offer a way past it. Visible only
     when focused. */
  .skip-link{
    position:absolute; top:0; left:50%; transform:translate(-50%, -120%);
    z-index:3000; background:var(--accent); color:var(--on-accent);
    padding:10px 16px; border-radius:0 0 8px 8px; font-size:13px; font-weight:700;
    text-decoration:none; transition:transform .15s ease;
  }
  .skip-link:focus{ transform:translate(-50%, 0); }

  .field-help{ font-size:12px; color:var(--text-dim); margin-bottom:8px; }

  /* No focus indicator was defined anywhere, so keyboard users navigated an
     invisible cursor — the UA default outline is also nearly unreadable against
     these dark panels. :focus-visible keeps it off for mouse clicks. */
  :focus-visible{
    outline:2px solid var(--accent);
    outline-offset:2px;
    border-radius:4px;
  }
  .leaflet-container :focus-visible{ outline-offset:0; }

  /* ---- Panel header ----
     One row: the mark on the left, the two panel controls grouped on the
     right. Previously the brand, the collapse caret and the hide button were
     three separately positioned elements competing for the same corner, which
     is most of why the sidebar read as cluttered. */
  .panel-head{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    margin-bottom:12px;
  }
  /* The lockup is the wordmark, so it carries alt="Accelerate". Sized by
     height; the intrinsic width/height on the <img> reserve the box so the
     panel does not reflow as it loads. */
  .panel-brand{
    display:block; line-height:0; flex:none;
  }
  .panel-brand img{
    display:block; width:auto; height:26px;
  }
  .panel-brand:hover img{ opacity:.85; }

  /* ---- Panel settings row ----
     Map-level settings sit at the foot of the panel. Zoom lock used to be the
     first thing under the tabs, which gave a niche toggle the most valuable
     slot in the sidebar. */
  .panel-settings{
    margin-top:12px; padding-top:10px; border-top:1px solid var(--line);
  }
  .btn.subtle{
    width:100%; font-size:12px; color:var(--text-dim);
    background:transparent; border-color:var(--line);
  }
  .btn.subtle:hover{ color:var(--text); border-color:var(--text-dim); }
  .btn.subtle.on{
    color:var(--accent); border-color:var(--accent-border);
    background:var(--accent-tint);
  }

  /* A count is secondary to the heading it annotates. */
  .count-badge{ color:var(--text-dim); font-weight:400; }

  /* Stacked form controls in the Directions tab. */
  .cat-filter.stacked{ margin-bottom:8px; }

  /* The strip is empty until something is being drawn; without this it leaves
     a gap under the header for the whole of normal use. */
  .status-strip:empty{ display:none; }
  /* On light, the lockup sits on a dark plate rather than being recoloured —
     its outlines are white and would vanish on the white panel. */
  :root[data-theme="light"] .panel-brand{
    background:var(--brand-plate); border-radius:6px; padding:6px 10px;
    display:inline-block; margin-bottom:12px;
  }

  /* ---- Typography ----
     Headings take the display face; anything quoting a machine — counts,
     coordinates, file paths — takes the mono. */
  .panel h2, .panel h3, .modal h2, .modal h3{
    font-family:var(--font-display); font-weight:400; letter-spacing:.02em;
    text-transform:uppercase;
  }
  .status-pill, .sidebar-tab, .btn, .chip{
    font-family:var(--font-mono);
  }

  /* ---- Theme toggle ---- */
  .theme-toggle{
    position:absolute; top:14px; left:14px; z-index:1000;
    width:40px; height:40px; display:flex; align-items:center; justify-content:center;
    appearance:none; padding:0; font-family:inherit; font-size:15px; line-height:1;
    background:var(--panel); border:1px solid var(--line); border-radius:10px;
    color:var(--text); cursor:pointer; box-shadow:0 6px 20px var(--shadow);
    transition:border-color .15s, background .15s;
  }
  .theme-toggle:hover{ border-color:var(--accent); }

  /* Respect a user's reduced-motion preference. */
  @media (prefers-reduced-motion: reduce){
    *, *::before, *::after{
      animation-duration:0.01ms !important;
      animation-iteration-count:1 !important;
      transition-duration:0.01ms !important;
      scroll-behavior:auto !important;
    }
  }

  /* Top bar: site toggle */
  .topbar{
    position:absolute; top:14px; left:50%; transform:translateX(-50%);
    z-index:1000; display:flex; gap:2px; background:var(--panel);
    border:1px solid var(--line); border-radius:10px; padding:3px;
    box-shadow:0 6px 20px var(--shadow);
  }
  .topbar button{
    appearance:none; border:none; background:transparent; color:var(--text-dim);
    padding:9px 22px; border-radius:8px; font-size:14px; font-weight:600;
    letter-spacing:0.02em; cursor:pointer; transition:background .15s, color .15s;
  }
  .topbar button.active{ background:var(--accent); color:var(--on-accent); }
  .topbar button:not(.active):hover{ color:var(--text-bright); }

  /* Contribute (GitHub) widget */
  .contribute-widget{
    position:absolute; top:14px; right:14px; z-index:1000;
  }
  .contribute-btn{
    display:flex; align-items:center; gap:7px; appearance:none; cursor:pointer;
    background:var(--panel); border:1px solid var(--line); color:var(--text-bright);
    font-size:13px; font-weight:600; padding:9px 14px; border-radius:10px;
    box-shadow:0 6px 20px var(--shadow);
  }
  .contribute-btn:hover{ background:var(--panel-2); }
  .contribute-menu{
    display:none; position:absolute; top:calc(100% + 6px); right:0; min-width:210px;
    background:var(--panel); border:1px solid var(--line); border-radius:10px;
    overflow:hidden; box-shadow:0 6px 20px var(--shadow);
  }
  .contribute-menu.show{ display:block; }
  .contribute-menu{ padding:6px 0; max-height:80vh; overflow-y:auto; }
  .menu-section-label{
    font-size:10.5px; text-transform:uppercase; letter-spacing:0.1em; font-weight:700;
    color:var(--text-dim); padding:8px 14px 4px;
  }
  .menu-item{
    display:flex; align-items:center; gap:8px; width:100%; box-sizing:border-box;
    appearance:none; border:none; background:transparent; cursor:pointer; text-align:left;
    padding:9px 14px; font-size:12.5px; color:var(--text); text-decoration:none; font-family:inherit;
  }
  .menu-item:hover{ background:var(--panel-2); }
  .menu-item span:first-of-type{ flex:1; }
  .menu-badge{
    font-size:10px; font-weight:700; color:var(--on-accent); background:var(--accent);
    border-radius:10px; padding:1px 7px; flex:none;
  }
  .menu-badge:empty{ display:none; }
  .menu-divider{ height:1px; background:var(--line); margin:6px 0; }


  /* Left tool panel */
  .panel{
    position:absolute; top:70px; left:14px; z-index:1000; width:250px;
    background:var(--panel); border:1px solid var(--line); border-radius:12px;
    padding:14px; color:var(--text); box-shadow:0 6px 20px var(--shadow);
  }
  .panel h2{
    font-size:11px; text-transform:uppercase; letter-spacing:0.12em;
    color:var(--text-dim); margin:0 0 10px 0; font-weight:700;
  }
  /* ---- Status strip: compact pills for global setup state ---- */
  .status-strip{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
  .status-strip:empty{ display:none; }
  .status-pill{
    display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700;
    color:var(--accent); background:var(--accent-tint); border:1px solid var(--accent-border);
    border-radius:12px; padding:4px 9px 4px 8px; letter-spacing:0.01em;
  }
  .status-pill::before{ content:''; width:5px; height:5px; border-radius:50%; background:var(--accent); flex:none; }

  /* ---- Floating edit toolbar: shown at the bottom center of the map
     while an editing mode (from the Contribute menu) is active. The
     normal side panel stays a pure view — these controls live outside
     it so "view" and "edit" never share the same surface. ---- */
  .edit-toolbar{
    position:absolute; left:50%; bottom:22px; transform:translateX(-50%);
    z-index:1600; display:flex; align-items:center; gap:10px;
    background:var(--panel); border:1px solid var(--accent); border-radius:12px;
    padding:8px 10px; box-shadow:0 8px 26px var(--shadow-lg);
    max-width:calc(100vw - 28px);
  }
  .edit-toolbar-label{
    font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em;
    color:var(--accent); padding-left:4px; flex:none; white-space:nowrap;
  }
  .edit-toolbar-actions{ display:flex; gap:8px; flex-wrap:wrap; }
  .edit-toolbar .btn{ padding:8px 12px; font-size:12.5px; white-space:nowrap; }

  /* ---- Section card: groups a tool section with a left accent rule ---- */
  .section-card{
    border-left:2px solid var(--line); padding-left:10px; margin-bottom:16px;
  }
  .section-card:last-child{ margin-bottom:0; }
  .section-card h2{ margin-top:0; }

  #statusBox.status{
    border-top:1px solid var(--line); margin-top:14px; padding-top:12px;
  }

  .tool-row{ display:flex; gap:8px; margin-bottom:8px; }
  .btn{
    flex:1; appearance:none; border:1px solid var(--line); background:var(--panel-2);
    color:var(--text-bright); padding:9px 8px; border-radius:8px; font-size:13px; font-weight:600;
    cursor:pointer; transition:border-color .15s, background .15s;
  }
  .btn:hover{ border-color:var(--accent); }
  .btn.on{ background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
  .btn.danger:hover{ border-color:var(--danger); }
  .btn-success{ background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
  .btn-success:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }
  .btn.full{ width:100%; }
  .btn:disabled{ opacity:0.35; cursor:not-allowed; }

  .status{
    margin-top:10px; font-size:12.5px; line-height:1.45; color:var(--text-dim);
    min-height:34px; border-top:1px dashed var(--line); padding-top:10px;
  }
  .status.active{ color:var(--accent-2); }

  .action-row{ display:flex; gap:8px; margin-top:8px; }

  /* Building list */
  .buildings-box{ margin-top:14px; }
  .buildings-box h2{ margin-bottom:6px; }
  #buildingList{ list-style:none; margin:0; padding:0; max-height:180px; overflow-y:auto; }
  #buildingList li{
    display:flex; align-items:center; justify-content:space-between;
    padding:6px 8px; border-radius:6px; font-size:12.5px; cursor:pointer;
    border:1px solid transparent;
  }
  #buildingList li:hover{ background:var(--panel-2); border-color:var(--line); }
  #buildingList li .x{
    color:var(--text-dim); font-weight:700; padding:0 4px;
  }
  #buildingList li .x:hover{ color:var(--danger); }
  .empty-note{ font-size:12px; color:var(--text-dim); font-style:italic; }

  /* Kanban-style building groups */
  .kanban-group{ margin-bottom:10px; }
  .kanban-group-header{
    display:flex; align-items:center; gap:6px;
    font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em;
    color:var(--text-dim); padding:6px 0 4px; cursor:pointer; user-select:none;
  }
  .kanban-group-header .building-cat-dot{ flex:none; }
  .kanban-count{
    margin-left:auto; font-size:10px; font-weight:700;
    background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
    padding:1px 6px; color:var(--text-dim);
  }
  .building-list{ list-style:none; margin:0; padding:0; max-height:180px; overflow-y:auto; }
  .building-list li{
    padding:5px 8px; border-radius:6px; font-size:12.5px; cursor:pointer;
    border:1px solid transparent; margin-bottom:2px;
  }
  .building-list li:hover{ background:var(--panel-2); border-color:var(--line); }

  /* Landmark list — imported points waiting to be traced into buildings */
  #landmarkList{ list-style:none; margin:0; padding:0; max-height:180px; overflow-y:auto; }
  #landmarkList li{
    display:flex; align-items:center; justify-content:space-between; gap:6px;
    padding:6px 8px; border-radius:6px; font-size:12.5px;
    border:1px solid transparent;
  }
  #landmarkList li:hover{ background:var(--panel-2); border-color:var(--line); }
  #landmarkList li .lm-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .expand-btn{
    flex:none; appearance:none; border:1px solid var(--line); background:var(--panel-2);
    color:var(--accent); font-size:13px; font-weight:700; line-height:1;
    width:26px; height:26px; border-radius:6px; cursor:pointer;
  }
  .expand-btn:hover{ border-color:var(--accent); background:var(--accent); color:var(--on-accent); }
  .expand-btn.has-entry{ border-color:var(--warn); }

  /* Legend / attribution custom */
  .leaflet-control-attribution{
    background:var(--attribution-bg) !important; color:var(--text-dim) !important;
  }
  .leaflet-control-attribution a{ color:var(--link) !important; }

  /* pulsing crosshair cursor helper */
  .drawing-cursor{ cursor:crosshair !important; }

  /* Panel collapse toggle (mobile only).
     This and .sidebar-toggle are <button>s rather than <div>s so they are
     focusable and announced; the resets below keep them looking identical. */
  /* Hidden on desktop; the small-screen media query below turns it on. Sizing
     is shared with .sidebar-hide-btn further down. */
  .panel-toggle{ display:none; }

  /* ---- Desktop sidebar hide/show ----
     Now a square icon button sitting in .panel-head rather than being
     absolutely positioned over the panel's top-right corner. Exactly one of
     these two controls is visible at a time — the caret on small screens, this
     on desktop — so the group never holds more than one button. */
  .sidebar-hide-btn{
    width:28px; height:28px; flex:none;
    align-items:center; justify-content:center;
    appearance:none; font-family:inherit; font-size:12px; line-height:1;
    border:1px solid var(--line); border-radius:7px;
    background:var(--panel-2); color:var(--text-dim); cursor:pointer; padding:0;
  }
  .sidebar-hide-btn{ display:flex; }
  .sidebar-hide-btn:hover{ border-color:var(--text-dim); color:var(--text-bright); }
  .panel{ transition: transform .2s ease, opacity .2s ease; }
  .panel.hidden-desktop{ transform:translateX(-120%); opacity:0; pointer-events:none; }
  .sidebar-toggle{
    position:absolute; top:70px; left:14px; z-index:1000; width:40px; height:40px;
    display:flex; align-items:center; justify-content:center; background:var(--panel);
    border:1px solid var(--line); border-radius:10px; color:var(--text); font-size:16px;
    cursor:pointer; box-shadow:0 6px 20px var(--shadow);
    appearance:none; font-family:inherit; padding:0;
  }
  .sidebar-toggle:hover{ border-color:var(--accent); }

  /* ---- Category filter / legend / chips ---- */
  .cat-filter{
    width:100%; appearance:none; border:1px solid var(--line); background:var(--panel-2);
    color:var(--text-bright); padding:7px 8px; border-radius:7px; font-size:12.5px; margin-bottom:6px;
  }
  .cat-legend{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
  .cat-legend .tag{
    display:flex; align-items:center; gap:4px; font-size:10.5px; color:var(--text-dim);
    background:var(--panel-2); border:1px solid var(--line); border-radius:12px; padding:2px 8px 2px 5px;
  }
  .cat-legend .dot{ width:8px; height:8px; border-radius:50%; flex:none; }
  .building-cat-dot{ width:8px; height:8px; border-radius:50%; flex:none; margin-right:6px; display:inline-block; }

  .chip-row{ display:flex; flex-wrap:wrap; gap:6px; }
  .chip{
    appearance:none; border:1px solid var(--line); background:var(--panel-2); color:var(--text);
    font-size:12px; font-weight:600; padding:6px 10px; border-radius:16px; cursor:pointer;
    display:flex; align-items:center; gap:5px;
  }
  .chip .dot{ width:8px; height:8px; border-radius:50%; }
  .chip.selected{ border-color:var(--accent); background:var(--accent-tint-strong); color:var(--text-bright); }

  /* ---- Name/category modal ---- */
  .modal-overlay{
    position:absolute; inset:0; z-index:2000; background:var(--overlay);
    display:flex; align-items:center; justify-content:center;
  }
  .modal-box{
    width:320px; max-width:90vw; background:var(--panel); border:1px solid var(--line);
    border-radius:14px; padding:18px; box-shadow:0 12px 32px var(--shadow-xl);
  }
  .modal-box h3{ margin:0 0 12px 0; font-size:15px; color:var(--text-bright); }
  .modal-box input{
    width:100%; appearance:none; border:1px solid var(--line); background:var(--panel-2);
    color:var(--text-bright); padding:9px 10px; border-radius:8px; font-size:14px; margin-bottom:12px;
  }
  .modal-label{ font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-dim); margin-bottom:8px; font-weight:700; }

  /* ---- Sidebar tabs ---- */
  .sidebar-tabs{
    display:flex; gap:2px; margin-bottom:12px;
    background:var(--panel-2); border-radius:8px; padding:3px;
  }
  .sidebar-tab{
    flex:1; appearance:none; border:none; background:transparent; color:var(--text-dim);
    padding:7px 12px; border-radius:6px; font-size:12px; font-weight:700;
    cursor:pointer; text-align:center; transition:background .15s, color .15s;
  }
  .sidebar-tab.active{ background:var(--accent); color:var(--on-accent); }
  .sidebar-tab:not(.active):hover{ color:var(--text-bright); }
  .tab-panel{ display:none; }
  .tab-panel.active{ display:block; }

  /* ---- Contribution preview modal ---- */
  .modal-desc{ font-size:12px; color:var(--text-dim); margin:0 0 10px 0; line-height:1.4; }
  .json-preview{
    background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
    padding:10px; font-size:11px; max-height:220px; overflow:auto;
    color:var(--accent); white-space:pre-wrap; word-break:break-all;
    font-family:"Cascadia Code","Fira Code","Consolas",monospace; margin:0 0 12px 0;
  }

  /* ============ MOBILE OPTIMIZATION ============ */
  @media (max-width: 680px){
    html, body{ overscroll-behavior:none; }

    .sidebar-hide-btn{ display:none; }
    .sidebar-toggle{ display:none; }

    /* Topbar: smaller, tighter */
    .topbar{
      top:calc(8px + env(safe-area-inset-top)); padding:2px; gap:1px;
    }
    .topbar button{ padding:8px 14px; font-size:12px; }

    /* Contribute widget: compact pill at top-right */
    .contribute-widget{
      top:calc(8px + env(safe-area-inset-top)); right:8px; left:auto;
    }
    .contribute-btn{
      padding:7px 12px; font-size:12px; border-radius:8px;
    }
    .contribute-btn svg{ width:13px; height:13px; }
    .contribute-menu{
      position:fixed; top:auto; left:0; right:0; bottom:0;
      max-height:55vh; border-radius:14px 14px 0 0;
      border:1px solid var(--line); border-bottom:none;
      padding:8px 0 env(safe-area-inset-bottom);
      z-index:2000;
      box-shadow:0 -8px 30px var(--shadow-xl);
    }
    .contribute-menu.show{ animation: slideUp .2s ease; }
    @keyframes slideUp{
      from{ transform:translateY(100%); }
      to{ transform:translateY(0); }
    }
    .menu-item{ padding:14px 18px; font-size:14px; }
    .menu-section-label{ padding:10px 18px 4px; font-size:11px; }

    /* ===== BOTTOM SHEET PANEL ===== */
    .panel{
      top:auto; left:0; right:0; bottom:0; width:auto;
      max-height:50vh; overflow:hidden;
      border-radius:14px 14px 0 0; border-bottom:none;
      padding:0;
      transition:transform .25s cubic-bezier(.4,0,.2,1);
      box-shadow:0 -8px 24px var(--shadow-xl);
      display:flex; flex-direction:column;
    }
    .panel.collapsed{ transform:translateY(calc(100% - 52px)); }

    /* Drag handle bar */
    .panel-toggle{
      display:flex; align-items:center; justify-content:center;
      width:100%; height:44px; flex-shrink:0; cursor:pointer;
      background:var(--panel); border-bottom:1px solid var(--line);
    }
    .panel-toggle::after{
      content:''; width:36px; height:4px; border-radius:2px;
      background:var(--line);
    }
    .panel.collapsed .panel-toggle::after{ background:var(--text-dim); }

    /* Scrollable content area inside the sheet */
    .panel > *:not(.panel-toggle){ flex:1; min-height:0; }
    .panel{ padding:0 env(safe-area-inset-right) calc(env(safe-area-inset-bottom)) env(safe-area-inset-left); }

    /* Inner scroll container: status + tabs + content */
    .panel > .status-strip,
    .panel > .sidebar-tabs,
    .panel > .tab-panel,
    .panel > .status,
    .panel > #statusBox{ padding-left:14px; padding-right:14px; }

    /* Status strip: tiny, inline */
    .status-strip{ padding:8px 14px 0; margin-bottom:4px; flex-wrap:nowrap; overflow-x:auto; }
    .status-pill{ font-size:9px; padding:2px 6px; white-space:nowrap; }

    /* Tabs: compact, full-width */
    .sidebar-tabs{ margin:0 14px 6px; border-radius:6px; padding:2px; }
    .sidebar-tab{ padding:8px 0; font-size:12px; font-weight:700; }

    /* Tab panels: scrollable */
    .tab-panel{ overflow-y:auto; -webkit-overflow-scrolling:touch; padding:0 14px; }
    .tab-panel.active{ display:block; }

    /* Section cards: no left border, just spacing */
    .section-card{
      border-left:none; padding-left:0; margin-bottom:10px;
      border-top:1px solid var(--line); padding-top:10px;
    }
    .section-card:first-child{ border-top:none; padding-top:0; }
    .section-card h2{ font-size:10px; margin-bottom:6px; }

    /* Building/landmark lists: fill available space */
    .building-list{ max-height:none; }
    #buildingList{ max-height:none; }
    #landmarkList{ max-height:none; }
    .building-list li{ padding:10px 8px; font-size:13px; }
    #landmarkList li{ padding:10px 8px; font-size:13px; }
    .expand-btn{ width:36px; height:36px; font-size:15px; }

    /* Status text at bottom: minimal */
    .status{ font-size:11px; min-height:auto; padding:8px 14px; margin:0; border:none; color:var(--text-dim); }

    /* Buttons: bigger touch targets */
    .tool-row{ gap:8px; margin-bottom:8px; }
    .btn{ padding:12px 8px; font-size:14px; min-height:48px; border-radius:10px; }

    /* Edit toolbar: above the sheet */
    .edit-toolbar{
      left:8px; right:8px; bottom:calc(56px + env(safe-area-inset-bottom));
      transform:none; max-width:none; flex-wrap:wrap;
      padding:8px 10px; gap:8px;
    }
    .edit-toolbar .btn{ padding:10px 12px; font-size:13px; min-height:44px; }

    /* Modals: full-width on mobile */
    .modal-box{
      width:calc(100vw - 24px); max-width:none; padding:16px;
    }
    .modal-box input{
      font-size:16px; /* prevents iOS zoom on focus */
      padding:12px 12px;
    }
    .json-preview{ font-size:10px; max-height:35vh; }

    /* Contribute menu touch feedback */
    .contribute-menu .menu-item:active{ background:var(--accent); color:var(--on-accent); }

    /* Leaflet controls: bigger */
    .leaflet-touch .leaflet-bar a{ width:40px; height:40px; line-height:40px; }
  }
