/* Photo mode (public/src/photo/). While it is on, the app's own interface is cleared away and only the picture and the
   camera controls remain. The look follows the shell: dark glass, the gold accent. */

html.photo-on body > *:not(#stage):not(.photo-root):not(script):not(style):not(link) { visibility: hidden !important; }
html.photo-on #stage > *:not(canvas) { visibility: hidden !important; }
html.photo-on #view { cursor: grab; }
html.photo-on.photo-dragging, html.photo-on.photo-dragging #view { cursor: grabbing; }
/* the picture is composed on the whole window, not on what the dock and the phone's sheet leave */
html.photo-on body #stage, html.photo-on body.shell-on #stage, html.photo-on body.shell-on.is-phone #stage { position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; width: auto; height: auto; }

.photo-root {
  --photo-glass: rgba(22, 43, 39, 0.9);
  --photo-line: rgba(255, 240, 222, 0.18);
  --photo-text: #f6f2e9;
  --photo-dim: #c5ccc3;
  --photo-accent: #d8af67;
  --photo-accent-wash: rgba(216, 175, 103, 0.18);
  position: fixed; inset: 0; z-index: 40; pointer-events: none; color: var(--photo-text);
  font-family: "Sonalon Sans", system-ui, sans-serif; font-size: 14px; line-height: 1.4;
}
.photo-root[hidden] { display: none; }
.photo-root * { box-sizing: border-box; }
.photo-root button, .photo-root select, .photo-root input, .photo-root progress { pointer-events: auto; font: inherit; flex: none; }
.photo-root button:focus-visible, .photo-root select:focus-visible, .photo-root input:focus-visible { outline: 3px solid var(--photo-accent); outline-offset: 2px; }

/* the frame the picture will hold: the screen outside it is dark (the canvas is filled there), this draws on top */
.photo-frame { position: absolute; outline: 1px solid rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.photo-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-grid line { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.photo-grid line.photo-horizon { stroke: rgba(216, 175, 103, 0.9); stroke-dasharray: 6 5; }
.photo-ring { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 2px solid var(--photo-accent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.photo-ring::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--photo-accent); }
.photo-hud { position: absolute; left: 8px; bottom: 8px; padding: 0.2em 0.6em; border-radius: 0.5rem; background: rgba(10, 20, 18, 0.62); font-family: "Sonalon Mono", ui-monospace, monospace; font-size: 12px; max-width: calc(100% - 16px); }
.photo-refine { position: absolute; right: 8px; top: 8px; font-family: "Sonalon Mono", ui-monospace, monospace; font-size: 11px; color: var(--photo-dim); text-shadow: 0 1px 2px #000; }
.photo-refine:empty { display: none; }

.photo-top, .photo-bottom, .photo-panel, .photo-progress, .photo-result {
  background: var(--photo-glass); border: 1px solid var(--photo-line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.photo-top { position: absolute; left: 10px; right: 10px; top: 8px; display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.6rem; border-radius: 999px; pointer-events: auto; }
.photo-title { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.photo-presets { display: flex; gap: 0.3rem; overflow-x: auto; flex: 1 1 0; min-width: 0; padding: 2px; scrollbar-width: thin; }
.photo-chip, .photo-toggle, .photo-small, .photo-more, .photo-exit {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.32em 0.85em; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--photo-dim); cursor: pointer; white-space: nowrap; min-height: 2.1em;
}
.photo-chip:hover, .photo-toggle:hover, .photo-small:hover, .photo-more:hover, .photo-exit:hover { color: var(--photo-text); background: rgba(255, 255, 255, 0.08); }
.photo-chip[aria-pressed="true"], .photo-toggle[aria-pressed="true"], .photo-more[aria-expanded="true"] { background: var(--photo-accent-wash); color: #eed1a0; border-color: rgba(216, 175, 103, 0.5); }
.photo-exit { border-color: var(--photo-line); color: var(--photo-text); }
.photo-small { border-color: var(--photo-line); font-size: 13px; }

.photo-panel { position: absolute; right: 10px; top: 64px; bottom: 112px; width: 290px; overflow-y: auto; padding: 0.7rem 0.8rem; border-radius: 1rem; pointer-events: auto; }
.photo-panel[hidden] { display: none; }
.photo-group { margin: 0 0 0.9rem; }
.photo-group h3 { margin: 0 0 0.4rem; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--photo-dim); }
.photo-field { display: grid; grid-template-columns: 7.2em 1fr auto; align-items: center; gap: 0.5rem; margin: 0.32rem 0; }
.photo-field select { grid-column: 2 / 4; background: rgba(0, 0, 0, 0.28); color: var(--photo-text); border: 1px solid var(--photo-line); border-radius: 0.5rem; padding: 0.25em 0.4em; }
.photo-slider input { width: 100%; accent-color: var(--photo-accent); }
.photo-slider output { min-width: 3.6em; text-align: right; font-family: "Sonalon Mono", ui-monospace, monospace; font-size: 12px; color: var(--photo-dim); }
.photo-label { color: var(--photo-dim); font-size: 13px; }
.photo-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
.photo-wrap { flex-wrap: wrap; }
.photo-note { margin: 0.25rem 0; font-size: 12px; color: var(--photo-dim); }

.photo-bottom { position: absolute; left: 10px; right: 10px; bottom: 8px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "aspects develop" "output develop"; align-items: center; gap: 0.35rem 0.9rem; padding: 0.45rem 0.8rem; border-radius: 1.1rem; pointer-events: auto; }
.photo-aspects { display: flex; gap: 0.1rem; flex-wrap: wrap; }
.photo-aspects .photo-chip { padding: 0.2em 0.65em; min-height: 1.9em; font-size: 13px; }
.photo-custom { width: 4.6em; background: rgba(0,0,0,0.28); color: var(--photo-text); border: 1px solid var(--photo-line); border-radius: 999px; padding: 0.15em 0.6em; font-size: 13px; }
.photo-output { grid-area: output; display: flex; gap: 0.2rem 0.9rem; flex-wrap: wrap; align-items: center; }
.photo-output .photo-field { grid-template-columns: auto auto; margin: 0; gap: 0.35rem; }
.photo-output .photo-field select { grid-column: auto; }
.photo-output .photo-slider { grid-template-columns: auto 7rem auto; }
.photo-output .photo-slider[hidden] { display: none; }
.photo-develop { grid-area: develop; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.photo-plan { margin: 0; font-size: 12px; color: var(--photo-dim); max-width: 22rem; text-align: right; }
.photo-warn { color: #f0b3a4; }
.photo-shutter { display: inline-flex; align-items: center; gap: 0.6em; padding: 0.35em 1.1em 0.35em 0.5em; border-radius: 999px; border: 1px solid rgba(216, 175, 103, 0.7); background: var(--photo-accent); color: #20342f; font-weight: 700; cursor: pointer; }
.photo-shutter:disabled { opacity: 0.55; cursor: default; }
.photo-shutter-ring { width: 1.7em; height: 1.7em; border-radius: 50%; border: 3px solid #20342f; background: radial-gradient(circle, #20342f 38%, transparent 42%); }

.photo-progress { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(26rem, calc(100% - 2rem)); padding: 1rem 1.2rem; border-radius: 1rem; pointer-events: auto; text-align: center; }
.photo-progress[hidden], .photo-result[hidden] { display: none; }
.photo-progress h3 { margin: 0 0 0.6rem; font-size: 15px; }
.photo-progress progress { width: 100%; height: 0.8rem; accent-color: var(--photo-accent); }
.photo-progress-text { margin: 0.5rem 0; font-size: 13px; color: var(--photo-dim); }
.photo-result { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0.8rem; border-radius: 0.9rem; pointer-events: auto; max-width: calc(100% - 2rem); font-size: 13px; }
.photo-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 760px) {
  .photo-top { border-radius: 1rem; flex-wrap: wrap; }
  .photo-title { display: none; }
  .photo-bottom { grid-template-columns: 1fr; grid-template-areas: "aspects" "output" "develop"; gap: 0.4rem; max-height: 44vh; overflow-y: auto; }
  .photo-develop { align-items: stretch; }
  .photo-plan { text-align: left; max-width: none; }
  .photo-panel { top: 64px; left: 10px; right: 10px; width: auto; bottom: auto; max-height: 38vh; }
}
@media (prefers-reduced-motion: no-preference) { .photo-chip, .photo-toggle { transition: background-color 0.15s, color 0.15s; } }

/* tips, keys, help, shapes */
.photo-root kbd { display: inline-block; min-width: 1.4em; padding: 0.05em 0.4em; margin: 0 0.12em; border: 1px solid var(--photo-line); border-bottom-width: 2px; border-radius: 0.35rem; background: rgba(0, 0, 0, 0.3); color: var(--photo-text); font: 600 11px "Sonalon Mono", ui-monospace, monospace; text-align: center; }
.photo-presets .photo-chip kbd { margin-right: 0.3em; opacity: 0.8; }
.photo-help-button { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.8em; border-radius: 999px; border: 1px solid rgba(216, 175, 103, 0.6); background: var(--photo-accent-wash); color: #eed1a0; cursor: pointer; min-height: 2.1em; }
.photo-help-button [aria-hidden] { font-weight: 700; }
.photo-strip { position: absolute; left: 10px; right: 10px; bottom: 0; margin: 0; padding: 0.15rem 0.5rem; display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; justify-content: center; font-size: 12px; color: var(--photo-dim); text-shadow: 0 1px 2px #000; pointer-events: none; }
.photo-bottom { bottom: 22px; }
.photo-notice { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); max-width: calc(100% - 2rem); padding: 0.4rem 0.9rem; border-radius: 999px; background: var(--photo-accent); color: #20342f; font-weight: 700; font-size: 13px; pointer-events: none; text-align: center; }
.photo-notice[hidden] { display: none; }
.photo-hint { display: block; margin: -0.15rem 0 0.35rem; color: var(--photo-dim); font-size: 11.5px; line-height: 1.3; }
.photo-fieldwrap { margin: 0.1rem 0; }
.photo-shape { grid-area: aspects; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.photo-shaperow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.photo-aspects { display: flex; gap: 0.1rem; flex-wrap: wrap; }
.photo-orientation { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid var(--photo-line); }
.photo-orientation .photo-chip { padding: 0.2em 0.7em; min-height: 1.9em; font-size: 13px; }
.photo-orientation .photo-chip:disabled { opacity: 0.45; cursor: default; }
.photo-aspect-note { margin: 0; font-size: 12px; color: var(--photo-dim); }
.photo-help { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(58rem, calc(100% - 1.5rem)); max-height: calc(100% - 9rem); overflow-y: auto; padding: 0.9rem 1.2rem; border-radius: 1rem; pointer-events: auto; background: rgba(18, 36, 33, 0.97); border: 1px solid rgba(216, 175, 103, 0.5); box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55); }
.photo-help[hidden] { display: none; }
.photo-help-head { display: flex; align-items: center; justify-content: space-between; }
.photo-help h3 { margin: 0; font-size: 17px; }
.photo-help h4 { margin: 0.7rem 0 0.25rem; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--photo-accent); }
.photo-steps { margin: 0.6rem 0 0.2rem 1.1rem; padding: 0; color: var(--photo-text); font-size: 13.5px; }
.photo-steps li { margin: 0.2rem 0; }
.photo-help-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 1.4rem; }
.photo-keys { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.7rem; margin: 0; font-size: 13px; }
.photo-keys dt { white-space: nowrap; }
.photo-keys dd { margin: 0; color: var(--photo-dim); }
.photo-help-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.8rem; flex-wrap: wrap; }
.photo-remember { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 13px; color: var(--photo-dim); }
.photo-remember input { accent-color: var(--photo-accent); }
.photo-root[data-ui="hidden"] .photo-top, .photo-root[data-ui="hidden"] .photo-bottom, .photo-root[data-ui="hidden"] .photo-panel, .photo-root[data-ui="hidden"] .photo-strip { display: none; }
@media (max-width: 760px) { .photo-strip { display: none; } .photo-bottom { bottom: 8px; } .photo-help { max-height: calc(100% - 4rem); } .photo-help-button span:last-child { display: none; } }

.photo-keys.stacked { grid-template-columns: 1fr; gap: 0.05rem; }
.photo-keys.stacked dd { margin-bottom: 0.4rem; }
.photo-help-cols { grid-template-columns: 1.25fr 1fr 1fr 1fr; }
@media (max-width: 1000px) { .photo-help-cols { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); } }
