/* ==========================================================================
     INSTASLICE STUDIO · UNIFIED DESIGN SYSTEM
     One set of tokens, one set of controls, shared by Slicer, Collage,
     3D Reel and Annotate. Phone first (<900px), workstation layout >=900px.
     ========================================================================== */
  :root {
    /* surfaces */
    --bg-0: #07090d;
    --bg-1: #0d1117;
    --bg-2: #141922;
    --bg-3: #1c222c;
    --bg-4: #262d39;
    /* hairlines */
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.13);
    --border: var(--line);
    --border-subtle: var(--line);
    --border-hi: rgba(56, 189, 248, 0.5);
    /* text */
    --text-1: #eef2f7;
    --text-2: #a4afc0;
    --text-3: #6d7a8e;
    /* accent + semantic */
    --cyan: #38bdf8;
    --accent: #38bdf8;
    --accent-ink: #04141f;
    --accent-soft: rgba(56, 189, 248, 0.13);
    --accent-line: rgba(56, 189, 248, 0.46);
    --amber: #fbbf24;
    --emerald: #34d399;
    --rose: #fb7185;
    --violet: #8b5cf6;
    --accent-blue: #0284c7;
    --grad-main: linear-gradient(180deg, #4cc6fb 0%, #2fb0ee 100%);
    --grad-cine: linear-gradient(180deg, #252b39 0%, #191d26 100%);
    /* shape + rhythm */
    --r-xs: 6px;
    --r-sm: 9px;
    --r-md: 12px;
    --r-lg: 18px;
    --ctl: 40px;           /* one height for every control row on phones */
    --cta: 46px;           /* primary buttons */
    --gap: 8px;
    --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --notch-pad: 52px;
    --bot-pad: env(safe-area-inset-bottom, 10px);
    --deck-h: clamp(236px, 30dvh, 272px);
    --hdr-h: 120px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
  }
  input[type="text"] { user-select: text; -webkit-user-select: text; }

  html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg-0);
    color: var(--text-1);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.3;
    touch-action: none;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
  }
  button { font-family: inherit; color: inherit; cursor: pointer; }
  button:disabled { cursor: default; }
  #reelPanelFormat :disabled { opacity: 0.55; }
  button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  svg.ico {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
  }

  /* ---------- sliders: slim track, filled progress, round thumb ---------- */
  input[type="range"] {
    --pf: 0.5;
    --thumb: 20px;
    --fill: calc(var(--thumb) / 2 + var(--pf) * (100% - var(--thumb)));
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    border: 0;
    outline: none;
    cursor: pointer;
    margin: 0;
    touch-action: pan-y;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent) 0, var(--accent) var(--fill), rgba(255, 255, 255, 0.13) var(--fill), rgba(255, 255, 255, 0.13) 100%);
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--thumb);
    height: var(--thumb);
    margin-top: calc((4px - var(--thumb)) / 2);
    border-radius: 50%;
    background: #f4f7fb;
    border: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2);
    transition: transform 0.14s var(--ease), box-shadow 0.14s;
  }
  input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--accent-soft); }
  input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.13); }
  input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
  input[type="range"]::-moz-range-thumb { width: var(--thumb); height: var(--thumb); border-radius: 50%; background: #f4f7fb; border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }

  /* ---------- icon + text buttons ---------- */
  .btn-icon, .btn-pill {
    height: var(--ctl);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.005em;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.12s var(--ease);
  }
  .btn-icon { width: var(--ctl); padding: 0; color: var(--text-2); font-size: 18px; line-height: 1; }
  .btn-pill { padding: 0 14px; }
  .btn-icon:active, .btn-pill:active { background: var(--bg-3); transform: scale(0.97); }
  .btn-pill.tone-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
  .btn-pill.tone-accent:active { background: rgba(56, 189, 248, 0.22); }

  .btn-open-native { position: relative; overflow: hidden; }
  .btn-open-native input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.001;
    cursor: pointer;
    z-index: 5;
    font-size: 100px;
  }

  /* 3.34: the Slicer's own export group (format, size, Moon scale, Export) inside its panel */
  .slicer-export { display: flex; flex-direction: column; gap: 8px; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
  .slicer-export-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
  .slicer-export-row .seg-group { flex: 1; min-width: 0; }
  .slicer-export-row .blur-bar-label { min-width: 46px; }
  .slicer-export-btn { width: 100%; justify-content: center; height: var(--cta, 44px); }
  .top-bar .btn-export:not(.slicer-export-btn) { }
  .collage-export { margin-top: 4px; }
  .collage-export .slicer-export-btn svg.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; margin-right: 6px; }
  .collage-export-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .collage-export-sub .btn-pill { height: 38px; justify-content: center; }
  .collage-export .slicer-export-row .seg-group .seg-btn { white-space: nowrap; }
  .btn-export {
    background: var(--accent);
    border-color: transparent;
    color: var(--accent-ink);
    padding: 0 8px 0 14px;
  }
  .btn-export:active { background: #62ccfa; }
  .btn-export .badge-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(4, 20, 31, 0.16);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  /* primary call-to-action family */
  .btn-primary-slice, .btn-primary-collage, .btn-reel-render, .btn-share-ios, .btn-cine-reel,
  #btnApplyStarTargets, #btnExportAnnotatedFull, #btnFindStarTargets {
    height: var(--cta);
    border-radius: var(--r-md);
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.005em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    white-space: nowrap;
    min-width: 0;
    box-shadow: 0 6px 18px -8px rgba(56, 189, 248, 0.7);
    transition: background 0.16s, transform 0.12s var(--ease), opacity 0.16s;
  }
  .btn-primary-slice, .btn-primary-collage, .btn-reel-render { flex: 1; }
  .btn-primary-slice:active, .btn-primary-collage:active, .btn-reel-render:active, .btn-share-ios:active,
  #btnApplyStarTargets:active:not(:disabled), #btnExportAnnotatedFull:active:not(:disabled), #btnFindStarTargets:active:not(:disabled) {
    background: #62ccfa;
    transform: scale(0.985);
  }
  .btn-reel-render:disabled, #btnApplyStarTargets:disabled, #btnExportAnnotatedFull:disabled, #btnFindStarTargets:disabled {
    opacity: 0.4;
    box-shadow: none;
    cursor: not-allowed;
  }
  #btnFindStarTargets { height: var(--ctl); font-size: 12.5px; padding: 0 14px; flex-shrink: 0; }
  #btnApplyStarTargets, #btnExportAnnotatedFull { height: var(--ctl); font-size: 12.5px; }

  .btn-reel-save-ready {
    width: 100%;
    height: var(--cta);
    border-radius: var(--r-md);
    border: 0;
    background: var(--emerald);
    color: #03150d;
    font-size: 13.5px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .btn-reel-save-ready.visible { display: flex; }

  /* secondary family */
  .btn-sub-action, .btn-zip-dl, .btn-dl-item {
    height: var(--ctl);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text-1);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    padding: 0 10px;
    min-width: 0;
    transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.12s var(--ease);
  }
  .btn-sub-action:active, .btn-zip-dl:active, .btn-dl-item:active { background: var(--bg-3); transform: scale(0.98); }
  .btn-sub-action svg.ico { color: var(--text-2); }
  .btn-sub-action.cyan-tint { border-color: var(--accent-line); background: var(--accent-soft); }
  .btn-sub-action.cyan-tint svg.ico { color: var(--accent); }
  .btn-zip-dl { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); font-size: 12.5px; font-weight: 700; }

  .sub-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); width: 100%; }
  .primary-actions-row { display: flex; gap: var(--gap); width: 100%; max-width: 100%; }

  /* tiny chips (Margin 6%, direction, aim, delete…) */
  .blur-mini-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--bg-3);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.16s, color 0.16s, border-color 0.16s;
  }
  .blur-mini-btn:active { background: var(--bg-4); }
  .blur-mini-btn.active { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

  .btn-clear {
    background: none;
    border: 0;
    color: var(--text-3);
    font-size: 11.5px;
    font-weight: 600;
    text-align: left;
    padding: 4px 0;
    transition: color 0.16s;
  }
  .btn-clear:active { color: var(--rose); }

  .btn-sync-style {
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: transparent;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.16s, border-color 0.16s, color 0.16s;
  }
  .btn-sync-style::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); transition: background 0.16s, box-shadow 0.16s; }
  .btn-sync-style.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
  .btn-sync-style.active::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }

  /* ---------- text fields ---------- */
  .text-input, .font-select-pro, .star-solve-options select {
    width: 100%;
    min-width: 0;
    height: var(--ctl);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background-color: var(--bg-0);
    color: var(--text-1);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.16s, box-shadow 0.16s, background-color 0.16s;
  }
  .text-input::placeholder { color: var(--text-3); font-weight: 400; }
  .text-input:focus, .font-select-pro:focus, .star-solve-options select:focus, .hex-input-pill:focus-within {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .font-select-pro, .star-solve-options select { cursor: pointer; flex: 1; }
  /* every drop-down shows a clear arrowhead on its right edge, so it reads as "tap to open a list" */
  select, select.font-select-pro {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa7ba' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px 16px;
    padding-right: 38px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  select:focus, select.font-select-pro:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  }
  select option, select optgroup { background: #12161d; color: var(--text-1); }

  .hex-input-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: var(--ctl);
    padding: 0 11px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg-0);
    flex-shrink: 0;
    transition: border-color 0.16s, box-shadow 0.16s;
  }
  .hex-color-chip { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.3); flex-shrink: 0; }
  .hex-text-field {
    width: 70px;
    border: 0;
    background: transparent;
    color: var(--text-1);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    outline: none;
  }

  /* ==========================================================================
     SHELL · header, mode switcher, stage, floating toolbar, filmstrip
     ========================================================================== */
  .app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-0);
    position: relative;
    overflow: hidden;
  }

  .top-bar {
    padding: max(env(safe-area-inset-top, 0px), var(--notch-pad), 6px) 12px 8px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
    flex-shrink: 0;
    z-index: 20;
  }
  /* phones: brand left, actions right, mode switcher on its own full-width row */
  .top-left, .top-right { display: contents; }
  .top-center { order: 10; flex: 0 0 100%; display: flex; min-width: 0; }

  .brand { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 14.5px; font-weight: 700; letter-spacing: -0.015em; color: var(--text-1); white-space: nowrap; }
  .brand svg { width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; }
  .brand i { display: none; font-style: normal; font-weight: 500; color: var(--text-3); }

  /* import button: icon only on phones */
  #btnOpenWrap { width: var(--ctl); padding: 0; }
  #btnOpenWrap span { display: none; }

  /* ---------- top level mode switcher ---------- */
  .mode-switch-pill {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    background: var(--bg-0);
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--line);
    gap: 2px;
    --tp: 3px;
  }
  .mode-switch-btn {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    height: 34px;
    padding: 0 5px;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    transition: color 0.22s;
  }
  .mode-switch-btn svg.ico { width: 14px; height: 14px; flex-shrink: 0; transition: color 0.22s; }
  .mode-switch-btn.active { color: var(--text-1); background: var(--bg-3); }
  .mode-switch-btn.active svg.ico { color: var(--accent); }
  .has-thumb .mode-switch-btn.active, .has-thumb.mode-switch-pill .mode-switch-btn.active { background: transparent; }

  /* ---------- the animated indicator shared by every segmented control ---------- */
  .seg-thumb {
    position: absolute;
    top: var(--tp, 3px);
    bottom: var(--tp, 3px);
    left: 0;
    width: 0;
    border-radius: 8px;
    background: var(--bg-4);
    box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: -1;               /* always behind the labels, whatever the browser decides to composite */
    opacity: 0;
    transition: left 0.34s var(--ease), width 0.34s var(--ease), opacity 0.2s;
  }
  .has-thumb { isolation: isolate; }   /* keeps that z-index:-1 inside the control itself */
  .seg-thumb.on { opacity: 1; }
  .seg-thumb.still { transition: none; }
  .mode-switch-pill .seg-thumb { border-radius: 9px; background: var(--bg-3); }

  /* ---------- segmented controls ---------- */
  .seg-group {
    display: flex;
    align-items: center;
    position: relative;
    height: var(--ctl);
    background: var(--bg-0);
    padding: 3px;
    border-radius: 11px;
    border: 1px solid var(--line);
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    --tp: 3px;
  }
  .seg-group.grow { flex: 1; }
  .seg-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    height: 100%;
    padding: 0 8px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    min-width: 0;
    transition: color 0.2s, background 0.2s;
  }
  .seg-btn.active { background: var(--bg-4); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line-2); }
  .has-thumb > .seg-btn.active { background: transparent; box-shadow: none; }
  .seg-btn.toggle-on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
  .seg-btn:active:not(.active) { color: var(--text-1); }
  /* iPhone / iPad (WebKit): inside scrolling panels the sliding highlight is replaced by a plain highlight on the
     chosen button itself, so the chosen value can never end up hidden underneath it */
  @supports (-webkit-touch-callout: none) {
    .seg-group > .seg-thumb { display: none; }
    .seg-group.has-thumb > .seg-btn.active { background: var(--bg-4); box-shadow: inset 0 0 0 1px var(--line-2); }
  }

  /* tab strips (Layout | Text | Borders, Solve | Pins | …) are segmented controls too */
  .collage-subtabs, .ann-tabs {
    display: flex;
    position: relative;
    height: var(--ctl);
    background: var(--bg-0);
    padding: 3px;
    border-radius: 11px;
    border: 1px solid var(--line);
    gap: 2px;
    flex-shrink: 0;
    --tp: 3px;
  }
  .col-subtab-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    height: 100%;
    padding: 0 10px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 0;
    text-align: center;
    transition: color 0.2s;
  }
  .col-subtab-btn.active { color: var(--text-1); background: var(--bg-4); box-shadow: inset 0 0 0 1px var(--line-2); }
  .has-thumb > .col-subtab-btn.active { background: transparent; box-shadow: none; }
  #reelTabsNav { width: 100%; flex: 1; }
  .ann-tabs { width: 100%; }
  .ann-tabs .col-subtab-btn { padding: 0 2px; }

  /* ---------- stage ---------- */
  .workspace {
    position: relative;
    flex: 1;
    min-height: 120px;
    width: 100%;
    background: radial-gradient(ellipse at 50% 42%, #111821 0%, #07090d 74%);
    overflow: hidden;
  }
  #editorCanvas, #collageCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
  }
  /* Solve progress: the photo turns grayscale and a green bar fills from the solver's own search progress. */
  #editorCanvas { transition: filter 0.45s ease; }
  .workspace.is-solving #editorCanvas { filter: grayscale(1) brightness(0.55) contrast(1.06); }
  .solve-overlay {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    pointer-events: none;
  }
  .solve-overlay[hidden] { display: none; }
  .solve-overlay-card {
    width: min(440px, 100%);
    padding: 14px 16px 12px;
    border-radius: var(--r-md);
    background: rgba(7, 9, 13, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.10);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  }
  .solve-overlay-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.13); overflow: hidden; }
  .solve-overlay-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.55);
    transition: width 0.28s linear;
  }
  .solve-overlay-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 12px; line-height: 1.3; color: var(--text-1); }
  .solve-overlay-row span:last-child { font-family: var(--font-mono); color: #86efac; }
  @media (prefers-reduced-motion: reduce) {
    #editorCanvas { transition: none; }
    .solve-overlay-fill { transition: none; }
  }
  #collageCanvas { display: none; cursor: grab; }
  #collageCanvas:active { cursor: grabbing; }

  .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(13, 17, 23, 0.72);
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    white-space: nowrap;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .workspace-status-pill { position: absolute; top: 10px; right: 10px; z-index: 12; pointer-events: none; }
  .q-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); flex-shrink: 0; }
  .q-dot.warn { background: var(--amber); }
  .zoom-pct { color: var(--accent); font-weight: 600; padding-left: 7px; border-left: 1px solid var(--line-2); }
  .zoom-pct.warn { color: var(--amber); }

  .desktop-shortcuts-hint {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(13, 17, 23, 0.72);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 12px;
    height: 26px;
    align-items: center;
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-3);
    pointer-events: none;
    z-index: 10;
    gap: 12px;
    white-space: nowrap;
  }
  .desktop-shortcuts-hint kbd { color: var(--text-2); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; margin-right: 3px; }

  .pin-mode-banner {
    position: absolute;
    top: 50px;                 /* its own row, below the full-screen button / hint and the status pill */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.92);
    border: 1px solid var(--accent-line);
    color: var(--text-1);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px 6px 14px;
    border-radius: 999px;
    z-index: 15;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    white-space: nowrap;
    max-width: calc(100% - 20px);
  }
  .pin-mode-banner.active { display: inline-flex; }

  .drop-overlay {
    position: absolute;
    inset: 12px;
    border-radius: var(--r-lg);
    border: 1.5px dashed var(--accent);
    background: rgba(7, 9, 13, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
  }
  .drop-overlay span.sub { color: var(--text-2); font-size: 12px; font-weight: 500; }
  .workspace.drag-over .drop-overlay { display: flex; }

  /* ---------- floating toolbar (one per mode) ---------- */
  .canvas-hud {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 16px;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid var(--line-2);
    z-index: 10;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    max-width: calc(100% - 16px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .canvas-hud::-webkit-scrollbar { display: none; }
  .hud-btn {
    position: relative;
    flex: none;
    min-width: 48px;
    height: 46px;
    padding: 0 6px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.16s, color 0.16s, transform 0.12s var(--ease);
  }
  .hud-btn::before {
    content: "";
    width: 19px;
    height: 19px;
    flex: none;
    background: currentColor;
    -webkit-mask: var(--i, none) center / contain no-repeat;
    mask: var(--i, none) center / contain no-repeat;
  }
  .hud-btn:active, .hud-btn.active { background: var(--bg-3); color: var(--text-1); }
  .hud-btn:active { transform: scale(0.95); }
  .hud-btn:disabled { opacity: 0.3; pointer-events: none; }
  .hud-btn.amber-hi { color: var(--accent); }
  .hud-sep { display: none; }
  .hud-note {
    align-self: center;
    margin: 0 6px 0 2px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.12);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--amber);
    white-space: nowrap;
  }

  /* ---------- filmstrip ---------- */
  .filmstrip-bar {
    height: 58px;
    background: var(--bg-1);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .strip-meta { display: flex; flex-direction: column; justify-content: center; gap: 1px; flex-shrink: 0; min-width: 62px; }
  .strip-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
  .strip-title span { background: var(--bg-3); color: var(--text-1); font-family: var(--font-mono); padding: 1px 6px; border-radius: 5px; font-size: 10.5px; letter-spacing: 0; }
  .strip-scroll { flex: 1; display: flex; align-items: center; gap: 7px; overflow-x: auto; overflow-y: hidden; height: 100%; padding: 4px 2px; scrollbar-width: none; }
  .strip-scroll::-webkit-scrollbar { display: none; }
  .strip-empty { font-size: 12px; color: var(--text-3); white-space: nowrap; }
  .thumb-item {
    position: relative;
    height: 44px;
    width: 35px;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    flex-shrink: 0;
    cursor: pointer;
  }
  .thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .thumb-num { position: absolute; bottom: 2px; left: 2px; background: rgba(7, 9, 13, 0.82); color: var(--text-1); font-family: var(--font-mono); font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 4px; }
  .thumb-del { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 5px; background: rgba(7, 9, 13, 0.82); color: var(--text-2); border: 0; font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; }
  .thumb-del:hover { color: var(--rose); }

  /* ---------- toast ---------- */
  .toast {
    position: fixed;
    top: calc(var(--hdr-h) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(20, 25, 34, 0.96);
    border: 1px solid var(--line-2);
    color: var(--text-1);
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.35;
    padding: 9px 16px;
    border-radius: 999px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.28s var(--ease);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    width: max-content;
    max-width: min(92vw, 460px);
    text-align: center;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ==========================================================================
     CONTROL DECK · identical building blocks in every section
     ========================================================================== */
  .control-deck {
    background: var(--bg-1);
    padding: 10px 12px max(var(--bot-pad), 10px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: none;
  }
  .deck-section {
    display: none;
    flex-direction: column;
    gap: var(--gap);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: var(--deck-h);
  }
  .deck-section.active { display: flex; }
  .deck-row { display: flex; align-items: center; gap: var(--gap); width: 100%; max-width: 100%; min-width: 0; flex-shrink: 0; }
  #slicerDeck { justify-content: space-between; }
  #slicerDeck .primary-actions-row { flex: 1; min-height: var(--cta); max-height: 58px; }
  #slicerDeck .primary-actions-row .btn-primary-slice { height: 100%; }

  .desktop-panel-heading {
    display: none;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: var(--text-3);
    text-transform: uppercase;
  }
  .inspector-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }

  /* ---------- slider row ---------- */
  .blur-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0 12px;
    height: var(--ctl);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 0;
  }
  .blur-bar-label { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; display: flex; align-items: center; gap: 5px; flex-shrink: 0; min-width: 52px; }
  .blur-bar-val { color: var(--text-1); font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; flex-shrink: 0; }
  .blur-bar input[type="range"] { flex: 1; min-width: 40px; }
  .blur-bar .blur-mini-btn { height: 26px; }
  /* two sliders side by side become two full-width rows on a phone: easier to hit, easier to read */
  .deck-row:has(> .blur-bar + .blur-bar) { flex-direction: column; align-items: stretch; }
  .deck-row:has(> .text-input + .text-input + .text-input) { flex-direction: column; align-items: stretch; }
  .deck-row:has(> .text-input + .text-input + .text-input) > .text-input { flex: none !important; }

  /* ---------- option cards: shared look (grid on desktop, carousel on phones) ---------- */
  .ann-style-card, .layout-card, .preset-card, .curve-card {
    position: relative;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    transition: border-color 0.24s var(--ease), background 0.24s var(--ease), color 0.24s, box-shadow 0.24s, transform 0.12s;
  }
  .ann-style-card:active, .layout-card:active, .preset-card:active, .curve-card:active { transform: scale(0.97); }
  .ann-style-card.active, .layout-card.active, .preset-card.active, .curve-card.active {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--text-1);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22), 0 8px 22px -12px rgba(56, 189, 248, 0.6);
  }
  .ann-style-card svg, .layout-card svg.tpl-svg { stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; transition: stroke 0.24s, opacity 0.24s; }
  .ann-style-card svg { width: 26px; height: 26px; }
  .layout-card svg.tpl-svg { width: 36px; height: 29px; }
  .ann-style-card.active svg, .layout-card.active svg.tpl-svg { stroke: var(--accent); opacity: 1; }
  .preset-card { gap: 3px; }
  .preset-card span { font-size: 12px; }
  .preset-card span.p-sub { font-size: 10.5px; color: var(--text-3); font-weight: 500; }
  .preset-card.active span.p-sub { color: var(--accent); }

  /* speed-curve picker (Starlight Dive / Cosmic Pullback) */
  .field-row.curve-row { display: none; }
  .field-row.curve-row.show { display: flex; }
  .curve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); width: 100%; max-width: 100%; }
  .curve-card { min-height: 58px; padding: 8px 4px 7px; gap: 5px; }
  .curve-card svg { width: 46px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; transition: stroke 0.24s, opacity 0.24s; }
  .curve-card svg .ref { stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.35; }
  .curve-card.active svg { stroke: var(--accent); opacity: 1; }
  .curve-card span { font-size: 11px; white-space: nowrap; }

  /* arrival-photo picker (Hyperjump / Warp Spiral) */
  .dest-row { display: none; align-items: center; gap: 10px; width: 100%; max-width: 100%; min-width: 0; flex-shrink: 0; height: var(--ctl);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 7px 0 6px; }
  .dest-row.show { display: flex; }
  .dest-thumb { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; background: var(--bg-3) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--line-2);
    display: flex; align-items: center; justify-content: center; color: var(--text-3); }
  .dest-thumb svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
  .dest-row.has-own .dest-thumb svg { display: none; }
  .dest-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; line-height: 1.15; }
  .dest-title { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
  .dest-sub { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dest-row.has-own .dest-sub { color: var(--accent); }
  .dest-btn { height: 26px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
    font-size: 11.5px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
  .dest-btn:active { background: rgba(56, 189, 248, 0.24); }
  .dest-clear { display: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text-2); flex-shrink: 0;
    align-items: center; justify-content: center; font-size: 12px; line-height: 1; }
  .dest-row.has-own .dest-clear { display: inline-flex; }
  .dest-clear:active { background: var(--bg-4); }

  .ann-style-grid, .collage-layout-grid, .preset-scroll { display: grid; gap: var(--gap); width: 100%; max-width: 100%; }
  .ann-style-grid { grid-template-columns: repeat(4, 1fr); }
  .collage-layout-grid { grid-template-columns: repeat(4, 1fr); }
  .preset-scroll { grid-template-columns: repeat(3, 1fr); }
  .ann-style-card { min-height: 74px; padding: 10px 4px; }
  .layout-card { min-height: 74px; padding: 10px 4px; }
  .preset-card { min-height: 62px; padding: 8px 6px; }

  /* ---------- alignment + colour ---------- */
  .align-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; max-width: 100%; flex-shrink: 0; }
  .btn-align-pos {
    height: var(--ctl);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text-2);
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    padding: 0 2px;
    min-width: 0;
    transition: all 0.2s;
  }
  .btn-align-pos svg.ico { width: 14px; height: 14px; }
  .btn-align-pos:active { background: var(--bg-3); }
  .btn-align-pos.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text-1); }
  .btn-align-pos.active svg.ico { color: var(--accent); }

  .color-palette-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 9px;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    flex-shrink: 0;
  }
  .color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    position: relative;
    transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  }
  .color-swatch:active { transform: scale(0.9); }
  .color-swatch.active { transform: scale(1.08); border-color: #fff; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.45); }
  .color-wheel-btn {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: conic-gradient(#f43f5e 0deg, #f97316 45deg, #eab308 90deg, #10b981 140deg, #06b6d4 190deg, #3b82f6 240deg, #8b5cf6 295deg, #ec4899 330deg, #f43f5e 360deg);
    border: 2px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .color-wheel-btn::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-0); border: 1px solid rgba(255, 255, 255, 0.6); pointer-events: none; }
  .color-wheel-btn input[type="color"] { position: absolute; inset: -8px; width: 44px; height: 44px; opacity: 0; cursor: pointer; border: 0; padding: 0; }
  .color-palette-row .hex-input-pill { flex: 1 1 148px; min-width: 0; }
  .color-palette-row .hex-text-field { flex: 1; min-width: 0; width: 70px; }

  /* ---------- cards: solver, export, lists ---------- */
  .star-solve-panel, .annotation-export-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-2);
    flex-shrink: 0;
  }
  .star-solve-head, .annotation-export-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
  .star-solve-heading, .annotation-export-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .star-solve-heading strong, .annotation-export-title strong { color: var(--text-1); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
  .star-solve-kicker { color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.03em; }
  .star-solve-note, .annotation-export-note, .annotation-export-title span { color: var(--text-3); font-size: 11px; line-height: 1.5; }
  .annotation-export-resolution { flex-shrink: 0; color: var(--accent); font-family: var(--font-mono); font-size: 10px; text-align: right; }
  .star-solve-options { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
  .star-solve-options label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 12px; font-weight: 600; min-width: 0; }
  .star-solve-options select { flex: 1; width: auto; max-width: 230px; min-width: 0; }
  .labeled-options { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 6px 12px; }
  .labeled-options select { width: 100%; max-width: none; }
  .star-solve-status { color: var(--text-2); font-size: 12px; line-height: 1.5; padding: 9px 11px; border-radius: var(--r-sm); background: var(--bg-0); border: 1px solid var(--line); }
  .star-solve-status.success { color: #86efac; border-color: rgba(52, 211, 153, 0.28); }
  .star-solve-status.warning { color: #f5d08a; border-color: rgba(245, 196, 103, 0.30); }
  #btnMoonScale:disabled { opacity: 0.45; }
  .star-solve-status.error { color: #fda4af; border-color: rgba(251, 113, 133, 0.28); }
  .solve-progress { display: grid; gap: 6px; }
  .solve-progress[hidden] { display: none; }
  .solve-progress progress {
    display: block;
    width: 100%;
    height: 8px;
    color-scheme: dark;
    accent-color: #22c55e;
  }
  .star-solve-summary { color: var(--accent); font-family: var(--font-mono); font-size: 10.5px; line-height: 1.55; overflow-wrap: anywhere; }
  .star-candidate-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; overscroll-behavior: contain; }
  .star-candidate {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-0);
    transition: border-color 0.16s, background 0.16s;
  }
  .star-candidate:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
  .star-candidate input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
  .star-candidate-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .star-candidate-info strong { color: var(--text-1); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .star-candidate-info span { color: var(--text-3); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .star-candidate-type { color: var(--accent); font-size: 10px; font-weight: 700; text-align: right; max-width: 88px; overflow-wrap: anywhere; }
  .star-solve-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .star-select-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
  .star-select-tools > span { color: var(--text-2); font-family: var(--font-mono); font-size: 10.5px; margin-right: 2px; }
  .star-select-tools button { height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
  .star-select-tools button:disabled { opacity: 0.38; }
  /* ---------- Moon atlas (Annotate > Solve > Moon) ---------- */
  #starSolvePanel[data-sky="stars"] .for-moon, #starSolvePanel[data-sky="moon"] .for-stars, #starSolvePanel[data-sky="moon"] #starSolveStatus, #starSolvePanel[data-sky="stars"] #moonStatus { display: none !important; }
  .sky-mode { flex-shrink: 0; width: 100%; }
  .moon-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .moon-chip { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-3); color: var(--text-3); font-size: 11.5px; font-weight: 600; transition: border-color 0.16s, background 0.16s, color 0.16s; }
  .moon-chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
  .moon-phase-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 8px; padding: 9px 10px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); }
  .moon-phase-row[hidden] { display: none; }
  .moon-phase-label { flex: 1 0 100%; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
  .moon-phase-row .moon-chip { background: var(--bg-3); }
  .moon-phase-row .moon-chip.on { background: var(--accent); border-color: var(--accent); color: #06121c; }
  .moon-adjust { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-0); }
  .moon-adjust > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 12px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
  .moon-adjust > summary::-webkit-details-marker { display: none; }
  .moon-adjust > summary::after { content: ""; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; }
  .moon-adjust[open] > summary::after { transform: rotate(225deg); }
  .moon-adjust-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 10px 12px; }
  .moon-rot-row { display: flex; gap: 6px; }
  .moon-rot-row .blur-mini-btn { flex: 1; height: 34px; }
  .moon-adjust .blur-bar { background: var(--bg-2); }
  .moon-tap { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
  .moon-tap-title { color: var(--text-1); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; }
  .moon-tap-note { color: var(--text-3); font-size: 11px; line-height: 1.5; }
  .moon-tap-row { display: flex; gap: 8px; align-items: center; }
  .moon-tap-row select { flex: 1; min-width: 0; }
  .moon-refs { display: flex; flex-wrap: wrap; gap: 6px; }
  .moon-ref { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(134, 239, 172, 0.35); background: rgba(52, 211, 153, 0.1); color: #86efac; font-size: 11px; font-weight: 600; }
  .moon-adjust :disabled { opacity: 0.45; }

  /* ---------- save sheet (phones): the picture, a Save-to-gallery button that opens the share sheet, and honest status text ---------- */
  #saveSheetModal [hidden] { display: none !important; }
  #saveSheetModal .save-pic { display: flex; justify-content: center; align-items: center; background: #000; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
  #saveSheetImg { display: block; max-width: 100%; max-height: min(34dvh, 340px); width: auto; height: auto; object-fit: contain; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; touch-action: manipulation; }
  #saveSheetModal .save-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); text-align: center; }
  #saveSheetModal .save-actions { display: flex; flex-direction: column; gap: 8px; }
  #saveSheetModal .save-actions > button { width: 100%; height: var(--cta); border-radius: var(--r-md); font-size: 14px; }
  #saveSheetModal .save-hint { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
  #saveSheetModal .save-status { font-size: 12px; line-height: 1.45; color: var(--text-2); }
  #saveSheetModal .save-status:empty { display: none; }
  #saveSheetModal .save-status[data-kind="ok"] { color: var(--emerald); }
  #saveSheetModal .save-status[data-kind="warn"] { color: var(--amber); }

  /* ---------- quick-edit card for the selected annotation ---------- */
  .pin-dock {
    position: fixed; left: 0; right: 0; bottom: var(--dock-lift, 0px); z-index: 55;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 14px max(var(--bot-pad), 12px);
    background: rgba(13, 17, 23, 0.97);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.55);
    animation: uiSheet 0.28s var(--ease);
  }
  .pin-dock[hidden] { display: none; }
  .pin-dock-head { display: flex; align-items: center; gap: 8px; }
  .pin-dock-head .btn-icon, .pin-dock-head .btn-pill { height: 38px; }
  .pin-dock-head .btn-icon { width: 38px; }
  .pin-dock-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); font-family: var(--font-mono); white-space: nowrap; }
  .pin-dock-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07); background: var(--accent); }
  .pin-dock-del { color: var(--rose); }
  .pin-dock-head .btn-icon:disabled { opacity: 0.35; }
  .pin-dock-fields { display: flex; flex-direction: column; gap: 8px; }
  .pin-dock-hand { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-3); }
  .pin-dock-hand[hidden] { display: none; }
  .pin-dock-hand .btn-pill { height: 32px; font-size: 11.5px; }
  @media (min-width: 640px) {
    .pin-dock { left: 0; right: 0; margin: 0 auto; width: min(520px, calc(100% - 32px)); bottom: calc(16px + var(--dock-lift, 0px)); padding: 12px 14px 14px; border: 1px solid var(--line-2); border-radius: 16px; }
  }
  @media (min-width: 900px) {
    .pin-dock { left: auto; right: 16px; margin: 0; width: 420px; }
  }
  #btnAnnHudEdit { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%2020h9'/%3E%3Cpath%20d='M16.5%203.5a2.12%202.12%200%200%201%203%203L7%2019l-4%201%201-4L16.5%203.5z'/%3E%3C/svg%3E"); }
  .ann-reset-labels[hidden] { display: none; }
  .ann-label-actions { display: flex; align-items: center; gap: 14px; }

  /* ---------- privacy notice ---------- */
  .privacy-copy { font-size: 12.5px; line-height: 1.55; color: var(--text-2); display: flex; flex-direction: column; gap: 14px; }
  .privacy-copy p, .privacy-copy ul { margin: 0; }
  .privacy-copy strong { color: var(--text-1); font-weight: 650; }
  .privacy-copy em { font-style: normal; color: var(--text-1); font-weight: 600; }
  .privacy-copy ul { padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
  .privacy-copy .priv-lead { font-size: 13.5px; line-height: 1.5; color: var(--text-1); font-weight: 600; }
  .privacy-copy .priv-small { font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
  .privacy-copy .priv-meta { font-size: 11px; color: var(--text-3); }
  .link-btn { display: inline; padding: 0; margin: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .priv-expand { align-self: flex-start; font-size: 11.5px; }
  .star-offline-options { display: flex; gap: 8px 14px; align-items: baseline; flex-wrap: wrap; }
  .star-offline-options [hidden], .star-solve-actions[hidden], .star-candidate-list[hidden],
  #starCatalogueFilters[hidden], #btnStarCatalogMore[hidden], #starOfflineExplain[hidden] { display: none; }
  #starCatalogueSearch { flex: 1; min-width: 0; max-width: 230px; }
  #btnStarCatalogMore { align-self: flex-start; }

  /* object types: one row that opens a list, several types can be ticked at once */
  .type-multi { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .type-multi-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; height: var(--ctl);
    padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-0);
    color: var(--text-2); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
    transition: border-color 0.16s, box-shadow 0.16s, background-color 0.16s;
  }
  .type-multi-btn:focus-visible, .type-multi.open .type-multi-btn { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
  .type-multi-lab { flex-shrink: 0; }
  .type-multi-val { flex: 1; min-width: 0; text-align: right; color: var(--text-1); font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .type-multi-chev { flex-shrink: 0; width: 16px; height: 16px; fill: none; stroke: #9aa7ba; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
  .type-multi.open .type-multi-chev { transform: rotate(180deg); }
  .type-multi-panel { display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-0); animation: typeOpen 0.16s ease-out; }
  .type-multi-panel[hidden] { display: none; }
  @keyframes typeOpen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .star-solve-options .type-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 8px; color: var(--text-1); font-size: 12.5px; font-weight: 500; cursor: pointer; justify-content: normal; }
  .type-row:hover { background: var(--bg-3); }
  .type-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
  .type-row em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
  .type-row.empty { opacity: 0.45; }
  .type-row.all { border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; margin-bottom: 2px; font-weight: 650; }
  @media (prefers-reduced-motion: reduce) { .type-multi-panel { animation: none; } .type-multi-chev { transition: none; } }

  /* layered notice: one collapsible row per Art. 13 topic, same chevron as the Annotate panels */
  .priv-secs { border-bottom: 1px solid var(--line); }
  .priv-sec { border-top: 1px solid var(--line); }
  .priv-sec > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 8px 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-1); font-size: 13px; font-weight: 650; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
  .priv-sec > summary::-webkit-details-marker { display: none; }
  .priv-sec > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform 0.2s; }
  .priv-sec[open] > summary::after { transform: rotate(225deg); }
  .priv-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .priv-body { display: flex; flex-direction: column; gap: 10px; padding: 0 2px 16px; }
  .priv-body p { margin: 0; }
  .priv-body dl { margin: 0; }
  .priv-body dt { margin: 12px 0 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
  .priv-body dt:first-child { margin-top: 0; }
  .priv-body dd { margin: 2px 0 0; overflow-wrap: anywhere; }
  @media (min-width: 640px) {
    .priv-body dl { display: grid; grid-template-columns: 124px minmax(0, 1fr); column-gap: 16px; row-gap: 12px; }
    .priv-body dt, .priv-body dt:first-child { margin: 0; padding-top: 3px; }
    .priv-body dd { margin: 0; }
  }
  /* ---------- Annotate > Style: grouped, quiet controls ---------- */
  .ann-sec { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-0); }
  .ann-sec > summary { list-style: none; cursor: pointer; height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: var(--text-1); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; -webkit-tap-highlight-color: transparent; }
  .ann-sec > summary::-webkit-details-marker { display: none; }
  .ann-sec > summary::after { content: ""; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform 0.2s; }
  .ann-sec[open] > summary { border-bottom: 1px solid var(--line); }
  .ann-sec[open] > summary::after { transform: rotate(225deg); }
  .ann-sec-body { display: flex; flex-direction: column; gap: 16px; padding: 14px 12px 16px; min-width: 0; }
  .ann-row { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .ann-lab { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
  .ann-sliders { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .ann-sec .blur-bar { background: var(--bg-2); }
  .ann-sec .blur-bar-label { min-width: 88px; }
  .ann-inline { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .ann-inline > .seg-group { flex: 1; min-width: 0; }
  .ann-seg-sm .seg-btn { font-size: 12px; padding: 0 3px; }
  .ann-hint { margin: 0; font-size: 11px; line-height: 1.5; color: var(--text-3); }
  .ann-sec .ann-style-grid { gap: 8px; }
  .ann-sec .ann-style-card { min-height: 76px; padding: 10px 4px 9px; gap: 6px; }
  .ann-sec .ann-style-card svg { width: 36px; height: 36px; stroke-width: 1.5; }
  .ann-sec .color-palette-row { padding: 0; background: none; border: 0; border-radius: 0; gap: 9px 10px; }
  .ann-sec .color-swatch { border-width: 1.5px; border-color: rgba(255, 255, 255, 0.16); }
  .ann-sec .color-swatch.active { transform: scale(1.06); border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); }
  .ann-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
  .ann-switch-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .ann-switch-txt b { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
  .ann-switch-txt span { font-size: 11px; line-height: 1.45; color: var(--text-3); }
  .ann-toggle { position: relative; flex: 0 0 auto; width: 40px; height: 24px; padding: 0; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-3); transition: background 0.2s, border-color 0.2s; -webkit-tap-highlight-color: transparent; }
  .ann-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform 0.22s var(--ease), background 0.2s; }
  .ann-toggle[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
  .ann-toggle[aria-checked="true"]::after { transform: translateX(16px); background: var(--accent); }
  .ann-well { position: relative; width: var(--ctl); height: var(--ctl); flex: 0 0 auto; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-0); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .ann-well[hidden] { display: none; }
  .ann-well input[type="color"] { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
  .ann-well input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
  .ann-well input[type="color"]::-webkit-color-swatch { border: 1.5px solid rgba(255, 255, 255, 0.4); border-radius: 50%; }
  .ann-well input[type="color"]::-moz-color-swatch { border: 1.5px solid rgba(255, 255, 255, 0.4); border-radius: 50%; }
  .ann-moon-only { display: none; }
  #annotateDeck[data-sky="moon"] .ann-moon-only { display: flex; }
  .moon-guides { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 6px; }

  /* Moon: the apply button takes the same primary look as the Starfield one */
  #btnMoonApply {
    height: var(--ctl); font-size: 12.5px; padding: 0 16px; border: 0; border-radius: var(--r-md);
    background: var(--accent); color: var(--accent-ink); font-weight: 700; letter-spacing: 0.005em;
    display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; min-width: 0;
    box-shadow: 0 6px 18px -8px rgba(56, 189, 248, 0.7);
    transition: background 0.16s, transform 0.12s var(--ease), opacity 0.16s;
  }
  #btnMoonApply:hover:not(:disabled) { background: #62ccfa; }
  #btnMoonApply:active:not(:disabled) { background: #62ccfa; transform: scale(0.985); }
  #btnMoonApply:disabled { opacity: 0.4; box-shadow: none; cursor: not-allowed; }

  /* detections are pins: the Moon button only exists while the orientation is unconfirmed; every list explains the ticks */
  #btnMoonApply[hidden] { display: none !important; }
  .star-solve-actions .live-hint { flex: 1 1 100%; margin: 2px 0 0; color: var(--text-3); font-size: 11px; line-height: 1.5; }
  .ann-list .strip-empty { white-space: normal; line-height: 1.5; }
  #annTitleInput:disabled, #annSubInput:disabled { opacity: 0.5; }

  .ann-list { display: flex; flex-direction: column; gap: 6px; }
  .ann-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px 9px 12px;
    border-radius: var(--r-sm);
    background: var(--bg-2);
    border: 1px solid var(--line);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
  }
  .ann-item.selected { border-color: var(--accent-line); background: var(--accent-soft); }
  .ann-item-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .ann-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
  .ann-texts { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ann-texts strong { color: var(--text-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ann-texts span { font-size: 10.5px; color: var(--text-3); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ann-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

  /* generic field blocks (used by sheets and the annotate panes) */
  .field-row { display: flex; flex-direction: column; gap: 8px; width: 100%; min-width: 0; flex-shrink: 0; }
  .field-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); font-weight: 600; min-width: 0; }
  .field-label > span:last-child:not(:first-child) { color: var(--text-3); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; text-align: right; }
  .field-label strong { font-weight: 700; }
  .divider-top { border-top: 1px solid var(--line); padding-top: 12px; }

  /* ---------- panes: one visible at a time; phones turn them into a swipeable track ---------- */
  .col-subpanel, .ann-pane { flex-direction: column; gap: var(--gap); width: 100%; min-width: 0; display: none; }
  .col-subpanel.active, .ann-pane.active { display: flex; }

  /* ---------- swipe carousels (phones) ----------
     Plain momentum scrolling (no snapping), so a flick keeps gliding and slows down like any other scroll.
     The soft edge fades are driven by how far the strip has been moved (--fl / --fr, set by the UI kit):
     none while it is untouched, growing on the side you scroll away from, shrinking back as you return. */
  @media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
    .carousel {
      --cw: 92px;
      --cg: 9px;
      --fl: 0px;
      --fr: 0px;
      display: flex;
      gap: var(--cg);
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: none;
      position: relative;
      width: 100%;
      padding: 6px 0 8px;
      overscroll-behavior-x: contain;
      -webkit-overflow-scrolling: touch;
      -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
      mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
    }
    .carousel::-webkit-scrollbar { display: none; }
    .carousel > * { flex: 0 0 var(--cw); }
    .carousel.preset-scroll { --cw: 124px; }
    .carousel.collage-layout-grid { --cw: 88px; }
    .carousel.curve-grid { --cw: 92px; }
    .carousel .curve-card { min-height: 58px; }
    .carousel .ann-style-card, .carousel .layout-card { min-height: 76px; }
    .carousel .preset-card { min-height: 62px; }
  }

  /* ==========================================================================
     3D REEL STAGE
     ========================================================================== */
  .reel-workspace-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #05070a;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 46px 14px calc(var(--hud-reserve, 60px) + 4px);
    overflow: hidden;
  }
  .reel-canvas-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: layout paint;
  }
  #reelCanvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    background: #05070a;
    border-radius: 10px;
    border: 1px solid var(--line-2);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
    cursor: crosshair;
    touch-action: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  .reel-stage-caption {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 26px;
    padding: 4px 14px;
    border-radius: 14px;
    background: rgba(13, 17, 23, 0.72);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 2px;
    text-align: center;
  }
  .reel-stage-caption .hud-sep { display: none; }
  .reel-hud-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
  .reel-tag {
    background: rgba(13, 17, 23, 0.72);
    border: 1px solid var(--line);
    color: var(--text-1);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .reel-progress-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: var(--accent); transform-origin: left center; transform: scaleX(0); will-change: transform; }

  /* ==========================================================================
     SHEETS (settings, frame, paste, export)
     ========================================================================== */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 8, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 60;
    display: none;
    align-items: flex-end;
    justify-content: center;
  }
  .modal-backdrop.open { display: flex; animation: uiFade 0.22s ease; }
  .sheet {
    width: 100%;
    max-width: 580px;
    max-height: 92dvh;
    background: var(--bg-1);
    border-top: 1px solid var(--line-2);
    border-radius: 22px 22px 0 0;
    padding: 8px 18px max(var(--bot-pad), 18px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    animation: uiSheet 0.36s var(--ease);
  }
  .sheet > * { flex-shrink: 0; }
  .sheet::before { content: ""; width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto -4px; flex-shrink: 0; }
  .sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .sheet-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
  .sheet .deck-row { flex-wrap: wrap; }
  .sheet .field-row .blur-bar { width: 100%; }
  .sheet .seg-group { width: 100%; }
  .photo-privacy-copy { display: grid; gap: 8px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
  .photo-privacy-copy p { margin: 0; }
  .photo-privacy-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  @keyframes uiFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes uiSheet { from { transform: translateY(36px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes uiPop { from { transform: translateY(10px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes uiPane { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

  .fit-preview-wrap { width: 100%; height: 160px; background: #05070b; border: 1px solid var(--line); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
  #fitPreviewCanvas { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; border-radius: 6px; }

  .paste-dropzone {
    width: 100%;
    min-height: 96px;
    border-radius: var(--r-md);
    border: 1.5px dashed var(--accent-line);
    background: var(--accent-soft);
    color: var(--text-1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
  }
  .paste-dropzone:focus { border-color: var(--accent); background: rgba(56, 189, 248, 0.2); }
  .paste-dropzone span.sub { font-size: 11.5px; color: var(--text-2); font-weight: 500; pointer-events: none; }
  .paste-dropzone img { max-width: 120px; max-height: 60px; border-radius: 6px; }

  /* Instagram preview */
  .ig-card { background: #000; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; position: relative; }
  .ig-top { padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
  .ig-top .btn-pill { height: 30px; font-size: 11.5px; padding: 0 12px; }
  .ig-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ig-track::-webkit-scrollbar { display: none; }
  .ig-track.seam-inspect { gap: 2px; scroll-snap-type: none; }
  .ig-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; background: #05070b; max-height: 46dvh; }
  .ig-SlideImg { max-width: 100%; max-height: 46dvh; width: auto; height: auto; display: block; object-fit: contain; }
  .ig-dots { display: flex; justify-content: center; gap: 6px; padding: 10px; }
  .ig-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); transition: all 0.25s var(--ease); }
  .ig-dot.active { background: var(--accent); width: 18px; border-radius: 3px; }
  .ig-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(7, 9, 13, 0.82); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 5; }
  .ig-nav-btn:active { background: var(--accent); color: var(--accent-ink); }
  .ig-nav-btn.prev { left: 10px; }
  .ig-nav-btn.next { right: 10px; }
  .export-actions { display: flex; flex-direction: column; gap: 12px; }
  .export-primary-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gap); }
  .dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
  .dl-item-wrap { display: flex; align-items: center; gap: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; }
  .dl-item-wrap .btn-dl-item { border: 0; flex: 1; height: 32px; background: transparent; }
  .btn-move-slide { width: 28px; height: 32px; border: 0; background: var(--bg-3); color: var(--text-2); border-radius: 7px; font-size: 11px; font-weight: 700; }
  .btn-move-slide:active { color: var(--accent); }

  /* ==========================================================================
     PHONES AND SMALL TABLETS (portrait)
     ========================================================================== */
  @media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
    .canvas-hud {
      left: 0;
      right: 0;
      bottom: 0;
      transform: none;
      max-width: none;
      width: 100%;
      border-radius: 0;
      border: 0;
      border-top: 1px solid var(--line);
      background: var(--bg-1);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      box-shadow: none;
      padding: 3px 8px;
      gap: 2px;
    }
    .canvas-hud::before, .canvas-hud::after { content: ""; margin: auto; }
    .hud-btn { height: 42px; min-width: 48px; }
    .canvas-hud > .hud-btn:first-child { margin-left: 0; }

    .workspace-status-pill { top: 8px; right: 8px; }
    .reel-workspace-stage { padding-top: 40px; }

    /* sliding panes */
    .pane-viewport { position: relative; flex: 1; min-height: 0; contain: layout style; }
    .pane-track {
      display: flex;
      height: 100%;
      overflow-x: auto;
      overflow-y: hidden;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      overscroll-behavior-x: contain;
      -webkit-overflow-scrolling: touch;
      will-change: scroll-position;
    }
    .pane-track::-webkit-scrollbar { display: none; }
    .pane-track > .col-subpanel, .pane-track > .ann-pane {
      display: flex;
      flex: 0 0 100%;
      height: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior-y: contain;
      scroll-snap-align: start;
      scroll-snap-stop: always;
      scrollbar-width: none;
      padding-bottom: 16px;
      contain: layout style;
      -webkit-overflow-scrolling: touch;
    }
    .pane-track > .col-subpanel::-webkit-scrollbar, .pane-track > .ann-pane::-webkit-scrollbar { display: none; }
    .pane-track > * > * { flex-shrink: 0; }
    .pane-viewport::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 28px;
      background: linear-gradient(180deg, rgba(13, 17, 23, 0), var(--bg-1) 90%);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.25s;
    }
    .pane-viewport.more::after { opacity: 1; }

    /* filmstrip hides itself until something has been sliced */
    .filmstrip-bar { transition: height 0.32s var(--ease), border-color 0.32s; }
    .filmstrip-bar.is-empty { height: 0; border-top-width: 0; border-bottom-width: 0; }

    /* one swipeable row per option set */
    .collage-subtabs { flex: 1; }
    #colCellSelectorGroup { flex: 0 1 auto; }
    .deck-row:has(> #colCellSelectorGroup) { flex-wrap: nowrap; }
    #colCellSelectorGroup .seg-btn { flex: 0 1 auto; width: 32px; min-width: 22px; padding: 0 2px; }   /* up to 6 boxes: chips give way, never clip */
    #collageTabsNav .col-subtab-btn { padding: 0 5px; min-width: min-content; }
    /* Borders pane: Gap / Margin, then the backdrop (style + BG Blur); Radius / Border are polish and come last */
    #colFrameRow { order: 3; }
    #colBgBlurRow .blur-bar { height: 30px; }          /* same slim height as the stacked sliders above it */
    #colGapBar.is-off { display: none; }               /* a single box has no gap: its room goes to the controls that matter */
    .desktop-panel-heading { display: none; }
  }

  @media (pointer: coarse) {
    .text-input, .font-select-pro, .star-solve-options select, .hex-text-field { font-size: 16px; }
  }
  @media (max-width: 540px) {
    .mode-switch-btn svg.ico { display: none; }
    .mode-switch-btn { padding: 0 4px; font-size: 11.5px; }
  }
  @media (max-width: 380px) {
    .top-bar { padding-left: 8px; padding-right: 8px; }
    .mode-switch-btn { padding: 0 3px; font-size: 11px; }
  }
  @media (max-height: 700px) {
    :root { --ctl: 38px; --cta: 44px; }
  }
  @media (pointer: coarse) { .desktop-shortcuts-hint { display: none !important; } }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  }

  /* ==========================================================================
     WORKSTATION (desktop and landscape phones): stage left, inspector right
     ========================================================================== */
  @media (min-width: 900px), (orientation: landscape) and (min-width: 640px) and (max-height: 540px) {
    :root { --notch-pad: 0px !important; --bot-pad: 14px; --ctl: 34px; --cta: 40px; --deck-h: auto; --gap: 8px; }
    body { font-size: 12.5px; }

    .app {
      max-width: none;
      height: 100vh;
      height: 100dvh;
      display: grid;
      grid-template-columns: minmax(0, 1fr) clamp(320px, 44vw, 420px);
      grid-template-rows: 56px minmax(0, auto) minmax(0, 1fr);
      grid-template-areas: "header header" "stage filmstrip" "stage deck";
    }
    .top-bar {
      grid-area: header;
      display: grid;
      grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
      grid-template-areas: "left center right";
      flex-wrap: nowrap;
      padding: 0 16px;
      height: 56px;
      gap: 12px;
    }
    .top-left, .top-right { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: nowrap; }
    .top-left { grid-area: left; justify-self: start; }
    .top-right { grid-area: right; justify-self: end; }
    .top-center { grid-area: center; order: 0; flex: none; justify-content: center; justify-self: center; min-width: 0; }
    .brand { margin-right: 8px; flex-shrink: 0; }
    .brand i { display: inline; }
    .mode-switch-pill { width: auto; }
    .mode-switch-btn { flex: 0 0 auto; height: 34px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
    .mode-switch-btn svg.ico { display: block; }
    #btnOpenWrap { width: auto; padding: 0 14px; }
    #btnOpenWrap span { display: inline; }
    @media (max-width: 1319px) {
      .brand i { display: none; }
      #btnOpenWrap { width: var(--ctl); padding: 0; }
      #btnOpenWrap span { display: none; }
      .mode-switch-btn { padding: 0 10px; gap: 5px; }
    }
    @media (max-width: 1080px) {
      .top-bar { padding: 0 12px; gap: 8px; }
      .brand { margin-right: 4px; }
      .mode-switch-btn svg.ico { display: none; }
      .mode-switch-btn { padding: 0 10px; font-size: 12px; }
    }
    @media (max-width: 899.5px) {
      .brand { gap: 0; margin-right: 2px; }
      .brand span { display: none; }
      .top-bar { padding: 0 10px; gap: 6px; }
      .lang-btn { padding: 0 8px; }
      .lang-btn .chev { display: none; }
      .mode-switch-btn { padding: 0 8px; font-size: 11.5px; }
    }
    @media (max-width: 699.5px) {
      .top-left { gap: 4px; }
      .mode-switch-btn { padding: 0 6px; font-size: 11px; }
    }
    .btn-icon:hover, .btn-pill:hover, .btn-sub-action:hover, .btn-zip-dl:hover, .btn-dl-item:hover, .blur-mini-btn:hover, .btn-sync-style:hover { border-color: var(--line-2); color: var(--text-1); background: var(--bg-3); }
    .btn-export:hover { background: #62ccfa; color: var(--accent-ink); border-color: transparent; }
    .mode-switch-btn:hover:not(.active) { color: var(--text-1); }
    .seg-btn:hover:not(.active), .col-subtab-btn:hover:not(.active) { color: var(--text-1); }
    .ann-style-card:hover:not(.active), .layout-card:hover:not(.active), .preset-card:hover:not(.active) { background: var(--bg-3); color: var(--text-1); border-color: var(--line-2); }
    .color-swatch:hover { transform: scale(1.1); }
    .btn-primary-slice:hover, .btn-primary-collage:hover, .btn-reel-render:hover, .btn-share-ios:hover, #btnApplyStarTargets:hover:not(:disabled), #btnExportAnnotatedFull:hover:not(:disabled), #btnFindStarTargets:hover:not(:disabled) { background: #62ccfa; }

    .workspace { grid-area: stage; border-right: 1px solid var(--line); height: 100%; min-width: 0; min-height: 0; }
    .desktop-shortcuts-hint { display: inline-flex; }
    .workspace.narrow .desktop-shortcuts-hint { display: none; }
    .workspace-status-pill { top: 10px; right: 10px; }

    .canvas-hud {
      left: 50%;
      right: auto;
      bottom: 16px;
      transform: translateX(-50%);
      width: auto;
      max-width: calc(100% - 24px);
      padding: 4px;
      border-radius: 14px;
      border: 1px solid var(--line-2);
      background: rgba(13, 17, 23, 0.8);
      backdrop-filter: blur(16px) saturate(1.3);
      -webkit-backdrop-filter: blur(16px) saturate(1.3);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    }
    .canvas-hud::before, .canvas-hud::after { display: none; }
    .hud-btn { flex-direction: row; height: 32px; min-width: 0; padding: 0 12px; gap: 7px; font-size: 12px; border-radius: 10px; }
    .hud-btn::before { width: 16px; height: 16px; }
    .hud-btn:hover { background: var(--bg-3); color: var(--text-1); }
    .canvas-hud.compact .hud-btn { font-size: 0; gap: 0; padding: 0; width: 38px; min-width: 38px; justify-content: center; }
    .canvas-hud.compact .hud-btn::before { width: 18px; height: 18px; }
    .reel-workspace-stage { padding: 52px 28px calc(var(--hud-reserve, 64px) + 8px); }

    .filmstrip-bar {
      grid-area: filmstrip;
      height: auto;
      min-height: 112px;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      padding: 14px 18px 12px;
      gap: 10px;
      border-top: 0;
    }
    .filmstrip-bar.is-empty { height: auto; border-bottom-width: 1px; }
    .strip-meta { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
    .strip-scroll { padding: 2px 0; min-height: 56px; scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
    .strip-scroll::-webkit-scrollbar { display: block; height: 5px; }
    .strip-scroll::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
    .thumb-item { height: 56px; width: 45px; }

    .control-deck {
      grid-area: deck;
      padding: 16px 18px 24px;
      gap: 0;
      justify-content: flex-start;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior: contain;
      scrollbar-width: thin;
      scrollbar-color: var(--bg-4) transparent;
      min-width: 0;
    }
    .control-deck::-webkit-scrollbar { width: 6px; }
    .control-deck::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
    .deck-section { height: auto; gap: 14px; justify-content: flex-start; }
    #slicerDeck { justify-content: flex-start; }
    #slicerDeck .primary-actions-row { flex: none; min-height: 0; max-height: none; }
    #slicerDeck .primary-actions-row .btn-primary-slice { height: var(--cta); }

    /* every sub panel is visible at once on the workstation, separated by quiet headings */
    .pane-viewport, .pane-track { display: contents; }
    .col-subpanel { display: flex; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
    .ann-pane.active { animation: uiPane 0.24s var(--ease) both; }
    .collage-subtabs { display: none; }
    .desktop-panel-heading { display: flex; }
    .ann-tabs { display: flex; }

    /* option sets are tidy grids again */
    .ann-style-grid, .collage-layout-grid { grid-template-columns: repeat(4, 1fr); }
    .preset-scroll { grid-template-columns: repeat(3, 1fr); }
    .ann-style-card, .layout-card { min-height: 70px; padding: 9px 4px; }
    .ann-style-card svg { width: 24px; height: 24px; }
    .layout-card svg.tpl-svg { width: 32px; height: 26px; }
    .collage-layout-grid .layout-card.wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 52px; padding: 8px 16px; text-align: left; }
    .collage-layout-grid .layout-card.wide .tpl-text { align-items: flex-start; }
    .layout-card.wide .tpl-sub { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; color: var(--text-3); }
    .layout-card.wide.active .tpl-sub { color: var(--accent); }

    .color-swatch { width: 24px; height: 24px; }
    .color-wheel-btn { width: 24px; height: 24px; }

    .modal-backdrop { align-items: center; padding: 24px; }
    .sheet { max-width: 640px; width: min(640px, 100%); max-height: 88vh; border-radius: 18px; border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); padding: 22px 24px; gap: 18px; animation: uiPop 0.3s var(--ease); }
    .sheet::before { display: none; }
    .fit-preview-wrap { height: 210px; }
  }

  @media (min-width: 1440px) {
    .app { grid-template-columns: minmax(0, 1fr) 460px; }
    .control-deck { padding: 20px 22px 28px; }
  }

  /* ==========================================================================
     BIGGER PREVIEW · full-screen stage (Annotate + 3D Reel) and the room it frees up
     ========================================================================== */
  .stage-focus-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--line-2);
    background: rgba(13, 17, 23, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-1);
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.12s var(--ease);
  }
  .stage-focus-btn::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--i, none) center / contain no-repeat;
    mask: var(--i, none) center / contain no-repeat;
  }
  .stage-focus-btn:active { transform: scale(0.94); background: var(--bg-3); }
  html.focus-stage .stage-focus-btn { color: var(--accent); border-color: var(--accent-line); }

  /* phones: the button is offered on Annotate and 3D Reel, and the Output strip (slicer-only) makes room for the stage */
  @media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
    .stage-focus-btn { display: inline-flex; }     /* 3.44: in every mode, the Slicer and the Collage included */
    html[data-mode="annotate"] .filmstrip-bar, html[data-mode="reel"] .filmstrip-bar { display: none; }
    html[data-mode="reel"] .reel-hud-top { left: 52px !important; }
    .reel-workspace-stage { padding-left: 8px; padding-right: 8px; }
  }
  @media (pointer: coarse) {
    .stage-focus-btn { display: inline-flex; }
    html[data-mode="reel"] .reel-hud-top { left: 52px !important; }
  }

  /* full-screen: the stage covers the whole screen (inside the safe areas); header, strip and inspector step aside */
  html.focus-stage .top-bar, html.focus-stage .filmstrip-bar, html.focus-stage .control-deck { visibility: hidden; }
  html.focus-stage .workspace {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: env(safe-area-inset-left, 0px);
    right: env(safe-area-inset-right, 0px);
    bottom: 0;
    width: auto;
    height: auto;
    min-height: 0;
    max-width: none;
    z-index: 50;
    border: 0;
  }
  html.focus-stage .toast { top: calc(env(safe-area-inset-top, 0px) + 10px) !important; }
  html.focus-stage .reel-workspace-stage { padding: 46px 8px calc(var(--hud-reserve, 60px) + 2px); gap: 6px; }
  @media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
    html.focus-stage .canvas-hud { padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px)); }
  }
  @media (min-width: 900px), (orientation: landscape) and (min-width: 640px) and (max-height: 540px) {
    html.focus-stage .canvas-hud { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  }

  /* toolbar glyphs (CSS masks, so the app can keep rewriting the button text) */
  #btnUndoMove, #btnReelUndo { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='1%204%201%2010%207%2010'/%3E%3Cpath%20d='M3.51%2015a9%209%200%201%200%202.13-9.36L1%2010'/%3E%3C/svg%3E"); }
  #btnFitCrop { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203H5a2%202%200%200%200-2%202v3m18%200V5a2%202%200%200%200-2-2h-3m0%2018h3a2%202%200%200%200%202-2v-3M3%2016v3a2%202%200%200%200%202%202h3'/%3E%3C/svg%3E"); }
  #btnZoom100 { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='11'%20cy='11'%20r='8'/%3E%3Cline%20x1='21'%20y1='21'%20x2='16.65'%20y2='16.65'/%3E%3Cline%20x1='11'%20y1='8'%20x2='11'%20y2='14'/%3E%3Cline%20x1='8'%20y1='11'%20x2='14'%20y2='11'/%3E%3C/svg%3E"); }
  #btnCenter { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cline%20x1='22'%20y1='12'%20x2='18'%20y2='12'/%3E%3Cline%20x1='6'%20y1='12'%20x2='2'%20y2='12'/%3E%3Cline%20x1='12'%20y1='6'%20x2='12'%20y2='2'/%3E%3Cline%20x1='12'%20y1='22'%20x2='12'%20y2='18'/%3E%3C/svg%3E"); }
  #btnRot90, #btnAnnRot90 { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%204%2023%2010%2017%2010'/%3E%3Cpath%20d='M20.49%2015a9%209%200%201%201-2.12-9.36L23%2010'/%3E%3C/svg%3E"); }
  #btnOpenAnnotate, #btnAnnMarkers, #btnColMarkers { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='5'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='1'/%3E%3C/svg%3E"); }
  #btnOpenStyle { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6.13%201L6%2016a2%202%200%200%200%202%202h15'/%3E%3Cpath%20d='M1%206.13L16%206a2%202%200%200%201%202%202v15'/%3E%3C/svg%3E"); }
  #btnAnnUndo { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='1%204%201%2010%207%2010'/%3E%3Cpath%20d='M3.51%2015a9%209%200%201%200%202.13-9.36L1%2010'/%3E%3C/svg%3E"); }
  #btnAnnHudPlace { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='5'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='1'/%3E%3C/svg%3E"); }
  #btnCollageUndo { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='1%204%201%2010%207%2010'/%3E%3Cpath%20d='M3.51%2015a9%209%200%201%200%202.13-9.36L1%2010'/%3E%3C/svg%3E"); }
  #collageHud .btn-open-native { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='3'%20width='18'%20height='18'%20rx='2'/%3E%3Ccircle%20cx='8.5'%20cy='8.5'%20r='1.5'/%3E%3Cpolyline%20points='21%2015%2016%2010%205%2021'/%3E%3C/svg%3E"); }
  #btnColUseMainImg { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolygon%20points='12%202%202%207%2012%2012%2022%207%2012%202'/%3E%3Cpolyline%20points='2%2017%2012%2022%2022%2017'/%3E%3Cpolyline%20points='2%2012%2012%2017%2022%2012'/%3E%3C/svg%3E"); }
  #btnColSwapNext { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='17%201%2021%205%2017%209'/%3E%3Cpath%20d='M3%2011V9a4%204%200%200%201%204-4h14'/%3E%3Cpolyline%20points='7%2023%203%2019%207%2015'/%3E%3Cpath%20d='M21%2013v2a4%204%200%200%201-4%204H3'/%3E%3C/svg%3E"); }
  #btnColFitCell { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203H5a2%202%200%200%200-2%202v3m18%200V5a2%202%200%200%200-2-2h-3m0%2018h3a2%202%200%200%200%202-2v-3M3%2016v3a2%202%200%200%200%202%202h3'/%3E%3C/svg%3E"); }
  #btnColRotCell { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%204%2023%2010%2017%2010'/%3E%3Cpath%20d='M20.49%2015a9%209%200%201%201-2.12-9.36L23%2010'/%3E%3C/svg%3E"); }
  #btnColFlipH { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%203v18'%20stroke-dasharray='2%203'/%3E%3Cpath%20d='M8%207L3%2017h5z'/%3E%3Cpath%20d='M16%207l5%2010h-5z'/%3E%3C/svg%3E"); }
  #btnColToggleDragMode { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='5%209%202%2012%205%2015'/%3E%3Cpolyline%20points='9%205%2012%202%2015%205'/%3E%3Cpolyline%20points='15%2019%2012%2022%209%2019'/%3E%3Cpolyline%20points='19%209%2022%2012%2019%2015'/%3E%3Cline%20x1='2'%20y1='12'%20x2='22'%20y2='12'/%3E%3Cline%20x1='12'%20y1='2'%20x2='12'%20y2='22'/%3E%3C/svg%3E"); }
  #btnColToggleDragMode[data-s="text"] { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='4%207%204%204%2020%204%2020%207'/%3E%3Cline%20x1='9'%20y1='20'%20x2='15'%20y2='20'/%3E%3Cline%20x1='12'%20y1='4'%20x2='12'%20y2='20'/%3E%3C/svg%3E"); }
  #btnReplayReel { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='1%204%201%2010%207%2010'/%3E%3Cpath%20d='M3.51%2015a9%209%200%201%200%202.13-9.36L1%2010'/%3E%3C/svg%3E"); }
  #btnTogglePlayReel { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='6'%20y='4'%20width='4'%20height='16'%20rx='1'/%3E%3Crect%20x='14'%20y='4'%20width='4'%20height='16'%20rx='1'/%3E%3C/svg%3E"); }
  #btnTogglePlayReel[data-s="play"] { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolygon%20points='6%203%2020%2012%206%2021%206%203'/%3E%3C/svg%3E"); }
  #btnResetReelAim { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cline%20x1='22'%20y1='12'%20x2='18'%20y2='12'/%3E%3Cline%20x1='6'%20y1='12'%20x2='2'%20y2='12'/%3E%3Cline%20x1='12'%20y1='6'%20x2='12'%20y2='2'/%3E%3Cline%20x1='12'%20y1='22'%20x2='12'%20y2='18'/%3E%3C/svg%3E"); }
  #btnReelOpenAnnotate { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='5'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='1'/%3E%3C/svg%3E"); }
  #btnAnnZoomIn { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='11'%20cy='11'%20r='8'/%3E%3Cline%20x1='21'%20y1='21'%20x2='16.65'%20y2='16.65'/%3E%3Cline%20x1='11'%20y1='8'%20x2='11'%20y2='14'/%3E%3Cline%20x1='8'%20y1='11'%20x2='14'%20y2='11'/%3E%3C/svg%3E"); }
  #btnAnnZoomOut { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='11'%20cy='11'%20r='8'/%3E%3Cline%20x1='21'%20y1='21'%20x2='16.65'%20y2='16.65'/%3E%3Cline%20x1='8'%20y1='11'%20x2='14'%20y2='11'/%3E%3C/svg%3E"); }
  #btnAnnFit { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203H5a2%202%200%200%200-2%202v3m18%200V5a2%202%200%200%200-2-2h-3m0%2018h3a2%202%200%200%200%202-2v-3M3%2016v3a2%202%200%200%200%202%202h3'/%3E%3C/svg%3E"); }
  #btnStageFocus { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='15%203%2021%203%2021%209'/%3E%3Cpolyline%20points='9%2021%203%2021%203%2015'/%3E%3Cline%20x1='21'%20y1='3'%20x2='14'%20y2='10'/%3E%3Cline%20x1='3'%20y1='21'%20x2='10'%20y2='14'/%3E%3C/svg%3E"); }
  html.focus-stage #btnStageFocus { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='4%2014%2010%2014%2010%2020'/%3E%3Cpolyline%20points='20%2010%2014%2010%2014%204'/%3E%3Cline%20x1='14'%20y1='10'%20x2='21'%20y2='3'/%3E%3Cline%20x1='3'%20y1='21'%20x2='10'%20y2='14'/%3E%3C/svg%3E"); }


  /* ---------- turn 6: dimmed rows, Blur Fit card, reel rotate glyph ---------- */
  .is-off { opacity: 0.42; transition: opacity 0.2s var(--ease); }
  .is-inert { pointer-events: none; }
  .layout-card .tpl-text { display: flex; flex-direction: column; align-items: center; min-width: 0; }
  .layout-card .tpl-text b { font-weight: inherit; }
  .layout-card .tpl-sub { display: none; font-style: normal; }
  #btnReelRotate { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%204%2023%2010%2017%2010'/%3E%3Cpath%20d='M20.49%2015a9%209%200%201%201-2.12-9.36L23%2010'/%3E%3C/svg%3E"); }

  /* ===== Signature / watermark (Settings) ===== */
  .wm-actions { display: flex; gap: 8px; }
  .wm-actions .btn-pill { flex: 1; justify-content: center; }
  .wm-actions .btn-pill[hidden], .wm-panel[hidden] { display: none !important; }
  /* watermarks on the annotated picture */
  #annWmPanel .wm-actions { flex: 0 0 auto; }
  #annWmPanel .wm-actions .btn-pill { flex: 0 0 auto; padding: 0 14px; }
  #annWmPanel .btn-pill:disabled { opacity: 0.4; }
  .ann-wm-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .ann-wm-list[hidden], .ann-wm-edit[hidden], #annWmTextRow[hidden] { display: none; }
  .ann-wm-list .moon-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ann-wm-edit { display: flex; flex-direction: column; gap: 8px; }
  .ann-wm-row { display: flex; gap: 8px; }
  .ann-wm-row .blur-mini-btn { flex: 1; height: 32px; }
  .ann-wm-color { width: 44px; height: var(--ctl); padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-0); cursor: pointer; flex-shrink: 0; }
  #moonScaleOpacityRow { margin-top: 2px; }
  .wm-panel { display: flex; flex-direction: column; gap: 12px; }
  .wm-stage { display: flex; gap: 14px; align-items: stretch; }
  .wm-preview { flex: 0 0 auto; width: 112px; aspect-ratio: 4 / 5; border-radius: var(--r-sm); border: 1px solid var(--line-2); overflow: hidden; background: #05070b; }
  .wm-preview canvas { display: block; width: 100%; height: 100%; }
  .wm-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: center; }
  .wm-cell { position: relative; min-height: 38px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); -webkit-tap-highlight-color: transparent; transition: background 0.18s, border-color 0.18s; }
  .wm-cell::after { content: ""; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transition: width 0.18s, height 0.18s, background 0.18s; }
  .wm-cell[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
  .wm-cell[aria-checked="true"]::after { width: 12px; height: 12px; background: var(--accent); }
  #wmField .blur-bar { background: var(--bg-2); }

  /* How does it work?, credits and how the app was made (Annotate, Solve tab) */
  .about-sec { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-0); }
  .about-sec + .about-sec { margin-top: 8px; }
  .about-sec > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-1); font-size: 12.5px; font-weight: 650; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
  .about-sec > summary::-webkit-details-marker { display: none; }
  .about-sec > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; }
  .about-sec[open] > summary::after { transform: rotate(225deg); }
  .about-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-sm); }
  .about-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 14px; font-size: 12.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
  .about-body p, .about-body ol, .about-body ul, .about-body h4 { margin: 0; }
  .about-body strong { color: var(--text-1); font-weight: 650; }
  .about-h { margin-top: 6px !important; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
  .about-h:first-child { margin-top: 0 !important; }
  .about-steps, .about-list { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
  .about-note { font-size: 11.5px; color: var(--text-3); }
  .about-credits { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
  .about-credits li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }

  /* Mechanism text: lead, nested sections, definition lists */
  .about-lead { font-size: 13px; color: var(--text-1); }
  .about-subs { border-top: 1px solid var(--line); }
  .about-sub { border-bottom: 1px solid var(--line); }
  .about-sub > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 8px 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-1); font-size: 12.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
  .about-sub > summary::-webkit-details-marker { display: none; }
  .about-sub > summary::after { content: ""; flex: none; width: 6px; height: 6px; margin-right: 3px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform 0.2s; }
  .about-sub[open] > summary::after { transform: rotate(225deg); }
  .about-sub > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .about-sub-body { display: flex; flex-direction: column; gap: 10px; padding: 0 2px 14px; }
  .about-sub-body p, .about-sub-body ol, .about-sub-body dl { margin: 0; }
  .about-dl dt { margin: 12px 0 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
  .about-dl dt:first-child { margin-top: 0; }
  .about-dl dd { margin: 2px 0 0; }
  .about-body sup { font-size: 0.75em; line-height: 0; }

/* 3.35 constellations panel */
.cons-box { gap: 8px; }
.cons-opts { display: flex; flex-direction: column; gap: 8px; width: 100%; padding-top: 4px; }
.cons-opts .live-hint { margin: 0; }
.cons-line-row { align-items: flex-start; flex-wrap: wrap; }
.seg-group.seg-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; gap: 3px; padding: 3px; flex: 1 1 200px; }
.seg-group.seg-grid-3 .seg-thumb, .seg-group.seg-grid-3::before { display: none !important; }
.seg-group.seg-grid-3 .seg-btn { height: 28px; padding: 0 5px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.seg-group.seg-grid-3 .seg-btn.active { background: rgba(56, 189, 248, .18); color: var(--text-1); border-color: rgba(56, 189, 248, .48); font-weight: 600; }
.star-solve-options .type-row[hidden], .type-row[hidden], .blur-bar[hidden] { display: none !important; }
#starConsBox .type-row em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }


/* ---------- interface languages (3.38) ---------- */
html.i18n-loading body { visibility: hidden; animation: i18nShow 0s 2.6s forwards; }   /* hidden only while the dictionary loads; shown anyway after 2.6 s */
@keyframes i18nShow { to { visibility: visible; } }
.i18n-doc-note { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: 12px; }
html[lang="zh-Hans"] { --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", sans-serif; }
html[lang="ja"] { --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Noto Sans JP", "Source Han Sans JP", sans-serif; }
html[lang="zh-Hans"] body, html[lang="ja"] body { letter-spacing: 0; word-break: normal; line-break: strict; }
html[lang="zh-Hans"] .btn-pill, html[lang="ja"] .btn-pill, html[lang="zh-Hans"] .seg-btn, html[lang="ja"] .seg-btn { letter-spacing: 0; }

/* 3.39: one Export per section */
.collage-export-sub .btn-pill.span2 { grid-column: 1 / -1; gap: 8px; }
.collage-export-sub .btn-pill .badge-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(125,211,252,0.16); color: var(--accent); font-size: 11px; font-weight: 700; }
.reel-res-warn { margin: 8px 2px 0; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(251,191,36,0.38); background: rgba(251,191,36,0.08); color: #fcd34d; font-size: 12px; line-height: 1.4; }
.reel-res-warn[hidden] { display: none; }

/* 3.40: language picker, one slider per row, resolution hints */
.lang-wrap { position: relative; }
.lang-btn { height: 36px; padding: 0 10px 0 11px; gap: 6px; font-size: 12px; letter-spacing: 0.04em; }
.lang-btn .ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lang-btn .chev { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; opacity: 0.65; transition: transform 0.16s; }
.lang-btn[aria-expanded="true"] { border-color: var(--accent-line); color: var(--accent); }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 212px; padding: 6px; display: grid; gap: 2px; z-index: 400;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6); }
.lang-menu[hidden] { display: none; }
.lang-item, .lang-chip { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; color: var(--text-1); font-size: 14px; font-weight: 600; text-align: left; border-radius: 10px; }
.lang-item { height: 42px; padding: 0 12px; width: 100%; }
.lang-item .lang-code, .lang-chip .lang-code { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); }
.lang-item:hover, .lang-chip:hover { background: var(--bg-3); }
.lang-item[aria-selected="true"], .lang-chip[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.lang-item[aria-selected="true"] .lang-code, .lang-chip[aria-checked="true"] .lang-code { color: var(--accent); }
.lang-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; width: 100%; }
.lang-chip { height: 46px; padding: 0 12px; background: var(--bg-2); border-color: var(--line); }
/* every slider gets the full width of its panel: the label, the value and the slider never share a row with another control */
.deck-row:has(> .blur-bar) { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.deck-row:has(> .blur-bar) > * { flex: none !important; width: 100%; }
.deck-row:has(> .blur-bar) > .blur-bar input[type="range"] { min-width: 120px; }
.margin-quick-btn { width: 100%; height: 34px; font-size: 12px; }
.res-hint { margin: 2px 2px 0; font-size: 11.5px; line-height: 1.4; color: var(--text-3); }
.moon-warn { margin: 2px 0 0; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(251,191,36,0.38); background: rgba(251,191,36,0.08); color: #fcd34d; font-size: 12px; line-height: 1.4; }
.moon-warn[hidden] { display: none; }

.blur-bar[hidden]{display:none !important}

/* 3.40: the zoom-area picker of the Reel */
.aim-picker{display:flex;flex-direction:column;gap:8px;margin:2px 0 10px}
.aim-head{display:flex;align-items:center;gap:10px}
.aim-head .aim-val{margin-left:auto;font-family:var(--font-mono);font-size:12px;color:var(--cyan,#5ed6ff)}
.aim-btn{padding:6px 12px;font-size:12px}
#reelAimCanvas{display:block;align-self:center;max-width:100%;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:#05070d;cursor:crosshair;touch-action:none;outline:none}
#reelAimCanvas:focus-visible{border-color:var(--cyan,#5ed6ff);box-shadow:0 0 0 2px rgba(94,214,255,.35)}

/* 3.40: region crops */
.crops-list{display:flex;flex-direction:column;gap:8px}
.crop-item{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.03)}
.crop-thumb{width:96px;height:96px;object-fit:contain;border-radius:8px;background:#05070d;flex:none}
.crop-meta{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.crop-meta strong{font-size:14px}
.crop-meta span{font-family:var(--font-mono);font-size:12px;color:var(--text-2,#9aa7b8)}
.crop-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.crop-actions .btn-pill{padding:6px 10px;font-size:12px}
.crops-actions{display:flex;gap:8px;flex-wrap:wrap}
.crop-sheet .crop-stage{display:flex;justify-content:center;background:#000;border:1px solid var(--line);border-radius:12px;padding:6px}
#cropCanvas{display:block;max-width:100%;touch-action:none;cursor:crosshair;border-radius:6px}
.crop-size{font-family:var(--font-mono);font-size:12px;text-align:center;color:var(--cyan,#5ed6ff)}
#cropAspectGroup{flex-wrap:wrap}

/* 3.41: board of the crops, automatic crops */
.crops-auto{display:flex;flex-direction:column;gap:6px}
.crops-auto .seg-group{flex-wrap:wrap}
.crops-auto .seg-btn:disabled{opacity:.45;pointer-events:none}
.board-box{display:flex;flex-direction:column;gap:10px;margin-top:6px;padding-top:12px;border-top:1px solid var(--line)}
.board-preview-wrap{display:flex;justify-content:center;background:#05070d;border:1px solid var(--line);border-radius:12px;padding:8px}
#boardPreview{display:block;max-width:100%;max-height:min(58vh,520px);width:auto;height:auto;border-radius:6px}
#boardLayoutGroup,#boardShapeGroup{flex-wrap:wrap}
.board-save{align-self:stretch;padding:12px 14px;font-size:14px}
.crops-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(68px,1fr));gap:8px;flex-direction:initial}
.crops-list:empty{display:none}
.crop-tile{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;padding:0;border:1px solid var(--line);border-radius:10px;background:#05070d;cursor:pointer;overflow:hidden}
.crop-tile .crop-thumb{width:100%;height:100%;object-fit:contain;border-radius:0;background:transparent}
.crop-tile.on{border-color:var(--cyan,#5ed6ff);box-shadow:0 0 0 1px var(--cyan,#5ed6ff) inset}
.crop-num{position:absolute;left:4px;top:4px;min-width:18px;height:18px;padding:0 4px;border-radius:5px;background:rgba(4,7,14,.9);color:#fff;font:700 11px/18px var(--font-mono,monospace);text-align:center}
.crop-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.03)}
.crop-bar-meta{display:flex;flex-direction:column;min-width:0}
.crop-bar-meta strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}
.crop-bar-meta span{font-family:var(--font-mono);font-size:12px;color:var(--text-2,#9aa7b8)}
.measure-list{display:flex;flex-direction:column;gap:6px}
.measure-list:empty{display:none}
.measure-row{display:flex;align-items:center;gap:10px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.03)}
.measure-row span{font-family:var(--font-mono);font-size:12px;color:var(--text-2,#9aa7b8)}
.measure-row strong{flex:1;font-size:15px}
.measure-row .btn-pill{padding:5px 10px;font-size:12px}
#scaleBarGroup{flex-wrap:wrap}
#scaleBarGroup .seg-btn:disabled{opacity:.45}

/* 3.41: phones in portrait. The options panel is a sheet that can be pulled taller, always scrolls with the finger and keeps the main button in reach;
   the header no longer reserves a notch the phone does not have (the real safe area is read from the device). */
html, body { touch-action: pan-x pan-y; }
.deck-grip { display: none; }
@media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
  .top-bar { padding-bottom: 6px; gap: 6px; }
  .control-deck { box-sizing: border-box; height: var(--deck-total, 46dvh); padding-top: 0; touch-action: pan-y; border-top-left-radius: 16px; border-top-right-radius: 16px; box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.38); position: relative; z-index: 6; }
  .control-deck.is-dragging { transition: none; }
  .control-deck:not(.is-dragging) { transition: height 0.24s var(--ease); }
  .deck-grip { display: flex; align-items: center; justify-content: center; flex: none; width: 100%; height: 26px; margin: 0 0 2px; padding: 0; border: 0; background: transparent; touch-action: none; cursor: ns-resize; }
  .deck-grip::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.75; transition: background 0.2s, opacity 0.2s; }
  .deck-grip:active::before, .control-deck.is-dragging .deck-grip::before { background: var(--accent); opacity: 1; }
  .deck-section { height: auto; flex: 1 1 auto; min-height: 0; }
  #slicerDeck { overflow-x: hidden; overflow-y: auto; justify-content: flex-start; padding-bottom: 6px; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-y; }
  #slicerDeck::-webkit-scrollbar { display: none; }
  #slicerDeck > * { flex-shrink: 0; }
  #slicerDeck .primary-actions-row { flex: none; min-height: var(--cta); max-height: none; position: sticky; bottom: 0; z-index: 3; margin-top: auto; padding: 10px 0 2px; background: linear-gradient(180deg, rgba(13, 17, 23, 0), var(--bg-1) 26%); }
  #slicerDeck .primary-actions-row .btn-primary-slice { height: var(--cta); }
  html.deck-big .filmstrip-bar { display: none; }
}
@media (min-width: 900px), (orientation: landscape) and (min-width: 640px) and (max-height: 540px) {
  #collageExportBox.col-subpanel { border-bottom: 0; padding-bottom: 0; }
}
#btnAnnHudMeasure { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%2017L17%203l4%204L7%2021z'/%3E%3Cpath%20d='M7.5%2012.5l2%202M10.5%209.5l2%202M13.5%206.5l2%202'/%3E%3C/svg%3E"); }

/* 3.41 / 3.45: Tonight's sky Pro */
.planner-sheet{max-width:660px;max-height:min(94dvh,920px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.planner-head-actions{display:flex;align-items:center;gap:6px}
.btn-red-pill{border-color:rgba(248,113,113,.38);color:#fca5a5}
.btn-red-pill.active,html.red-night .btn-red-pill,html.red-night #btnRedLight{background:rgba(220,38,38,.28);border-color:#ef4444;color:#ff8a8a;box-shadow:0 0 0 1px rgba(239,68,68,.35) inset}
.planner-site{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}
.planner-field{display:flex;flex-direction:column;gap:4px;flex:1;min-width:104px}
.planner-field span{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.planner-field .text-input{width:100%}
.planner-loc-btn{flex:none;height:36px;white-space:nowrap}
.planner-dial{display:flex;flex-direction:column;gap:6px;padding:10px 10px 8px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.02));box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
.pl-dial-bar{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:32px}
.pl-dial-ico{position:relative;flex:none;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;border:1px solid var(--line);background:rgba(255,255,255,.05);color:var(--text-2);cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.pl-dial-ico:hover{background:rgba(255,255,255,.10);color:var(--text-1);border-color:var(--line-2)}
.pl-date-native{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer;border:0;padding:0;margin:0}
.pl-dial-units{display:flex;align-items:center;justify-content:center;gap:2px;flex:1;min-width:0;font-variant-numeric:tabular-nums}
.pl-unit-btn{appearance:none;border:1px solid transparent;background:transparent;color:var(--text-2);font-family:var(--font-mono);font-size:14.5px;font-weight:600;padding:4px 7px;border-radius:8px;cursor:pointer;line-height:1.1;transition:background .15s,color .15s,border-color .15s,box-shadow .15s}
.pl-unit-btn:hover{color:var(--text-1);background:rgba(255,255,255,.06)}
.pl-unit-btn.active{background:rgba(92,200,255,.18);border-color:rgba(92,200,255,.55);color:#ffffff;font-weight:800;box-shadow:0 0 12px rgba(92,200,255,.18)}
.pl-unit-gap{width:10px;flex:none}
.pl-unit-colon{color:var(--text-3);font-family:var(--font-mono);font-weight:700;font-size:14px;padding:0 1px;user-select:none}
.planner-now-btn{height:30px;padding:0 10px;font-size:11.5px;font-weight:700;flex:none}
.pl-dial-wheel-wrap{position:relative;width:100%;height:54px;border-radius:10px;overflow:hidden;border:1px solid rgba(255,255,255,.09);background:linear-gradient(180deg,rgba(4,9,18,.92),rgba(11,18,32,.96) 50%,rgba(4,9,18,.92));box-shadow:inset 0 6px 12px rgba(0,0,0,.45),inset 0 -6px 12px rgba(0,0,0,.45)}
.pl-dial-canvas{width:100%;height:54px;display:block;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
.pl-dial-canvas.dragging{cursor:grabbing}
.pl-sort-bar{display:flex;align-items:stretch;gap:6px}
.pl-sort-bar #plSortGroup{flex:1;min-width:0}
.pl-sort-dir{flex:none;width:38px;min-height:var(--ctl,36px);padding:0;display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:16px;font-weight:800;border-color:var(--accent-line);color:var(--accent);background:var(--accent-soft)}
.pl-sort-dir:hover{filter:brightness(1.12)}
.pl-dir-ico{display:inline-block;line-height:1;transition:transform .18s ease}
.pl-sort-dir[data-dir="asc"] .pl-dir-ico{transform:rotate(180deg)}
.diag-actions{display:flex;gap:8px;flex-wrap:wrap}
.diag-actions .btn-pill{flex:1;justify-content:center;min-width:130px}
.planner-pro-bar{display:flex;flex-direction:column;gap:8px}
.planner-ctl-group{display:flex;flex-direction:column;gap:4px}
.planner-ctl-lbl{font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
#plFilterGroup .seg-btn,#plSetupGroup .seg-btn,#plSortGroup .seg-btn{font-size:11px;padding:0 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.planner-summary{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.03);font-size:13px;line-height:1.4}
.pl-moon{display:flex;align-items:center;gap:8px;color:var(--text-2);font-size:12.5px;flex-wrap:wrap}
.pl-moon i{width:16px;height:16px;border-radius:50%;flex:none;background:linear-gradient(90deg,#f4efe0 calc(var(--p)*1%),#2a3140 calc(var(--p)*1%));box-shadow:0 0 0 1px rgba(255,255,255,.2)}
.pl-moon em{font-style:normal;color:var(--accent);margin-left:auto}
#plTypeGroup,#plSetupGroup,#plSortGroup{flex-wrap:wrap}
.planner-list{display:flex;flex-direction:column;gap:10px}
.pl-row{display:flex;flex-direction:column;gap:8px;padding:12px 13px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.02))}
.pl-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.pl-main{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.pl-main strong{font-size:15.5px;letter-spacing:-.01em}
.pl-main span{font-size:12px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl-score{flex:none;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:46px;padding:4px 8px;border-radius:10px;border:1px solid var(--sc-line,rgba(255,255,255,.16));background:var(--sc-bg,rgba(255,255,255,.06));color:var(--sc-fg,var(--text-1));line-height:1.05}
.pl-score b{font-family:var(--font-mono);font-size:15px;font-weight:800}
.pl-score small{font-size:8.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;opacity:.85}
.pl-score.sc-great{--sc-fg:#34d399;--sc-bg:rgba(52,211,153,.14);--sc-line:rgba(52,211,153,.42)}
.pl-score.sc-good{--sc-fg:#38bdf8;--sc-bg:rgba(56,189,248,.14);--sc-line:rgba(56,189,248,.40)}
.pl-score.sc-fair{--sc-fg:#fbbf24;--sc-bg:rgba(251,191,36,.14);--sc-line:rgba(251,191,36,.40)}
.pl-score.sc-poor{--sc-fg:#f87171;--sc-bg:rgba(248,113,113,.14);--sc-line:rgba(248,113,113,.38)}
.pl-chips{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.pl-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:7px;font-family:var(--font-mono);font-size:10.5px;font-weight:600;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.09);color:var(--text-2);white-space:nowrap}
.pl-chip.alt-now{color:#7dd3fc;border-color:rgba(125,211,252,.30);background:rgba(56,189,248,.11)}
.pl-chip.alt-low{color:#f87171;border-color:rgba(248,113,113,.28);background:rgba(248,113,113,.09)}
.pl-chip.moon-ok{color:#86efac;border-color:rgba(134,239,172,.26)}
.pl-chip.moon-warn{color:#fde68a;border-color:rgba(251,191,36,.32);background:rgba(251,191,36,.09)}
.pl-chip.moon-bad{color:#fca5a5;border-color:rgba(248,113,113,.35);background:rgba(248,113,113,.11)}
.pl-chip.flip{color:#c4b5fd;border-color:rgba(196,181,253,.30);background:rgba(167,139,250,.09)}
.pl-chip.fov-ok{color:#5eead4;border-color:rgba(94,234,212,.32);background:rgba(45,212,191,.10)}
.pl-chip.fov-warn{color:#fcd34d;border-color:rgba(252,211,77,.30)}
.pl-vis{display:flex;flex-direction:column;gap:5px}
.pl-spark{width:100%;height:96px;display:block;border-radius:9px;background:#070c16;border:1px solid rgba(255,255,255,.09);touch-action:pan-y;cursor:crosshair;user-select:none;-webkit-user-select:none}
.pl-spark.scrubbing{border-color:rgba(92,200,255,.55);cursor:ew-resize}
.pl-vis em{font-style:normal;font-family:var(--font-mono);font-size:11px;color:var(--text-2);line-height:1.35}
.pl-year{display:grid;grid-template-columns:repeat(12,1fr);gap:3px}
.pl-year i{font-style:normal;text-align:center;font-size:10px;font-weight:600;line-height:19px;height:19px;border-radius:5px;background:rgba(148,163,184,.08);color:rgba(148,163,184,.55);transition:transform .12s ease}
.pl-year i.t1{background:rgba(99,102,241,.28);color:#c7d2fe}
.pl-year i.t2{background:rgba(56,189,248,.42);color:#e0f2fe}
.pl-year i.t3{background:#2dd4bf;color:#042022;font-weight:700}
.pl-year i.t4{background:linear-gradient(135deg,#fbbf24,#f59e0b);color:#1f1102;font-weight:800}
.pl-year i.now-mo{box-shadow:0 0 0 1.5px #ffffff inset,0 0 8px rgba(255,255,255,.28)}
.pl-empty{padding:14px;text-align:center;color:var(--text-2);font-size:13px}

/* Extra #4A / #4B / #5 buttons */
.btn-overlay-export{width:100%;margin-top:6px;justify-content:center}
.tel-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.btn-auto-card{height:26px;padding:0 10px;font-size:11px;border-color:var(--accent-line);color:var(--accent);background:var(--accent-soft)}
#btnAnnCompare.is-on{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-line)}
#btnAnnCompare { --i: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='12'%20y1='3'%20x2='12'%20y2='21'/%3E%3Cpolyline%20points='8%208%204%2012%208%2016'/%3E%3Cpolyline%20points='16%208%2020%2012%2016%2016'/%3E%3C/svg%3E"); }

/* Extra #3: Global Red-Light Dark Adaptation UI mode */
html.red-night{
  --bg-0:#070101;--bg-1:#110303;--bg-2:#1b0505;--bg-3:#260808;--bg-4:#3a0d0d;
  --text-1:#ff6666;--text-2:#d94848;--text-3:#9e2f2f;
  --accent:#ff3b3b;--accent-ink:#1a0202;--accent-soft:rgba(255,59,59,.18);--accent-line:rgba(255,59,59,.45);
  --cyan:#ff5555;--amber:#ff4545;--green:#e03c3c;--red:#ff2a2a;
  --line:rgba(255,70,70,.16);--line-2:rgba(255,70,70,.38);
}
html.red-night body,html.red-night .stage-wrap,html.red-night .reel-workspace-stage{background:#050000}
html.red-night .seg-thumb{background:#3a0d0d;box-shadow:inset 0 0 0 1px rgba(255,80,80,.38)}
html.red-night .pl-moon i{background:linear-gradient(90deg,#ff5e5e calc(var(--p)*1%),#280707 calc(var(--p)*1%));box-shadow:0 0 0 1px rgba(255,80,80,.28)}
html.red-night .pl-spark{background:#0b0101;border-color:rgba(255,60,60,.24)}
html.red-night .pl-spark.scrubbing{border-color:#ff4d4d}
html.red-night .planner-dial{background:linear-gradient(180deg,rgba(45,6,6,.55),rgba(18,2,2,.8));border-color:rgba(255,60,60,.26)}
html.red-night .pl-dial-wheel-wrap{background:linear-gradient(180deg,#080000,#170303 50%,#080000);border-color:rgba(255,60,60,.25)}
html.red-night .pl-unit-btn.active{background:rgba(220,38,38,.30);border-color:#ff4b4b;color:#ff9e9e;box-shadow:0 0 10px rgba(255,50,50,.22)}
html.red-night .pl-year i{background:rgba(255,50,50,.08);color:rgba(255,90,90,.45)}
html.red-night .pl-year i.t1{background:rgba(220,38,38,.22);color:#ff9090}
html.red-night .pl-year i.t2{background:rgba(220,38,38,.42);color:#ffb0b0}
html.red-night .pl-year i.t3{background:rgba(239,68,68,.68);color:#1f0202}
html.red-night .pl-year i.t4{background:#ff4848;color:#1a0101}
html.red-night .pl-score{--sc-fg:#ff7878;--sc-bg:rgba(220,38,38,.18);--sc-line:rgba(255,75,75,.42)}
html.red-night .pl-chip{background:rgba(255,50,50,.10);border-color:rgba(255,70,70,.24);color:#ff7a7a}

/* Looks for the constellations (3.41) */
.cons-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin: 2px 0 8px; }
.cons-theme { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 10px; border-radius: 11px; border: 1px solid var(--line, rgba(255,255,255,.12)); background: rgba(255,255,255,.04); color: inherit; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.cons-theme i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--c) 0 28%, transparent 30%), conic-gradient(from 20deg, var(--c), transparent 35%, var(--c) 60%, transparent 85%); box-shadow: 0 0 8px -1px var(--c); opacity: .95; }
.cons-theme:hover { background: rgba(255,255,255,.08); }
.cons-theme.active { border-color: var(--accent, #5cc8ff); background: rgba(92,200,255,.14); box-shadow: 0 0 0 1px var(--accent, #5cc8ff) inset; }
/* 3.43: the scale bar choices sit like the corners they name: Off on the left, the two top corners above the two bottom ones */
#scaleBarGroup { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "off tl tr" "off bl br"; gap: 3px; height: auto; align-items: stretch; }
#scaleBarGroup .seg-btn { flex: none; height: auto; min-height: var(--ctl); padding: 4px 6px; white-space: normal; line-height: 1.15; text-align: center; }
#scaleBarGroup [data-sbar="off"] { grid-area: off; } #scaleBarGroup [data-sbar="tl"] { grid-area: tl; } #scaleBarGroup [data-sbar="tr"] { grid-area: tr; }
#scaleBarGroup [data-sbar="bl"] { grid-area: bl; } #scaleBarGroup [data-sbar="br"] { grid-area: br; }
#scaleBarGroup .seg-thumb { display: none; }

/* 3.41: the zoom-area picker never traps a swipe on a phone: a tap aims, holding still grabs the target */
@media (pointer: coarse) { #reelAimCanvas { touch-action: pan-y; } }
#reelAimCanvas.grabbed { border-color: var(--cyan, #5ed6ff); box-shadow: 0 0 0 2px rgba(94,214,255,.45); }

/* 3.41: a tab strip that is too narrow scrolls sideways instead of letting its labels run into each other */
.ann-tabs, .collage-subtabs { overflow-x: auto; scrollbar-width: none; }
.ann-tabs::-webkit-scrollbar, .collage-subtabs::-webkit-scrollbar { display: none; }
.ann-tabs .col-subtab-btn, .collage-subtabs .col-subtab-btn { min-width: min-content; padding-left: 6px; padding-right: 6px; }

/* ==========================================================================
   3.42 · drop-down lists, check boxes, full-screen (home-screen) app
   ========================================================================== */
select.sel-native { display: none !important; }
.sel-btn {
  -webkit-appearance: none; appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 0; height: var(--ctl); padding: 0 11px 0 13px; margin: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: linear-gradient(180deg, #0a0d13, var(--bg-0)); color: var(--text-1);
  font-family: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; outline: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.16s, box-shadow 0.16s, background-color 0.16s;
}
.sel-btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.22); }
.sel-btn:focus-visible, .sel-btn[aria-expanded="true"] { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.sel-btn:disabled { opacity: 0.45; cursor: default; }
.sel-btn-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn.is-placeholder .sel-btn-text { color: var(--text-3); }
.sel-btn-caret { flex: none; color: var(--text-3); transition: transform 0.2s var(--ease), color 0.2s; }
.sel-btn[aria-expanded="true"] .sel-btn-caret { transform: rotate(180deg); color: var(--accent); }
.star-solve-options .sel-btn { flex: 1; width: auto; max-width: 230px; }
.labeled-options .sel-btn { width: 100%; max-width: none; }
.moon-tap-row .sel-btn { flex: 1; min-width: 0; }
@media (pointer: coarse) { .sel-btn { font-size: 14px; } }

.sel-layer { position: fixed; inset: 0; z-index: 5000; }
.sel-layer[hidden] { display: none; }
.sel-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 10, 0); transition: background-color 0.2s; -webkit-tap-highlight-color: transparent; }
.sel-layer.is-sheet.is-open .sel-backdrop { background: rgba(3, 6, 10, 0.62); }
.sel-pop {
  position: absolute; display: flex; flex-direction: column; min-height: 0; overflow: hidden; outline: none;
  background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.03) inset; color: var(--text-1);
}
.sel-list { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.sel-head { display: none; }
.sel-item {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 38px; padding: 0 12px 0 14px;
  border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-1); cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.sel-item-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-item-check { flex: none; display: grid; place-items: center; width: 20px; height: 20px; color: var(--accent); opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.18s var(--ease); }
.sel-item.is-selected { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.sel-item.is-selected .sel-item-check { opacity: 1; transform: none; }
.sel-item.is-active:not(.is-selected) { background: var(--bg-4); }
.sel-item.is-placeholder .sel-item-text { color: var(--text-3); }
.sel-item.is-disabled { opacity: 0.38; cursor: default; }
.sel-group + .sel-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.sel-group-name { padding: 8px 14px 4px; color: var(--text-3); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sel-layer.is-pop .sel-pop { border-radius: 13px; opacity: 0; transform: translateY(-4px) scale(0.985); transform-origin: top center; transition: opacity 0.14s, transform 0.18s var(--ease); }
.sel-layer.is-pop .sel-pop.is-up { transform-origin: bottom center; transform: translateY(4px) scale(0.985); }
.sel-layer.is-pop.is-open .sel-pop { opacity: 1; transform: none; }
.sel-layer.is-sheet .sel-pop {
  left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: min(74dvh, 600px);
  border-radius: 20px 20px 0 0; border-bottom: 0; background: var(--bg-1);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 10px); transform: translateY(104%); transition: transform 0.26s var(--ease);
}
.sel-layer.is-sheet.is-open .sel-pop { transform: none; }
.sel-layer.is-sheet .sel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; position: relative; padding: 18px 10px 6px 20px; }
.sel-layer.is-sheet .sel-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--text-3); opacity: 0.6; }
.sel-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sel-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--bg-3); color: var(--text-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sel-x:active { background: var(--bg-4); color: var(--text-1); }
.sel-layer.is-sheet .sel-list { padding: 4px 12px 8px; }
.sel-layer.is-sheet .sel-item { min-height: 52px; padding: 0 14px 0 16px; border-radius: 12px; font-size: 15px; }
.sel-layer.is-sheet .sel-item + .sel-item { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .sel-pop, .sel-backdrop, .sel-item-check, .sel-btn-caret { transition: none !important; } }

/* check boxes: a real box, drawn by us, with room before the text */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center; width: 22px; height: 22px; margin: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.28); border-radius: 7px; background: var(--bg-0); cursor: pointer; vertical-align: middle;
  transition: background-color 0.16s, border-color 0.16s, box-shadow 0.16s;
}
input[type="checkbox"]::after {
  content: ""; width: 11px; height: 6px; margin-top: -2px; border-left: 2.6px solid var(--accent-ink); border-bottom: 2.6px solid var(--accent-ink);
  transform: rotate(-45deg) scale(0); transition: transform 0.16s var(--ease);
}
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:hover:not(:checked) { border-color: rgba(255, 255, 255, 0.5); }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1.5px var(--accent-line); }
input[type="checkbox"]:disabled { opacity: 0.4; cursor: default; }
.type-multi-panel { gap: 4px; padding: 8px; }
.star-solve-options .type-row, .type-row {
  display: grid; align-items: center; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 16px; min-height: 46px; padding: 6px 12px 6px 12px; border: 1px solid transparent; border-radius: 10px;
  transition: background-color 0.16s, border-color 0.16s;
}
.type-row:has(input:checked):not(.all) { background: var(--accent-soft); border-color: rgba(56, 189, 248, 0.22); }
.type-row.all { border-radius: 10px; border-bottom-color: var(--line); margin-bottom: 4px; }
.type-row input { width: 22px; height: 22px; }
.star-candidate { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 16px; min-height: 52px; padding: 8px 14px 8px 13px; }
.star-candidate input { width: 22px; height: 22px; }

/* home-screen app (iPhone "Add to Home Screen"): there is no browser bar, so the whole screen is ours.
   The picture and the options sheet already follow the full height; here the band kept for the home indicator is trimmed to what it really needs. */
html.is-standalone, html.is-standalone body { overscroll-behavior: none; -webkit-touch-callout: none; }
@media (max-width: 899px) and (orientation: portrait), (max-width: 639px) {
  html.is-standalone { --bot-pad: max(calc(env(safe-area-inset-bottom, 0px) - 18px), 10px); }
  html.is-standalone .sel-layer.is-sheet .sel-pop { padding-bottom: max(calc(env(safe-area-inset-bottom, 0px) - 8px), 10px); }
}

.planner-privacy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 4px; color: var(--text-3); font-size: 11px; line-height: 1.45; }
.planner-privacy .btn-pill { flex: none; }

/* 3.44: the header never wraps — language button stays on the first row on every phone */
@media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
  .top-bar { gap: 6px 5px; }
  .top-bar .brand { flex: 1 1 0; min-width: 24px; margin-right: 0; overflow: hidden; }
  .top-bar .brand span { overflow: hidden; text-overflow: ellipsis; }
  .lang-wrap { flex: none; }
  .lang-btn { width: auto; min-width: 0; padding: 0 9px; gap: 5px; }
  .lang-btn .chev { display: none; }
}
@media (max-width: 379px) and (orientation: portrait), (max-width: 379px) and (min-height: 541px) {
  .top-bar { padding-left: 8px; padding-right: 8px; }
  .top-bar .brand span { display: none; }
}

/* 3.44 / 3.45: Tonight's sky — the whole catalogue: search, five kinds, five sorts, five setup FOV presets */
.planner-find { width: 100%; }
#plTypeGroup, #plSortGroup, #plSetupGroup { display: grid; gap: 3px; height: auto; align-items: stretch; }
#plTypeGroup, #plSortGroup, #plSetupGroup { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#plTypeGroup .seg-btn, #plSortGroup .seg-btn, #plSetupGroup .seg-btn { flex: none; height: auto; min-height: var(--ctl, 36px); padding: 4px 3px; font-size: 11.5px; white-space: normal; line-height: 1.15; text-align: center; letter-spacing: 0; }
#plTypeGroup .seg-thumb, #plSortGroup .seg-thumb, #plSetupGroup .seg-thumb { display: none; }
.planner-count { min-height: 18px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.planner-more { width: 100%; height: var(--ctl, 40px); }
.planner-more[hidden] { display: none; }

/* 3.44 / 3.45: soft fade at the bottom of the Slicer while the options can still be scrolled (phones) */
.deck-fade { display: none; }
@media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
  .deck-fade {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
    background: linear-gradient(180deg, rgba(13, 17, 23, 0) 0%, rgba(13, 17, 23, 0.86) 72%, var(--bg-1) 100%);
  }
  .control-deck.deck-more .deck-fade { opacity: 1; }
}

/* ==========================================================================
   3.45 · GLOBAL USABILITY & VISUAL POLISH (Android, iOS, PC)
   - Native dark inputs (no white Firefox/Chrome date or number spinners)
   - Slicer natural flow + bottom-edge fade (never obscures Margin 6%)
   - Smooth GPU-friendly vertical deck resize & modal swipe-down sheets
   - Zenfone 8 / Firefox Android target list scroll fix (no nested scroll trap)
   - Zero text overlap across all 7 languages (IT, DE, ES, FR, EN, ZH, JA)
   - Refined surface depth, hover/focus polish & non-overlapping toasts
   ========================================================================== */
html { color-scheme: dark; }

/* Dark native inputs & polished focus states */
input[type="number"], input[type="date"], input[type="search"] {
  color-scheme: dark;
  user-select: text;
  -webkit-user-select: text;
}
.text-input, .sel-btn, .hex-input-pill {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.btn-icon, .btn-pill, .btn-sub-action {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.btn-primary-slice, .btn-primary-collage, .btn-reel-render, .btn-share-ios,
#btnApplyStarTargets, #btnExportAnnotatedFull, #btnFindStarTargets, #btnMoonApply, .btn-export {
  box-shadow: 0 8px 20px -8px rgba(56, 189, 248, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Prevent localized text from ever spilling out of segmented controls or colliding */
.seg-btn {
  overflow: hidden;
  text-overflow: ellipsis;
}
.slicer-export-row .seg-btn {
  padding: 0 5px;
  font-size: 11.5px;
}
.btn-sub-action {
  padding: 0 7px;
  gap: 5px;
  overflow: hidden;
}
.btn-sub-action span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast: clean placement that never covers status pills, focus button, or modal headers */
.toast {
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 120;
  transform: translateX(-50%) translateY(10px);
  background: rgba(16, 21, 30, 0.94);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Language menu polish (now exclusively in header) */
.lang-menu {
  background: rgba(20, 25, 34, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-color: rgba(255, 255, 255, 0.16);
}

/* Modal sheets: real swipe-down-to-close handle, smooth GPU transform & crisp surfaces */
.modal-backdrop {
  transition: background-color 0.2s ease, opacity 0.2s ease;
}
.sheet {
  position: relative;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sheet.is-sheet-dragging {
  transition: none !important;
  animation: none !important;
}
.sheet.is-sheet-settling {
  transition: transform 0.24s var(--ease) !important;
  animation: none !important;
}
.sheet.is-sheet-closing {
  transition: transform 0.2s cubic-bezier(0.32, 0, 0.67, 0), opacity 0.2s ease !important;
  animation: none !important;
}
.sheet::before {
  content: "";
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--text-3);
  opacity: 0.65;
  margin: 4px auto -2px;
  flex-shrink: 0;
  transition: background-color 0.18s, opacity 0.18s, width 0.18s;
}
.sheet.is-sheet-dragging::before {
  background: var(--accent);
  opacity: 1;
  width: 52px;
}
.sheet-header {
  cursor: grab;
  touch-action: none;
}
.sheet-header:active { cursor: grabbing; }
.sheet-header button { cursor: pointer; touch-action: manipulation; }

/* Tonight's Sky responsive polish (date never clips year, filter chips breathe) */
.planner-site { gap: 8px 10px; }
.planner-field { min-width: 148px; }
#plDate { min-width: 152px; }
#btnPlLocate { flex: 1 1 150px; justify-content: center; }
.planner-privacy { flex-wrap: wrap; }
#plTypeGroup .seg-btn { font-size: 11.5px; padding: 5px 2px; }

/* Sky mask sensitivity row */
.sky-mask-sens { margin-top: 2px; }
.sky-mask-sens .blur-bar-label { min-width: 0; font-size: 11.5px; }

/* Desktop: refined scrollbars, hover polish & crisp modals */
@media (min-width: 900px), (orientation: landscape) and (min-width: 640px) and (max-height: 540px) {
  .sheet-header { cursor: default; touch-action: auto; }
  .star-candidate-list {
    max-height: 300px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-4) transparent;
  }
  .star-candidate-list::-webkit-scrollbar { width: 5px; }
  .star-candidate-list::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
  .sheet {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-4) transparent;
  }
  .sheet::-webkit-scrollbar { width: 6px; }
  .sheet::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
  .toast {
    bottom: 84px;
    left: calc((100% - clamp(320px, 44vw, 420px)) / 2);
  }
  /* Narrow desktop/landscape segmented labels stay legible with zero clipping */
  #colBgStyleGroup .seg-btn { padding: 0 3px; font-size: 10.5px; }
  #colTextBgGroup .seg-btn, #colTextOrientGroup .seg-btn { padding: 0 4px; font-size: 11px; }
  #annStyleGroup .seg-btn, #annWeightGroup .seg-btn, #annLayoutGroup .seg-btn { padding: 0 4px; font-size: 11px; }
  #reelPanelOptics .seg-btn, #reelPanelFormat .seg-btn { padding: 0 4px; font-size: 10.5px; }
}
@media (min-width: 1440px) {
  .toast { left: calc((100% - 460px) / 2); }
}

/* Phones (portrait & narrow viewports): silky deck slider, Slicer natural scroll, Zenfone/Firefox target list fix */
@media (max-width: 899px) and (orientation: portrait), (max-width: 639px), (max-width: 899px) and (min-height: 541px) {
  /* Larger, easier-to-grab vertical drag handle on control-deck */
  .deck-grip {
    height: 32px;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .deck-grip::before {
    width: 46px;
    height: 5px;
    opacity: 0.72;
  }
  .control-deck {
    background: linear-gradient(180deg, #101620 0%, var(--bg-1) 36px);
    border-top: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.48);
  }
  .control-deck:not(.is-dragging) {
    transition: height 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Smooth filmstrip collapse (no abrupt 58px display:none jump mid-drag!) */
  .filmstrip-bar {
    transition: height 0.24s var(--ease), opacity 0.2s ease, border-color 0.24s;
  }
  html.deck-big .filmstrip-bar {
    display: flex;
    height: 0;
    opacity: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    pointer-events: none;
  }

  /* Slicer flows naturally from top to bottom; bottom-edge #deckFade indicates vertical scrollability */
  #slicerDeck {
    padding-bottom: max(var(--bot-pad), 26px);
  }
  #slicerDeck .primary-actions-row {
    position: static;
    bottom: auto;
    z-index: auto;
    margin-top: 0;
    padding: 0;
    background: none;
  }

  /* Zenfone 8 + Firefox Android fix: NO nested vertical scroll trap inside .ann-pane!
     Target list scrolls natively inside the single .ann-pane scroller with stable scroll anchoring. */
  .pane-track > .col-subpanel, .pane-track > .ann-pane {
    touch-action: pan-x pan-y;
    overflow-anchor: none;
    padding-bottom: 24px;
  }
  .star-candidate-list {
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  /* Collage > Borders backdrop row: wrap color wheel + HEX onto a clean second row on narrow phones so Blur/Black/White/Custom never clip */
  #colPanelStyle .deck-row:has(> #colBgStyleGroup) {
    flex-wrap: wrap;
  }
  #colPanelStyle .deck-row:has(> #colBgStyleGroup) > #colBgStyleGroup {
    flex: 1 0 100%;
  }
  #colPanelStyle .deck-row:has(> #colBgStyleGroup) > .hex-input-pill {
    flex: 1;
  }

  /* Compact segmented controls on narrow phones (360-390px) for Italian & long locales */
  .seg-btn { font-size: 11px; padding: 0 3px; }
  .slicer-export-row .seg-btn { font-size: 10.5px; padding: 0 3px; }
  #reelPanelOptics .seg-btn, #reelPanelFormat .seg-btn { font-size: 10px; padding: 0 3px; }
  #colTextBgGroup .seg-btn, #colTextOrientGroup .seg-btn { font-size: 10.5px; padding: 0 3px; }
  #annStyleGroup .seg-btn, #annWeightGroup .seg-btn, #annLayoutGroup .seg-btn { font-size: 10px; padding: 0 2px; }
  #plTypeGroup .seg-btn, #plSortGroup .seg-btn, #plSetupGroup .seg-btn { font-size: 10.5px; padding: 4px 2px; }
  .btn-sub-action { font-size: 11.5px; padding: 0 6px; gap: 4px; }
  .btn-sub-action svg.ico { width: 14px; height: 14px; }

  /* Place toast cleanly above the control deck on phones so it never blocks top HUD or modal headers */
  .toast {
    bottom: auto;
    top: calc(var(--hdr-h, 100px) + 48px);
  }
}

@media (max-width: 375px) {
  .slicer-export-row .blur-bar-label { min-width: 40px; font-size: 11.5px; }
  #plTypeGroup, #plSortGroup, #plSetupGroup { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-unit-btn { font-size: 13px; padding: 3px 4px; }
  .pl-unit-gap { width: 5px; }
  .planner-now-btn { padding: 0 7px; font-size: 10.5px; }
}

/* Multilingual text-fit polish (DE / ES / FR / IT / JA / ZH): prevent clipped labels in tight segmented buttons */
#reelFramingGroup .seg-btn { font-size: 10.5px; padding: 0 4px; white-space: normal; line-height: 1.1; text-align: center; }
#reelSpikesGroup .seg-btn { font-size: 10.5px; padding: 0 4px; white-space: normal; line-height: 1.1; text-align: center; }
#btnRevOrder { flex: 0 0 auto; padding: 0 7px; }
.ann-seg-sm .seg-btn { font-size: 10.5px; padding: 0 3px; }

/* ==========================================================================
   3.45 · DEDICATED SKY TONIGHT SECTION + INTERACTIVE 360° SKY MAP
   Observatory split layout on desktop (sticky map + wheel left, targets right)
   and compact thumb-first stack on mobile with expandable 360° planetarium.
   ========================================================================== */
html[data-mode="sky"] .control-deck,
html[data-mode="sky"] .filmstrip-bar,
html[data-mode="sky"] #btnStageFocus,
html[data-mode="sky"] #resBadge,
html[data-mode="sky"] #desktopShortcutsHint,
html[data-mode="sky"] #dropOverlay,
html[data-mode="sky"] #pinModeBanner,
html[data-mode="sky"] #moonTapBanner,
html[data-mode="sky"] .canvas-hud,
html[data-mode="sky"] #pinDock {
  display: none !important;
}
html[data-mode="sky"] .workspace {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  border-right: 0;
  background: var(--bg-0);
}
.sky-workspace-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.06), transparent 46%), var(--bg-0);
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
}
.sky-workspace-stage::-webkit-scrollbar { width: 6px; }
.sky-workspace-stage::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
.sky-stage-inner {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 12px calc(var(--bot-pad, 16px) + 28px);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.sky-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.sky-stage-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sky-stage-heading h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  line-height: 1.2;
}
.sky-stage-sub {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.3;
}
.sky-studio-layout {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}
.sky-obs-col, .sky-list-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}
.sky-panel-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.014));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 0;
}
.sky-panel-card .planner-field { min-width: 112px; }
.sky-only-row { min-height: 40px; padding: 4px 10px; }
.sky-hints { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.sky-hints .live-hint { margin: 0; }

/* 360° Interactive Sky Map Card */
.sky-map-card {
  padding: 10px;
  gap: 8px;
}
.sky-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.sky-map-mode {
  height: 32px;
  flex: 0 1 auto;
  min-width: 0;
}
.sky-map-mode .seg-btn {
  padding: 0 10px;
  font-size: 11.5px;
  white-space: nowrap;
}
.sky-map-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sky-map-mini-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-0);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sky-map-mini-btn:hover { color: var(--text-1); border-color: var(--line-2); }
.sky-map-mini-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}
.sky-map-wrap {
  position: relative;
  width: 100%;
  height: clamp(248px, 39dvh, 330px);
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #040814;
  transition: height 0.24s var(--ease);
}
.sky-map-card.is-expanded .sky-map-wrap {
  height: clamp(360px, 66dvh, 580px);
}
.sky-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.sky-map-canvas.dragging { cursor: grabbing; }
.sky-map-overlay-ctls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 4;
}
.sky-map-fab {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(7, 13, 25, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sky-map-fab:hover {
  background: rgba(20, 34, 58, 0.92);
  border-color: var(--accent-line);
  color: var(--accent);
}
.sky-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(4, 8, 18, 0.72);
  pointer-events: none;
}
.sky-map-empty[hidden] { display: none; }
.sky-map-wrap.is-pending .sky-map-canvas {
  filter: grayscale(0.92) brightness(0.48) blur(1.6px);
  transition: filter 0.16s ease;
}
.sky-map-canvas {
  transition: filter 0.22s ease;
}
.sky-map-pending {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 14, 22, 0.56);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  pointer-events: none;
}
.sky-map-pending[hidden] { display: none; }
.sky-map-pending-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  max-width: 280px;
  padding: 12px 18px;
  border-radius: 13px;
  background: rgba(15, 23, 38, 0.90);
  border: 1px solid rgba(148, 163, 184, 0.30);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
  text-align: center;
}
.sky-map-pending-card strong {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}
.sky-map-pending-card span {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.3;
}
.sky-map-pending-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.28);
  border-top-color: #5cc8ff;
  animation: skySpin 0.72s linear infinite;
  margin-bottom: 2px;
}
@keyframes skySpin {
  to { transform: rotate(360deg); }
}
html.red-night .sky-map-pending {
  background: rgba(16, 2, 2, 0.64);
}
html.red-night .sky-map-pending-card {
  background: rgba(28, 3, 3, 0.94);
  border-color: rgba(255, 72, 72, 0.36);
}
html.red-night .sky-map-pending-card strong { color: #ffb4b4; }
html.red-night .sky-map-pending-card span { color: rgba(255, 130, 130, 0.72); }
html.red-night .sky-map-pending-dot {
  border-color: rgba(255, 72, 72, 0.25);
  border-top-color: #ff4a4a;
}
.sky-map-hud {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 2px 0;
  min-width: 0;
}
.sky-map-hud-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.sky-map-hud-main strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sky-map-time-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #7dd3fc;
}
.sky-map-time-badge.is-scrub {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.48);
  color: #6ee7b7;
}
.sky-map-hud-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

/* Interactive target card selection */
.pl-row {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.pl-row:hover {
  border-color: rgba(125, 211, 252, 0.34);
}
.pl-row.is-selected {
  border-color: rgba(56, 189, 248, 0.72);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.10), rgba(56, 189, 248, 0.03));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.28) inset, 0 8px 24px -14px rgba(56, 189, 248, 0.55);
}
.pl-chip.az-chip {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.08);
}

@media (max-width: 380px) {
  .sky-map-mode .seg-btn { padding: 0 7px; font-size: 11px; }
  .sky-map-mini-btn { min-width: 28px; height: 28px; padding: 0 5px; font-size: 10.5px; }
}

@media (min-width: 900px), (orientation: landscape) and (min-width: 640px) and (max-height: 540px) {
  html[data-mode="sky"] .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
    grid-template-areas: "header" "stage";
  }
  html[data-mode="sky"] .toast {
    left: 50%;
    bottom: 24px;
  }
}
@media (min-width: 900px) {
  .sky-stage-inner { padding: 18px 24px 40px; gap: 13px; }
  .sky-stage-heading h1 { font-size: 20px; }
  .sky-panel-card { padding: 13px 14px; }
  .sky-map-card { padding: 11px 12px; }
}
@media (min-width: 1060px) {
  .sky-studio-layout {
    display: grid;
    grid-template-columns: minmax(410px, 46%) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
  .sky-obs-col {
    position: sticky;
    top: 14px;
  }
  .sky-map-wrap {
    height: clamp(275px, 41dvh, 410px);
  }
  .sky-map-card.is-expanded .sky-map-wrap {
    height: clamp(410px, 64dvh, 590px);
  }
}
@media (min-width: 1520px) {
  .sky-stage-inner { max-width: 1560px; }
  .sky-studio-layout {
    grid-template-columns: minmax(460px, 40%) minmax(0, 1fr);
  }
  .planner-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
  }
  .planner-list .pl-empty { grid-column: 1 / -1; }
}

/* Red-light night vision mode on dedicated Sky Tonight workspace & 360° Sky Map */
html.red-night .sky-workspace-stage {
  background: #050000;
}
html.red-night .sky-panel-card {
  background: linear-gradient(180deg, rgba(42, 5, 5, 0.48), rgba(16, 2, 2, 0.76));
  border-color: rgba(255, 60, 60, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 80, 80, 0.08);
}
html.red-night .sky-map-wrap {
  background: #070000;
  border-color: rgba(255, 60, 60, 0.28);
}
html.red-night .sky-map-fab {
  background: rgba(26, 2, 2, 0.84);
  border-color: rgba(255, 70, 70, 0.34);
  color: #ff9c9c;
}
html.red-night .sky-map-mini-btn.active {
  background: rgba(220, 38, 38, 0.26);
  border-color: #ef4444;
  color: #ff8a8a;
}
html.red-night .sky-map-time-badge {
  background: rgba(220, 38, 38, 0.24);
  border-color: rgba(255, 75, 75, 0.45);
  color: #ff9a9a;
}
html.red-night .pl-row {
  background: linear-gradient(180deg, rgba(40, 5, 5, 0.42), rgba(16, 2, 2, 0.68));
  border-color: rgba(255, 60, 60, 0.22);
}
html.red-night .pl-row.is-selected {
  border-color: #ff5555;
  background: linear-gradient(180deg, rgba(160, 20, 20, 0.28), rgba(60, 6, 6, 0.55));
  box-shadow: 0 0 0 1px rgba(255, 80, 80, 0.35) inset;
}

/* ==========================================================================
   3.46 · COLLAPSIBLE NIGHT SKY DRAWERS, DMS COORDS, RIG/MOSAIC, BORTLE/HORIZON,
          LUNAR TERMINATOR, NIGHT SESSION TIMELINE, FITS STF & REVEAL VIDEO
   ========================================================================== */
.sky-attached-dial {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sky-map-events {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.sky-map-events[hidden] { display: none; }
.sky-ev-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.36);
  color: #fde68a;
}

/* Collapsible Observatory Drawers */
.sky-drawer {
  padding: 0;
  overflow: hidden;
}
.sky-drawer > summary.sky-drawer-sum {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
}
.sky-drawer > summary.sky-drawer-sum::-webkit-details-marker { display: none; }
.sky-drawer > summary.sky-drawer-sum::after {
  content: '▾';
  font-size: 11px;
  color: var(--text-3);
  transition: transform 0.18s ease;
  flex: none;
}
.sky-drawer[open] > summary.sky-drawer-sum::after {
  transform: rotate(180deg);
}
.sky-drawer-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sky-drawer-chip {
  flex: 0 1 auto;
  max-width: 58%;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sky-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}
.sky-rig-drawer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

/* Coordinates Decimal & DMS (+/-) */
.sky-coord-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.sky-coord-fmt {
  height: 30px;
  flex: 0 1 auto;
}
.sky-coord-fmt .seg-btn {
  padding: 0 9px;
  font-size: 11px;
}
.planner-site-dms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.planner-site[hidden], .planner-site-dms[hidden], .sky-custom-rig-row[hidden] { display: none; }
.pl-dms-pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pl-dms-lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
}
.pl-dms-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.pl-dms-deg, .pl-dms-min {
  width: 100%;
  min-width: 0;
  flex: 1 1 0;
  text-align: center;
  font-family: var(--font-mono);
  padding: 6px 5px;
}
.pl-dms-unit {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  flex: none;
}
.pl-dms-hint {
  grid-column: 1 / -1;
  margin: 0;
}
.sky-site-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sky-site-actions .btn-pill { flex: 1 1 120px; justify-content: center; }

/* Bortle & Local Horizon */
.sky-subbox {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.sky-subbox .live-hint { margin: 0; }
.sky-hor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.sky-hor-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.sky-hor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.sky-hor-grid label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-0);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
}
.sky-hor-grid input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

/* Setup / Rig Grid & Mosaic Controls */
.sky-rig-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: auto !important;
  gap: 4px;
  padding: 4px;
}
.sky-rig-grid .seg-btn {
  min-height: 29px;
  padding: 4px 4px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sky-custom-rig {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sky-custom-rig[hidden] { display: none; }
.sky-custom-rig-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 7px;
}
.sky-mosaic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sky-mosaic-row[hidden] { display: none; }
.sky-mosaic-row .seg-group {
  height: 30px;
  flex: 0 1 auto;
}
.sky-mosaic-row .seg-btn { padding: 0 8px; font-size: 11px; }
.sky-pa-bar { flex: 1 1 130px; min-width: 120px; }
.sky-rig-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.35;
}

/* Lunar Terminator Panel */
.pl-term-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pl-term-ev {
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.13);
  border: 1px solid rgba(251, 191, 36, 0.38);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pl-term-ev strong { font-size: 12px; color: #fde68a; }
.pl-term-ev span { font-size: 11px; color: var(--text-2); }
.pl-term-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.pl-term-item {
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pl-term-item strong {
  font-size: 11.5px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-term-item span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

/* Multi-Target Night Session Planner */
.pl-session-canvas {
  width: 100%;
  height: 148px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #040814;
  display: block;
}
.pl-session-canvas[hidden] { display: none; }
.pl-session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pl-session-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.pl-session-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.pl-session-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pl-session-info strong { font-size: 12px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-session-info span { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.pl-session-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pl-session-actions[hidden] { display: none; }
.pl-night-btn {
  flex: none;
  padding: 2px 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pl-night-btn:hover { border-color: var(--accent-line); color: var(--text-1); }
.pl-night-btn.in-session {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.52);
  color: #6ee7b7;
}
.pl-chip.hor-blocked {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.14);
}

/* FITS STF Floating Banner */
.fits-stf-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 24px);
  padding: 5px 8px;
  border-radius: 12px;
  background: rgba(7, 13, 25, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.fits-stf-banner[hidden] { display: none; }
.fits-stf-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  color: #7dd3fc;
  padding: 0 4px;
  white-space: nowrap;
}
.fits-stf-modes {
  height: 26px;
  flex: 0 1 auto;
}
.fits-stf-modes .seg-btn {
  padding: 0 7px;
  font-size: 10.5px;
}

/* Slicer 2-col social row, Annotate Planets & Reveal Video */
.sub-actions-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.star-planets-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.star-planets-date {
  width: 100%;
  font-family: var(--font-mono);
}
.reveal-video-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-reveal-export {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.20), rgba(168, 85, 247, 0.20));
  border-color: rgba(125, 211, 252, 0.42);
  color: #e0f2fe;
}
.btn-reveal-export:disabled { opacity: 0.45; }

/* 2-row corner grids matching #scaleBarGroup so localized corner names never clip */
#wcsCompassGroup, #wcsInsetGroup {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "off tl tr" "off bl br";
  gap: 3px;
  height: auto;
  align-items: stretch;
}
#wcsCompassGroup .seg-btn, #wcsInsetGroup .seg-btn {
  flex: none;
  height: auto;
  min-height: var(--ctl);
  padding: 4px 6px;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}
#wcsCompassGroup .seg-btn:disabled, #wcsInsetGroup .seg-btn:disabled, #wcsGridGroup .seg-btn:disabled { opacity: 0.45; }
#wcsCompassGroup [data-wcomp="off"], #wcsInsetGroup [data-winset="off"] { grid-area: off; }
#wcsCompassGroup [data-wcomp="tl"],  #wcsInsetGroup [data-winset="tl"]  { grid-area: tl; }
#wcsCompassGroup [data-wcomp="tr"],  #wcsInsetGroup [data-winset="tr"]  { grid-area: tr; }
#wcsCompassGroup [data-wcomp="bl"],  #wcsInsetGroup [data-winset="bl"]  { grid-area: bl; }
#wcsCompassGroup [data-wcomp="br"],  #wcsInsetGroup [data-winset="br"]  { grid-area: br; }
#wcsCompassGroup .seg-thumb, #wcsInsetGroup .seg-thumb { display: none; }

@media (min-width: 900px) {
  .fits-stf-banner { top: 44px; }
}

/* Allow desktop sticky left column to scroll smoothly without shrinking open drawers */
@media (min-width: 1060px) {
  .sky-obs-col {
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-4) transparent;
  }
  .sky-obs-col > * {
    flex: 0 0 auto;
  }
}
@media (max-width: 440px) {
  .planner-site-dms { grid-template-columns: 1fr; }
  .sky-rig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-term-grid { grid-template-columns: 1fr; }
}

/* Red-light night vision accents for v3.46 drawers */
html.red-night .sky-drawer-chip,
html.red-night .sky-ev-pill,
html.red-night .pl-term-ev {
  background: rgba(200, 30, 30, 0.22);
  border-color: rgba(255, 80, 80, 0.44);
  color: #ff9c9c;
}
html.red-night .pl-term-ev strong { color: #ffb4b4; }
html.red-night .pl-night-btn.in-session {
  background: rgba(220, 40, 40, 0.26);
  border-color: #ff5555;
  color: #ffb4b4;
}
html.red-night .sky-attached-dial { border-top-color: rgba(255, 60, 60, 0.22); }
html.red-night .fits-stf-banner { background: rgba(22, 2, 2, 0.92); border-color: rgba(255, 70, 70, 0.42); }
html.red-night .fits-stf-tag { color: #ff8c8c; }

/* AZ / EQ sky map grid & mount orientation toggle */
#btnSkyMapGrid[data-grid="eq"] {
  background: rgba(251, 191, 36, 0.20);
  border-color: rgba(251, 191, 36, 0.52);
  color: #fde68a;
  font-weight: 800;
}
html.red-night #btnSkyMapGrid[data-grid="eq"] {
  background: rgba(220, 40, 40, 0.28);
  border-color: #ff6666;
  color: #ffb8b8;
}
#reelRevealStyleRow {
  margin-top: 2px;
}
.deck-row[hidden],
#reelRevealStyleRow[hidden],
#reelRotRow[hidden],
#reelRotHint[hidden],
.fits-stf-banner[hidden] {
  display: none !important;
}



/* ===== 3.47 ===== */
/* Local horizon: numbers dead-centre in their boxes (no number-spinner space, same line box for every cell) */
.sky-hor-grid label { align-items: center; justify-content: center; gap: 2px; padding: 6px 4px 5px; text-align: center; }
.sky-hor-grid label > span { display: block; width: 100%; text-align: center; line-height: 1; letter-spacing: .02em; }
.sky-hor-grid input {
  -webkit-appearance: none; -moz-appearance: textfield; appearance: textfield;
  display: block; box-sizing: border-box; width: 100%; min-width: 0; height: 20px; margin: 0; padding: 0;
  line-height: 20px; text-align: center; text-indent: 0; font-variant-numeric: tabular-nums;
}
.sky-hor-grid input::-webkit-outer-spin-button, .sky-hor-grid input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; display: none; }
@media (pointer: coarse) { .sky-hor-grid input { font-size: 16px; } }

/* altitude charts: key to the sky-phase ribbon */
.pl-phase-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; margin: 2px 2px 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.pl-phase-legend[hidden] { display: none; }
.pl-phase-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pl-phase-legend i { display: inline-block; width: 15px; height: 5px; border-radius: 3px; }
.pl-phase-legend .ph-civil { background: #fb923c; }
.pl-phase-legend .ph-naut { background: #818cf8; }
.pl-phase-legend .ph-astro { background: #5b56e6; }
.pl-phase-legend .ph-night { background: #1e293b; box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .38); }
html.red-night .pl-phase-legend .ph-civil { background: #ff8060; }
html.red-night .pl-phase-legend .ph-naut { background: #e65050; }
html.red-night .pl-phase-legend .ph-astro { background: #aa2828; }
html.red-night .pl-phase-legend .ph-night { background: #340a0a; box-shadow: inset 0 0 0 1px rgba(255, 110, 110, .35); }

/* 3.54 · the time zone of the site looks like the fields around it: in the column of a planner field the list kept flex:1 and shrank to the
   height of its text, and the label style of the field (small capitals) reached the text of the list */
.planner-field .sel-btn { flex: none; height: var(--ctl); }
.planner-field .sel-btn span { font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none; color: inherit; }
.planner-field .sel-btn .sel-btn-caret { color: var(--text-3); }
.planner-field .sel-btn[aria-expanded="true"] .sel-btn-caret { color: var(--accent); }
.planner-tz .live-hint { color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ==========================================================================
   3.55 · Meet the contributors
   ========================================================================== */
.contrib-card {
  position: relative; overflow: hidden; margin-top: 10px; padding: 14px 12px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: radial-gradient(120% 90% at 100% 0%, rgba(56, 189, 248, 0.10), transparent 55%),
              radial-gradient(90% 80% at 0% 100%, rgba(167, 139, 250, 0.10), transparent 60%), var(--bg-0);
}
/* a few faint stars behind the card */
.contrib-sky {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 70%, #cfe8ff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 46% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 63% 58%, #fde68a 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 30%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 90% 80%, #cfe8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 88%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 54% 92%, #fff 50%, transparent 51%);
}
.contrib-head { position: relative; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.contrib-spark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fde68a;
  background: radial-gradient(circle at 50% 45%, rgba(253, 230, 138, 0.22), rgba(253, 230, 138, 0.04) 70%); border: 1px solid rgba(253, 230, 138, 0.25); }
.contrib-spark svg { animation: contrib-twinkle 3.2s ease-in-out infinite; }
.contrib-titles { min-width: 0; }
.contrib-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-1); letter-spacing: 0.01em; }
.contrib-sub { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.contrib-grid { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.contrib-grid > li { min-width: 0; }
.contrib-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; padding: 14px 8px 12px; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  color: var(--text-1); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.contrib-item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c1) 45%, transparent); box-shadow: 0 10px 24px -14px var(--c1); }
.contrib-item:active { transform: translateY(0) scale(0.985); }
.contrib-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the avatar: initials inside a ring in the photographer's two colours */
.contrib-avatar { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 210deg, var(--c1), var(--c2), var(--c1)); box-shadow: 0 0 18px -6px var(--c1); }
.contrib-avatar > span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a2233, #07090d 75%); font-size: 16px; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; text-shadow: 0 0 10px color-mix(in srgb, var(--c1) 70%, transparent); }
.contrib-name { font-size: 13px; font-weight: 650; line-height: 1.25; color: var(--text-1); overflow-wrap: anywhere; }
.contrib-handle { display: inline-flex; align-items: center; justify-content: center; gap: 3px; max-width: 100%; min-width: 0; font-size: 11px; line-height: 1.3; color: var(--c1); }
.contrib-handle-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-handle svg { flex: none; opacity: 0.8; }
.contrib-note { position: relative; margin: 10px 2px 0; font-size: 11px; color: var(--text-3); text-align: center; }
@media (min-width: 560px) { .contrib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@keyframes contrib-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; } 50% { transform: scale(0.86) rotate(12deg); opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) { .contrib-spark svg { animation: none; } .contrib-item { transition: none; } .contrib-item:hover { transform: none; } }
/* red light: the cards keep the red of the rest of the page */
html.red-night .contrib-card { background: var(--bg-0); }
html.red-night .contrib-sky { opacity: 0.25; filter: grayscale(1) sepia(1) saturate(6) hue-rotate(-50deg); }
html.red-night .contrib-item { --c1: #ff4545 !important; --c2: #9e2f2f !important; }
html.red-night .contrib-spark { color: #ff5555; background: rgba(255, 59, 59, 0.12); border-color: rgba(255, 59, 59, 0.3); }
html.red-night .contrib-avatar > span { background: #110303; color: #ff6666; text-shadow: none; }

/* ==========================================================================
   3.57 · red light: the last pieces that stayed white, blue or green
   ========================================================================== */
/* sliders: the round knob and the empty part of the track */
html.red-night input[type="range"]::-webkit-slider-thumb { background: #ff5c5c; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.35); }
html.red-night input[type="range"]:active::-webkit-slider-thumb { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--accent-soft); }
html.red-night input[type="range"]::-moz-range-thumb { background: #ff5c5c; }
html.red-night input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--accent) 0, var(--accent) var(--fill), rgba(255, 70, 70, 0.18) var(--fill), rgba(255, 70, 70, 0.18) 100%);
}
html.red-night input[type="range"]::-moz-range-track { background: rgba(255, 70, 70, 0.18); }
/* the glow of the main buttons (Slice ×3, Export, Identify targets, Render…) */
html.red-night .btn-primary-slice, html.red-night .btn-primary-collage, html.red-night .btn-reel-render, html.red-night .btn-share-ios, html.red-night .btn-cine-reel,
html.red-night #btnApplyStarTargets, html.red-night #btnExportAnnotatedFull, html.red-night #btnFindStarTargets, html.red-night #btnMoonApply, html.red-night .btn-export {
  box-shadow: 0 8px 20px -8px rgba(255, 59, 59, 0.55), inset 0 1px 0 rgba(255, 140, 140, 0.22) !important;
}
html.red-night .btn-export:active, html.red-night .btn-export:hover { background: #ff6b6b !important; }
html.red-night .badge-count { background: rgba(255, 90, 90, 0.22) !important; color: var(--text-1) !important; }
/* chosen cards, linked styles, quality dot, toasts, deck edge */
html.red-night .ann-style-card.active, html.red-night .layout-card.active, html.red-night .preset-card.active, html.red-night .curve-card.active {
  box-shadow: inset 0 0 0 1px rgba(255, 70, 70, 0.25), 0 8px 22px -12px rgba(255, 59, 59, 0.55);
}
html.red-night .btn-sync-style.active::before { box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.22); }
html.red-night .q-dot { background: #ff4545; }
html.red-night .q-dot.warn { background: #9e2f2f; }
html.red-night .toast { border-color: var(--line-2) !important; }
html.red-night .control-deck, html.red-night footer.control-deck { border-top-color: var(--line) !important; }
html.red-night #reelAimCanvas { border-color: var(--line-2) !important; }
html.red-night .btn-reveal-export { color: var(--text-1) !important; border-color: var(--accent-line) !important; background: var(--accent-soft) !important; box-shadow: none !important; }
/* the colour pickers keep their shades, seen through red */
html.red-night .color-swatch, html.red-night .color-wheel-btn, html.red-night .hex-color-chip { filter: grayscale(1) sepia(1) saturate(5) hue-rotate(-50deg) brightness(0.8); }
/* check boxes */
html.red-night input[type="checkbox"] { border-color: rgba(255, 70, 70, 0.4); }
html.red-night input[type="checkbox"]:hover:not(:checked) { border-color: rgba(255, 90, 90, 0.6); }
html.red-night input[type="checkbox"]::after { border-left-color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
html.red-night .type-row.sky-only-row, html.red-night label.type-row { border-color: var(--accent-line) !important; }
/* the month strip of the target charts: the current month */
html.red-night .pl-year i.now-mo { box-shadow: 0 0 0 1.5px #ff6b6b inset, 0 0 8px rgba(255, 80, 80, 0.3); }

/* ==========================================================================
   3.57 · target cards that open: the chart and the month strip only when asked
   ========================================================================== */
.planner-count-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.planner-count-row .planner-count { min-width: 0; }
.pl-expand-all { flex: none; height: 30px; padding: 0 12px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.pl-expand-all[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pl-row { cursor: pointer; }
.pl-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.pl-foot em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); line-height: 1.35; min-width: 0; }
.pl-toggle { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text-2); font-size: 11px; font-weight: 600; }
.pl-toggle svg { transition: transform 0.2s ease; }
.pl-row.is-open .pl-toggle { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pl-row.is-open .pl-toggle svg { transform: rotate(180deg); }
.pl-more { display: none; flex-direction: column; gap: 8px; }
.pl-row.is-open .pl-more { display: flex; animation: pl-open 0.18s ease; }
.pl-map-btn { align-self: flex-end; font-size: 12px; }
@keyframes pl-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pl-row.is-open .pl-more { animation: none; } .pl-toggle svg { transition: none; } }
html.red-night .pl-toggle { background: rgba(255, 60, 60, 0.05); }

/* 3.57 · a target from J2000 coordinates */
.pl-coord-box { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.02); }
.pl-coord-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text-1); }
.pl-coord-sum::-webkit-details-marker { display: none; }
.pl-coord-sum svg { flex: none; color: var(--accent); }
.pl-coord-sum::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform 0.2s ease; }
.pl-coord-box[open] > .pl-coord-sum::after { transform: rotate(225deg); }
.pl-coord-body { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.pl-coord-pair { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-coord-pair .planner-field { flex: 1 1 120px; }
.pl-coord-body .text-input { width: 100%; font-variant-numeric: tabular-nums; }
.pl-coord-hint { margin: 0; font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); line-height: 1.45; }
.pl-coord-hint.is-ok { color: var(--accent); }
.pl-coord-hint.is-error { color: #fca5a5; }
html.red-night .pl-coord-hint.is-error { color: #ff8080; }
.pl-coord-add { align-self: flex-start; height: 34px; padding: 0 14px; font-weight: 600; }
.pl-del-btn { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-3); cursor: pointer; }
.pl-del-btn:hover { color: var(--text-1); border-color: var(--line-2); }

/* 3.65: empty state, drawn in the same style as the empty Collage boxes (dashed inner outline, accent "+" badge, short
   prompt). It is placed exactly on the preview it belongs to: the carousel frame in the Slicer, the picture frame in
   Annotate and the reel canvas in 3D Reel, so it is always centred on what is underneath. The whole area opens the picker. */
.empty-hint-wrap { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 6; display: none; align-items: center; justify-content: center; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.no-photo .empty-hint-wrap { display: flex; }
html.no-photo[data-mode="collage"] .empty-hint-wrap, html.no-photo[data-mode="sky"] .empty-hint-wrap { display: none; }
.eh-stack { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: calc(100% - 28px); box-sizing: border-box; transition: border-color 0.15s; }
/* Annotate and 3D Reel: the whole preview is shaded with the same gradient as an empty Collage box
   (the Slicer paints it on the canvas, under the slide dividers and numbers) */
.empty-hint-wrap::before { content: ''; position: absolute; inset: 1px; border-radius: inherit; background: linear-gradient(180deg, #131a26 0%, #0a0e15 100%); pointer-events: none; display: none; }
html[data-mode="annotate"] .empty-hint-wrap::before, html[data-mode="reel"] .empty-hint-wrap::before { display: block; }
html[data-mode="reel"] .empty-hint-wrap { border-radius: 10px; }
.eh-head { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.eh-plus { position: relative; width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--accent-soft, rgba(56, 189, 248, 0.12)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.eh-plus::before, .eh-plus::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 2px; margin: -1px 0 0 -10px; border-radius: 2px; background: var(--accent); }
.eh-plus::after { transform: rotate(90deg); }
.eh-title { font-size: 16px; font-weight: 600; line-height: 1.25; color: #E2E8F0; letter-spacing: 0.005em; }
.eh-btn { margin-top: 16px; flex: none; height: 36px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(56, 189, 248, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28); transition: filter 0.15s; }
.eh-btn:hover { filter: brightness(1.08); }
.eh-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eh-btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eh-alt { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.3; color: #7C8BA1; }
.eh-alt svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eh-alt-touch { display: none; }
@media (hover: none) { .eh-alt-hover { display: none; } .eh-alt-touch { display: inline-flex; } }
/* short previews (phones): badge and title on one line, smaller button */
.empty-hint-wrap.eh-compact .eh-head { flex-direction: row; gap: 9px; }
.empty-hint-wrap.eh-compact .eh-plus { width: 28px; height: 28px; }
.empty-hint-wrap.eh-compact .eh-plus::before, .empty-hint-wrap.eh-compact .eh-plus::after { width: 12px; margin-left: -6px; }
.empty-hint-wrap.eh-compact .eh-title { font-size: 14.5px; }
.empty-hint-wrap.eh-compact .eh-btn { margin-top: 10px; height: 32px; padding: 0 14px; font-size: 12.5px; }
.empty-hint-wrap.eh-compact .eh-alt { margin-top: 8px; font-size: 11px; }
.empty-hint-wrap.eh-tiny .eh-head, .empty-hint-wrap.eh-tiny .eh-alt { display: none !important; }
.empty-hint-wrap.eh-tiny .eh-btn { margin-top: 0; }
html.red-night .eh-btn { box-shadow: none; }
/* 3.64: labels that do not fit their button in the current language (desktop and tablet).
   1) the buttons of a segmented control share its width by label length instead of in equal parts,
   2) then the type gets a little smaller, 3) only as a last resort a label runs on two lines. */
.seg-group.seg-fit > .seg-btn { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; }
.seg-group.seg-tight > .seg-btn { font-size: 11.5px; letter-spacing: -0.01em; padding-left: 4px; padding-right: 4px; }
.seg-group.seg-wrap > .seg-btn { white-space: normal; line-height: 1.05; text-align: center; font-size: 11px; }
.btn-pill.lbl-tight, .btn-sub-action.lbl-tight, .hud-btn.lbl-tight { font-size: 11.5px; letter-spacing: -0.01em; padding-left: 6px; padding-right: 6px; }
.btn-pill.lbl-wrap, .btn-sub-action.lbl-wrap, .hud-btn.lbl-wrap { white-space: normal; line-height: 1.1; text-align: center; }
/* Collage: the background choice gets its own line, colour picker and hex field below it */
.deck-row.cbg-row { flex-wrap: wrap; }
.deck-row.cbg-row > #colBgStyleGroup { flex: 1 1 100%; }
.deck-row.cbg-row > .hex-input-pill { flex: 1 1 auto; }
/* Collage: font and text direction share a line only while both fit, otherwise the direction moves below */
.deck-row.cfont-row { flex-wrap: wrap; }
.deck-row.cfont-row > :not(#colTextOrientGroup) { flex: 1 1 250px; min-width: 0; }
.deck-row.cfont-row > #colTextOrientGroup { flex: 1 0 auto !important; }

/* 3.66: the import box is a card of its own, lifted off the shaded preview by a border, a soft shadow and a frosted blur
   (in the Slicer the slide dividers run on behind it, softened by the blur) */
.eh-stack { padding: 24px 34px 20px; border-radius: 16px; background: rgba(30, 38, 52, 0.52); -webkit-backdrop-filter: blur(16px) saturate(135%); backdrop-filter: blur(16px) saturate(135%); border: 1px solid rgba(255, 255, 255, 0.10); box-shadow: 0 26px 60px -22px rgba(0, 0, 0, 0.9), 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.empty-hint-wrap:hover .eh-stack { border-color: var(--accent-line, rgba(56, 189, 248, 0.45)); }
.workspace.drag-over .eh-stack { border-color: var(--accent); }
.empty-hint-wrap.eh-compact .eh-stack { border-radius: 12px; }
.empty-hint-wrap.eh-tiny .eh-stack { padding: 8px 10px; }
html.red-night .eh-stack { background: rgba(40, 10, 10, 0.5); border-color: rgba(255, 90, 90, 0.18); }
.empty-hint-wrap.eh-compact .eh-stack { padding: 10px 16px; }
.empty-hint-wrap.eh-compact .eh-btn { margin-top: 8px; height: 30px; }
.empty-hint-wrap.eh-compact .eh-alt { margin-top: 6px; font-size: 10.5px; }
.empty-hint-wrap.eh-tiny .eh-stack { padding: 8px 10px; }

/* 3.68: the card keeps one layout per device and is only scaled to fit the preview (no re-wrapping while the options
   sheet is dragged), then fades out when the preview gets too small for it */
.empty-hint-wrap { overflow: hidden; }
.eh-stack { max-width: none; white-space: nowrap; transform-origin: 50% 50%; transition: transform 0.14s ease-out, opacity 0.22s ease-out, border-color 0.15s; }
.eh-title, .eh-alt, .eh-alt span, .eh-btn { white-space: nowrap; }
.empty-hint-wrap.eh-gone { cursor: default; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .eh-stack { transition: none; } }
.eh-mini { position: absolute; left: 50%; top: 50%; --k: 1; transform: translate(-50%, -50%) scale(var(--k)); opacity: 0; pointer-events: none; height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(56, 189, 248, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28); transition: opacity 0.22s ease-out, transform 0.14s ease-out; }
.eh-mini svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html.red-night .eh-mini { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .eh-mini { transition: none; } }
.eh-stack.eh-off { opacity: 0; pointer-events: none; }
.eh-mini.eh-on { opacity: 1; pointer-events: auto; }

/* 3.69: Collage sections fold like the Night Sky drawers (workstation layout only; phones keep their tabs) */
@media (min-width: 900px), (orientation: landscape) and (min-width: 640px) and (max-height: 540px) {
  #collageDeck .col-subpanel { border: 1px solid var(--line); border-radius: 16px; padding: 0 12px 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.014)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
  #collageDeck .col-subpanel > .col-drawer-sum { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -12px; padding: 10px 12px; cursor: pointer; user-select: none; -webkit-user-select: none; font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text-1); border-radius: 16px; }
  #collageDeck .col-subpanel > .col-drawer-sum::after { content: '▾'; font-size: 11px; color: var(--text-3); transition: transform 0.18s ease; flex: none; }
  #collageDeck .col-subpanel:not(.is-folded) > .col-drawer-sum { border-bottom: 1px solid rgba(255, 255, 255, 0.06); border-radius: 16px 16px 0 0; margin-bottom: 2px; }
  #collageDeck .col-subpanel:not(.is-folded) > .col-drawer-sum::after { transform: rotate(180deg); }
  #collageDeck .col-subpanel > .col-drawer-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  #collageDeck .col-subpanel > .col-drawer-sum .sky-drawer-chip { margin-left: auto; }
  #collageDeck .col-subpanel.is-folded { padding-bottom: 0; gap: 0; }
  #collageDeck .col-subpanel.is-folded > :not(.col-drawer-sum) { display: none !important; }
}
.col-sync-row { justify-content: space-between; }
.btn-pill.col-rot-all { flex: none; gap: 6px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.btn-pill.col-rot-all .ico { width: 15px; height: 15px; }
.btn-pill.col-rot-all.is-on { color: var(--accent); border-color: var(--accent-line, rgba(56, 189, 248, 0.5)); }
.col-rot-sheet { max-width: 440px; }
.col-rot-q { margin: 0; color: var(--text-2); font-size: 13px; }
.col-rot-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col-rot-choice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-1); font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.col-rot-choice:hover, .col-rot-choice:focus-visible { border-color: var(--accent); outline: none; background: rgba(56, 189, 248, 0.06); }
.col-rot-choice svg { width: 56px; height: 42px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.col-rot-t { font-size: 13px; font-weight: 700; }
.col-rot-d { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
@media (max-width: 420px) { .col-rot-choices { grid-template-columns: 1fr; } }

/* 3.70: red light for the start-up prompt and the empty previews */
html.red-night .eh-title { color: var(--text-1); }
html.red-night .eh-alt { color: var(--text-3); }
html.red-night .empty-hint-wrap::before { background: linear-gradient(180deg, #170404 0%, #0a0202 100%); }
html.red-night .eh-stack { background: rgba(40, 8, 8, 0.55); border-color: rgba(255, 80, 80, 0.2); box-shadow: 0 26px 60px -22px rgba(0, 0, 0, 0.9); }
html.red-night .col-rot-choice:hover, html.red-night .col-rot-choice:focus-visible { background: rgba(255, 59, 59, 0.08); }
html.red-night .cons-theme i { --c: #ff5a5a !important; }

/* 3.70: flags beside each language; the list scrolls when the screen is short */
.lang-menu { max-height: min(520px, calc(100vh - 84px)); max-height: min(520px, calc(100dvh - 84px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lang-flag { position: relative; flex: none; width: 21px; height: 14px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); background: #222; }
.lang-flag svg { display: block; width: 100%; height: 100%; }
.lang-item .lang-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.red-night .lang-flag { box-shadow: 0 0 0 1px rgba(255, 70, 70, 0.3); }
html.red-night .lang-flag svg { filter: grayscale(1) brightness(0.9) contrast(1.05); }
html.red-night .lang-flag::after { content: ""; position: absolute; inset: 0; background: #ff3b3b; mix-blend-mode: multiply; }
.seg-group.seg-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; justify-content: flex-start; }
.seg-group.seg-scroll::-webkit-scrollbar { display: none; }
.seg-group.seg-scroll > .seg-btn { flex: 0 0 auto; white-space: nowrap; }
#plTypeGroup.seg-scroll, #plSortGroup.seg-scroll, #plSetupGroup.seg-scroll { display: flex; flex-wrap: wrap; overflow: visible; }
#plTypeGroup.seg-scroll > .seg-btn, #plSortGroup.seg-scroll > .seg-btn, #plSetupGroup.seg-scroll > .seg-btn { flex: 1 1 auto; padding-left: 8px; padding-right: 8px; }
/* 3.72: written in capitals already, so the micro sign stays µ (upper-casing turns it into Greek M and reads as MM) */
.planner-field span.case-kept { text-transform: none; }
/* 3.72: the card of a target picked on the sky map */
.pl-row.pl-picked { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset; }
.pl-picked-tag { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.pl-picked-x { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.pl-picked-x:hover { color: var(--text-1); background: var(--bg-3); }
.planner-list .pl-row { scroll-margin: 14px 0; }
.pl-row.pl-map-pick { margin: 10px 0 12px; scroll-margin: 12px 0; }

/* 3.76: support the app (PayPal donations) */
.donate-card { position: relative; margin-top: 14px; padding: 14px 14px 12px; border-radius: 16px; border: 1px solid var(--line-2); background: linear-gradient(160deg, rgba(244, 114, 182, 0.08), rgba(56, 189, 248, 0.05) 60%, transparent), var(--bg-1); }
.field-row > .donate-card { margin-top: 0; }
.donate-head { display: flex; gap: 12px; align-items: flex-start; }
.donate-heart { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #f472b6; background: rgba(244, 114, 182, 0.12); border: 1px solid rgba(244, 114, 182, 0.28); }
.donate-titles { min-width: 0; }
.donate-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-1); letter-spacing: 0.01em; }
.donate-sub { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.donate-btn { width: 100%; justify-content: center; margin-top: 12px; }
.donate-note { margin: 7px 0 0; font-size: 11px; color: var(--text-3); text-align: center; }
html.red-night .donate-card { background: var(--bg-1); }
html.red-night .donate-heart { color: var(--accent); background: transparent; border-color: var(--line-2); }

/* 3.77: search field: a round clear button, and "Did you mean" suggestions */
.pl-find-wrap { position: relative; }
.pl-find-wrap .planner-find { padding-right: 40px; }
.planner-find::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.pl-find-clear { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; }
.pl-find-clear[hidden] { display: none; }
.pl-find-clear:hover, .pl-find-clear:focus-visible { color: var(--text-1); }
.pl-suggest { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin: 10px 2px 4px; }
.pl-suggest-lbl { font-size: 12.5px; color: var(--text-2); }
.pl-sugg { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent-line); background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 100%; }
.pl-sugg small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.pl-sugg:hover, .pl-sugg:focus-visible { background: var(--bg-3); }

/* 3.78: Play the night */
.sky-map-play .ico-pause { display: none; }
.sky-map-play.is-playing .ico-play { display: none; }
.sky-map-play.is-playing .ico-pause { display: block; }
.sky-map-play.is-playing { border-color: var(--accent-line); color: var(--accent); }

/* 3.79: one more map button (constellation borders). The view buttons keep their labels on one line: where the row is too narrow the
   small buttons move to a second row. On a phone the two rows are laid out on purpose: the view switch across the width, then the
   small buttons spread evenly under it (bigger to tap) */
.sky-map-toolbar { flex-wrap: wrap; row-gap: 6px; }
.sky-map-mode { flex: 0 0 auto; }
.sky-map-toggles { margin-left: auto; }
@media (max-width: 440px) {
  .sky-map-mode { flex: 1 1 100%; display: flex; }
  .sky-map-mode .seg-btn { flex: 1 1 0; }
  .sky-map-toggles { flex: 1 1 100%; margin-left: 0; gap: 5px; }
  .sky-map-mini-btn { flex: 1 1 0; min-width: 0; height: 30px; padding: 0 2px; }
}

/* 3.80: a long press on the previews (to lift a box and swap it) must not open the iOS image callout */
#editorCanvas, #collageCanvas { -webkit-touch-callout: none; }
