/* Wolken · style.css (shell from nights 052, 053, 058) */
:root {
  --bg: #04060d; --ui-text: #e8e3d6; --muted: #8d97ab; --amber: #e8a84a; --violet: #a98bff;
  --panel-bg: rgba(8, 12, 22, 0.74); --panel-border: rgba(255, 255, 255, 0.1); --field: rgba(10, 14, 27, 0.92);
  --mono: ui-monospace, Menlo, "SF Mono", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); overscroll-behavior: none; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ui-text); -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#cv { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; display: block;
  touch-action: none; cursor: grab; background: var(--bg); image-rendering: auto; }
#cv.dragging { cursor: grabbing; }


a.home { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: calc(14px + env(safe-area-inset-left, 0px)); z-index: 8;
  font-size: 12px; color: #8d9ab0; text-decoration: none; padding: 4px 7px; border-radius: 5px;
  background: rgba(6, 10, 22, 0.84); border: 1px solid var(--panel-border); }
a.home:hover, a.home:focus-visible { color: var(--amber); }

/* HUD: bottom-left on wide screens, above the toolbar when the two would meet */
.hud { position: fixed; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: calc(14px + env(safe-area-inset-left, 0px)); z-index: 8;
  font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--muted); padding: 5px 8px; border-radius: 6px; white-space: pre;
  background: rgba(6, 10, 22, 0.84); border: 1px solid var(--panel-border); font-variant-numeric: tabular-nums; pointer-events: none;
  max-width: calc(100vw - 28px); overflow: hidden; }
.hud .v { color: var(--ui-text); }
.hud .note { color: var(--amber); }

.title-overlay { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); z-index: 9;
  text-align: center; pointer-events: none; opacity: 1; transition: opacity 1s ease;
  max-width: min(440px, calc(100vw - 300px)); padding: 6px 18px; border-radius: 12px;
  background: rgba(8, 10, 18, 0.82); border: 1px solid var(--panel-border); }
.title-overlay.faded { opacity: 0; }
.title-overlay h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.06em; color: #f0e2c4; text-shadow: 0 1px 12px rgba(0,0,0,0.95); }
.title-overlay p { margin: 1px 0 0; font-size: 11.5px; color: #b3bccb; text-shadow: 0 1px 10px rgba(0,0,0,0.95); }
@media (min-width: 64rem) {
  .title-overlay { right: auto; left: 50%; transform: translateX(-50%); width: max-content; max-width: 520px; }
}

/* ---------- toolbar ---------- */
.bar { position: fixed; z-index: 8; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; padding: 6px; border-radius: 11px;
  background: var(--panel-bg); border: 1px solid var(--panel-border); max-width: calc(100vw - 28px); }
.btn { flex: 0 0 auto; min-height: 40px; min-width: 40px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--panel-border); background: rgba(18, 24, 38, 0.7); border-radius: 8px; font-size: 13px; color: var(--ui-text); cursor: pointer; white-space: nowrap;
  touch-action: manipulation; }
.btn:hover { border-color: rgba(255,255,255,0.24); }
.btn.go { color: #10131c; background: var(--amber); border-color: var(--amber); font-weight: 600; }
.btn.go:hover { background: #f0b862; }
.btn.tog[aria-pressed="true"] { color: var(--violet); border-color: rgba(169,139,255,0.6); background: rgba(30,24,48,0.75); }
.btn.flash { color: var(--amber); border-color: rgba(232,168,74,0.7); }
.btn.go.flash { color: #10131c; }
#urlBox { flex: 1 0 100%; width: 100%; font-family: var(--mono); font-size: 11px; padding: 6px; border-radius: 6px; border: 1px solid var(--panel-border);
  background: var(--field); -webkit-user-select: text; user-select: text; }

/* ---------- help ---------- */
.help { position: fixed; z-index: 20; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px));
  max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px);
  width: min(420px, calc(100vw - 28px)); display: flex; flex-direction: column; border-radius: 12px; background: rgba(8, 12, 22, 0.96);
  border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--panel-border); }
.help-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; color: #f0e2c4; }
.help-body { overflow: auto; padding: 6px 14px 14px; font-size: 12.5px; line-height: 1.45; -webkit-user-select: text; user-select: text; }
.help-body h3 { margin: 12px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--amber); font-weight: 600; }
.help-body p { margin: 6px 0; color: #b3bccb; }
.help-body dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; }
.help-body dt { font-family: var(--mono); font-size: 12px; color: var(--ui-text); }
.help-body dd { margin: 0; color: var(--muted); }
.help-body code { font-family: var(--mono); font-size: 12px; color: var(--ui-text); }

@media (prefers-reduced-motion: reduce) { .title-overlay { transition: none; } }

/* ---------- medium widths: the toolbar is wide, so the HUD sits above it ---------- */
@media (max-width: 80rem) {
  .hud { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- phone ---------- */
@media (max-width: 34rem) {
  a.home { top: calc(10px + env(safe-area-inset-top, 0px)); left: calc(10px + env(safe-area-inset-left, 0px)); }
  .hud { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); left: calc(10px + env(safe-area-inset-left, 0px));
    white-space: normal; font-size: 10.5px; line-height: 1.45; padding: 4px 7px; max-width: calc(100vw - 20px); }
  .title-overlay { top: calc(46px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; transform: none; width: auto; max-width: none;
    padding: 5px 12px; border-radius: 9px; background: rgba(8,10,18,0.8); transition: opacity 0.5s ease; }
  .title-overlay h1 { font-size: 15px; }
  .title-overlay p { font-size: 10.5px; margin-top: 1px; }
  .bar { left: calc(10px + env(safe-area-inset-left, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-width: none; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 5px; }
  .bar .btn { flex: 1 1 calc(20% - 4px); min-width: 0; min-height: 40px; padding: 0 2px; font-size: 12px; }
  .hud { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .help { top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; left: 8px; width: auto; max-height: calc(100dvh - 130px); }
  .help-head .btn { flex: 0 0 auto; padding: 0 12px; }
}
@media (max-width: 34rem) and (prefers-reduced-motion: reduce) { .title-overlay { transition: none; } }

/* ---------- graceful failure message ---------- */
.msg { position: fixed; z-index: 10; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100vw - 40px);
  font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--ui-text); text-align: center; padding: 12px 16px; border-radius: 8px;
  background: rgba(6, 10, 22, 0.9); border: 1px solid var(--panel-border); }

.msg pre { margin: 8px 0 0; max-height: 40vh; overflow: auto; text-align: left; font-size: 11px; white-space: pre-wrap; color: var(--muted); -webkit-user-select: text; user-select: text; }
