/* Generated from allsky/index.html for the Shadow DOM block on /{lang}/allsky (app/views/allsky.php). */

  :host {
    display: block;
    --cyan: #00ddff;
    --neon: #00ff99;
    --neon-dim: rgba(0, 255, 153, 0.55);
    --cyan-dim: rgba(0, 221, 255, 0.5);
    --text: #e8eef5;
    --text-dim: #8b93a7;
    --text-faint: #5a6378;
    --panel: rgba(8, 16, 22, 0.72);
    --panel-header: rgba(0, 0, 0, 0.4);
    --border: rgba(0, 221, 170, 0.18);
    --border-strong: rgba(0, 221, 255, 0.4);
  }

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

  .as-root {
    background: transparent;
    color: var(--text);
    font-family: 'Saira', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }

  /* Background layers — same vibe as the deepskyunity.com landing */
  .bg-gradient {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at center, #001824 0%, #000810 50%, #000000 100%);
    z-index: -3;
  }
  .bg-grid {
    position: fixed; inset: 0;
    background-image:
      linear-gradient(rgba(0, 221, 170, 0.08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 221, 170, 0.08) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: -2;
    pointer-events: none;
  }
  .bg-stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
  .star { position: absolute; background: white; border-radius: 50%; }

  .mono { font-family: 'JetBrains Mono', monospace; }

  .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 48px;
    position: relative;
  }

  /* HEADER */
  header.site {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
  }
  .brand {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    text-decoration: none;
    color: inherit;
    transition: filter 0.2s ease;
  }
  .brand:hover { filter: brightness(1.15); }
  .brand:hover .brand-back { transform: translateX(-3px); opacity: 1; color: var(--neon); }
  .brand-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border);
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1;
    opacity: 0.65;
    transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
    align-self: center;
    border-radius: 2px;
  }
  .brand:hover .brand-back { border-color: var(--neon); }
  .brand .name {
    font-family: 'Saira', sans-serif;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 5px;
    color: var(--cyan);
    text-shadow: 0 0 12px rgba(0, 221, 255, 0.35);
  }
  .brand .sep { color: var(--text-faint); font-size: 18px; font-weight: 300; }
  .brand .section {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--neon);
    text-shadow: 0 0 8px rgba(0, 255, 153, 0.4);
    text-transform: uppercase;
  }

  .meta {
    display: flex;
    gap: 22px;
    font-size: 12px;
    color: var(--text-dim);
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
  }
  .live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--neon);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
  }
  .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 8px var(--neon);
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 153, 0.6); }
    50%      { opacity: 0.55; box-shadow: 0 0 0 7px rgba(0, 255, 153, 0); }
  }

  /* DATE BAR — controls keogram/star trails/timelapse target night */
  .date-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    margin-bottom: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    backdrop-filter: blur(2px);
    flex-wrap: wrap;
  }
  .date-bar .label {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    color: var(--cyan);
    text-transform: uppercase;
    margin-right: 4px;
  }
  .date-bar .spacer { flex: 1; min-width: 0; }
  .date-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 6px 10px;
    letter-spacing: 0.05em;
    outline: none;
    color-scheme: dark;
    transition: border-color 0.2s, box-shadow 0.2s;
    border-radius: 2px;
    min-width: 150px;
  }
  .date-input:hover, .date-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0, 221, 255, 0.18);
  }
  .date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) saturate(6) hue-rotate(150deg);
    cursor: pointer;
    opacity: 0.85;
  }
  .date-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--cyan);
    width: 30px;
    height: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s;
    border-radius: 2px;
  }
  .date-btn:hover:not(:disabled) {
    border-color: var(--cyan);
    background: rgba(0, 221, 255, 0.08);
    box-shadow: 0 0 10px rgba(0, 221, 255, 0.3);
  }
  .date-btn:disabled { opacity: 0.3; cursor: not-allowed; }
  .date-latest {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 7px 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 2px;
  }
  .date-latest:hover { color: var(--neon); border-color: var(--neon-dim); }
  .date-latest.active {
    color: var(--neon);
    border-color: var(--neon-dim);
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.18);
  }
  .date-latest.active::before {
    content: '●';
    color: var(--neon);
    margin-right: 6px;
    font-size: 8px;
    vertical-align: middle;
    text-shadow: 0 0 6px var(--neon);
  }

  /* GRID — equal 2x2 squares */
  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  @media (max-width: 720px) {
    .grid { grid-template-columns: 1fr; }
  }

  /* Forecast card — fixed 1000px, centered below the 2x2 grid */
  .forecast {
    margin: 18px auto 0;
    max-width: 1000px;
    width: 100%;
  }
  .forecast .card-body {
    aspect-ratio: auto;
    padding: 0;
    background: #000;
  }
  .forecast iframe {
    display: block;
    width: 100%;
    height: 700px;
    border: 0;
  }

  /* Seeing card — 520x736, centered above the meteogram */
  .seeing {
    margin: 18px auto 0;
    max-width: 520px;
    width: 100%;
  }
  .seeing .card-body {
    aspect-ratio: auto;
    padding: 0;
    background: #000;
  }
  .seeing iframe {
    display: block;
    width: 100%;
    height: 736px;
    border: 0;
  }
  .forecast-attrib {
    padding: 6px 16px;
    border-top: 1px solid var(--border);
    background: var(--panel-header);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: right;
  }
  .forecast-attrib a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
  }
  .forecast-attrib a:hover {
    color: var(--cyan);
    text-shadow: 0 0 8px rgba(0, 221, 255, 0.5);
  }

  .card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(2px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  }
  .card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 0 24px rgba(0, 221, 255, 0.10);
  }

  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-header);
  }
  .card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--cyan);
    text-transform: uppercase;
  }
  .card-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-faint);
  }

  .card-body {
    position: relative;
    background: #000;
    flex: 1;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .card-body img,
  .card-body video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  .card-body.zoomable { cursor: zoom-in; }

  /* ============================================================
     SKY OVERLAY — constellation lines drawn on a canvas laid over
     the live frame. The JPEG itself is never touched, so this is a
     real toggle rather than something burnt into the image.
     ============================================================ */
  .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .sky-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 4px 9px;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    transition: all 0.2s;
  }
  .sky-toggle:hover { color: var(--cyan); border-color: var(--cyan-dim); }
  .sky-toggle.active {
    color: var(--cyan);
    border-color: var(--cyan-dim);
    background: rgba(0, 221, 255, 0.06);
    box-shadow: 0 0 10px rgba(0, 221, 255, 0.18);
  }
  .sky-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
  }
  .sky-canvas[hidden] { display: none; }

  /* Calibration panel — only injected on ?cal=1 or Shift+C */
  .cal-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 300;
    width: 268px;
    background: rgba(4, 10, 14, 0.94);
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    padding: 12px 14px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
  }
  .cal-panel h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 4px;
  }
  .cal-panel .cal-hint { font-size: 9.5px; color: var(--text-faint); line-height: 1.4; margin-bottom: 10px; }
  .cal-row { display: grid; grid-template-columns: 40px 1fr 52px; align-items: center; gap: 7px; margin-bottom: 5px; }
  .cal-row label { color: var(--text-faint); }
  .cal-row input[type=range] { width: 100%; accent-color: var(--cyan); height: 14px; }
  .cal-row input[type=number], .cal-panel select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    width: 100%;
    color-scheme: dark;
  }
  .cal-btns { display: flex; gap: 6px; margin: 10px 0 8px; flex-wrap: wrap; }
  .cal-btns button {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    padding: 5px 6px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .cal-btns button:hover { border-color: var(--cyan); background: rgba(0, 221, 255, 0.08); }
  .cal-panel textarea {
    width: 100%;
    height: 92px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--border);
    color: var(--neon);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    line-height: 1.45;
    padding: 6px;
    border-radius: 2px;
    resize: vertical;
    white-space: pre-wrap;
    word-break: break-all;
  }

  /* ============================================================
     TIMELAPSE HOVER-SCRUBBER
     Move the mouse across the Timelapse card → flip through the
     night's individual frames (images/YYYYMMDD/*.jpg via frames.json).
     Works even before the timelapse mp4 exists. Click → play the mp4.
     ============================================================ */
  .card-body img.scrub-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;              /* JS toggles inline display; overlays the video */
    z-index: 2;
    background: #000;
    pointer-events: none;       /* let mouse events reach .card-body */
    -webkit-user-drag: none;
    user-select: none;
  }
  .timelapse-card .card-body.scrubbable {
    cursor: ew-resize;
    touch-action: pan-y;   /* horizontal swipe scrubs; vertical stays native page-scroll */
  }

  .scrub-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 6;
    pointer-events: none;
  }
  .card-body.scrubbable:hover .scrub-bar { opacity: 1; }
  .scrub-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
  }
  .scrub-hint {
    position: absolute;
    left: 12px; top: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 3px 7px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 6;
  }
  .card-body.scrubbable:hover .scrub-hint { opacity: 0.9; transform: translateY(0); }

  /* Touch devices have no hover — keep the scrub affordances always visible */
  @media (hover: none) {
    .card-body.scrubbable .scrub-bar  { opacity: 1; }
    .card-body.scrubbable .scrub-hint { opacity: 0.9; transform: translateY(0); }
  }

  /* Viewfinder corner brackets — fade in on hover, HUD/instrument cue */
  .card-body.zoomable::before {
    content: '';
    position: absolute;
    inset: 8px;
    background:
      linear-gradient(var(--cyan), var(--cyan)) top    left  / 14px 1px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top    left  / 1px 14px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top    right / 14px 1px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top    right / 1px 14px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom left  / 14px 1px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom left  / 1px 14px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom right / 14px 1px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom right / 1px 14px no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease, inset 0.3s ease;
    pointer-events: none;
    z-index: 4;
  }
  .card-body.zoomable:hover::before {
    opacity: 0.75;
    inset: 6px;
  }

  /* Expand glyph — appears top-right on hover */
  .expand-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    color: var(--cyan);
    opacity: 0;
    transform: translate(2px, -2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 5;
    filter: drop-shadow(0 0 4px rgba(0, 221, 255, 0.5));
  }
  .card-body.zoomable:hover .expand-hint {
    opacity: 0.85;
    transform: translate(0, 0);
  }
  .expand-hint svg { width: 100%; height: 100%; }

  .placeholder {
    color: var(--text-faint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 40px 20px;
    text-align: center;
    line-height: 1.7;
  }
  .placeholder .label {
    color: var(--neon);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 10px;
    display: block;
    margin-bottom: 8px;
    text-shadow: 0 0 6px rgba(0, 255, 153, 0.4);
  }

  /* FOOTER */
  footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-faint);
    flex-wrap: wrap;
    gap: 8px;
  }
  footer a { color: var(--text-dim); text-decoration: none; transition: color 0.2s, text-shadow 0.2s; }
  footer a:hover { color: var(--cyan); text-shadow: 0 0 8px rgba(0, 221, 255, 0.5); }

  /* ============================================================
     LIGHTBOX
     ============================================================ */
  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: lbFadeIn 0.18s ease;
  }
  .lightbox[hidden] { display: none; }

  .lightbox-backdrop {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse at center, rgba(0, 24, 36, 0.85) 0%, rgba(0, 4, 8, 0.96) 70%),
      rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: zoom-out;
  }

  .lightbox-frame {
    position: relative;
    max-width: min(96vw, 1600px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: rgba(8, 16, 22, 0.85);
    border: 1px solid var(--border-strong);
    box-shadow:
      0 0 40px rgba(0, 221, 255, 0.18),
      0 0 120px rgba(0, 221, 255, 0.08),
      inset 0 0 0 1px rgba(0, 0, 0, 0.4);
    animation: lbScale 0.28s cubic-bezier(0.18, 0.9, 0.3, 1);
  }

  /* Larger viewfinder brackets framing the lightbox */
  .lightbox-frame::before {
    content: '';
    position: absolute;
    inset: -8px;
    background:
      linear-gradient(var(--cyan), var(--cyan)) top    left  / 28px 2px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top    left  / 2px 28px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top    right / 28px 2px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top    right / 2px 28px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom left  / 28px 2px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom left  / 2px 28px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom right / 28px 2px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom right / 2px 28px no-repeat;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(0, 221, 255, 0.6));
  }

  .lightbox-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.55);
    flex-wrap: wrap;
  }
  .lightbox-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--cyan);
    text-transform: uppercase;
  }
  .lightbox-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    flex: 1;
  }
  .lightbox-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--cyan);
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s;
    border-radius: 2px;
  }
  .lightbox-close svg { width: 12px; height: 12px; }
  .lightbox-close:hover {
    border-color: var(--cyan);
    background: rgba(0, 221, 255, 0.08);
    box-shadow: 0 0 12px rgba(0, 221, 255, 0.4);
  }

  .lightbox-body {
    position: relative;          /* anchors the sky-overlay canvas */
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
  }
  .lightbox-body img,
  .lightbox-body video {
    max-width: 100%;
    max-height: calc(92vh - 88px);
    display: block;
    object-fit: contain;
  }

  .lightbox-footer {
    padding: 8px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.45);
    text-align: center;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }
  .lightbox-footer kbd {
    font-family: 'JetBrains Mono', monospace;
    color: var(--cyan);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1px 5px;
    margin: 0 2px;
  }

  @keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes lbScale {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
  }

  
