:root {
      --ink: #14101f;
      --cream: #fff4d6;
      --gold: #ffc21a;
      --gold-warm: #f5aa00;
      --mag: #b5239b;
      --blue: #1f5bd8;
      --violet: #7b3fa0;
      --yellow: #e9b400;
      --pink: #e75480;
      --red: #d93025;
      --green: #168045;
      --orange: #ea580c;
      --my: #e9b400;
      --lc: #e9b400;
      --bg-main: var(--gold);
      --bg-grad: linear-gradient(180deg, var(--gold) 0%, var(--gold-warm) 100%);
      --surface: var(--cream);
      --surface-soft: #fffdf6;
      --text-main: #14101f;
      --border-soft: rgba(20, 16, 31, 0.28);
      --disp: "Rozha One", "Mukta", Georgia, serif;
      --body: "Mukta", system-ui, -apple-system, sans-serif;
    }

    body.dark-mode {
      --bg-main: #110e1c;
      --bg-grad: linear-gradient(180deg, #14101f 0%, #1d1630 100%);
      --surface: #1e192e;
      --surface-soft: #27213b;
      --text-main: #fff4d6;
      --border-soft: rgba(255, 244, 214, 0.22);
    }

    * { box-sizing: border-box; margin: 0; }

    body {
      font-family: var(--body);
      font-weight: 700;
      color: var(--text-main);
      background-color: var(--bg-main);
      background-image:
        radial-gradient(rgba(214, 23, 127, 0.1) 1.2px, transparent 1.4px),
        var(--bg-grad);
      background-size: 14px 14px, 100% 100%;
      background-attachment: fixed;
      padding: env(safe-area-inset-top, 0) 0 0;
      min-height: 100vh;
      transition: background-color 0.25s ease, color 0.25s ease;
    }

    #app {
      max-width: 500px;
      margin: 0 auto;
      padding: 12px 16px 104px;
    }

    /* Compact Header */
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 6px;
      flex-wrap: wrap;
    }

    .hi-pill {
      background: var(--surface);
      color: var(--text-main);
      border: 1.5px solid var(--border-soft);
      border-radius: 999px;
      padding: 4px 11px;
      font-size: 12px;
      font-weight: 800;
    }

    .top-actions {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
    }

    .mode-toggle {
      min-height: 34px;
      border: 1.5px solid var(--border-soft);
      background: var(--surface);
      color: var(--text-main);
      border-radius: 999px;
      padding: 4px 11px;
      font: 800 12px var(--body);
      cursor: pointer;
    }

    .ticket-link {
      background: var(--ink);
      color: var(--gold);
      border: 1.5px solid rgba(255, 244, 214, 0.25);
      text-decoration: none;
      border-radius: 999px;
      padding: 5px 11px;
      font-size: 12px;
      font-weight: 800;
      min-height: 34px;
      display: inline-flex;
      align-items: center;
    }

    h1 {
      font-family: var(--disp);
      font-weight: 400;
      font-size: 36px;
      line-height: 0.98;
      color: var(--cream);
      -webkit-text-stroke: 2.2px var(--ink);
      paint-order: stroke fill;
      text-shadow: 3px 3px 0 var(--my), 5px 5px 0 var(--ink);
    }

    /* Compact Selector Trigger Bar (keeps Hero Arch above the fold!) */
    .quick-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 10px 0 12px;
      flex-wrap: wrap;
    }

    .picker-trigger {
      flex: 1;
      min-height: 44px;
      border: 2px solid var(--ink);
      background: var(--cream);
      color: var(--ink);
      border-radius: 14px;
      padding: 8px 13px;
      font: 800 14px var(--body);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      box-shadow: 3px 3px 0 var(--ink);
    }
    body.dark-mode .picker-trigger {
      background: var(--surface);
      color: var(--cream);
      border-color: rgba(255, 244, 214, 0.35);
      box-shadow: 3px 3px 0 var(--my);
    }

    .open-pill {
      min-height: 44px;
      border: 1.5px solid var(--border-soft);
      background: var(--surface);
      color: var(--text-main);
      border-radius: 14px;
      padding: 8px 12px;
      font: 800 12.5px var(--body);
      cursor: pointer;
    }
    .open-pill[aria-pressed="true"] {
      background: #168045;
      color: #fff;
      border-color: #168045;
    }

    /* Collapsible Selector Drawer */
    .drawer {
      background: var(--surface);
      color: var(--text-main);
      border: 2px solid var(--border-soft);
      border-radius: 18px;
      padding: 12px;
      margin-bottom: 14px;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    }

    .drawer-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
      font-size: 12.5px;
      font-weight: 800;
    }

    .home-select {
      border: 1.5px solid var(--border-soft);
      background: var(--surface-soft);
      color: var(--text-main);
      border-radius: 10px;
      padding: 5px 9px;
      font: 700 12.5px var(--body);
      min-height: 36px;
    }

    .line-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

    .lbtn {
      min-height: 36px;
      border: 1.5px solid var(--border-soft);
      background: var(--surface-soft);
      color: var(--text-main);
      padding: 4px 10px;
      border-radius: 999px;
      font: 800 12px var(--body);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .lbtn[aria-pressed="true"] {
      background: var(--ink);
      color: var(--gold);
      border-color: var(--ink);
    }
    body.dark-mode .lbtn[aria-pressed="true"] {
      background: var(--gold);
      color: var(--ink);
    }

    .pdot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 1.5px solid var(--ink);
      display: inline-block;
      flex: none;
    }

    .search-box {
      width: 100%;
      min-height: 40px;
      padding: 7px 12px;
      border: 1.5px solid var(--border-soft);
      border-radius: 11px;
      background: var(--surface-soft);
      font: 700 13.5px var(--body);
      color: var(--text-main);
      margin-bottom: 8px;
    }

    .place-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      max-height: 190px;
      overflow-y: auto;
      padding: 2px;
    }

    .pchip {
      min-height: 38px;
      border: 1.5px solid var(--border-soft);
      background: var(--surface-soft);
      color: var(--text-main);
      padding: 5px 10px;
      border-radius: 10px;
      font: 700 12.5px/1.2 var(--body);
      cursor: pointer;
      text-align: left;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .pchip[aria-pressed="true"] {
      background: var(--ink);
      color: var(--cream);
      border-color: var(--ink);
    }
    body.dark-mode .pchip[aria-pressed="true"] {
      background: var(--gold);
      color: var(--ink);
    }
    .pchip small { opacity: 0.72; font-size: 11px; }

    /* Hero Arch Card (Thick 3px border reserved for the hero!) */
    .frame {
      position: relative;
      padding: 9px;
      border: 3px solid var(--ink);
      border-radius: 155px 155px 20px 20px;
      box-shadow: 8px 8px 0 var(--ink);
      background: repeating-linear-gradient(
        135deg,
        var(--mag) 0 12px,
        var(--cream) 12px 16px,
        var(--blue) 16px 28px,
        var(--cream) 28px 32px,
        var(--gold) 32px 44px,
        var(--cream) 44px 48px,
        var(--green) 48px 60px,
        var(--cream) 60px 64px
      );
    }
    body.dark-mode .frame {
      border-color: rgba(255, 244, 214, 0.45);
      box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55);
    }

    .inner {
      position: relative;
      background: var(--cream);
      color: #14101f;
      border: 3px solid var(--ink);
      border-radius: 144px 144px 12px 12px;
      padding: 22px 18px 18px;
      background-image: radial-gradient(rgba(20, 16, 31, 0.055) 1px, transparent 1.4px);
      background-size: 8px 8px;
    }
    body.dark-mode .inner {
      background: #1e192e;
      color: #fff4d6;
      border-color: rgba(255, 244, 214, 0.25);
      background-image: radial-gradient(rgba(255, 244, 214, 0.06) 1px, transparent 1.4px);
    }

    .flowers { display: flex; justify-content: center; align-items: center; gap: 7px; margin-bottom: 6px; }
    .flowers i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--mag); }
    .flowers i:nth-child(2n) { background: var(--blue); }
    .flowers i:nth-child(3n) { background: var(--gold); }
    .flowers i:nth-child(4) { width: 13px; height: 13px; background: var(--red); }

    .lbl { text-align: center; font-size: 13px; font-weight: 800; }

    .gate {
      font-family: var(--disp);
      text-align: center;
      font-size: 128px;
      line-height: 0.94;
      color: var(--lc);
      -webkit-text-stroke: 4px var(--ink);
      paint-order: stroke fill;
      text-shadow: 6px 6px 0 var(--ink);
      margin: 2px 0 4px;
    }
    .gate.text-gate { font-size: clamp(36px, 11vw, 60px); line-height: 1.05; overflow-wrap: anywhere; }
    body.dark-mode .gate {
      -webkit-text-stroke: 2.5px #fff4d6;
      text-shadow: 5px 5px 0 #090710;
    }
    .gate.none { opacity: 0.45; }

    .flip { animation: flip 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
    @keyframes flip {
      0% { transform: perspective(400px) rotateX(85deg); opacity: 0.4; }
      100% { transform: perspective(400px) rotateX(0deg); opacity: 1; }
    }

    .meta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 8px; }
    .mbadge { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--border-soft); background: var(--surface-soft); color: var(--text-main); }
    .mbadge.open { background: #dcfce7; color: #166534; border-color: #166534; }
    .mbadge.closed { background: #fee2e2; color: #991b1b; border-color: #991b1b; }
    .mbadge.fast { background: var(--gold); color: #14101f; border-color: #14101f; }
    .mbadge.auto { background: #ede9fe; color: #5b21b6; border-color: #5b21b6; }

    .pname { font-family: var(--disp); font-size: 28px; line-height: 1.05; margin-top: 8px; }
    .stn { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-top: 4px; flex-wrap: wrap; }
    .dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--ink); flex: none; background: var(--lc); }

    .interchange {
      margin-top: 8px;
      padding: 6px 10px;
      border-radius: 10px;
      background: rgba(255, 194, 26, 0.22);
      border: 1.5px solid rgba(255, 194, 26, 0.55);
      font-size: 12.5px;
      font-weight: 700;
    }

    .route { margin: 10px 0 4px; }
    .route svg { display: block; width: 100%; height: 22px; }
    .route path { stroke-dasharray: 6 6; stroke-width: 4; fill: none; stroke-linecap: round; }

    .walk { font-size: 16.5px; font-weight: 800; margin-top: 4px; line-height: 1.3; }
    .warn { margin-top: 8px; border: 2px dashed var(--red); background: rgba(217, 48, 37, 0.08); color: #9e170e; border-radius: 10px; padding: 7px 10px; font-size: 13px; }
    body.dark-mode .warn { color: #fca5a5; }
    .src { font-size: 12px; margin-top: 8px; padding-top: 7px; border-top: 1.5px dashed var(--border-soft); opacity: 0.85; font-weight: 600; line-height: 1.35; }

    .stamp-wrap {
      position: absolute;
      right: -8px;
      top: 106px;
      width: 90px;
      height: 90px;
      transform: rotate(-13deg);
      pointer-events: none;
    }
    .stamp-wrap.pop { animation: thud 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
    @keyframes thud {
      from { transform: rotate(-13deg) scale(1.9); opacity: 0.2; }
      to { transform: rotate(-13deg) scale(1); opacity: 1; }
    }

    .row { display: flex; gap: 12px; margin-top: 14px; }
    .btn {
      flex: 1;
      min-height: 46px;
      border: 3px solid var(--ink);
      border-radius: 14px;
      padding: 11px 10px;
      font: 800 15px var(--body);
      cursor: pointer;
      background: var(--ink);
      color: var(--gold);
      box-shadow: 4px 4px 0 var(--my);
    }
    .btn.alt { background: var(--cream); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
    body.dark-mode .btn { background: var(--gold); color: var(--ink); border-color: var(--gold); }
    body.dark-mode .btn.alt { background: var(--surface); color: var(--cream); border-color: rgba(255, 244, 214, 0.35); box-shadow: 4px 4px 0 #090710; }

    h2 {
      font-family: var(--disp);
      font-weight: 400;
      font-size: 28px;
      margin: 4px 0 10px;
      color: var(--ink);
      -webkit-text-stroke: 0;
      text-shadow: 2px 2px 0 rgba(255, 244, 214, 0.7);
    }
    body.dark-mode h2 {
      color: var(--cream);
      -webkit-text-stroke: 1.5px var(--ink);
      paint-order: stroke fill;
      text-shadow: 3px 3px 0 #090710;
    }

    .panel {
      background: var(--surface);
      color: var(--text-main);
      border: 2px solid var(--border-soft);
      border-radius: 18px;
      padding: 12px;
      margin-bottom: 12px;
    }

    .route-note { font-size: 13px; line-height: 1.4; opacity: .86; margin: 2px 0 10px; }
    .route-coverage { margin-bottom: 12px; border-color: #9a6700; }
    .route-card h3 { font: 400 23px var(--disp); margin-bottom: 3px; }
    .route-card > p { font-size: 13px; margin-bottom: 10px; }
    .route-leg { display: flex; align-items: flex-start; gap: 9px; border-top: 1px solid var(--border-soft); padding: 10px 2px; line-height: 1.35; }
    .route-leg .pdot { margin-top: 4px; }
    .route-leg small { opacity: .8; }
    .route-transfer { border-left: 3px solid var(--gold-warm); margin: 0 0 8px 7px; padding: 5px 9px; font-size: 12.5px; }
    .route-foot { line-height: 1.55; overflow-wrap: anywhere; }
    .route-foot small { font-size: 12px; opacity: .8; }
    #calculateRoute { width: 100%; margin-top: 10px; }

    .item {
      display: block;
      width: 100%;
      text-align: left;
      background: var(--surface);
      color: var(--text-main);
      border: 2px solid var(--border-soft);
      border-radius: 16px;
      padding: 12px 14px;
      margin-bottom: 10px;
      cursor: pointer;
      font: inherit;
    }
    .item b { font-family: var(--disp); font-weight: 400; font-size: 20px; display: block; }
    .badge { display: inline-block; margin-top: 5px; border: 1.5px solid var(--red); color: #b91c1c; border-radius: 8px; padding: 1px 8px; font-size: 11.5px; font-weight: 800; }
    .badge.ok { border-color: var(--green); color: #15803d; }
    body.dark-mode .badge { color: #fca5a5; border-color: #f87171; }
    body.dark-mode .badge.ok { color: #86efac; border-color: #4ade80; }

    .empty { background: var(--surface); color: var(--text-main); border: 2px dashed var(--border-soft); border-radius: 16px; padding: 16px; line-height: 1.45; }

    label { display: block; font-size: 13px; margin: 10px 0 4px; }
    label:first-child { margin-top: 0; }
    input, select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--border-soft); border-radius: 12px; background: var(--surface-soft); font: 800 15px var(--body); color: var(--text-main); }

    .theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
    .tbtn { min-height: 42px; border: 1.5px solid var(--border-soft); border-radius: 10px; background: var(--surface-soft); color: var(--text-main); font: 800 13px var(--body); cursor: pointer; }
    .tbtn[aria-pressed="true"] { background: var(--ink); color: var(--gold); border-color: var(--ink); }

    .poster { margin-top: 16px; background: var(--cream); color: #14101f; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 7px 7px 0 var(--ink); padding: 18px; text-align: center; transform: rotate(-1deg); }
    .poster.theme-gold { background: var(--gold); color: #14101f; }
    .poster.theme-dark { background: #14101f; color: var(--cream); border-color: var(--cream); box-shadow: 7px 7px 0 var(--my); }
    .poster .g { font-family: var(--disp); font-size: 84px; line-height: 0.96; color: var(--lc); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink); margin: 4px 0; }
    .poster.theme-dark .g { -webkit-text-stroke: 2px var(--cream); text-shadow: 4px 4px 0 var(--my); }

    .stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .ps { aspect-ratio: 1; border-radius: 50%; border: 4px double var(--ink); background: var(--cream); color: #14101f; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px; transform: rotate(-5deg); box-shadow: 4px 4px 0 var(--ink); line-height: 1.2; }
    .ps:nth-child(even) { transform: rotate(5deg); }
    .ps b { font-family: var(--disp); font-weight: 400; font-size: 18px; }

    .view-heading, .item-card-head, .home-prompt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .view-heading h2 { margin: 4px 0 10px; }
    .small-action, .icon-action, .category-chip {
      min-height: 44px; border: 1.5px solid var(--border-soft); border-radius: 11px;
      background: var(--surface-soft); color: var(--text-main); padding: 9px 13px;
      font: 800 13px var(--body); cursor: pointer;
    }
    .icon-action { border-color: var(--my); white-space: nowrap; }
    .category-filters {
      display: flex; gap: 7px; overflow-x: auto; padding: 3px 2px 8px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .category-filters::-webkit-scrollbar { display: none; }
    .category-chip { flex: 0 0 auto; min-height: 44px; }
    .category-chip.selected { background: var(--ink); color: var(--gold); border-color: var(--my); }
    body.dark-mode .category-chip.selected { background: var(--gold); color: var(--ink); }
    .filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
    .filter-toggle-btn {
      flex: 1 1 auto;
      min-height: 44px;
      border: 1.5px solid var(--border-soft);
      border-radius: 11px;
      background: var(--surface-soft);
      color: var(--text-main);
      padding: 9px 12px;
      font: 800 13px var(--body);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .advanced-filters { margin-top: 10px; padding-top: 10px; border-top: 1.5px dashed var(--border-soft); }
    .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .filter-grid label { min-width: 0; }
    .filter-grid select, .filter-grid input { font-size: 13px; }
    .check-filter { display: flex; align-items: center; gap: 8px; min-height: 44px; }
    .check-filter input { width: 22px; min-height: 22px; }
    .disabled-filter { opacity: .62; }
    .filter-actions { align-items: center; margin-top: 8px; }
    #resultSummary { font-size: 13px; font-weight: 800; }
    .discovery-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .item-card, .saved-list { min-width: 0; background: var(--surface); color: var(--text-main); border: 2px solid var(--border-soft); border-radius: 16px; padding: 12px; overflow-wrap: anywhere; }
    .item-title { border: 0; background: transparent; color: inherit; text-align: left; padding: 4px 2px; font: 400 21px var(--disp); cursor: pointer; }
    .item-card p, .detail-card p { font-size: 13px; line-height: 1.45; margin: 7px 0; }
    .tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
    .tag-row .badge { margin: 0; }
    .schedule-summary { border-left: 3px solid var(--gold-warm); padding: 5px 8px; margin: 8px 0; font-size: 12.5px; line-height: 1.4; }
    .schedule-summary small { display: inline; opacity: .8; }
    .card-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; margin-top: 8px; }
    .card-actions select { min-width: 0; min-height: 44px; font-size: 13px; }
    .card-actions .btn { min-height: 44px; font-size: 13px; }
    .detail-card h3, .saved-list h4 { margin: 0; font: 400 25px var(--disp); }
    .detail-card .card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .my-profile { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
    .my-profile .route-note { grid-column: 1 / -1; margin-bottom: 0; }
    .inline-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; margin-bottom: 12px; }
    .inline-form label { min-width: 0; }
    .inline-form .btn { min-height: 44px; font-size: 13px; }
    .saved-list { margin: 9px 0; }
    .saved-place-list > div, .trip-stop { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border-soft); padding: 5px 0; }
    .trip-stop > span:last-child { display: flex; gap: 3px; }
    .trip-hours { display: block; font-size: 11px; opacity: .78; }
    .home-discovery { margin: 12px 0 12px; }
    .home-prompt { margin: 6px 2px; font-size: 15px; }
    .home-row { margin: 6px 2px; }
    .home-row > b { font-size: 12px; }
    .home-place-row { display: flex; gap: 6px; overflow-x: auto; padding: 3px 1px 6px; }
    .home-place { flex: 0 0 auto; max-width: 210px; min-height: 44px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text-main); border-radius: 10px; padding: 8px 10px; font: 700 12.5px var(--body); cursor: pointer; }

    nav {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      max-width: 500px;
      margin: 0 auto;
      background: var(--ink);
      display: flex;
      gap: 3px;
      padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0));
      border-top: 3.5px solid var(--my);
      z-index: 10;
    }
    nav button {
      flex: 1 1 0;
      min-width: 0;
      min-height: 46px;
      background: none;
      border: 0;
      color: #ede7d8;
      font: 800 12px/1.15 var(--body);
      letter-spacing: -0.15px;
      padding: 8px 2px;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      transition: background 0.15s ease, color 0.15s ease;
    }
    nav button[aria-current="page"] {
      background: var(--gold);
      color: var(--ink);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }

    #toast {
      position: fixed;
      top: calc(16px + env(safe-area-inset-top, 0));
      left: 50%;
      transform: translateX(-50%) translateY(-10px);
      background: var(--ink);
      color: var(--gold);
      padding: 10px 20px;
      border-radius: 999px;
      font-weight: 800;
      font-size: 13.5px;
      opacity: 0;
      transition: opacity 0.2s, transform 0.2s;
      z-index: 25;
      pointer-events: none;
      border: 2.5px solid var(--my);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      white-space: nowrap;
    }
    #toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
    [hidden] { display: none !important; }
    @media (min-width: 700px) { .discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    @media (max-width: 420px) {
      .filter-grid { grid-template-columns: 1fr; }
      .card-actions { grid-template-columns: minmax(0, 1fr) auto; }
      .card-actions .small-action { min-height: 44px; padding: 8px 10px; font-size: 12px; }
      nav { gap: 2px; padding-left: 4px; padding-right: 4px; }
      nav button { font-size: 11.5px; letter-spacing: -0.25px; padding: 8px 1px; min-height: 46px; }
    }
    /* Community Platform Styles */
    .community-pill {
      min-height: 34px;
      border: 1.5px solid var(--border-soft);
      background: var(--surface);
      color: var(--text-main);
      border-radius: 999px;
      padding: 4px 11px;
      font: 800 12px var(--body);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: background 0.15s ease, color 0.15s ease;
    }
    .community-pill[aria-current="page"] {
      background: var(--ink);
      color: var(--gold);
      border-color: var(--gold);
    }
    .home-community-banner {
      margin: 12px 2px 6px;
      background: var(--surface);
      border: 2px solid var(--border-soft);
      border-radius: 14px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    .community-banner-content b {
      font-size: 14px;
      color: var(--ink);
    }
    body.dark-mode .community-banner-content b {
      color: var(--cream);
    }
    .community-banner-content p {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-main);
      opacity: 0.9;
      margin-top: 2px;
    }
    .community-notice-banner {
      background: var(--surface);
      border-left: 4px solid var(--blue);
      border-radius: 8px;
      padding: 10px 12px;
      margin-bottom: 12px;
      display: flex;
      gap: 10px;
      font-size: 12px;
      line-height: 1.35;
    }
    .community-notice-banner .notice-icon {
      font-size: 16px;
      color: var(--blue);
    }
    .community-notice-banner small {
      display: block;
      margin-top: 3px;
      opacity: 0.85;
    }
    .community-profile-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 14px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .profile-info {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .profile-avatar {
      font-size: 22px;
      background: var(--bg-main);
      border-radius: 50%;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1.5px solid var(--border-soft);
    }
    .profile-stats {
      display: block;
      font-size: 11px;
      font-weight: 600;
      opacity: 0.8;
    }
    .profile-bar-actions {
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .community-feed {
      display: flex;
      flex-direction: column;
      gap: 14px;
      margin-top: 12px;
    }
    .post-card {
      background: var(--surface);
      border: 1.5px solid var(--border-soft);
      border-radius: 14px;
      padding: 14px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }
    .post-header {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 8px;
    }
    .post-meta-line {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      font-size: 12px;
    }
    .post-author {
      font-weight: 800;
      color: var(--text-main);
    }
    .post-time {
      opacity: 0.75;
      font-size: 11px;
    }
    .post-category-tag {
      background: var(--surface-soft);
      border: 1px solid var(--border-soft);
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 11px;
      font-weight: 700;
    }
    .post-status-badge {
      background: rgba(31, 91, 216, 0.12);
      color: var(--blue);
      border: 1px solid rgba(31, 91, 216, 0.3);
      border-radius: 4px;
      padding: 2px 6px;
      font-size: 10.5px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.4px;
    }
    body.dark-mode .post-status-badge {
      background: rgba(79, 140, 255, 0.18);
      color: #8bb6ff;
      border-color: rgba(79, 140, 255, 0.4);
    }
    .post-destination-link {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-main);
      border: 1px solid var(--border-soft);
      border-radius: 6px;
      padding: 3px 8px;
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      color: var(--text-main);
      text-decoration: none;
    }
    .post-title {
      font-size: 16px;
      font-weight: 800;
      line-height: 1.25;
      margin: 6px 0 8px;
      color: var(--text-main);
    }
    .post-content {
      font-size: 13.5px;
      font-weight: 600;
      line-height: 1.45;
      color: var(--text-main);
      margin-bottom: 10px;
      word-break: break-word;
    }
    .destination-update-callout {
      background: rgba(234, 88, 12, 0.1);
      border-left: 3.5px solid var(--orange);
      border-radius: 6px;
      padding: 8px 10px;
      margin: 8px 0 10px;
      font-size: 12px;
      line-height: 1.35;
    }
    .destination-update-callout b {
      color: var(--orange);
    }
    .post-actions-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border-soft);
      flex-wrap: wrap;
    }
    .post-action-group {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .helpful-btn {
      background: var(--surface-soft);
      border: 1.5px solid var(--border-soft);
      border-radius: 999px;
      padding: 6px 12px;
      font: 800 12px var(--body);
      color: var(--text-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-height: 44px;
    }
    .helpful-btn[aria-pressed="true"] {
      background: rgba(231, 84, 128, 0.15);
      border-color: var(--pink);
      color: var(--pink);
    }
    .comment-toggle-btn {
      background: none;
      border: 1px solid transparent;
      font: 700 12px var(--body);
      color: var(--text-main);
      padding: 6px 10px;
      cursor: pointer;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      border-radius: 8px;
    }
    .comment-toggle-btn:hover {
      background: var(--surface-soft);
    }
    .post-more-actions {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .comments-container {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed var(--border-soft);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .comment-card {
      background: var(--surface-soft);
      border: 1px solid var(--border-soft);
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 12px;
    }
    .comment-head {
      display: flex;
      justify-content: space-between;
      margin-bottom: 3px;
      font-size: 11px;
    }
    .comment-text {
      font-weight: 600;
      line-height: 1.35;
    }
    .comment-form {
      display: flex;
      gap: 6px;
      margin-top: 6px;
    }
    .comment-input {
      flex: 1;
      min-height: 44px;
      padding: 8px 10px;
      border: 1.5px solid var(--border-soft);
      border-radius: 8px;
      font: 600 12px var(--body);
      background: var(--surface);
      color: var(--text-main);
    }
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(2px);
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      overflow-y: auto;
    }
    .modal-content {
      background: var(--surface);
      border: 2.5px solid var(--my);
      border-radius: 16px;
      width: 100%;
      max-width: 480px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
      padding: 18px;
    }
    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
      padding-bottom: 10px;
      border-bottom: 1.5px solid var(--border-soft);
    }
    .modal-header h3 {
      font-family: var(--disp);
      font-size: 20px;
      color: var(--text-main);
    }
    .close-btn {
      background: none;
      border: 0;
      font-size: 20px;
      font-weight: 800;
      color: var(--text-main);
      cursor: pointer;
      padding: 6px 10px;
      min-height: 44px;
      min-width: 44px;
    }
    .post-form {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .post-form label {
      font-size: 13px;
      font-weight: 700;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .post-form label .required {
      color: var(--red);
    }
    .post-form input, .post-form select, .post-form textarea {
      border: 1.5px solid var(--border-soft);
      background: var(--surface-soft);
      color: var(--text-main);
      border-radius: 8px;
      padding: 10px 12px;
      font: 700 13px var(--body);
      width: 100%;
    }
    .conditional-fields {
      background: rgba(234, 88, 12, 0.08);
      border: 1.5px dashed var(--orange);
      border-radius: 10px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .modal-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      margin-top: 14px;
    }
    .community-detail-section {
      margin-top: 14px;
      padding: 14px;
      border: 2px solid var(--border-soft);
      border-radius: 12px;
      background: var(--surface);
    }
    .place-community-posts {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin: 10px 0;
    }
    .inline-select-label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 700;
    }
    .inline-select-label select {
      padding: 6px 8px;
      border: 1.5px solid var(--border-soft);
      border-radius: 6px;
      background: var(--surface-soft);
      color: var(--text-main);
      font: 700 12px var(--body);
    }

    /* Stage 6: Supabase Auth & Multi-User Platform Styles */
    .auth-pill {
      min-height: 34px;
      border: 1.5px solid var(--border-soft);
      background: var(--surface);
      color: var(--text-main);
      border-radius: 999px;
      padding: 4px 11px;
      font: 800 12px var(--body);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
      white-space: nowrap;
    }
    .auth-pill.logged-in {
      border-color: var(--gold);
      background: rgba(255, 194, 26, 0.15);
    }
    body.dark-mode .auth-pill.logged-in {
      background: rgba(255, 194, 26, 0.2);
    }

    /* Auth Dropdown Menu */
    .auth-dropdown {
      position: absolute;
      top: 50px;
      right: 16px;
      z-index: 95;
      background: var(--surface);
      border: 2px solid var(--border-soft);
      border-radius: 14px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
      width: 280px;
      max-width: calc(100vw - 32px);
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .auth-dropdown-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-soft);
    }
    .auth-dropdown-user {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow: hidden;
    }
    .auth-avatar {
      font-size: 22px;
      line-height: 1;
    }
    .auth-user-info {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .auth-user-info b {
      font-size: 14px;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      color: var(--text-main);
    }
    .auth-user-info small {
      font-size: 11px;
      color: rgba(20, 16, 31, 0.7);
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
    body.dark-mode .auth-user-info small {
      color: rgba(255, 244, 214, 0.7);
    }

    /* Status Badges */
    .cloud-status-badge {
      font-size: 11px;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: 999px;
      white-space: nowrap;
      line-height: 1.2;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .cloud-status-badge::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      display: inline-block;
    }
    .badge-offline {
      background: rgba(234, 88, 12, 0.12);
      color: var(--orange);
      border: 1px solid rgba(234, 88, 12, 0.3);
    }
    .badge-offline::before {
      background: var(--orange);
    }
    .badge-online {
      background: rgba(22, 128, 69, 0.12);
      color: var(--green);
      border: 1px solid rgba(22, 128, 69, 0.3);
    }
    .badge-online::before {
      background: var(--green);
    }
    .badge-syncing {
      background: rgba(31, 91, 216, 0.12);
      color: var(--blue);
      border: 1px solid rgba(31, 91, 216, 0.3);
    }
    .badge-syncing::before {
      background: var(--blue);
    }

    /* Dropdown Actions */
    .auth-dropdown-actions {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .auth-menu-item {
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--surface-soft);
      border: 1px solid var(--border-soft);
      border-radius: 8px;
      padding: 8px 10px;
      cursor: pointer;
      color: var(--text-main);
      text-align: left;
      min-height: 44px;
      transition: background 0.12s ease;
      width: 100%;
    }
    .auth-menu-item:hover, .auth-menu-item:focus {
      background: rgba(255, 194, 26, 0.2);
    }
    .menu-item-icon {
      font-size: 18px;
      line-height: 1;
    }
    .menu-item-text {
      display: flex;
      flex-direction: column;
      line-height: 1.2;
    }
    .menu-item-text b {
      font-size: 13px;
    }
    .menu-item-text small {
      font-size: 11px;
      color: rgba(20, 16, 31, 0.65);
    }
    body.dark-mode .menu-item-text small {
      color: rgba(255, 244, 214, 0.65);
    }
    .auth-signout-item {
      margin-top: 4px;
      border-color: rgba(217, 48, 37, 0.4);
      color: var(--red);
    }
    .auth-signout-item:hover {
      background: rgba(217, 48, 37, 0.1);
    }

    /* Auth Tabs */
    .auth-tabs {
      display: flex;
      gap: 4px;
      background: var(--surface-soft);
      border-radius: 8px;
      padding: 3px;
      margin-bottom: 12px;
      border: 1px solid var(--border-soft);
    }
    .auth-tab {
      flex: 1;
      min-height: 38px;
      border: 0;
      background: transparent;
      color: var(--text-main);
      font: 700 12px var(--body);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
      padding: 6px 4px;
      text-align: center;
    }
    .auth-tab.active, .auth-tab[aria-selected="true"] {
      background: var(--surface);
      color: var(--text-main);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
      font-weight: 800;
    }

    /* Auth Alert Banner */
    .auth-alert {
      padding: 10px 12px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      margin-bottom: 12px;
      background: rgba(217, 48, 37, 0.12);
      border: 1.5px solid var(--red);
      color: var(--red);
    }
    .auth-alert.success {
      background: rgba(22, 128, 69, 0.12);
      border-color: var(--green);
      color: var(--green);
    }
    .auth-modal-footer {
      margin-top: 14px;
      padding-top: 10px;
      border-top: 1px solid var(--border-soft);
    }

    /* Cloud Sync Panel in My Delhi */
    .cloud-sync-panel {
      margin-bottom: 12px;
    }
    .panel-head-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }
    .panel-head-row h3 {
      font-family: var(--disp);
      font-size: 18px;
      margin: 0;
    }

    /* Migration Modal Styles */
    .migration-intro {
      font-size: 13px;
      line-height: 1.4;
      margin-bottom: 12px;
    }
    .migration-summary-panel {
      background: var(--surface-soft);
      border: 1.5px solid var(--border-soft);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 12px;
    }
    .migration-summary-title {
      font-size: 13px;
      margin-bottom: 8px;
    }
    .migration-summary-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    .migration-stat-item {
      background: var(--surface);
      border: 1px solid var(--border-soft);
      border-radius: 8px;
      padding: 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    .stat-number {
      font-size: 20px;
      font-weight: 800;
      color: var(--gold-warm);
      line-height: 1.1;
    }
    body.dark-mode .stat-number {
      color: var(--gold);
    }
    .stat-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-main);
    }

    /* Migration Progress Bar */
    .migration-progress-box {
      margin: 12px 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .progress-track {
      width: 100%;
      height: 10px;
      background: var(--surface-soft);
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid var(--border-soft);
    }
    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--gold) 0%, var(--orange) 100%);
      transition: width 0.3s ease;
      border-radius: 999px;
    }
    .migration-status-text {
      font-size: 12px;
      font-weight: 700;
      color: var(--text-main);
      text-align: center;
    }

    button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3.5px solid var(--gold); outline-offset: 2px; }

/* ==================================================================== */
/* Stage 7: Admin & Data Management Dashboard Styles                   */
/* ==================================================================== */

.admin-dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.admin-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1.5px solid var(--border-soft);
}

.admin-title-area h2 {
  margin: 4px 0 0 0;
  font-size: clamp(20px, 3.5vw, 26px);
  color: var(--text-main);
}

.admin-back-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
}
.admin-back-btn:hover {
  color: var(--gold);
}

.admin-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-env-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-env-badge.badge-preview {
  background: rgba(234, 88, 12, 0.15);
  color: #c2410c;
  border: 1px solid rgba(234, 88, 12, 0.4);
}
.admin-env-badge.badge-live {
  background: rgba(22, 128, 69, 0.15);
  color: #15803d;
  border: 1px solid rgba(22, 128, 69, 0.4);
}

/* Status Strip */
.admin-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.admin-current-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-user-avatar {
  font-size: 22px;
}
.admin-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #14101f;
  margin-left: 6px;
  text-transform: uppercase;
}

.admin-preview-role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.preview-role-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.role-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.role-switch-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
}
.role-switch-btn:hover {
  border-color: var(--gold);
}
.role-switch-btn.active {
  background: var(--gold);
  color: #14101f;
  border-color: var(--gold);
  font-weight: 800;
}
.role-switch-btn.unauth.active {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
}

/* Unauthorized Screen */
.admin-unauthorized-panel {
  text-align: center;
  padding: 40px 20px;
}
.admin-arch-gate {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.unauth-roles-info {
  text-align: left;
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  font-size: 13px;
}
.unauth-roles-info ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.unauth-roles-info li {
  margin-bottom: 4px;
}
.unauth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* Sub-Navigation */
.admin-sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid var(--border-soft);
  padding-bottom: 8px;
}
.admin-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease;
}
.admin-nav-btn:hover {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}
.admin-nav-btn.active {
  background: var(--surface-soft);
  border-color: var(--gold);
  color: var(--text-main);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.admin-nav-icon {
  font-size: 16px;
}
.nav-count-badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}

.admin-workspace,
.admin-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* KPI Metric Cards */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 360px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.kpi-icon {
  font-size: 22px;
  opacity: 0.85;
}
.kpi-value {
  font-family: var(--font-heading);
  font-size: clamp(24px, 4vw, 30px);
  color: var(--text-main);
  margin: 4px 0 2px 0;
  line-height: 1.1;
}
.kpi-value.kpi-status {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}
.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Two-column overview grid */
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 680px) {
  .admin-overview-grid {
    grid-template-columns: 1fr;
  }
}
.admin-widget-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}
.widget-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-main);
}
.widget-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.widget-item {
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.widget-item-title {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.widget-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Filter Strip */
.admin-filter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.admin-search-wrap {
  flex: 1 1 260px;
}
.admin-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dest-count-summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  width: 100%;
}

/* Responsive Table */
.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.admin-table th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-weight: 800;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-main);
  vertical-align: middle;
}
.admin-table tr:hover {
  background: var(--surface-soft);
}

/* Status Chips */
.status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: capitalize;
}
.status-pill.published,
.status-pill.active,
.status-pill.approved,
.status-pill.resolved {
  background: rgba(22, 128, 69, 0.15);
  color: #15803d;
  border: 1px solid rgba(22, 128, 69, 0.35);
}
.status-pill.draft,
.status-pill.pending_review,
.status-pill.pending,
.status-pill.under_review {
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
  border: 1px solid rgba(234, 179, 8, 0.35);
}
.status-pill.flagged,
.status-pill.suspended,
.status-pill.rejected,
.status-pill.needs_clarification {
  background: rgba(220, 38, 38, 0.15);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.status-pill.hidden,
.status-pill.archived,
.status-pill.dismissed {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

/* Action button inside tables */
.table-action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
}
.table-action-btn:hover {
  border-color: var(--gold);
}
.table-action-btn.danger {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.3);
}

/* Moderation List Cards */
.admin-moderation-list,
.admin-update-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-card-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-card-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-main);
}
.admin-card-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}
.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

/* Destination Form Modal */
.modal-large {
  max-width: 820px;
  width: 95%;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 12px 0;
}
.admin-fieldset {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.admin-fieldset legend {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0 6px;
  text-transform: uppercase;
}
.admin-fieldset.highlight-fieldset {
  border-color: var(--gold);
  background: var(--surface-soft);
}
.version-notice {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Versions Timeline */
.versions-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  margin: 14px 0;
}
.version-timeline-item {
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.version-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.version-num {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Moderation Subtabs */
.moderation-sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.sub-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
}
.sub-tab.active {
  background: var(--gold);
  color: #14101f;
  border-color: var(--gold);
}

@media (max-width: 600px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-status-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==================================================================== */
/* Stage 8: PWA, Performance & Accessibility Styles                    */
/* ==================================================================== */

/* Skip Link for Keyboard Accessibility */
.skip-link {
  position: absolute;
  top: -80px;
  left: 12px;
  background: var(--gold);
  color: #14101f;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
  border-radius: 8px;
  z-index: 99999;
  text-decoration: none;
  transition: top 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  border: 2px solid #14101f;
}
.skip-link:focus {
  top: 12px;
  outline: 3.5px solid #14101f;
  outline-offset: 2px;
}

/* PWA Offline Banner */
.pwa-offline-banner {
  background: #1e1b2e;
  color: #f9f6f0;
  border-bottom: 2px solid var(--gold);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 9990;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pwa-status-icon {
  color: var(--gold);
  font-size: 16px;
}

/* PWA Update Toast */
.pwa-update-toast {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-main);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 9995;
  width: min(92%, 460px);
}
.pwa-update-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}
.pwa-update-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* PWA Install Top Button */
.pwa-install-top-btn {
  background: var(--gold);
  color: #14101f;
  border: 1.5px solid #14101f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  transition: transform 0.15s ease;
}
.pwa-install-top-btn:hover {
  transform: translateY(-1px);
}

/* Enhanced Focus Visibility (WCAG 2.2 AA) */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3.5px solid var(--gold);
  outline-offset: 2px;
}

/* Prefers-Reduced-Motion Support (WCAG 2.2 AA) */
@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;
  }
  .card, .gate {
    transition: none !important;
  }
}

/* Layout Containment for Fast Rendering */
.discovery-grid {
  contain: layout style;
}
.discovery-grid .item {
  content-visibility: auto;
  contain-intrinsic-size: 130px;
}
