/* Compact, page-scoped hierarchy for the Tonight shooting brief.
   共通カラートークン（--shoot-*）は static/shoot/theme.css の :root が持つ。
   ここで再定義しないこと（同じ値の二重管理はドリフトの原因になる）。
   このブロックに残すのは、この画面だけが使う間隔・文字サイズのスケールに限る。 */
body.shoot-tonight-page {
    --tonight-space-1: 4px;
    --tonight-space-2: 8px;
    --tonight-space-3: 12px;
    --tonight-space-4: 16px;
    --tonight-space-5: 20px;
    --tonight-space-6: 24px;
    --tonight-type-xs: 11px;
    --tonight-type-sm: 12px;
    --tonight-type-md: 14px;
    --tonight-type-lg: 16px;
    --tonight-type-xl: clamp(20px, 4vw, 24px);
    color: var(--shoot-text);
}

body.shoot-tonight-page main.container { width: 100%; max-width: none; margin: 0 !important; padding: 0; }
body.shoot-tonight-page .tonight-shell { width: min(100% - 32px, 860px); margin: 0 auto; padding: var(--tonight-space-6) 0 calc(84px + env(safe-area-inset-bottom, 0px)); }

.tonight-page-header, .tonight-card-topline, .tonight-section-heading, .tonight-list-heading,
.tonight-comparison-row, .tonight-quick-links, .tonight-condition-row, .tonight-meta-row { display: flex; align-items: center; }
.tonight-page-header { margin: 0 0 var(--tonight-space-4); }
.tonight-page-header h1 { margin: 0; color: var(--shoot-text); font-size: var(--tonight-type-xl); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.tonight-card, .shoot-skeleton-card.tonight-skeleton { background: var(--shoot-surface); border: 1px solid var(--shoot-line); border-radius: var(--shoot-radius-card); box-shadow: var(--shoot-card-shadow); backdrop-filter: var(--shoot-blur); }
.tonight-primary-card, .tonight-mini-chart-card, .tonight-comparison-section, .tonight-quick-links,
.shoot-cloud-section, #tonightMiniChartSkeleton, #tonightCloudSkeleton { margin: 0 0 var(--tonight-space-4); }
.tonight-primary-card { padding: var(--tonight-space-4); }
.tonight-card-topline { justify-content: space-between; gap: var(--tonight-space-3); margin-bottom: var(--tonight-space-3); }
.tonight-card-topline p { margin: 0; color: var(--shoot-text); font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; }
.tonight-card-topline span { color: var(--shoot-text-faint); font-size: var(--tonight-type-xs); font-weight: 500; line-height: 1.35; text-align: right; white-space: nowrap; }

.tonight-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--tonight-space-2); align-items: center; margin-bottom: var(--tonight-space-3); }
.tonight-point-control, .tonight-target-nav { min-width: 0; }
.tonight-target-nav { position: relative; }
.tonight-point-control { position: relative; display: flex; align-items: center; min-height: 44px; color: var(--shoot-text); background: var(--shoot-surface-strong); border: 1px solid var(--shoot-line-strong); border-radius: var(--shoot-radius-pill); }
.tonight-control-icon { position: absolute; left: var(--tonight-space-3); z-index: 1; color: var(--shoot-accent); font-size: var(--tonight-type-md); pointer-events: none; }
.tonight-control-chevron { position: absolute; right: var(--tonight-space-3); z-index: 1; color: var(--shoot-text-dim); font-size: var(--tonight-type-sm); pointer-events: none; }
.tonight-point-control select { width: 100%; min-width: 0; min-height: 44px; padding: 0 30px 0 32px; overflow: hidden; appearance: none; color: var(--shoot-text); font: inherit; font-size: var(--tonight-type-md); font-weight: 650; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; background: transparent; border: 0; border-radius: inherit; }
.tonight-target-toggle { display: flex; align-items: center; gap: var(--tonight-space-2); width: 100%; min-height: 44px; padding: 0 var(--tonight-space-3); overflow: hidden; color: var(--shoot-text); font: inherit; font-size: var(--tonight-type-md); font-weight: 650; line-height: 1.5; background: var(--shoot-surface-strong); border: 1px solid var(--shoot-line-strong); border-radius: var(--shoot-radius-pill); }
.tonight-target-toggle > span:first-child { color: var(--shoot-accent-2); }
.tonight-target-toggle #tonightTargetValue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tonight-target-toggle .tonight-control-chevron { position: static; margin-left: auto; }
.tonight-target-nav [role="tablist"] { position: absolute; top: calc(100% + var(--tonight-space-1)); right: 0; z-index: 20; display: none; gap: var(--tonight-space-1); width: min(330px, calc(100vw - 48px)); min-height: 44px; padding: 0; overflow-x: auto; scrollbar-width: none; background: var(--shoot-surface-solid); border: 1px solid var(--shoot-line-strong); border-radius: var(--shoot-radius-pill); box-shadow: var(--shoot-card-shadow); }
.tonight-target-nav [role="tablist"].is-open { display: flex; }
.tonight-target-nav [role="tablist"]::-webkit-scrollbar { display: none; }
.tonight-target-nav button { flex: 1 0 auto; min-height: 44px; padding: 0 var(--tonight-space-2); color: var(--shoot-text-dim); font: inherit; font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; white-space: nowrap; background: transparent; border: 0; border-radius: var(--shoot-radius-pill); }
.tonight-target-nav button.active { color: var(--shoot-accent); font-weight: 650; background: var(--shoot-accent-soft); box-shadow: inset 0 0 0 1px var(--shoot-accent-line); }
.tonight-location-status { grid-column: 1 / -1; margin: 0; color: var(--shoot-text-faint); font-size: var(--tonight-type-xs); font-weight: 500; line-height: 1.35; }
.tonight-location-status:empty { display: none; }
.tonight-location-status[data-state="offline"], .tonight-location-status[data-state="error"] { color: var(--shoot-warn); }
.tonight-loading { color: var(--shoot-text-dim); font-size: var(--tonight-type-md); line-height: 1.5; }
.tonight-skeleton { margin-bottom: 0; }

.tonight-decision-band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--tonight-space-3); align-items: center; padding: var(--tonight-space-3) 0; border-top: 1px solid var(--shoot-line); border-bottom: 1px solid var(--shoot-line); }
.tonight-decision-copy { min-width: 0; }
#tonightTargetWindow { margin: 0 0 var(--tonight-space-2); color: var(--shoot-text); font-size: var(--tonight-type-lg); font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
#tonightTargetWindow[data-availability="unavailable"] { color: var(--shoot-warn); }
.tonight-condition-lines { display: grid; gap: var(--tonight-space-1); }
.tonight-condition-row { min-width: 0; margin: 0; color: var(--shoot-text); font-size: var(--tonight-type-md); font-weight: 650; line-height: 1.5; font-variant-numeric: tabular-nums; }
.tonight-moon-row { gap: var(--tonight-space-2); }
.tonight-moon-row p { margin: 0; }
.tonight-moon { width: 26px; height: 26px; flex: 0 0 auto; }
.tonight-moon[hidden] { display: none; }
.tonight-light-dots { color: var(--shoot-text-dim); }
.tonight-meta-row { flex-wrap: wrap; gap: var(--tonight-space-2); margin-top: var(--tonight-space-1); }
.tonight-meta-chip { margin: 0; padding: var(--tonight-space-1) var(--tonight-space-2); color: var(--shoot-text-dim); font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; font-variant-numeric: tabular-nums; background: var(--shoot-surface-strong); border: 1px solid var(--shoot-line); border-radius: var(--shoot-radius-pill); }
.tonight-meta-chip--dew { color: var(--shoot-dew-strong); border-color: var(--shoot-dew-soft); }
.shoot-direction-arrow { display: inline-block; margin-right: var(--tonight-space-1); color: var(--shoot-accent); transform-origin: center; }
.tonight-score-panel { display: grid; min-width: 104px; place-items: center; padding-left: var(--tonight-space-3); border-left: 1px solid var(--shoot-line); }
.tonight-score { display: grid; place-items: center; }
#tonightScoreLabel[hidden] { display: none; }
.tonight-model-comparison, .tonight-ceiling-note { margin: 0; padding: var(--tonight-space-3) 0; font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--shoot-line); }
.tonight-model-comparison { color: var(--shoot-text-dim); }
.tonight-ceiling-note { color: var(--shoot-warn); }
.tonight-primary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tonight-space-2); margin-top: var(--tonight-space-3); }
.tonight-action-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--tonight-space-2); min-height: 44px; padding: 0 var(--tonight-space-3); font: inherit; font-size: var(--tonight-type-md); font-weight: 650; line-height: 1.5; text-decoration: none; border: 1px solid; border-radius: var(--shoot-radius-control); }
.tonight-action-button--primary { color: #05131a; background: var(--shoot-accent); border-color: var(--shoot-accent); }
.tonight-action-button--secondary { color: var(--shoot-accent); background: transparent; border-color: var(--shoot-accent-line); }

.tonight-mini-chart-card { padding: var(--tonight-space-4); overflow: hidden; }
.tonight-mini-chart-card .night-bar-item { cursor: default; }
.tonight-mini-chart-card .night-bar-date, .tonight-mini-chart-card .night-bar-item { font-variant-numeric: tabular-nums; }
.tonight-section-heading, .tonight-list-heading { justify-content: space-between; gap: var(--tonight-space-2); }
.tonight-section-heading { margin-bottom: var(--tonight-space-3); }
.tonight-section-heading h2, .tonight-list-heading h2 { margin: 0; color: var(--shoot-text); font-size: var(--tonight-type-lg); font-weight: 700; line-height: 1.35; }
.tonight-inline-legend { margin-left: auto; color: var(--shoot-text-faint); font-size: var(--tonight-type-xs); font-weight: 500; line-height: 1.35; white-space: nowrap; }
.tonight-section-heading > a, .tonight-list-heading > a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 var(--tonight-space-2); color: var(--shoot-accent); font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; text-decoration: none; white-space: nowrap; border: 1px solid var(--shoot-accent-line); border-radius: var(--shoot-radius-control); }

.tonight-comparison-section { min-width: 0; }
.tonight-list-heading { margin-bottom: var(--tonight-space-2); }
.tonight-list { display: grid; gap: var(--tonight-space-2); }
.tonight-list > p { margin: 0; padding: var(--tonight-space-3); color: var(--shoot-text-dim) !important; font-size: var(--tonight-type-sm); line-height: 1.45; background: var(--shoot-surface); border: 1px solid var(--shoot-line); border-radius: 14px; }
.tonight-comparison-row { justify-content: space-between; gap: var(--tonight-space-3); min-width: 0; min-height: 58px; padding: var(--tonight-space-2) var(--tonight-space-3); color: var(--shoot-text); text-decoration: none; background: var(--shoot-surface); border: 1px solid var(--shoot-line); border-radius: 14px; }
.tonight-comparison-row:hover { color: var(--shoot-text); border-color: var(--shoot-accent-line); }
.tonight-comparison-row > div { min-width: 0; }
.tonight-comparison-row strong { display: block; overflow: hidden; color: var(--shoot-text); font-size: var(--tonight-type-md); font-weight: 650; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.tonight-comparison-detail { display: block; margin-top: var(--tonight-space-1); overflow: hidden; color: var(--shoot-text-dim); font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.tonight-row-score { display: grid; flex: 0 0 46px; width: 46px; min-width: 46px; place-items: center; padding: 0; font-variant-numeric: tabular-nums; }

.tonight-quick-links { justify-content: flex-start; flex-wrap: wrap; gap: var(--tonight-space-2); }
.tonight-quick-links a { display: inline-flex; align-items: center; gap: var(--tonight-space-2); min-height: 44px; padding: 0 var(--tonight-space-3); color: var(--shoot-text-dim); font-size: var(--tonight-type-sm); font-weight: 500; line-height: 1.45; text-decoration: none; background: var(--shoot-surface); border: 1px solid var(--shoot-line); border-radius: var(--shoot-radius-pill); }
.tonight-quick-links i { color: var(--shoot-accent-2); }
.tonight-quick-links a:hover, .tonight-list-heading > a:hover { color: var(--shoot-accent); border-color: var(--shoot-accent-line); }

.shoot-cloud-section { padding: var(--tonight-space-4); }
.shoot-cloud-legend { display: flex; align-items: center; gap: var(--tonight-space-1); color: var(--shoot-text-dim); font-size: var(--tonight-type-xs); font-weight: 500; line-height: 1.35; white-space: nowrap; }
.shoot-cloud-legend i { width: 7px; height: 7px; margin-left: var(--tonight-space-1); border-radius: 50%; }
.shoot-cloud-legend .is-low, .shoot-cloud-bar.is-low { background: var(--shoot-cloud-low); }
.shoot-cloud-legend .is-mid, .shoot-cloud-bar.is-mid { background: var(--shoot-cloud-mid); }
.shoot-cloud-legend .is-high, .shoot-cloud-bar.is-high { background: var(--shoot-cloud-high); }
.shoot-cloud-chart { display: flex; align-items: flex-end; gap: 5px; min-height: 128px; padding: var(--tonight-space-1) 0 0; overflow-x: auto; }
.shoot-cloud-hour { display: grid; flex: 1 0 36px; min-width: 36px; gap: var(--tonight-space-1); color: var(--shoot-text-dim); font-size: var(--tonight-type-xs); line-height: 1.35; text-align: center; }
.shoot-cloud-bars { display: flex; align-items: flex-end; justify-content: center; height: 92px; gap: 2px; padding: 3px; background: var(--shoot-surface-strong); border-radius: 5px; }
.shoot-cloud-bar { width: 28%; min-height: 3px; border-radius: 2px 2px 0 0; }
.shoot-cloud-time { min-height: 1em; font-variant-numeric: tabular-nums; }
.tonight-shell :is(a, button, select):focus-visible { outline: 2px solid var(--shoot-accent); outline-offset: 3px; }

@media (max-width: 600px) {
    body.shoot-tonight-page .tonight-shell { width: min(100% - 24px, 860px); padding-top: var(--tonight-space-4); }
    .tonight-inline-legend { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 390px) {
    .tonight-controls { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
    .tonight-point-control select { padding-right: 24px; padding-left: 28px; font-size: var(--tonight-type-sm); }
    .tonight-control-icon { left: var(--tonight-space-2); }
    .tonight-control-chevron { right: var(--tonight-space-2); }
    .tonight-target-nav button { padding: 0 7px; }
    .tonight-decision-band { grid-template-columns: minmax(0, 1fr) 86px; gap: var(--tonight-space-2); }
    .tonight-score-panel { min-width: 86px; padding-left: var(--tonight-space-2); }
    .shoot-ring--lg { width: 86px; height: 86px; }
    .shoot-ring--lg .shoot-ring-value { font-size: 1.55rem; }
    .tonight-section-heading { gap: var(--tonight-space-1); }
    .tonight-inline-legend { font-size: 10px; }
    .tonight-section-heading > a { min-width: 40px; padding: 0 6px; }
}
@media (min-width: 768px) { .tonight-primary-card { padding: var(--tonight-space-5); } }
/* bottom_nav.js が .mobile-bottom-nav を <html> 直下へ移すため、body の子孫セレクタでは当たらない
   （night.css / nights.css と同じ一般兄弟結合子(~)にする必要がある。子孫結合子のままだと
   このルールは一致せず、static/style.css の半透明ナビ色にフォールバックしてしまう）。 */
@media (max-width: 991.98px) { body.shoot-tonight-page ~ .mobile-bottom-nav { background: var(--shoot-bg); border-top-color: var(--shoot-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); } }
@media (prefers-reduced-motion: reduce) { .tonight-comparison-row, .tonight-action-button { transition: none; } }
