/* Moon Phase Photographer: the Rooftop Observatory (an overhead orbit chart, a telescope camera, an edge-on side view,
   a harbor tide gauge and a shot log). Art by art.js, colors from the --mp-* properties below (light and dark). */
html {
  --mp-space1: #101a3a; --mp-space2: #1d1640; --mp-deck1: #3c4a6b; --mp-deck2: #222b44; --mp-line: #0d1222;
  --mp-accent: #3b3f8f; --mp-ink: #1b2033; --mp-panel1: #f6f6fb; --mp-panel2: #e9eaf4; --mp-card: #ffffff;
  --mp-chip: #ffffff; --mp-chip-on: #e3e4f6; --mp-ok: #13704a; --mp-bad: #b3261e; --mp-node: #d58cff; --mp-north: #ffd84a;
  --mp-ghost: #5fe0a0; --mp-bulge: #4fb3ff;
}
html[data-theme="dark"] {
  --mp-space1: #070b1c; --mp-space2: #120d2a; --mp-deck1: #252d44; --mp-deck2: #141a2b; --mp-line: #05070f;
  --mp-accent: #a9adff; --mp-ink: #eceefa; --mp-panel1: #1b1f30; --mp-panel2: #151826; --mp-card: #1b1f30;
  --mp-chip: #161a28; --mp-chip-on: #2b2f55; --mp-ok: #4fd08c; --mp-bad: #ff8a80;
}
.mp { position: absolute; inset: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.mp button { font: inherit; }
.mp-controls { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--mp-panel1), var(--mp-panel2)); color: var(--mp-ink); border: 3px solid var(--mp-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.mp-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; overflow: auto; }
.mp-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mp-accent); }
.mp-step, .mp-step-b { display: grid; gap: 4px; }
.mp-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.mp-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--mp-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .mp-n { color: #10122a; }
.mp-step.is-done .mp-n { background: var(--mp-ok); }
.mp-mark { margin-left: auto; font-weight: 800; }
.mp-mark.is-ok { color: var(--mp-ok); }
.mp-mark.is-bad { color: var(--mp-bad); }
.mp-how { margin: 0; line-height: 1.3; font-size: 16px; opacity: .9; }
.mp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-read { min-width: 3.2em; padding: 1px 8px; border-radius: 6px; background: var(--mp-card); border: 1px solid rgba(59, 63, 143, .35); font-size: 18px; }
.mp-btn { min-height: 36px; min-width: 44px; padding: 2px 10px; border: 2px solid var(--mp-accent); border-radius: 10px; background: var(--mp-chip); color: var(--mp-ink); font-weight: 700; cursor: pointer; }
.mp-btn:hover:not(:disabled) { background: var(--mp-chip-on); }
.mp-btn:disabled { opacity: .55; cursor: default; }
.mp-dialrow { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; align-items: center; }
.mp-dialside { display: grid; gap: 4px; }
.mp-dial { display: block; width: 120px; height: 120px; touch-action: none; cursor: pointer; }
.mp-dial-bg { fill: var(--mp-space1); stroke: var(--mp-accent); stroke-width: 3; }
.mp-dial-orbit { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 2; stroke-dasharray: 4 4; }
.mp-dial-sun { fill: none; stroke: var(--mp-north); stroke-width: 3; stroke-linecap: round; }
.mp-knob-focus { fill: transparent; stroke: none; }
.mp-knob-d { fill: var(--mp-node); stroke: #fff; stroke-width: 2; }
.mp-knob, .mp-moon { pointer-events: none; outline: none; }
.mp-knob:focus-visible .mp-knob-focus, .mp-moon:focus-visible .mp-moon-focus { stroke: #ffffff; stroke-width: 3; stroke-dasharray: 5 3; }
.mp-chips { display: grid; gap: 3px; }
.mp-chips--event { grid-template-columns: 1fr 1fr; }
.mp-chip { position: relative; display: flex; align-items: center; min-height: 36px; padding: 2px 26px 2px 10px; border: 2px solid #a8abc8; border-radius: 10px;
  background: var(--mp-chip); color: var(--mp-ink); font-size: 16px; line-height: 1.15; text-align: left; cursor: pointer; }
html[data-theme="dark"] .mp-chip { border-color: #474b6e; }
.mp-chip:hover:not(:disabled) { border-color: var(--mp-accent); }
.mp-chip.is-on { border-color: var(--mp-accent); background: var(--mp-chip-on); font-weight: 700; box-shadow: inset 0 0 0 1px var(--mp-accent); }
.mp-chip.is-on::before { content: '●'; margin-right: 6px; color: var(--mp-accent); }
.mp-chip-m { position: absolute; right: 8px; font-weight: 800; }
.mp-chip.is-key { border-color: var(--mp-ok); box-shadow: inset 0 0 0 2px var(--mp-ok); }
.mp-chip.is-key .mp-chip-m { color: var(--mp-ok); }
.mp-chip.is-wrong { border-color: var(--mp-bad); border-style: dashed; }
.mp-chip.is-wrong .mp-chip-m { color: var(--mp-bad); }
.mp-chip:disabled { cursor: default; opacity: 1; }
.mp-days { width: 8em; min-height: 40px; padding: 4px 8px; border: 2px solid var(--mp-accent); border-radius: 8px; background: var(--mp-card); color: var(--mp-ink); font: inherit; font-size: 18px; }
.mp-days:disabled { opacity: 1; }
.mp button:focus-visible, .mp input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }

/* reference card */
.mp-brief { flex: none; padding: 4px 12px; border: 2px solid var(--mp-accent); border-radius: 12px; background: var(--mp-panel1); color: var(--mp-ink); }
.mp-brief p { margin: 0; line-height: 1.35; }

/* scene */
.mp-scene { flex: none; border-radius: 12px; overflow: hidden; border: 2px solid var(--mp-line); background: linear-gradient(var(--mp-deck1), var(--mp-deck2)); }
.mp-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px), #151b2e; }
.mp-sign { padding: 1px 12px; border-radius: 6px; background: var(--mp-accent); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 2px 0 var(--mp-line); }
html[data-theme="dark"] .mp-sign { color: #10122a; }
.mp-tag { margin-left: auto; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,.14); color: #f2f3fb; font-size: 16px; font-weight: 700; }
.mp-body { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 10px; padding: 8px; }
.mp-chartcol { display: grid; gap: 6px; align-content: start; }
.mp-chartwrap { line-height: 0; }
.mp-chart { display: block; width: 420px; height: auto; border-radius: 10px; border: 2px solid var(--mp-line); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.is-locked .mp-chart, .is-locked .mp-dial { cursor: default; }
.mp-t { font-family: var(--tlg-font); font-size: 17px; font-weight: 700; fill: #eef0fb; paint-order: stroke; stroke: rgba(8, 10, 30, .75); stroke-width: 3px; pointer-events: none; }
.mp-t-dim { fill: #c4c9e6; font-weight: 600; }
.mp-t-sun { fill: #3a2600; stroke: rgba(255, 240, 180, .7); }
.mp-t-ang { font-size: 17px; }
.mp-t-park { font-size: 17px; fill: #ffe9a6; }
.mp-t-fx { fill: var(--mp-bulge); }
.mp-t-ghost { fill: var(--mp-ghost); }
.mp-t-g { font-size: 16px; }
.mp-orbit { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 2; stroke-dasharray: 6 5; }
.mp-dir { fill: none; stroke: #ffe9a6; stroke-width: 3; }
.mp-dir-head { fill: #ffe9a6; }
.mp-ray { fill: none; stroke: rgba(255, 220, 120, .35); stroke-width: 2; stroke-dasharray: 10 12; pointer-events: none; }
.mp-ray-head { fill: none; stroke: rgba(255, 220, 120, .5); stroke-width: 2; }
.mp-slot { cursor: pointer; }
.mp-slot-dot { fill: rgba(255,255,255,.18); stroke: rgba(255,255,255,.75); stroke-width: 2; }
.mp-chart:hover .mp-slot-dot { stroke: #fff; }
.mp-park-ring { fill: none; stroke: #ffe9a6; stroke-width: 2; stroke-dasharray: 4 4; }
.mp-park.is-gone { display: none; }
.mp-moon-focus { fill: transparent; }
.mp-nodeline { stroke: var(--mp-node); stroke-width: 3; stroke-dasharray: 8 5; fill: none; pointer-events: none; }
.mp-node-up { fill: var(--mp-node); stroke: #fff; stroke-width: 1.5; pointer-events: none; }
.mp-node-dn { fill: var(--mp-space1); stroke: var(--mp-node); stroke-width: 3; pointer-events: none; }
.mp-north { fill: none; stroke: var(--mp-north); stroke-width: 5; opacity: .55; pointer-events: none; }
.mp-l-node, .mp-l-fx, .mp-l-ghost { pointer-events: none; }

/* reveal on the chart */
.mp-viewarc { fill: none; stroke: #ffe066; stroke-width: 3.5; stroke-dasharray: 4 3; }
.mp-bulge { fill: none; stroke-width: 4; }
.mp-bulge-moon { stroke: var(--mp-bulge); fill: rgba(79, 179, 255, .18); }
.mp-bulge-sun { stroke: #ffd84a; stroke-dasharray: 6 4; }
.mp-bulges { animation: mp-grow 1s ease-out both; transform-origin: 0 0; }
.mp-umbra { fill: rgba(0, 0, 0, .65); stroke: rgba(255,255,255,.4); stroke-width: 1; animation: mp-fade .8s ease-out .3s both; }
.mp-ghost { fill: none; stroke: var(--mp-ghost); stroke-width: 3; stroke-dasharray: 5 4; animation: mp-pulse 1.1s ease-in-out 3; }
.mp-ghostline { stroke: var(--mp-ghost); stroke-width: 3; stroke-dasharray: 3 6; fill: none; }
@keyframes mp-grow { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mp-pulse { 50% { opacity: .35; } }
.mp-rays .mp-ray { animation: mp-flow 1.4s linear infinite; animation-play-state: paused; }
.is-shot .mp-rays .mp-ray { animation-play-state: running; animation-iteration-count: 3; }
@keyframes mp-flow { to { stroke-dashoffset: 44; } }

/* side column */
.mp-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mp-cam { padding: 4px 6px 4px; border-radius: 12px; background: linear-gradient(#e8ebf2, #b9c0cf); border: 2px solid var(--mp-line); color: #151b2e; box-shadow: 0 3px 6px rgba(0,0,0,.35); }
html[data-theme="dark"] .mp-cam { background: linear-gradient(#4a5168, #2e3447); color: #eef0fb; }
.mp-cam-top { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; line-height: 22px; }
.mp-rec { width: 10px; height: 10px; border-radius: 50%; background: #d23b3b; box-shadow: 0 0 6px #ff6b6b; }
.mp-cam-screen { position: relative; border-radius: 8px; overflow: hidden; border: 3px solid #151b2e; background: #05060a; line-height: 0; }
.mp-photo { display: block; width: 100%; height: auto; }
.mp-cover { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; line-height: 1.3;
  background: radial-gradient(circle at 50% 45%, #2a3150 0 20%, #12162a 21% 23%, #1c2238 24% 40%, #0a0c16 41%); color: #e6e9f8; font-weight: 700; }
.mp-cover-t { padding: 4px 8px; border-radius: 6px; background: rgba(5, 6, 12, .7); }
.is-shot .mp-cover { opacity: 0; transition: opacity .6s .25s; pointer-events: none; }
.mp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.is-shot .mp-flash { animation: mp-flash .7s ease-out; }
@keyframes mp-flash { 0% { opacity: 0; } 15% { opacity: .95; } 100% { opacity: 0; } }
.is-shot .mp-photo { animation: mp-develop 1.6s ease-out; }
@keyframes mp-develop { 0% { filter: blur(6px) brightness(1.8) sepia(.6); } 100% { filter: none; } }
.mp-cam-cap { margin: 3px 2px 0; font-size: 16px; line-height: 1.25; font-weight: 600; }
.mp-panel { padding: 4px 6px; border-radius: 10px; background: rgba(5, 8, 20, .45); color: #eef0fb; }
.mp-panel-h { margin: 0 0 2px; font-size: 16px; font-weight: 800; }
.mp-panel-cap { margin: 2px 0 0; font-size: 16px; line-height: 1.25; }
.mp-sideview, .mp-gauge { display: block; width: 100%; height: auto; border-radius: 6px; }
.mp-ecliptic { stroke: rgba(255,255,255,.6); stroke-width: 2; }
.mp-sideorbit { fill: none; stroke: var(--mp-node); stroke-width: 2; stroke-dasharray: 5 3; }
.mp-gauge-mark { stroke: #ffe066; stroke-width: 2; stroke-dasharray: 6 4; }
.mp-gauge-span { stroke: #ffe066; stroke-width: 3; }
.mp-tidewater { animation: mp-tide 2.4s ease-in-out 2 alternate both; }
@keyframes mp-tide { from { transform: translateY(var(--hi)); } to { transform: translateY(var(--lo)); } }
.mp-logwrap { padding: 3px 10px 4px; }
.mp-log { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 18px; }
.mp-lognote { margin: 2px 0 0; font-size: 16px; color: var(--mp-ghost); font-weight: 700; }
.mp-lognote:empty { display: none; }
.mp-log-r { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; line-height: 1.3; }
.mp-log dt { opacity: .85; }
.mp-log dd { margin: 0; font-weight: 700; text-align: right; }

.mp-about { flex: none; padding: 2px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.mp-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.mp-about p { margin: 4px 0; }

/* briefing example */
.mp-ex-svg { display: block; width: 100% !important; max-width: 460px; height: auto !important; max-height: none; border-radius: 10px; border: 2px solid var(--mp-line); }

@media (max-width: 1100px) and (min-width: 901px) {
  .mp-chart { width: 380px; }
  .mp-body { grid-template-columns: 380px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .mp { position: static; grid-template-columns: 1fr; }
  .mp-controls, .mp-right { overflow: visible; }
  .mp-body { grid-template-columns: 1fr; }
  .mp-chart { width: 100%; max-width: 460px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mp *, .mp *::before { animation: none !important; transition: none !important; }
  .is-shot .mp-cover { opacity: 0; }
}
@media (max-width: 600px) {
  .mp-t, .mp-t-ang, .mp-t-park { font-size: 22px; }
}
