:root {
  --bg: #070b18; --surface: #0d1428; --surface-2: #111b34; --line: rgba(169, 199, 255, .16);
  --text: #eef2ff; --muted: #9aa8c9; --link: #a9c7ff; --accent: #f7c969; --danger: #ff9696;
  --header-height: 64px; color-scheme: dark; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg); color: var(--text);
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; min-width: 0; background: radial-gradient(circle at 15% 0%, #101b3a 0, var(--bg) 38rem); min-height: 100vh; word-break: normal; overflow-wrap: break-word; }
button, input, select { font: inherit; }
button, select { color: var(--text); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-header { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; max-width: 1440px; padding: 0 28px; margin: auto; }
.brand { color: var(--text); text-decoration: none; font-weight: 760; letter-spacing: .04em; display: flex; gap: 9px; align-items: center; white-space: nowrap; }
.brand-mark, .empty-star { color: var(--accent); text-shadow: 0 0 22px rgba(247, 201, 105, .5); }
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; max-width: 1440px; margin: 0 auto; padding: 0 20px 24px; }
.viewer-column, .editor-side { min-width: 0; }
.toolbar { display: flex; gap: 8px; margin: 0 0 10px; }
.dropzone { min-height: min(78vh, 820px); border: 1px solid var(--line); border-radius: 14px; background: #050812; display: grid; place-items: center; position: relative; overflow: hidden; }
.dropzone.has-image { min-height: 0; height: auto; aspect-ratio: var(--image-aspect, auto); }
.dropzone[data-drag="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 35px rgba(247, 201, 105, .12); }
#preview, #key-preview { display: block; max-width: 100%; max-height: min(78vh, 820px); width: auto; height: auto; object-fit: contain; }
.has-image #preview, .has-image #key-preview { width: 100%; height: 100%; max-height: 70svh; }
.empty-state { text-align: center; padding: 38px 20px; max-width: 100%; }
.empty-star { font-size: 38px; }
h1 { font-size: 22px; margin: 12px 0 8px; }
.empty-state p { color: var(--muted); line-height: 1.7; margin: 0 0 12px; }
.privacy-badge { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 auto 18px; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.empty-guide { background: rgba(13, 20, 40, .62); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 12px; }
.empty-guide h2 { margin-bottom: 12px; }
.empty-guide ol { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; counter-reset: steps; }
.empty-guide li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.empty-guide li::before { counter-increment: steps; content: counter(steps); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--accent); }
.empty-guide b, .empty-guide span { display: block; grid-column: 2; }.empty-guide b { color: var(--text); }.empty-guide a, .site-footer a { color: var(--link); }
.stack-panel { position: absolute; inset: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; border-radius: 12px; background: rgba(7, 11, 24, .96); overflow: auto; }
.stack-panel h1 { margin-bottom: 8px; }
.stack-panel .select-label { width: min(100%, 320px); margin: 14px 0 4px; }
.stack-file-list, .stack-note, .stack-progress { width: min(100%, 460px); color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0 0 8px; overflow-wrap: anywhere; }
.stack-note { color: var(--accent); }.stack-progress { font-variant-numeric: tabular-nums; }
.viewer-footer { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; color: var(--muted); font-size: 12px; min-height: 38px; }
.image-meta { color: var(--muted); font-size: 12px; line-height: 1.6; padding: 0 2px 12px; font-variant-numeric: tabular-nums; }
#status[data-kind="error"] { color: var(--danger); } #status[data-kind="working"] { color: var(--accent); }
.histogram-wrap { border-top: 1px solid var(--line); padding-top: 12px; }.histogram-wrap canvas { width: 100%; height: 96px; display: block; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }.eyebrow span { opacity: .55; }
.control-panel { background: rgba(13, 20, 40, .82); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.panel-actions, .group-heading, .settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.control-group { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 15px; }.control-group:first-of-type { border-top: 0; margin-top: 12px; padding-top: 0; }
h2 { font-size: 13px; letter-spacing: .06em; margin: 0 0 13px; font-weight: 650; }
label { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; color: var(--muted); font-size: 12px; margin: 11px 0; min-height: 36px; }
label output { color: var(--text); font-variant-numeric: tabular-nums; }
label input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
input[type="range"] { height: 32px; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border:0; border-radius:50%; background:var(--accent); }.button { border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); cursor: pointer; font-size: 12px; transition: border-color .15s, background .15s, transform .15s; white-space: nowrap; }
a.button { color: inherit; text-decoration: none; }.button:hover, .text-button:hover { border-color: var(--accent); }.button:active { transform: translateY(1px); }.button:disabled, .button.primary:disabled { opacity: 1; cursor: not-allowed; filter: none; background: #2a3045; border-color: #3a4258; color: #8a8f9e; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #211a08; font-weight: 750; }.button.ghost { background: transparent; }
.header-actions { display: flex; gap: 8px; min-width: 0; }.header-actions .button { white-space: nowrap; }.button.wide { width: 100%; margin-top: 13px; padding: 0 11px; }.text-button { color: var(--link); background: none; border: 0; cursor: pointer; font-size: 11px; min-width: 44px; min-height: 32px; padding: 4px; }
.curve-canvas { width: 100%; height: 160px; display: block; border-radius: 6px; cursor: crosshair; touch-action: none; }.hint { color: var(--muted); opacity: .75; font-size: 12px; margin: 8px 0 0; }
.select-label { grid-template-columns: 1fr auto; }.select-label select, select, input[type="number"] { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; height: 36px; }input:invalid, input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px rgba(255,150,150,.2); }
.file-label { position: relative; overflow: hidden; text-align: center; flex: 1; }.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }.settings-actions { margin-top: 8px; }.settings-actions .button { flex: 1; }
.privacy-note { color: var(--muted); font-size: 12px; max-width: 1440px; margin: 0 auto; padding: 0 20px 14px; text-align: right; }
.site-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; max-width: 1440px; margin: 0 auto; padding: 8px 20px 24px; color: var(--muted); font-size: 12px; }.sticky-action-bar { position: sticky; bottom: 0; background: var(--surface); padding: 12px; z-index: 2; border: 1px solid var(--line); border-radius: 10px; }.sticky-action-bar .button { margin-top: 0; }.action-bar-buttons { display: grid; gap: 8px; }.sticky-action-bar .computed-output { margin: 0 0 8px; padding: 0; background: transparent; }.summary-line { display: block; white-space: nowrap; }.summary-detail { display: block; margin-top: 6px; }
.timelapse-shell { grid-template-columns: minmax(0, 1fr) 410px; }.timelapse-dropzone { min-height: min(68vh, 720px); }.timelapse-dropzone.has-image #key-preview { max-height: 70svh; }
.crop-overlay { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(2, 5, 14, .52); pointer-events: none; }.timelapse-keybar { padding: 12px 2px 4px; border-bottom: 1px solid var(--line); }.timelapse-keybar label { margin: 0; }
.frame-summary, .computed-output, .progress-text, .warning-text { color: var(--muted); font-size: 12px; line-height: 1.65; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }.warning-text { color: var(--accent); margin-top: 8px; }.progress-text { display: grid; gap: 2px; }.progress-text progress { display: block; width: 100%; margin-top: 8px; accent-color: var(--accent); }
.timelapse-section { border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 15px; }.timelapse-section h2 { margin-bottom: 8px; }.timelapse-controls { position: sticky; top: var(--header-height); max-height: calc(100vh - var(--header-height) - 20px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--accent) var(--surface-2); }.timelapse-controls #adjustment-state { margin-top: 10px; }.timelapse-controls #adjustment-state .panel-actions { display: none; }.timelapse-controls #adjustment-state .control-group { margin-top: 12px; padding-top: 11px; }.check-label { grid-template-columns: 1fr auto; min-height: 44px; }.check-label input { accent-color: var(--accent); width: 22px; height: 22px; }.input-suffix { display: flex; align-items: center; gap: 6px; }.input-suffix span { color: var(--muted); }.computed-output { margin: 14px 0 5px; padding: 10px; background: rgba(17, 27, 52, .65); border-radius: 7px; }.progress-text { color: var(--accent); margin-top: 10px; }.progress-eta, .stack-progress-eta, .progress-elapsed, .stack-progress-elapsed { color: var(--muted); }.result-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }.result-panel h2 { margin-bottom: 10px; }.result-panel video { width: 100%; display: block; border-radius: 8px; background: #02040c; }.result-panel .wide { display: block; text-align: center; text-decoration: none; }.small { padding-inline: 9px; }
details summary { cursor: pointer; color: var(--text); font-size: 13px; font-weight: 650; }details[open] summary { margin-bottom: 12px; }[hidden] { display: none !important; }
@media (pointer: coarse) { input[type="range"] { height: 44px; } }
@media (min-width: 900px) { .control-panel { position: sticky; top: var(--header-height); max-height: calc(100vh - var(--header-height) - 20px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--accent) var(--surface-2); } }
@media (min-width: 900px) { .has-image #preview, .has-image #key-preview { max-height: none; } }
@media (max-width: 899px) {
  body { padding-bottom: calc(var(--bar-h, 0px) + 16px); }.site-header { padding: 0 16px; }.app-shell { grid-template-columns: 1fr; padding: 0 12px 18px; gap: 12px; }.dropzone { min-height: 48vh; }.has-image #preview, .has-image #key-preview { max-height: 70svh; }.control-panel { border-radius: 12px; position: static; max-height: none; overflow: visible; }.empty-guide { display: none; }.stack-panel { inset: 10px; padding: 18px 12px; }.stack-panel .empty-actions { flex-direction: row-reverse; }.stack-panel .empty-actions .button { flex: 1 1 120px; }.privacy-note { padding: 0 12px 10px; line-height: 1.6; text-align: center; }.site-footer { padding-bottom: 14px; text-align: center; }.timelapse-shell { grid-template-columns: 1fr; }.timelapse-controls { max-height: none; }.sticky-action-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 20; }.sticky-action-bar .button { margin: 0; }.adjustment-details { margin-top: 15px; }
}
@media (max-width: 899px) { .sticky-action-bar .summary-detail { display: none; } }
@media (max-width: 899px) { input, select, textarea { font-size: 16px; } }
@media (max-width: 420px) { .site-header { gap: 8px; padding-inline: 10px; }.header-actions { gap: 4px; }.header-actions .button { padding-inline: 7px; }.brand { gap: 5px; }.viewer-footer { flex-direction: column; gap: 2px; }.toolbar { overflow-x: auto; } }
