/* Shared controls — fleet rollout wave 4 (2026-11-15).
   The styles for the three shared buttons (the canonical theme
   disc, the Settings cog, the feedback droplet), their sheets,
   and the rules Rob's canon attaches to them: no button or its
   text is ever highlightable; the droplet's mark stays readable
   (navy on bright backgrounds, white on dark ones, never
   etched); Opacity (--ctl-o, set by controls.js) is the only
   glass control and drives the density of the glass the
   controls and sheets wear in Glass mode; while a sheet is
   open the buttons it covers go quiet (never layer glass). */
:root{
  --cc-card:#ffffff; --cc-ink:#14213d; --cc-mut:#5b6478; --cc-line:#b9c2d6;
  --cc-amber:#d9a441; --cc-amber-ink:#14100a; --cc-on-bg:#14213d; --cc-on-fg:#ffffff; --cc-bad:#c23a2e;
  --ctl-o:.61;
}
html[data-theme-resolved="night"]{
  --cc-card:#1c232f; --cc-ink:#e9edf4; --cc-mut:#9aa6b8; --cc-line:#39445a;
  --cc-on-bg:#e9edf4; --cc-on-fg:#14213d; --cc-bad:#e56b6b;
}

/* NOSELECT — Rob's canon, 2026-11-15: no button, and no text or
 * icon inside a button, is ever highlightable, on any surface. */
button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}

/* The canonical theme disc: the chassis carries its own inline
 * seat; the float engine owns the seat while this file owns the
 * spring, the layer (the sheets at 800 outrank the buttons), and
 * the print rule. */
.themeToggle{
  z-index:700 !important;
  transition:left .5s cubic-bezier(.34,1.56,.64,1), top .5s cubic-bezier(.34,1.56,.64,1);
  touch-action:none;
}
@media print{ .themeToggle{ display:none !important; } }

/* The Settings cog: the canonical disc's sibling — same 40×40
 * glass chassis, the gear face. */
#ctl-cog{
  position:fixed; z-index:700; width:40px; height:40px; min-width:40px; min-height:40px;
  border-radius:50%; padding:0; margin:0; line-height:1;
  background:rgba(128,128,128,.2);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border:1px solid rgba(128,128,128,.3);
  font-size:18px; cursor:pointer; color:inherit;
  display:flex; align-items:center; justify-content:center;
  touch-action:none;
  transition:left .5s cubic-bezier(.34,1.56,.64,1), top .5s cubic-bezier(.34,1.56,.64,1);
}
#ctl-cog:focus-visible{ outline:2px solid #7aa7ff; outline-offset:2px; }
@media print{ #ctl-cog{ display:none !important; } }
html[data-theme="glass"] #ctl-cog{
  background:rgba(148,163,184,var(--ctl-o));
  -webkit-backdrop-filter:blur(18px) saturate(1.3); backdrop-filter:blur(18px) saturate(1.3);
}

/* The feedback droplet — Cool Button One's form (the wave-3
 * engine's build of it): a 96px glass disc, the bubble mark and
 * the Feedback word in currentColor. THE MARK SWITCH: the mark
 * stays readable on the background it floats over — navy
 * #14314e on bright backgrounds, white on dark ones.
 * This app’s pages carry a real night face: the resolved
 * face decides — white when it resolves to night (Night, and
 * Glass or Auto wearing the night face), navy by day. */
html[data-theme-resolved="night"] #cc-fb-float{color:#fff}
html[data-theme-resolved="night"] #cc-fb-float .cc-fb-bubble{filter:drop-shadow(0 1px 0 rgba(0,0,0,.4))}
html[data-theme-resolved="night"] #cc-fb-float .cc-fb-word{text-shadow:0 1px 0 rgba(0,0,0,.45),0 0 6px rgba(0,0,0,.30)}
#cc-fb-float{
  position:fixed; z-index:700; display:inline-flex; flex-direction:column;
  align-items:center; justify-content:center; gap:1px;
  width:96px; height:96px; min-width:96px; min-height:96px; padding:12px;
  border:1px solid rgba(255,255,255,.55); border-radius:50%;
  background:radial-gradient(circle at 36% 30%, rgba(255,255,255,.16), rgba(255,255,255,0) 46%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.10) 0%, rgba(255,255,255,.03) 52%, rgba(130,130,130,.06) 72%, rgba(60,60,60,.28) 81%, rgba(228,228,228,.55) 87%, rgba(255,255,255,.85) 92%, rgba(205,205,205,.38) 97%, rgba(150,150,150,.26) 100%);
  -webkit-backdrop-filter:blur(1px) saturate(1.25); backdrop-filter:blur(1px) saturate(1.25);
  color:#14314e; font-size:14.5px; font-weight:700; font-family:inherit; cursor:pointer;
  touch-action:none; user-select:none; -webkit-user-select:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22), inset 0 0 14px rgba(110,110,110,.14), 0 10px 22px rgba(20,20,20,.28);
  transition:left .5s cubic-bezier(.34,1.56,.64,1), top .5s cubic-bezier(.34,1.56,.64,1);
}
#cc-fb-float::before{
  content:""; position:absolute; top:7%; left:19%; width:58%; height:30%;
  border-radius:50%; background:radial-gradient(ellipse at center, rgba(255,255,255,.85), rgba(255,255,255,.28) 55%, rgba(255,255,255,0) 75%);
  transform:rotate(-14deg); pointer-events:none;
}
#cc-fb-float .cc-fb-bubble{ flex:0 0 auto; filter:drop-shadow(0 1px 0 rgba(255,255,255,.5)); }
#cc-fb-float .cc-fb-word{ line-height:1.05; text-shadow:0 1px 0 rgba(255,255,255,.55), 0 0 6px rgba(255,255,255,.35); }
#cc-fb-float.ctl-float-dragging{ cursor:grabbing; }
@media print{ #cc-fb-float{ display:none !important; } }

/* Sheets. The Settings sheet and the Cool Button One feedback
 * sheet share one shape; in Glass mode the sheet itself wears
 * the glass, at the Opacity the visitor chose. */
.ctl-scrim, .cc-scrim{ position:fixed; inset:0; background:rgba(15,22,40,.55); z-index:800; display:flex; align-items:flex-end; justify-content:center; }
.ctl-scrim[hidden], .cc-scrim[hidden]{ display:none; }
.ctl-sheet, .cc-sheet{
  position:relative; background:var(--cc-card); color:var(--cc-ink);
  width:100%; max-width:480px; max-height:92vh; overflow:auto;
  border-radius:18px 18px 0 0; padding:18px 16px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width:700px){ .ctl-sheet, .cc-sheet{ border-radius:18px; margin-bottom:24px; } }
html[data-theme="glass"] .ctl-sheet, html[data-theme="glass"] .cc-sheet{
  background:color-mix(in srgb, var(--cc-card) calc(var(--ctl-o) * 100%), transparent);
  -webkit-backdrop-filter:blur(18px) saturate(1.3); backdrop-filter:blur(18px) saturate(1.3);
  border:1px solid rgba(255,255,255,.22); border-bottom:0;
}
.ctl-sheet h2, .cc-sheet h2{ margin:0 0 8px; padding-right:40px; font-size:21px; border:0; }
.ctl-sheet h3{ margin:14px 0 4px; font-size:16px; }
.ctl-sheet p, .cc-sheet p{ line-height:1.45; }
.ctl-sheet .sub, .cc-sheet .sub{ color:var(--cc-mut); font-size:13.5px; }
.ctl-sheet-x, .cc-sheet-x{
  position:absolute; top:10px; right:10px; width:34px; height:34px; border-radius:50%;
  border:1px solid var(--cc-line); background:var(--cc-card); color:var(--cc-mut);
  font-size:15px; line-height:1; cursor:pointer; z-index:3; padding:0;
}
.ctl-flabel, .cc-flabel{ display:block; font-size:14px; font-weight:700; margin:14px 0 6px; }
.ctl-sheet input[type="range"]{ width:100%; }
.cc-fbchips{ display:flex; flex-wrap:wrap; gap:7px; margin:4px 0 2px; }
.cc-fbchip{
  border:1.5px solid var(--cc-line); background:var(--cc-card); color:var(--cc-ink);
  border-radius:999px; padding:7px 12px; font-size:13.5px; font-weight:600; cursor:pointer; font-family:inherit;
}
.cc-fbchip[aria-pressed="true"]{ border-color:var(--cc-on-bg); background:var(--cc-on-bg); color:var(--cc-on-fg); }
.cc-sheet textarea{
  width:100%; box-sizing:border-box; border:1.5px solid var(--cc-line); border-radius:10px;
  padding:11px 12px; font-size:16px; background:var(--cc-card); color:var(--cc-ink); font-family:inherit;
}
.cc-fb-send{
  font-size:16px; padding:12px 14px; width:100%; border:0; border-radius:14px;
  background:var(--cc-amber); color:var(--cc-amber-ink); font-weight:700; cursor:pointer; font-family:inherit;
}
.cc-fb-err{ color:var(--cc-bad); font-size:13.5px; line-height:1.4; margin-top:10px; white-space:pre-wrap; }

/* QUIET RULE — never layer glass: while any sheet is open, the
 * floating buttons it covers go quiet until it closes. */
html.ctl-open .themeToggle, html.ctl-open #ctl-cog, html.ctl-open #cc-fb-float{
  opacity:0; pointer-events:none;
}
