/* SPDX-License-Identifier: AGPL-3.0-only
   Leviate. Copyright (C) 2026 Vladyslav Pereverzyev */

@font-face { font-family: 'Jost'; font-weight: 300; font-display: swap; src: url('../vendor/fonts/jost-300.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/jost-400.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/jost-500.woff2') format('woff2'); }

:root {
  --bg: #011E2E;
  /* Width and side margins of the pages. */
  --maxw: 64rem;
  --gutter: 20px;
  /* Nearly solid on purpose: a blurred glass over the live 3D view costs a full
     re-blur every frame and made the view stutter. */
  --panel: rgba(4, 38, 58, 0.94);
  --panel-solid: #04263a;
  --panel-2: #063049;
  --line: rgba(255, 255, 255, 0.09);
  --text: #F1F4F6;
  --muted: #D0D0D0;
  --dim: #7d90a0;
  --accent: #2791CB;
  --accent-2: #57abd8;
  --teal: #10B279;
  --alert: #C25B5B;
  --rotate: #10B279;
  --pan: #E0B85A;
  --zoom: #57abd8;
  --radius: 10px;
  --font: 'Jost', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #2f5872; background-clip: padding-box; border: 3px solid transparent; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
/* Firefox has no ::-webkit-scrollbar: the same colors there. */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #2f5872 transparent; } }

/* ---------------------------------------------------------------- stage */

.stage {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, #06324c 0%, var(--bg) 68%);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.top {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.brand img { width: 28px; height: 28px; }
/* Leviate leads home from every page. */
a.brand { color: var(--text); text-decoration: none; pointer-events: auto; }
/* On the right of the header the name of the app, like in Leviate for Desktop. */
.top-end { display: flex; align-items: center; gap: 14px; }

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  text-align: center;
  pointer-events: none;
}
.empty > * { pointer-events: auto; }
.empty h1 {
  margin: 0 0 6px;
  font-weight: 300;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.24em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7em 1.5em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn.small { padding: 0.45em 1.1em; font-size: 13px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }

.link {
  background: none;
  border: 0;
  color: var(--dim);
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.link:hover { color: var(--text); }
a.link { text-decoration: none; }

.drop {
  position: absolute;
  inset: 14px;
  border: 1px dashed var(--accent);
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 300;
  font-size: 22px;
  background: rgba(39, 145, 203, 0.08);
  pointer-events: none;
  z-index: 100;
}

/* The Ko-fi note, the same as in Leviate for Desktop, under the header in the middle. */
.kofi {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 40px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(rgba(39, 145, 203, 0.12), rgba(39, 145, 203, 0.12)), var(--panel-solid);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 150;
}
.kofi[hidden] { display: none; }
.kofi-copy { flex: 1; min-width: 0; }
.kofi p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); }
.kofi .kofi-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.kofi .kofi-links { margin-top: 8px; font-size: 12px; color: var(--dim); }
.kofi-links button { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.kofi-links button:hover { color: var(--text); }
.kofi > .btn { flex: none; text-decoration: none; color: #fff; }

.legal {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: max(10px, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--dim);
  font-size: 11px;
}
/* Full width to sit in the middle; only the links take clicks, the rest goes to the 3D view. */
.legal { pointer-events: none; }
.legal a { color: var(--dim); text-decoration: none; pointer-events: auto; }
.legal a:hover { color: var(--text); }

/* The same footer at the bottom of the other pages (download, privacy, 404). */
.foot { margin-top: 40px; text-align: center; color: var(--dim); font-size: 11px; line-height: 1.6; }
footer.foot a { color: var(--dim); text-decoration: none; }
footer.foot a:hover { color: var(--text); }

/* -------------------------------------------------------------- windows */

.win {
  position: absolute;
  /* Grow and shrink with the screen, and never reach the tools at the bottom: on a low
     screen the inside of the window scrolls. */
  width: clamp(250px, 22vw, 360px);
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 64px - 104px);
  max-height: calc(100dvh - 64px - 104px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 10;
}
#win-files { top: 64px; left: 20px; }
#win-cam { top: 64px; right: 20px; width: clamp(270px, 24vw, 400px); }

.win-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.win.dragging .win-head { cursor: grabbing; }
.win.dragging { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); }

.win-fold {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.win-fold::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 11px;
  height: 1.5px;
  background: var(--muted);
}
.win-fold:hover { background: rgba(255, 255, 255, 0.06); }
.win.collapsed .win-fold::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 11px;
  width: 1.5px;
  background: var(--muted);
}
.win.collapsed .win-body { display: none; }

.win-body { padding: 0 14px 14px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.count {
  margin-left: 6px;
  color: var(--accent-2);
  letter-spacing: 0;
}

.row { display: flex; gap: 8px; margin-top: 10px; }

/* files */
.obj-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.obj-list:empty::before {
  content: "No files";
  display: block;
  color: var(--dim);
  padding: 2px 0;
}
.obj {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.obj:last-child { border-bottom: 0; }
.obj.off .name { opacity: 0.4; }
.obj input[type="color"] {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.obj input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.obj input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch-own {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(#C25B5B, #E0B85A, #10B279, #2791CB, #8b6fd6, #C25B5B);
}
.obj .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.obj button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
}
.obj button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* webcam */
.preview {
  position: relative;
  container-type: size;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #00131d;
}
.preview video,
.preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.preview.mirror video,
.preview.mirror canvas { transform: scaleX(-1); }

.cam-toggle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.55em 1.4em;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.cam-toggle:hover { background: var(--accent-2); }
.cam-toggle.on {
  left: auto;
  top: auto;
  right: 8px;
  bottom: 8px;
  transform: none;
  padding: 0.3em 0.9em;
  font-size: 12px;
  background: rgba(1, 30, 46, 0.7);
}
.cam-toggle.on:hover { background: var(--alert); }

.badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  background: rgba(1, 30, 46, 0.7);
  font-size: 12px;
  color: var(--muted);
}
.badge.rotate { color: var(--rotate); }
.badge.pan { color: var(--pan); }
.badge.zoom { color: var(--zoom); }

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 2px;
  color: var(--dim);
  font-size: 12px;
}
.hint .dot:not(:first-child) { margin-left: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.rotate { background: var(--rotate); }
.dot.pan { background: var(--pan); }
.dot.zoom { background: var(--zoom); }

.more { border-top: 1px solid var(--line); margin-top: 10px; }
.more summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 0 2px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { color: var(--text); }
.more[open] summary { color: var(--muted); }
.more summary { position: relative; padding-right: 30px; }
/* The same plus and minus as the windows, so it is clear the section opens and closes. */
.more summary::before,
.more summary::after {
  content: "";
  position: absolute;
  background: var(--muted);
}
.more summary::before { right: 3px; width: 10px; top: 15.25px; height: 1.5px; }
.more summary::after { right: 7.25px; width: 1.5px; top: 11px; height: 10px; }
.more[open] summary::after { display: none; }

.field { margin-top: 8px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
select {
  width: 100%;
  padding: 6px 32px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  /* One simple arrow drawn by us, the same on every browser, phone and computer. */
  appearance: none;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23D0D0D0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center / 10px 6px no-repeat;
  font-size: 13px;
}
/* The open list of every select in the style of the app: dark, rounded, blue for the
   chosen line. Browsers without this (Firefox, Safari today) keep their own list, with
   dark lines at least. */
select option { background: var(--panel-solid); color: var(--text); }
@supports (appearance: base-select) {
  select, select::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; gap: 6px; cursor: pointer; }
  select::picker-icon { display: none; }
  select:open { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 5l4-4 4 4' fill='none' stroke='%23D0D0D0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  select::picker(select) {
    /* Always open downwards, under the select; a long list scrolls. */
    position-try-order: normal;
    position-try-fallbacks: none;
    max-height: min(320px, calc(100% - 12px));
    overflow-y: auto;
    /* The open list is a layer of its own: our scroll bar there too. */
    scrollbar-width: thin;
    scrollbar-color: #2f5872 transparent;
    margin-top: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-solid);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: var(--text);
  }
  select option {
    padding: 7px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
  }
  select option:hover, select option:focus-visible { background: rgba(39, 145, 203, 0.18); color: var(--text); outline: none; }
  select option:checked { color: var(--text); }
  select option::checkmark { color: var(--accent-2); }
}

/* Every checkbox in the style of the app: dark box, blue when on, white tick. The
   switches of the consent preferences keep their own look. */
input[type="checkbox"]:not([hidden]):not(.ccp__switch input) {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: var(--panel-2) center / 12px 12px no-repeat;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
input[type="checkbox"]:not([hidden]):not(.ccp__switch input):hover { border-color: var(--accent); }
input[type="checkbox"]:not([hidden]):not(.ccp__switch input):checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6 9.6 3.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input[type="checkbox"]:not([hidden]):not(.ccp__switch input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field.slider {
  display: grid;
  grid-template-columns: 52px 1fr 30px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.field.slider label { color: var(--muted); }
.field.slider output { color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.field.two .check { margin: 0; }

.info { margin: 8px 0 0; color: var(--dim); font-size: 12px; }
.info:empty { display: none; }

.cam-row { margin-top: 8px; }
.cam-row .btn { flex: 1; }
.btn.ghost.on { border-color: var(--accent); color: var(--text); }
/* Use phone: the same fill, line and white text as the selects of the camera. */
#phone-link { background: var(--panel-2); border-color: var(--line); color: var(--text); }
#phone-link:hover, #phone-link.on { border-color: var(--accent); }

.qr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #00131d;
  z-index: 2;
}
.qr-code {
  /* As large as the preview allows in both directions, with room for the text under it. */
  width: min(62cqw, calc(100cqh - 46px));
  aspect-ratio: 1;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
}
.qr-code svg { display: block; width: 100%; height: 100%; }
.qr p { margin: 0; font-size: 12px; color: var(--muted); text-align: center; padding: 0 8px; }

/* phone page opened from the QR code */
body.phone-mode .stage { display: none; }
section.phone-mode {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: max(32px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 30%, #06324c 0%, var(--bg) 70%);
  text-align: center;
}
/* The header sits where it is on the other pages, at the top left, with the name of the page
   on the right like in Leviate for Desktop. */
.pm-head { align-self: stretch; display: flex; align-items: center; justify-content: space-between; }
.product { color: var(--dim); font-size: 11px; letter-spacing: 0.24em; }
.pm-preview {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: #00131d;
}
.pm-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-preview video.mirror { transform: scaleX(-1); }
.pm-status { margin: 0; color: var(--muted); max-width: 420px; min-height: 3em; }
/* The notes of the phone page (Wi-Fi, Ko-fi): the box of the Ko-fi note, fixed under the header
   and as wide as the preview. */
.kofi.pm-note {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  width: auto;
  max-width: 480px;
  margin-inline: auto;
  transform: none;
  text-align: left;
}

/* ---------------------------------------------------------------- tools */

.tools {
  position: absolute;
  left: 50%;
  bottom: max(44px, calc(env(safe-area-inset-bottom) + 28px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  z-index: 20;
}
.tool {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.tool:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
/* Front, Top, Left and Right change the view; the teal tools act on the model or the screen. */
.tool.act { color: #5fd3a6; }
.tool.act:hover { color: #fff; background: rgba(16, 178, 121, 0.16); }
.tool.act:has(input:checked) { background: var(--teal); color: #fff; }
.sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 700px) {
  /* Header and footer in the same place and size as on the other pages. */
  .top { top: max(32px, env(safe-area-inset-top)); left: var(--gutter); right: var(--gutter); }
  .kofi { top: 76px; width: calc(100vw - 24px); }

  /* Windows stack in one column under the header (js/windows.js places them). */
  .win, #win-cam { width: calc(100vw - 24px); max-width: none; max-height: calc(100dvh - 76px - 130px); }
  .win:not(.collapsed) { z-index: 30; }
  /* Hidden until js/windows.js has folded and stacked them: before that they showed open
     for a moment and then closed while the page was loading. */
  .win:not(.placed) { visibility: hidden; }
  .win-head { padding: 8px 8px 8px 12px; }
  .obj-list { max-height: 30vh; }
  .preview { aspect-ratio: 16 / 10; }
  /* The QR code needs a taller preview to be read whole. */
  .preview:has(.qr:not([hidden])) { aspect-ratio: 1; }

  .tools {
    left: 12px;
    right: 12px;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 18px;
    bottom: calc(max(6px, env(safe-area-inset-bottom)) + 56px);
  }
  .tool { padding: 6px 9px; font-size: 12.5px; }
  .sep, #fullscreen { display: none; }

  .legal { left: var(--gutter); right: var(--gutter); bottom: max(6px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; line-height: 1.6; }
}

/* --------------------------------------------------------------- consent */

/* Same banner and preferences window as vladpereverzyev.com. The banner lies over the page,
   solid, and the page does not move for it. */
.cc { position: fixed; inset: auto 0 0 0; z-index: 200; }
.cc__bar {
  padding: 16px max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: #01141f;
  box-shadow: 0 -18px 50px -30px rgba(0, 0, 0, 0.9);
}
.cc__inner {
  max-width: 1200px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 32px;
}
.cc__h { margin: 0 0 4px; font-size: 16px; font-weight: 400; color: var(--text); }
.cc__p { margin: 0; color: var(--muted); font-weight: 300; font-size: 13px; line-height: 1.65; max-width: 70ch; }
.cc__p a { color: var(--accent-2); }
.cc__p b, .ccp__desc b { font-weight: 500; color: var(--text); }
.cc__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cc__actions .btn { font-size: 13px; }

/* The window frosts the whole app behind it. */
.ccp {
  position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 16px;
  background: rgba(1, 12, 20, 0.55);
  overscroll-behavior: contain;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ccp.is-open { opacity: 1; }
.ccp__box {
  width: min(34rem, 100%); max-height: 85vh; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(4, 30, 46, 0.8);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  transition: opacity 0.3s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.ccp.is-open .ccp__box { opacity: 1; transform: none; }
.ccp__h { margin: 0 0 8px; font-size: 22px; font-weight: 300; color: var(--text); }
.ccp__p { margin: 0 0 20px; color: var(--muted); font-weight: 300; font-size: 13px; line-height: 1.65; }
.ccp__record { margin: -12px 0 20px; color: var(--dim); font-size: 12px; }
.ccp__list { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.ccp__item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
/* The category an action is waiting for. */
.ccp__item.is-asked .ccp__name { color: var(--accent-2); }
.ccp__item.is-asked .ccp__track { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(87, 171, 216, 0.25); }
.ccp__name { margin: 0 0 4px; font-size: 15px; font-weight: 400; color: var(--text); }
.ccp__desc { margin: 0; color: var(--muted); font-weight: 300; font-size: 13px; line-height: 1.6; }
.ccp__state { margin: 6px 0 0; color: var(--dim); font-size: 12px; }
.ccp__always { flex: 0 0 auto; color: var(--dim); font-size: 12px; padding-top: 3px; }
.ccp__switch { flex: 0 0 auto; position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.ccp__switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ccp__track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
  position: relative; transition: background 0.18s ease, border-color 0.18s ease;
}
.ccp__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--dim); transition: transform 0.18s ease, background 0.18s ease;
}
.ccp__switch input:checked + .ccp__track { background: var(--accent); border-color: var(--accent-2); }
.ccp__switch input:checked + .ccp__track::after { transform: translateX(18px); background: #fff; }
.ccp__switch input:focus-visible + .ccp__track { outline: 2px solid var(--accent); outline-offset: 3px; }
.ccp__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ccp__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

@media (max-width: 760px) {
  .cc__inner { grid-template-columns: minmax(0, 1fr); }
  .cc__p { font-size: 12px; }
  /* Three buttons of one size, sized by the row. */
  .cc__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cc__actions .btn { min-width: 0; padding-inline: 0.4em; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ccp, .ccp__box, .ccp__track, .ccp__track::after { transition: none; }
  .ccp__box { transform: none; }
}

/* The footer at the bottom of the phone camera page. */
.pm-foot { margin: auto 0 0; }
