
/* ── Lucide icon sizing ── */
button svg, a svg { width: 16px; height: 16px; stroke-width: 2; vertical-align: middle; flex-shrink: 0; pointer-events: none; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  html { height: 100%; overflow-x: hidden; }

  body {
    background: #f4f4f4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* ── Top nav ── */
  #topnav {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 52px;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
  }

  #nav-back {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 8px 8px 0;
    color: #026CDF;
    font-size: 22px;
    line-height: 1;
  }
  #nav-back.visible { display: block; }

  #nav-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    text-align: center;
    margin: 0 32px;
  }
  #nav-title.editable {
    cursor: pointer;
    border-bottom: 1px dashed #aaa;
  }
  #nav-title-input {
    display: none;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    border: none;
    border-bottom: 2px solid #003f8f;
    background: transparent;
    outline: none;
    width: 100%;
    max-width: 200px;
  }

  #nav-subtitle {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin-top: 1px;
  }

  /* ── Map area ── */
  #map-area {
    flex: 1;
    min-height: 0;
    height: calc(100dvh - 52px);
    position: relative;
    overflow: hidden;
    background: #f4f4f4;
  }

  .map-view {
    position: absolute;
    inset: 0;
    transition: opacity 0.25s ease;
  }

  #macro-view {
    opacity: 1;
    pointer-events: all;
  }
  #micro-view { opacity: 0; pointer-events: none; }
  #micro-view.active { opacity: 1; pointer-events: all; }
  #macro-view.hidden { opacity: 0; pointer-events: none; }

  #macro-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }

  #macro-view svg {
    position: absolute;
    inset: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: visible;
  }

  .section-hit {
    /* Fully invisible hit targets. pointer-events: all keeps taps/clicks working
       even though the overlay has no visible fill or stroke. */
    fill: transparent !important;
    fill-opacity: 0 !important;
    stroke: transparent !important;
    stroke-opacity: 0 !important;
    stroke-width: 14;
    cursor: pointer;
    pointer-events: all;
    touch-action: manipulation;
  }
  .section-hit:hover, .section-hit:active, .section-hit.selected {
    fill: transparent !important;
    fill-opacity: 0 !important;
    stroke: transparent !important;
    stroke-opacity: 0 !important;
  }

  /* Micro: detailed seats view centered on selected section */
  #micro-view {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #section-crop {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    touch-action: none;
    cursor: grab;
  }
  #section-crop.dragging { cursor: grabbing; }

  #crop-svg, #micro-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  #micro-svg {
    pointer-events: all;
  }

  #crop-svg {
    pointer-events: none;
  }

  .crop-outline {
    fill: none;
    stroke: rgba(2,108,223,.8);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
  }

  /* Seat dots */
  .seat-dot {
    cursor: pointer;
    vector-effect: non-scaling-stroke;
    stroke-width: 0.3;
    opacity: 1;
    fill: var(--cws-seat-color, #9ca3af);
    stroke: color-mix(in srgb, var(--cws-seat-color, #9ca3af) 70%, #111827);
  }
  .seat-dot.selected {
    fill: #003f8f;
    stroke: #000;
    stroke-width: 0.8;
    opacity: 1;
  }
  .seat-hit {
    cursor: pointer;
    fill: transparent;
    stroke: transparent;
    pointer-events: all;
  }
  .seat-dot:active { fill: #003f8f; }
  .seat-dot.visited-1 { fill: #9ca3af; stroke: #6b7280; }
  .seat-dot.visited-many { fill: #9ca3af; stroke: #6b7280; }

  /* ── Debug panel ── */
  #debug-panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.85);
    color: #0f0;
    font-family: monospace;
    font-size: 11px;
    z-index: 9999;
    max-height: 40vh;
    overflow-y: auto;
    padding: 6px 10px;
    display: none;
  }
  #debug-panel.visible { display: block; }
  #debug-toggle {
    display: block;
    width: auto;
    background: none;
    color: #bbb;
    border: none;
    font-size: 9px;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 0.6;
    text-align: left;
  }
  #debug-panel .debug-line { margin: 1px 0; }
  #debug-panel .debug-line.error { color: #f66; }
  #debug-panel .debug-line.warn { color: #fa0; }
  #debug-panel .debug-copy {
    position: sticky; top: 0;
    background: #222;
    padding: 4px;
    margin-bottom: 4px;
    display: flex; gap: 6px;
  }
  #debug-panel .debug-copy button {
    font-size: 4px; padding: 2px 6px;
    background: #555; color: #fff;
    border: none; border-radius: 3px; cursor: pointer;
  }

  /* ── Edit toolbar (slim mode bar) ── */
  #edit-toolbar {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 55;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 8px 12px;
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
  }
  #edit-toolbar.visible { display: flex; }
  #edit-toolbar-label { flex: 1; text-align: center; font-size: 13px; font-weight: 600; }
  #edit-toolbar button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  #edit-toolbar-undo { opacity: 0.5; }
  #edit-toolbar-undo.active { opacity: 1; }

  #nav-add {
    background: none;
    border: none;
    font-size: 22px;
    width: 30px;
    cursor: pointer;
    color: #003f8f;
    padding: 0;
    font-weight: 300;
    line-height: 1;
  }

  /* ── Mini add toolbar ── */
  #add-toolbar {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 70;
    background: #003f8f;
    padding: 8px 10px 6px;
  }
  #add-toolbar.visible { display: block; }
  #add-toolbar-row {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .add-tool-btn {
    padding: 6px 10px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .add-tool-btn.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
  }
  .add-tool-btn.done-btn {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    color: #fff;
  }
  .add-tool-btn.undo-btn { font-size: 14px; padding: 6px 8px; }
  .add-tool-btn.delete-btn { font-size: 14px; padding: 6px 8px; color: #ff6b6b; border-color: rgba(255,100,100,0.4); }
  .add-tool-btn.delete-btn:disabled { opacity: 0.3; color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.2); }
  #add-toolbar-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 5px;
    min-height: 14px;
  }
  #gradient-tool-panel {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  #gradient-tool-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  #gradient-tool-avoid.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
  }
  #gradient-tool-great.active {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
  }
  #gradient-tool-apply {
    background: rgba(255,255,255,0.2);
    color: #fff;
  }
  #gradient-tool-apply:disabled, #gradient-tool-clear:disabled {
    opacity: 0.3;
  }
  #gradient-tool-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 5px;
    min-height: 14px;
  }
  #gradient-threshold-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.7);
  }
  #gradient-threshold-row label {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
  }
  #gradient-threshold-row input {
    width: 38px;
    padding: 2px 4px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 11px;
  }

  /* ── Admin panel ── */
  #nav-gear {
    background: none;
    border: none;
    font-size: 20px;
    width: 30px;
    cursor: pointer;
    color: #555;
    padding: 0;
  }
  #admin-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    z-index: 60;
    max-height: 70dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  #admin-panel.open { transform: translateY(0); }
  #admin-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
  }
  #admin-title { font-size: 15px; font-weight: 700; flex: 1; }
  #admin-status { font-size: 11px; color: #888; }
  #admin-close { background:none;border:none;font-size:18px;cursor:pointer;color:#666;padding:0; }
  #admin-body { padding: 12px 16px; }
  .admin-section { margin-bottom: 14px; }
  .admin-label { font-size: 12px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
  .admin-row { display: flex; align-items: center; gap: 8px; }
  .admin-val { font-size: 16px; font-weight: 700; min-width: 32px; text-align: center; }
  .admin-hint { font-size: 11px; color: #aaa; }
  .admin-step {
    width: 32px; height: 32px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #f8f8f8;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    color: #333;
  }
  .admin-step:active { background: #e8e8e8; }
  .admin-toggle-btn {
    padding: 6px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #f8f8f8;
    font-size: 13px;
    cursor: pointer;
    color: #555;
  }
  .admin-toggle-btn.active { background: #003f8f; color: #fff; border-color: #003f8f; }
  .admin-action-btn {
    padding: 8px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #f8f8f8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
  }
  .admin-action-btn.primary { background: #003f8f; color: #fff; border-color: #003f8f; }
  .admin-action-btn.danger { color: #c0392b; border-color: #e8c0bb; }
  .admin-action-btn:active { opacity: 0.7; }
  .admin-mode-adding #crop-svg, .admin-mode-adding #micro-svg { cursor: crosshair !important; }
  .admin-mode-moving .seat-dot { cursor: grab !important; }
  .admin-mode-filling #crop-svg, .admin-mode-filling #micro-svg { cursor: crosshair !important; }
  .fill-anchor-dot { fill: #f39c12 !important; stroke: #d68910 !important; stroke-width: 1.5 !important; }
  .fill-preview-dot { fill: #f39c12; stroke: #e67e22; stroke-width: 0.5; opacity: 0.85; pointer-events: none; }
  .fill-drag-line { stroke: #f39c12; stroke-width: 1; stroke-dasharray: 3 2; opacity: 0.6; pointer-events: none; }
  #fill-confirm-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    z-index: 75;
    padding: 16px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    display: none;
  }
  #fill-confirm-bar.open { display: block; }
  #fill-confirm-info { font-size: 14px; font-weight: 600; color: #1a1a1a; line-height: 1.4; }
  .seat-dot.admin-selected-seat { stroke: #e67e22 !important; stroke-width: 1.5 !important; }
  .seat-label-text { font-size: 6px; fill: #333; pointer-events: none; font-family: -apple-system, sans-serif; }
  #admin-label-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #admin-label-inner {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    width: 240px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  }

  /* ── Bottom sheet ── */
  #bottom-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  #bottom-sheet.open { transform: translateY(0); }

  #sheet-handle {
    width: 36px; height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
  }

  #sheet-content {
    padding: 16px 20px 20px;
  }

  #sheet-seat-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }

  #sheet-seat-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
  }

  /* Visit history placeholder */
  #visit-history {
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
    margin-bottom: 16px;
  }

  .visit-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
  }

  .visit-entry:last-child { border-bottom: none; }

  .visit-date { font-size: 13px; font-weight: 600; }
  .visit-game { font-size: 12px; color: #666; margin-top: 2px; }

  .visit-stars {
    font-size: 13px;
    color: #f59e0b;
    letter-spacing: 1px;
  }

  .no-visits {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    padding: 8px 0 16px;
  }

  /* ── Favorite button ── */
  #btn-favorite {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #ccc;
    padding: 0 0 0 8px;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
  }
  #btn-favorite.active { color: #e74c3c; }
  #btn-favorite:active { transform: scale(1.3); }

  /* ── Photo strip (seat sheet) ── */
  #photo-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
  }
  #photo-strip:empty { display: none; }
  .photo-thumb {
    width: 72px; height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid #e5e7eb;
  }

  /* ── Photo preview row (log form) ── */
  #photo-preview-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  #photo-preview-row:empty { display: none; }
  .photo-preview-thumb {
    width: 64px; height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
  }
  #btn-add-photo {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    width: 100%;
  }

  /* ── Lightbox ── */
  #lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9000;
    align-items: center;
    justify-content: center;
  }
  #lightbox.open { display: flex; }
  #lightbox-img {
    max-width: 96vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
  }
  #lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }

  /* CTA button */
  #btn-log-visit {
    width: 100%;
    background: #026CDF;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
  }
  #btn-log-visit:active { background: #0150a8; }

  #btn-sheet-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    display: flex; align-items: center; justify-content: center;
  }

  /* ── Log form sheet (second sheet) ── */
  #log-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 50;
    max-height: 85dvh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  #log-sheet.open { transform: translateY(0); }

  #log-sheet-handle {
    width: 36px; height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
  }

  #log-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
  }

  #log-sheet-header span {
    font-size: 16px;
    font-weight: 700;
  }

  #btn-log-cancel {
    background: none;
    border: none;
    color: #026CDF;
    font-size: 14px;
    cursor: pointer;
  }

  #log-form {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .field-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 600;
  }

  .field-group input, .field-group textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fafafa;
    outline: none;
  }
  .field-group input:focus, .field-group textarea:focus {
    border-color: #026CDF;
    background: #fff;
  }

  .field-group textarea {
    resize: none;
    height: 72px;
    font-family: inherit;
  }

  /* Toggle group */
  .toggle-group {
    display: flex;
    gap: 8px;
  }

  .toggle-btn {
    flex: 1;
    padding: 9px 4px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
  }
  .toggle-btn.selected {
    border-color: #026CDF;
    background: #e8f1fd;
    color: #026CDF;
    font-weight: 600;
  }

  /* Star rating */
  #star-row {
    display: flex;
    gap: 10px;
  }

  .star-btn {
    font-size: 28px;
    cursor: pointer;
    color: #ddd;
    background: none;
    border: none;
    padding: 2px;
    transition: color 0.1s;
    line-height: 1;
    display: inline-flex;
  }
  .star-btn svg { width: 26px; height: 26px; stroke: #ddd; fill: none; transition: stroke 0.1s, fill 0.1s; }
  .star-btn.lit svg { stroke: #f59e0b; fill: #f59e0b; }
  .star-btn.lit { color: #f59e0b; }

  /* Score row */
  .score-row {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .score-row input { flex: 1; }
  .score-row span { color: #aaa; font-size: 18px; font-weight: 300; }

  #btn-save-visit {
    width: 100%;
    background: #026CDF;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
  }
  #btn-save-visit:active { background: #0150a8; }


/* ── Place Seat Tool ── */
.admin-mode-placing { cursor: crosshair !important; }
.admin-mode-placing .seat-hit { cursor: crosshair !important; }

/* ── Shade Painter ── */
#shade-panel.open { transform: translateY(0); }
#nav-shade.active { color: #f59e0b; }

.shade-slot-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid #ccc;
  border-radius: 10px;
  background: #fafafa;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  position: relative;
}
.shade-slot-btn.active { color: #fff; }
.shade-slot-btn small { font-weight: 400; opacity: 0.8; margin-left: 4px; }
.shade-slot-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.shade-slot-del {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(0,0,0,0.35);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.shade-slot-del:hover { color: #e74c3c; background: rgba(231,76,60,0.1); }
.seat-dot.shade-painted { opacity: 0.9; }

/* v3.2.0: light row/seat edge labels in micro view */
.micro-seat-label {
  fill: rgba(0, 0, 0, 0.22);
  font-size: 3px;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 2px;
  stroke-linejoin: round;
  pointer-events: none;
  user-select: none;
}
.micro-row-label {
  font-size: 4px !important;
  fill: rgba(0, 0, 0, 0.22);
  font-weight: 500;
  stroke-width: 1px;
}

/* Macro mode toggle bar */
#macro-mode-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.macro-mode-btn {
  padding: 7px 12px;
  border: none;
  background: #fff;
  color: #003f8f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-right: 1px solid #dde;
  transition: background 0.15s, color 0.15s;
}
.macro-mode-btn svg { width: 14px !important; height: 14px !important; flex-shrink: 0; }
.macro-mode-btn:last-child { border-right: none; }
.macro-mode-btn.active { background: #003f8f; color: #fff; }
.macro-mode-btn.active svg { stroke: #fff; }

/* Sections invisible in seats mode — keep pointer-events for tap */
.section-hit.macro-seats-mode {
  fill: transparent !important;
  stroke: transparent !important;
}

/* Row labels more visible in shade painter mode */
#map-area.shade-painter-active .micro-row-label {
  fill: rgba(0, 0, 0, 0.75) !important;
  font-weight: 700;
  font-size: 5px !important;
}

/* Shade painter touch handling */
#map-area.shade-painter-active,
#map-area.shade-painter-active #section-crop,
#map-area.shade-painter-active .seat-hit {
  cursor: crosshair !important;
  touch-action: none;
}
#map-area.shade-painter-erase,
#map-area.shade-painter-erase #section-crop,
#map-area.shade-painter-erase .seat-hit {
  cursor: cell !important;
}
.seat-dot.shade-painted {
  opacity: 0.95;
}


/* ── v3.2.4 fixes ── */
/* Gear/admin panel entry intentionally hidden; edit tools live under + toolbar. */
#nav-gear { display: none !important; }

/* Prevent the seat editor toolbar from being clipped on narrow mobile screens. */
#add-toolbar {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#add-toolbar::-webkit-scrollbar { display: none; }
#add-toolbar-row {
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
  padding-right: max(16px, env(safe-area-inset-right));
}
#add-toolbar .add-tool-btn { flex: 0 0 auto; }

/* Inline panel transform exists in index.html; force/open with class as backup. */
#shade-panel.open { transform: translateY(0) !important; }

/* ── v3.2.5 mobile edit toolbar fix ── */
/* Keep the destructive action reachable on narrow phones. */
#add-toolbar-row {
  flex-wrap: wrap !important;
  width: auto !important;
  min-width: 0 !important;
  padding-right: 0 !important;
}
#add-toolbar .add-tool-btn {
  flex: 0 0 auto;
  padding: 6px 8px;
}
#add-tool-select { order: 1; }
#add-tool-delete { order: 2; }
#add-tool-fill { order: 3; }
#add-tool-extend { order: 4; }
#add-tool-place { order: 5; }
#add-tool-number { order: 6; }
#add-toolbar-undo { order: 7; }
#add-toolbar-done {
  order: 8;
  margin-left: 0 !important;
}

/* v5.1.2 macro shade time filters */
#macro-mode-bar .macro-mode-row {
  display: flex;
  gap: 8px;
}
#macro-shade-slot-bar {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  max-width: min(92vw, 520px);
}
.macro-shade-slot-btn {
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.macro-shade-slot-btn.active {
  background: #fff;
  color: #111827;
}

/* v5.1.4 macro controls */
#macro-mode-bar {
  flex-direction: column;
  gap: 7px;
  padding: 7px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  max-width: min(94vw, 560px);
}
#macro-mode-bar .macro-mode-row,
#macro-mode-bar .macro-control-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
#macro-mode-bar .macro-mode-row {
  overflow: hidden;
  border-radius: 7px;
}
.macro-seat-search {
  min-width: 160px;
  flex: 1 1 180px;
  height: 32px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
}
.macro-seat-search:focus { border-color: #003f8f; }
.macro-seat-search.not-found {
  border-color: #dc2626;
  background: #fef2f2;
}
.macro-color-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
}
.macro-color-label input[type="color"] {
  width: 28px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
}

/* v5.1.5 macro controls/seat color consistency */
#macro-mode-bar {
  overflow: visible !important;
  max-height: calc(100dvh - 96px);
}
#macro-mode-bar .macro-control-row {
  min-width: 0;
}
#macro-seat-search-row {
  flex-wrap: nowrap !important;
}
.macro-seat-search {
  min-width: 0;
}
@media (max-width: 520px) {
  #macro-mode-bar {
    max-width: calc(100vw - 20px);
  }
  #macro-seat-search-row {
    width: 100%;
  }
  #btn-macro-seat-search {
    flex: 0 0 auto;
  }
}

/* v5.2.0 estimated shade timeline controls */
#macro-shade-timeline {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.macro-timeline-btn {
  border: 2px solid #003f8f;
  border-radius: 999px;
  background: #fff;
  color: #003f8f;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.macro-timeline-btn.active {
  background: #003f8f;
  color: #fff;
}
.macro-timeline-range {
  width: min(210px, 48vw);
}
.macro-timeline-label {
  min-width: 34px;
  text-align: right;
  color: #111827;
}

/* v5.2.1 seat search refinement */
#macro-seat-search-row.macro-seat-search-grid {
  display: grid !important;
  grid-template-columns: minmax(74px, 1fr) minmax(58px, .8fr) minmax(58px, .8fr) auto;
  width: 100%;
  gap: 6px;
}
#macro-seat-card {
  display: none;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  color: #0f172a;
  max-width: 360px;
}
#macro-seat-card.open { display: block; }
.macro-seat-card-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
}
.macro-seat-card-line {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}
#macro-seat-more-info {
  border: 1px solid #003f8f;
  border-radius: 7px;
  margin-top: 3px;
}
.seat-dot.macro-search-selected,
.seat-dot.selected.macro-search-selected {
  fill: #facc15 !important;
  stroke: #111827 !important;
  stroke-width: 1.2 !important;
  opacity: 1 !important;
}
@media (max-width: 520px) {
  #macro-seat-search-row.macro-seat-search-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  #btn-macro-seat-search {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

/* v5.3.0 full-view shade painter controls */
#macro-full-shade-row {
  display: none;
  padding-top: 2px;
}
.macro-full-shade-status {
  flex: 1 1 180px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
#macro-full-shade-row.ready .macro-full-shade-status { color: #0f172a; }
#macro-full-shade-row.painting .macro-full-shade-status { color: #003f8f; }
#macro-full-shade-row.erasing .macro-full-shade-status { color: #b91c1c; }
#btn-macro-shade-erase.active {
  background: #fee2e2;
  color: #b91c1c;
}
#macro-canvas.macro-full-shade-paint,
#macro-canvas.macro-full-shade-erase {
  cursor: crosshair;
}

#macro-mode-bar {
  top: 6px;
  left: 6px;
  gap: 5px !important;
  padding: 6px !important;
  max-width: calc(100vw - 12px) !important;
}
#macro-mode-bar .macro-mode-row,
#macro-mode-bar .macro-control-row {
  gap: 5px !important;
}
#macro-mode-bar.macro-shade-ready {
  background: rgba(255,255,255,0.84);
}
#macro-mode-bar.macro-shade-ready #macro-seat-search-row,
#macro-mode-bar.macro-shade-ready #macro-color-row,
#macro-mode-bar.macro-shade-ready #macro-seat-card {
  display: none !important;
}
#macro-mode-bar.macro-shade-ready .macro-mode-row .macro-mode-btn {
  padding: 5px 10px;
}
#macro-full-shade-row {
  gap: 0 !important;
  flex-wrap: nowrap !important;
  align-items: center;
  width: 100%;
}
#macro-full-shade-row .macro-mode-btn {
  padding: 7px 10px;
  min-height: 32px;
}
.macro-brush-stepper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.macro-stepper-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #003f8f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
#macro-shade-slot-bar {
  margin-top: 0 !important;
  gap: 5px !important;
}
#macro-mode-bar.macro-shade-ready #macro-shade-slot-bar {
  display: flex !important;
}
#macro-mode-bar.macro-shade-ready .macro-shade-slot-btn {
  background: rgba(255,255,255,0.82);
  color: #0f172a;
  border-color: #94a3b8;
  padding: 6px 10px;
}
#macro-mode-bar.macro-shade-ready .macro-shade-slot-btn.active {
  background: #003f8f;
  color: #fff;
}
@media (max-width: 520px) {
  #macro-mode-bar.macro-shade-ready {
    width: calc(100vw - 56px);
  }
  #macro-full-shade-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .macro-brush-stepper {
    margin-left: 4px;
  }
}

/* v5.3.2: Canvas owns macro interaction; keep legacy SVG from opening sections under paint/erase drags. */
body.macro-view-active #macro-svg {
  pointer-events: none !important;
}

/* v5.3.9 section-label graphic adjustment tools */
#macro-label-tools {
  display: none;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
#macro-mode-bar.section-labels-on #macro-label-tools {
  display: flex;
}
.macro-label-section-input {
  width: 86px;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  color: #0f172a;
}
.macro-label-section-input.not-found {
  border-color: #ef4444;
  background: #fef2f2;
}
.macro-mini-btn {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: #003f8f;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 8px;
}
.macro-opacity-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.macro-opacity-label input[type="range"] {
  width: 84px;
}
@media (max-width: 520px) {
  #macro-mode-bar.section-labels-on #macro-label-tools {
    max-height: 94px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .macro-opacity-label input[type="range"] { width: 72px; }
}

/* v5.4.0 collapsible macro menu + edit drawer */
#macro-mode-bar .macro-menu-head {
  width: 100%;
  overflow: visible !important;
}
#macro-mode-bar .macro-menu-head .macro-icon-btn {
  flex: 0 0 auto;
}
#btn-macro-menu-collapse {
  margin-left: auto;
  min-width: 38px;
  justify-content: center;
}
#macro-menu-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#macro-mode-bar.macro-menu-collapsed {
  width: auto !important;
  max-width: calc(100vw - 12px) !important;
}
#macro-mode-bar.macro-menu-collapsed #macro-menu-body {
  display: none !important;
}
#macro-edit-panel {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding-top: 3px;
  border-top: 1px solid rgba(148,163,184,0.35);
}
#macro-mode-bar.macro-edit-open #macro-edit-panel {
  display: flex;
}
#macro-mode-bar.macro-edit-open #macro-label-tools {
  display: flex;
}
#macro-mode-bar:not(.macro-edit-open) #macro-full-shade-row,
#macro-mode-bar:not(.macro-edit-open) #macro-shade-slot-bar,
#macro-mode-bar:not(.macro-edit-open) #macro-label-tools {
  display: none !important;
}
#macro-mode-bar.macro-shade-ready.macro-edit-open #macro-full-shade-row,
#macro-mode-bar.macro-shade-ready.macro-edit-open #macro-shade-slot-bar {
  display: flex !important;
}
#macro-section-label-size-display {
  min-width: 18px;
  text-align: right;
  font-size: 11px;
}
@media (max-width: 520px) {
  #macro-mode-bar.macro-edit-open #macro-edit-panel {
    max-height: 36dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #macro-mode-bar.macro-edit-open #macro-label-tools {
    max-height: none !important;
  }
}

/* v5.4.1 shade color controls */
.macro-shade-slot-wrap { display:inline-flex; align-items:center; gap:4px; }
.macro-shade-slot-color,
.shade-slot-color { width:28px; height:28px; padding:0; border:1px solid #d1d5db; border-radius:8px; background:#fff; }
.shade-slot-btn { display:inline-flex; align-items:center; gap:6px; }

/* v5.4.2 inline palette color chooser */
.macro-color-label input[type="color"],
.macro-shade-slot-color,
.shade-slot-color {
  display: none !important;
}
.macro-inline-color,
.shade-inline-color {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.macro-color-swatch,
.shade-color-swatch {
  width: 30px;
  height: 26px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.55);
  cursor: pointer;
  padding: 0;
}
.macro-color-swatch:active,
.shade-color-swatch:active { transform: scale(0.96); }
.macro-inline-palette,
.shade-inline-palette {
  display: none;
  position: absolute;
  z-index: 5000;
  top: calc(100% + 6px);
  left: 0;
  grid-template-columns: repeat(3, 30px);
  gap: 8px;
  padding: 10px;
  background: rgba(255,255,255,0.98);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
}
.macro-inline-palette.open,
.shade-inline-palette.open { display: grid; }
.macro-palette-color,
.shade-palette-color {
  width: 30px;
  height: 30px;
  border: 2px solid #e5e7eb;
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
}
.macro-palette-color:hover,
.shade-palette-color:hover { border-color: #003f8f; }
.macro-shade-slot-wrap { position: relative; }
.shade-slot-btn { overflow: visible; }

/* v5.4.3 compact macro menu search + collapsed shade toggles */
#macro-collapsed-shade-slot-bar {
  display: none;
  width: 100%;
  padding-top: 4px;
}
#macro-mode-bar.macro-menu-collapsed #macro-collapsed-shade-slot-bar {
  display: flex !important;
}
#macro-mode-bar:not(.macro-menu-collapsed) #macro-collapsed-shade-slot-bar {
  display: none !important;
}
#macro-search-panel {
  display: none;
  flex-direction: column;
  gap: 5px;
}
#macro-mode-bar.macro-search-open #macro-search-panel {
  display: flex;
}
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-menu-body {
  display: flex !important;
}
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-color-row,
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-edit-panel {
  display: none !important;
}
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-collapsed-shade-slot-bar {
  display: flex !important;
}
#btn-macro-search-panel.active {
  background: #004c97;
  color: #fff;
}
@media (max-width: 520px) {
  #macro-mode-bar .macro-menu-head {
    gap: 5px;
  }
  #btn-macro-search-panel,
  #btn-macro-edit-panel {
    min-width: 0;
    padding-left: 9px;
    padding-right: 9px;
  }
  #macro-mode-bar.macro-menu-collapsed {
    width: calc(100vw - 20px) !important;
  }
}

/* v5.4.4 search + seat audit/debug UI */
#macro-seat-search-row.macro-seat-search-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 7px;
  width: min(100%, 320px);
}
.macro-search-field {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}
.macro-search-field span {
  white-space: nowrap;
}
#macro-seat-search-row .macro-seat-search {
  width: 100%;
  min-width: 0;
}
#btn-macro-seat-search {
  width: 100%;
  justify-content: center;
}
.macro-search-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#btn-macro-seat-debug.active {
  background: #004c97;
  color: #fff;
}
.macro-seat-card-line.ok { color: #15803d; }
.macro-seat-card-line.bad { color: #b91c1c; }
.macro-seat-audit-card {
  max-width: min(100%, 420px) !important;
}
.macro-audit-list {
  max-height: 170px;
  overflow: auto;
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
  padding-top: 5px;
}
.macro-audit-section {
  font-size: 11px;
  font-weight: 650;
  color: #475569;
  padding: 2px 0;
}
@media (max-width: 520px) {
  #macro-seat-search-row.macro-seat-search-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
  .macro-search-field {
    grid-template-columns: 82px 1fr;
  }
}


/* v5.4.5 search drawer visibility + selected seat highlight */
#macro-mode-bar.macro-search-open #macro-menu-body {
  display: flex !important;
}
#macro-mode-bar.macro-search-open #macro-search-panel {
  display: flex !important;
  padding-top: 6px;
  border-top: 1px solid rgba(148,163,184,0.35);
}
#macro-mode-bar.macro-search-open #macro-seat-search-row.macro-seat-search-grid {
  display: grid !important;
}
#macro-mode-bar.macro-menu-collapsed.macro-search-open {
  width: min(380px, calc(100vw - 12px)) !important;
}
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-collapsed-shade-slot-bar {
  display: none !important;
}
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-search-panel {
  display: flex !important;
}
.macro-seat-card.open {
  display: block;
}
.macro-more-info-btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}
.seat-dot.macro-search-selected {
  fill: #facc15 !important;
  stroke: #111827 !important;
  stroke-width: 1.5px !important;
}


/* v5.4.6 search highlight visibility */
.seat-dot.macro-search-selected,
.seat-dot.selected.macro-search-selected {
  fill: #f59e0b !important;
  stroke: #92400e !important;
  stroke-width: 2px !important;
  opacity: 1 !important;
}

/* v5.4.7 multi-seat search + right info drawer */
#macro-search-seat::placeholder { color: #94a3b8; }
#macro-seat-info-drawer {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 72px;
  max-height: 40dvh;
  overflow: auto;
  background: rgba(251, 247, 236, 0.88);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border: 1.5px solid #D8CFB8;
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(42,38,32,.28);
  transform: translateY(calc(100% + 90px));
  transition: transform .18s ease;
  z-index: 60;
  padding: 10px 12px;
  color: #2A2620;
}
#macro-seat-info-drawer.open { transform: translateY(0); }
.macro-seat-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  color: #8A8270;
  font-size: 15px;
  padding: 2px 5px;
  min-height: auto;
}
#macro-seat-info-drawer h3 {
  font-family: 'Rokkitt', serif;
  font-weight: 800;
  font-size: 13px;
  color: #1D3557;
  margin: 0 28px 7px 0;
}

.macro-seat-info-summary {
  margin: 0 0 10px 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.macro-seat-info-item {
  border-top: 1px solid rgba(148,163,184,0.35);
  padding: 10px 0;
}
.macro-seat-info-title {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 5px;
}
.macro-seat-info-line {
  font-size: 12px;
  color: #334155;
  margin: 3px 0;
}
.macro-seat-info-line.muted { color: #94a3b8; }

.macro-seat-info-body {
  display: flex;
  gap: 10px;
  align-items: center;
}
.macro-seat-info-icons {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.macro-seat-info-icon-box {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FBF7EC;
  border: 1px solid #D8CFB8;
}
.macro-seat-info-icon-box i { font-size: 16px; }
.macro-seat-info-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.macro-seat-info-text-line {
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}
.macro-seat-info-text-line b {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: #8A8270;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: .02em;
}
.macro-seat-info-text-line span {
  font-family: 'Rokkitt', serif;
  font-weight: 700;
  color: #2A2620;
}
.macro-seat-info-per-seat {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #D8CFB8;
  font-size: 10px;
  color: #8A8270;
}
.macro-seat-info-per-seat-row { margin: 2px 0; }

/* v5.4.8 persistent selected-seat info button */
.macro-seat-info-fab {
  display: none;
  position: absolute;
  left: 24px;
  bottom: 72px;
  z-index: 42;
  max-width: min(310px, calc(100vw - 48px));
  border: 1.5px solid var(--line);
  border-radius: 0;
  background: var(--card);
  color: var(--stub);
  padding: 10px 14px;
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  box-shadow: 2px 3px 0 rgba(42,38,32,.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
}
.macro-seat-info-fab.open { display: block; }
.macro-seat-info-fab:active { transform: translateY(1px); }
.macro-seat-info-block {
  border-top: 1px solid rgba(148,163,184,0.35);
  padding: 10px 0;
}
#macro-seat-info-drawer h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}
#macro-seat-drawer-open-section {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}
@media (max-width: 560px) {
  .macro-seat-info-fab {
    left: 10px;
    bottom: 72px;
    max-width: calc(100vw - 20px);
  }
}

/* v5.4.9 macro home cleanup */
body.macro-view-active #topnav {
  height: 34px !important;
  padding: 0 8px !important;
}
body.macro-view-active #topnav > div[style*="flex:1"] {
  display: block !important;
  min-width: 0;
  overflow: hidden;
}
body.macro-view-active #nav-title {
  display: block !important;
  font-size: 12px !important;
  line-height: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #003f8f;
}
body.macro-view-active #nav-title-input,
body.macro-view-active #nav-subtitle {
  display: none !important;
}

#macro-mode-bar .macro-menu-head {
  align-items: center;
}
#btn-macro-gear-panel {
  min-width: 38px;
  justify-content: center;
  font-size: 15px;
}
#btn-macro-past-visits {
  white-space: nowrap;
}
#macro-gear-panel {
  display: none;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(148,163,184,0.35);
}
#macro-mode-bar.macro-gear-open #macro-gear-panel {
  display: flex;
}
#macro-mode-bar:not(.macro-gear-open) #macro-gear-panel,
#macro-mode-bar:not(.macro-gear-open) #macro-edit-panel {
  display: none !important;
}
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-edit-panel {
  display: flex !important;
}
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-label-tools {
  display: flex !important;
}
#macro-mode-bar.macro-gear-open.macro-shade-ready.macro-edit-open #macro-full-shade-row,
#macro-mode-bar.macro-gear-open.macro-shade-ready.macro-edit-open #macro-shade-slot-bar {
  display: flex !important;
}
#macro-mode-bar:not(.macro-gear-open) #macro-seat-audit-card {
  display: none !important;
}
.macro-seat-info-fab {
  background: #fff !important;
  color: #003f8f !important;
  border-color: rgba(0,63,143,0.28) !important;
}

@media (max-width: 520px) {
  #macro-mode-bar .macro-menu-head {
    gap: 4px;
  }
  #btn-macro-past-visits,
  #btn-macro-search-panel {
    padding-left: 9px;
    padding-right: 9px;
  }
}
/* Main-page shade time toggles stay visible outside the gear menu. */
#macro-collapsed-shade-slot-bar {
  display: flex !important;
  width: 100%;
  padding-top: 4px;
}
#macro-mode-bar.macro-menu-collapsed #macro-collapsed-shade-slot-bar,
#macro-mode-bar:not(.macro-menu-collapsed) #macro-collapsed-shade-slot-bar,
#macro-mode-bar.macro-menu-collapsed.macro-search-open #macro-collapsed-shade-slot-bar {
  display: flex !important;
}

/* v5.5.1 visual controls */
.macro-visual-color-row {
  gap: 10px;
  flex-wrap: wrap;
}
.macro-palette-custom,
.shade-palette-custom {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 104px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
}
.shade-global-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin: 2px 0 8px 0;
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 12px;
  background: rgba(248,250,252,0.96);
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

/* v6.0.2 page nav placeholder */
.macro-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #777;
  background: #f5f5f5;
}

/* v6.1.5 icon-only toolbar + past visit marker controls */
.macro-css-icon{display:inline-block;width:18px;height:18px;position:relative;vertical-align:-3px;flex:0 0 auto}
.macro-search-icon::before{content:"";position:absolute;left:2px;top:2px;width:10px;height:10px;border:2px solid currentColor;border-radius:50%}
.macro-search-icon::after{content:"";position:absolute;left:12px;top:12px;width:7px;height:2px;background:currentColor;transform:rotate(45deg);border-radius:2px;transform-origin:left center}
.macro-save-icon::before{content:"";position:absolute;inset:2px;border:2px solid currentColor;border-radius:3px}
.macro-save-icon::after{content:"";position:absolute;left:5px;right:5px;bottom:4px;height:5px;border:2px solid currentColor;border-bottom:0;border-radius:2px 2px 0 0}
.macro-gear-icon::before{content:"";position:absolute;left:4px;top:4px;width:10px;height:10px;border:2px solid currentColor;border-radius:50%;box-shadow:0 -7px 0 -4px currentColor,0 7px 0 -4px currentColor,7px 0 0 -4px currentColor,-7px 0 0 -4px currentColor,5px 5px 0 -4px currentColor,-5px -5px 0 -4px currentColor,5px -5px 0 -4px currentColor,-5px 5px 0 -4px currentColor}
.macro-edit-icon::before{content:"";position:absolute;left:4px;top:12px;width:12px;height:3px;background:currentColor;transform:rotate(-35deg);border-radius:2px}.macro-edit-icon::after{content:"";position:absolute;left:12px;top:5px;border-left:5px solid currentColor;border-top:3px solid transparent;border-bottom:3px solid transparent;transform:rotate(-35deg)}
.macro-save-icon-only{min-width:42px!important;padding-left:10px!important;padding-right:10px!important;justify-content:center!important;gap:0!important}



/* v6.1.6 Font Awesome normalization */
.macro-fa-icon{font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center}

/* v6.1.8 repaired compact color picker + edit panel cleanup */
.macro-color-label{
  display:inline-grid !important;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:7px 9px !important;
  border:1px solid rgba(148,163,184,.45) !important;
  border-radius:12px !important;
  background:rgba(248,250,252,.96) !important;
  font-size:12px !important;
  font-weight:850 !important;
  white-space:nowrap;
}
.macro-color-swatch{
  width:30px !important;
  height:30px !important;
  border-radius:9px !important;
  border:1px solid rgba(15,23,42,.22) !important;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.55) !important;
  min-height:0 !important;
  padding:0 !important;
}
.macro-inline-palette{display:none!important}
.macro-color-picker-popover{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  background:rgba(15,23,42,.18);
}
.macro-color-picker-card{
  width:min(390px, calc(100vw - 28px));
  max-height:calc(100dvh - 28px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  background:#fff;
  border-radius:22px;
  padding:14px;
  box-shadow:0 20px 55px rgba(15,23,42,.28);
  border:1px solid rgba(148,163,184,.25);
}
.macro-color-picker-head{
  display:grid;
  grid-template-columns:36px 1fr 36px;
  gap:8px;
  align-items:center;
  margin-bottom:10px;
}
.macro-color-picker-title{
  text-align:center;
  font-size:20px;
  font-weight:900;
  color:#111827;
}
.macro-color-picker-icon,
.macro-color-picker-close{
  width:36px !important;
  height:36px !important;
  min-height:36px !important;
  border-radius:50% !important;
  padding:0 !important;
  background:#f3f4f6 !important;
  color:#1f2937 !important;
  border:0 !important;
  font-size:14px !important;
}
.macro-color-picker-tabs{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:2px;
  background:#f1f5f9;
  border-radius:12px;
  padding:3px;
  margin-bottom:12px;
}
.macro-color-picker-tabs span{
  text-align:center;
  padding:8px 4px;
  border-radius:9px;
  font-size:14px;
  font-weight:850;
  color:#475569;
}
.macro-color-picker-tabs span.active{
  background:#fff;
  color:#111827;
  box-shadow:0 1px 3px rgba(0,0,0,.12);
}
.macro-color-picker-grid{
  display:grid;
  grid-template-columns:repeat(10,1fr);
  gap:0;
  overflow:hidden;
  border:1px solid #e5e7eb;
  border-radius:14px;
}
.macro-color-grid-cell{
  aspect-ratio:1;
  min-height:28px !important;
  border:0 !important;
  border-radius:0 !important;
  padding:0 !important;
}
.macro-color-grid-cell.selected{
  box-shadow:inset 0 0 0 3px #fff, inset 0 0 0 5px rgba(17,24,39,.55);
  z-index:1;
}
.macro-color-opacity-block{margin-top:16px}
.macro-color-opacity-label{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#6b7280;
}
.macro-color-opacity{
  width:100%;
  height:34px;
  accent-color:#935bab;
}
.macro-color-picker-bottom{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:14px;
  align-items:center;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e5e7eb;
}
.macro-color-selected-preview{
  width:72px;
  height:72px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.18);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.45);
}
.macro-color-preset-grid{
  display:grid;
  grid-template-columns:repeat(5,32px);
  gap:12px 14px;
}
.macro-color-preset{
  width:32px !important;
  height:32px !important;
  min-height:32px !important;
  border-radius:50% !important;
  border:2px solid transparent !important;
  padding:0 !important;
  box-shadow:0 1px 4px rgba(0,0,0,.18);
}
.macro-color-preset.active{
  border-color:#6b21a8 !important;
  box-shadow:0 0 0 3px #ede9fe;
}
.macro-color-plus{
  background:#f3f4f6 !important;
  color:#374151 !important;
  display:grid !important;
  place-items:center !important;
  box-shadow:none !important;
}
.macro-color-picker-hex-row{
  display:grid;
  grid-template-columns:1fr 72px;
  gap:8px;
  margin-top:14px;
}
.macro-color-hex{
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:9px 10px;
  font-size:14px;
  font-weight:800;
}
.macro-color-apply{
  min-height:38px !important;
  border-radius:10px !important;
  padding:8px 10px !important;
  background:#026CDF !important;
  color:#fff !important;
}
#macro-mode-bar.macro-edit-open #macro-edit-panel{
  gap:8px !important;
  max-height:42dvh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
#macro-visual-color-row{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px !important;
  width:100%;
}
#macro-label-tools{
  gap:6px !important;
}
#macro-label-tools .macro-mini-btn,
#macro-full-shade-row .macro-mode-btn,
#macro-mode-bar .macro-mode-btn{
  min-height:34px;
}
@media(max-width:520px){
  #macro-visual-color-row{grid-template-columns:1fr 1fr !important;}
  .macro-color-label{font-size:11px !important;padding:6px 8px!important;}
  .macro-color-swatch{width:28px!important;height:28px!important;}
}

/* v6.2.7 compact admin utility controls */
#macro-gear-panel .macro-utility-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 4px 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  min-width: 0 !important;
  line-height: 1.15 !important;
}
#macro-gear-panel .macro-utility-btn.active {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
#macro-seat-audit-card:not(.open) {
  display: none !important;
}
#macro-gear-panel #btn-macro-seat-audit,
#macro-gear-panel #btn-macro-seat-debug {
  flex: 0 0 auto !important;
}

/* v6.2.8 seat dot size steppers */
.macro-dot-size-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-height: 154px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 4px;
  box-sizing: border-box;
}
.macro-stepper-control {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 28px 34px 20px 28px;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  box-sizing: border-box;
}
.macro-stepper-control span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.macro-stepper-control b {
  text-align: right;
  font-size: 12px;
  color: #0f172a;
}
.macro-stepper-control em {
  font-style: normal;
  font-size: 10px;
  color: #64748b;
}
.macro-size-step {
  width: 28px;
  height: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #003f8f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}
.macro-size-step:active {
  background: #e2e8f0;
}
@media (max-width: 520px) {
  .macro-dot-size-tools {
    grid-template-columns: 1fr;
    max-height: 170px;
  }
  .macro-stepper-control {
    grid-template-columns: minmax(118px, 1fr) 30px 38px 22px 30px;
  }
}

/* v6.2.9 compact, toggle-based edit tools */
#macro-gear-panel .macro-edit-tool-btn {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 4px 7px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  min-width: 0 !important;
  min-height: 28px !important;
  line-height: 1.15 !important;
  flex: 0 0 auto !important;
}
#macro-gear-panel .macro-edit-tool-btn.active {
  background: #003f8f !important;
  color: #fff !important;
  border-color: #003f8f !important;
}
#macro-mode-bar.macro-edit-open #macro-edit-panel {
  max-height: 58dvh !important;
}
#macro-mode-bar.macro-edit-open #macro-full-shade-row,
#macro-mode-bar.macro-edit-open #macro-shade-slot-bar,
#macro-mode-bar.macro-edit-open #macro-visibility-row,
#macro-mode-bar.macro-edit-open #macro-visual-color-row,
#macro-mode-bar.macro-edit-open #macro-label-tools,
#macro-mode-bar.macro-edit-open #macro-dot-size-tools {
  display: none !important;
}
#macro-mode-bar.macro-edit-open.macro-tool-shade #macro-full-shade-row,
#macro-mode-bar.macro-edit-open.macro-tool-shade #macro-shade-slot-bar {
  display: flex !important;
}
#macro-mode-bar.macro-edit-open.macro-tool-visibility #macro-visibility-row {
  display: flex !important;
}
#macro-mode-bar.macro-edit-open.macro-tool-colors #macro-visual-color-row {
  display: grid !important;
}
#macro-mode-bar.macro-edit-open.macro-tool-labels #macro-label-tools {
  display: flex !important;
}
#macro-mode-bar.macro-edit-open.macro-tool-sizes #macro-dot-size-tools {
  display: grid !important;
}
#macro-mode-bar.macro-tool-sizes #macro-dot-size-tools {
  max-height: none !important;
  overflow: visible !important;
}
#macro-mode-bar.macro-tool-sizes #macro-edit-panel {
  overflow-y: auto !important;
}
#macro-mode-bar.macro-tool-colors #macro-edit-panel {
  max-height: 46dvh !important;
}
#macro-mode-bar.macro-tool-colors #macro-visual-color-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#macro-mode-bar.macro-tool-colors .macro-color-label {
  min-height: 34px !important;
  padding: 5px 7px !important;
}
#macro-mode-bar.macro-tool-colors .macro-color-swatch {
  width: 26px !important;
  height: 26px !important;
}
@media (max-width: 520px) {
  #macro-mode-bar.macro-edit-open #macro-edit-panel {
    max-height: 58dvh !important;
  }
  #macro-mode-bar.macro-tool-sizes .macro-dot-size-tools {
    grid-template-columns: 1fr !important;
  }
}

/* v6.2.9 override older gear/edit display rules */
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-full-shade-row,
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-shade-slot-bar,
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-visual-color-row,
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-label-tools,
#macro-mode-bar.macro-gear-open.macro-edit-open #macro-dot-size-tools,
#macro-mode-bar.macro-gear-open.macro-shade-ready.macro-edit-open #macro-full-shade-row,
#macro-mode-bar.macro-gear-open.macro-shade-ready.macro-edit-open #macro-shade-slot-bar {
  display: none !important;
}
#macro-mode-bar.macro-gear-open.macro-edit-open.macro-tool-shade #macro-full-shade-row,
#macro-mode-bar.macro-gear-open.macro-edit-open.macro-tool-shade #macro-shade-slot-bar,
#macro-mode-bar.macro-gear-open.macro-shade-ready.macro-edit-open.macro-tool-shade #macro-full-shade-row,
#macro-mode-bar.macro-gear-open.macro-shade-ready.macro-edit-open.macro-tool-shade #macro-shade-slot-bar {
  display: flex !important;
}
#macro-mode-bar.macro-gear-open.macro-edit-open.macro-tool-colors #macro-visual-color-row {
  display: grid !important;
}
#macro-mode-bar.macro-gear-open.macro-edit-open.macro-tool-labels #macro-label-tools {
  display: flex !important;
}
#macro-mode-bar.macro-gear-open.macro-edit-open.macro-tool-sizes #macro-dot-size-tools {
  display: grid !important;
}

/* v6.2.10 compact macro toolbar fixes */
.macro-crosshair-icon::before{content:"";position:absolute;left:3px;top:3px;width:12px;height:12px;border:2px solid currentColor;border-radius:50%;box-sizing:border-box}
.macro-crosshair-icon::after{content:"";position:absolute;left:8px;top:0;width:2px;height:18px;background:currentColor;box-shadow:-8px 8px 0 -0.5px currentColor,8px 8px 0 -0.5px currentColor;opacity:.9}
#btn-macro-jump-section.active{background:#003f8f!important;color:#fff!important}
#btn-macro-jump-section:not(.active){background:#f8fafc!important;color:#94a3b8!important}
#macro-debug-dock{position:fixed;right:62px;bottom:18px;z-index:84;display:flex;gap:6px;align-items:center;pointer-events:auto}
.macro-debug-dock-btn{width:24px;height:24px;border:0!important;background:transparent!important;color:rgba(71,85,105,.45)!important;padding:0!important;border-radius:50%;font-size:11px;font-weight:900;line-height:1;display:inline-flex;align-items:center;justify-content:center;box-shadow:none!important}
.macro-debug-dock-btn.active{color:#003f8f!important;background:rgba(0,63,143,.08)!important}
.macro-debug-letter{font-size:11px;font-weight:900;line-height:1}
#macro-seat-audit-card{position:fixed;left:12px;right:12px;bottom:54px;z-index:83;max-height:32dvh;overflow:auto;-webkit-overflow-scrolling:touch;background:rgba(255,255,255,.96)!important;box-shadow:0 12px 28px rgba(15,23,42,.18)}
#macro-mode-bar.macro-gear-open.macro-edit-open.macro-tool-sizes #macro-dot-size-tools{display:grid!important}
#macro-mode-bar.macro-tool-sizes #macro-edit-panel{max-height:54dvh!important;overflow-y:auto!important}
#macro-mode-bar.macro-tool-sizes #macro-dot-size-tools{max-height:none!important;overflow:visible!important}
#macro-mode-bar .macro-menu-head .macro-save-icon-only{min-width:36px!important;width:36px!important;padding-left:8px!important;padding-right:8px!important}
#macro-gear-panel .macro-edit-tool-btn{min-height:26px!important;padding:3px 6px!important;font-size:10.5px!important}
@media(max-width:520px){
  #macro-mode-bar.macro-tool-sizes .macro-dot-size-tools{grid-template-columns:1fr!important;gap:5px!important}
  .macro-stepper-control{min-height:30px!important;padding:3px 5px!important}
  #macro-seat-audit-card{bottom:50px;max-height:30dvh}
}
#macro-mode-bar #macro-seat-audit-card.open{display:block!important}

/* colorblind-friendly mode: shade painter's painting(blue)/erasing(red) status
   text was the same red/blue pair that's hard to tell apart. Swap erase to orange. */
html.colorblind #macro-full-shade-row.erasing .macro-full-shade-status { color: var(--red); }
html.colorblind #btn-macro-shade-erase.active { background: #fde8d2; color: var(--red); }
