/* panel-controls.css — one height, one button, one dropdown (2026-11-05).
 *
 * The geometry and type of the panel's controls. Their material is the glass:
 * .px-btn and px-select are in TARGETS (glass-surface.js), and glass-surface.css
 * paints them and their hover and press. The grounds below are what an unglassed
 * control shows until it mounts. Tokens only, so both themes are already here.
 * Loaded after every other sheet except glass-surface.css, which must stay last. */

:root {
  --ctl-h: 32px;       /* every button, dropdown and single-line input */
  --ctl-h-sm: 28px;    /* an icon button, a close, an action inside a message */
  --ctl-h-xs: 24px;    /* an action set inline in a line of text (the target floor) */
  --ctl-h-lg: 40px;    /* the one call to action of a sheet: sign in, continue, upgrade */
  --ctl-inset: 12px;   /* a dropdown's text from the left, its chevron from the right */
  --scroll-fade: 18px; /* how far a scroller's content fades at an edge it can scroll past */
}

/* ---- the scroll edge (2026-11-15) ----
 * A list that scrolls says so at the edge it can scroll past: its content fades
 * out over --scroll-fade there, and only there — no fade at the top until it has
 * been scrolled, none at the bottom once the end is in view. pxScrollFade(el)
 * (panel-controls.js) keeps .is-more-up / .is-more-down true to the scroll
 * position; .px-scroll is the scroller itself, scrollbar hidden.
 *
 * THE FADE IS A MASK, SO IT GOES ON AN INNER SCROLLER, NEVER ON A SURFACE. On
 * a glass menu or a card it would take the glass, the rim and the shadow with
 * it. A menu keeps its surface and its fixed rows (a back row, a search field)
 * and scrolls a .px-scroll inside. */
.px-scroll {
  display: flex; flex-direction: column; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.px-scroll::-webkit-scrollbar { display: none; }
.px-scroll.is-more-up {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade));
          mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade));
}
.px-scroll.is-more-down {
  -webkit-mask-image: linear-gradient(to top, transparent, #000 var(--scroll-fade));
          mask-image: linear-gradient(to top, transparent, #000 var(--scroll-fade));
}
.px-scroll.is-more-up.is-more-down {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade), #000 calc(100% - var(--scroll-fade)), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade), #000 calc(100% - var(--scroll-fade)), transparent);
}

/* The same edge for a row that scrolls sideways: pxScrollFade(el, { x: true }). */
.px-scroll-x {
  display: flex; align-items: center; min-width: 0;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
}
.px-scroll-x::-webkit-scrollbar { display: none; }
.px-scroll-x.is-more-left {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--scroll-fade));
          mask-image: linear-gradient(to right, transparent, #000 var(--scroll-fade));
}
.px-scroll-x.is-more-right {
  -webkit-mask-image: linear-gradient(to left, transparent, #000 var(--scroll-fade));
          mask-image: linear-gradient(to left, transparent, #000 var(--scroll-fade));
}
.px-scroll-x.is-more-left.is-more-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--scroll-fade), #000 calc(100% - var(--scroll-fade)), transparent);
          mask-image: linear-gradient(to right, transparent, #000 var(--scroll-fade), #000 calc(100% - var(--scroll-fade)), transparent);
}

/* EVERY SINGLE-LINE INPUT, BY ELEMENT. Listed by class this would miss the next
   one. The vertical padding goes because the height is the height now, and at 10px
   a 14px field's content box was shorter than its own line. */
input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"],
          [type="hidden"], [type="color"]) {
  height: var(--ctl-h);
  padding-block: 0;
}

/* A sheet's own fields stand beside its call to action, so they take its height. */
input:is(.auth-input, .wel-input) { height: var(--ctl-h-lg); }

/* ---- the button ---- */
.px-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctl-h); padding: 0 14px; flex-shrink: 0;
  border: none; border-radius: var(--r-ctl); cursor: pointer;
  font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  color: var(--t-secondary); background: var(--s-inter); box-shadow: var(--lit-pill);
}
.px-btn:hover { color: var(--bone); }
.px-btn[aria-pressed="true"] { color: var(--t-primary); }
.px-btn--primary { color: var(--t-primary); }
.px-btn--danger { color: rgb(var(--danger-rgb)); }
.px-btn:disabled { color: var(--t-meta); cursor: default; }
.px-btn.is-working { animation: px-create-pulse 1.1s ease-in-out infinite; }

/* ---- the call to action ----
 * The one button a sheet exists for: sign in, continue, upgrade, "Off I go".
 * Same type as .px-btn, one size up, full width. Solid bone where it is the
 * only way forward (sign-in, welcome); the raised ground where it sits beside
 * a choice (the limit wall's two cards, whose two buttons must be one box). */
:is(.wel-primary, .auth-submit, .lim-go, .lim-off) {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: var(--ctl-h-lg); padding: 0 16px;
  border: 0; border-radius: var(--r-ctl); cursor: pointer; white-space: nowrap;
}
:is(.wel-primary, .auth-submit) {
  font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  background: var(--bone); color: var(--ink);
}
:is(.wel-primary, .auth-submit):hover { opacity: .88; }
:is(.wel-primary, .auth-submit):disabled { opacity: .45; cursor: default; }
/* Get started in liquid glass: a .wel-primary that is also a .px-btn takes the
   panel's button material (glass-surface.js TARGETS, .px-btn) in the welcome's
   shape, so its words are light, not ink on bone. */
.wel-primary.px-btn { color: var(--t-primary); }
.wel-primary.px-btn:hover { opacity: 1; color: var(--bone); }

/* ---- the secondary action ----
 * Text actions that live in a sheet's body rather than its foot: "Sign in to
 * sync", "Upgrade", "Check anyway". .px-btn's box and type, its glass from
 * TARGETS. */
:is(.auth-cta, .un-upgrade, .check-anyway) {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctl-h); padding: 0 14px;
  border: 0; border-radius: var(--r-ctl); cursor: pointer; white-space: nowrap;
  font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--t-strong); background: var(--s-inter); box-shadow: var(--lit-pill);
}
.auth-cta { display: flex; }
:is(.auth-cta, .un-upgrade, .check-anyway):hover { color: var(--bone); background: rgba(var(--warm-rgb),.16); }

/* ---- the chat action ----
 * A button inside a message: Retry, Skip, Send, "Ask about this", "Show more".
 * Reading type (it sits in prose), a hairline box, the rim on the one that
 * moves things forward. Every one of these was its own guess before: three
 * paddings, two radii, three focus rings. */
:is(.px-empty-retry, .px-ask-skip, .px-ask-send, .px-ask-again,
    .px-ab-note-skip, .px-ab-note-send, .px-lens-ask, .px-page-more) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h-sm); padding: 0 12px;
  font: 400 var(--fs-md)/1 var(--sans); white-space: nowrap;
  color: var(--t-secondary); background: transparent;
  border: 1px solid rgba(var(--bone-rgb), .16); border-radius: var(--r-ctl);
  cursor: pointer;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease, border-color var(--dur-1) ease;
}
/* Inline in a line of text: the target floor, not a block's height. */
:is(.px-page-more, .px-ask-again) { height: var(--ctl-h-xs); padding: 0 10px; vertical-align: middle; }
/* The one that moves things forward. */
:is(.px-empty-retry, .px-ask-send, .px-ask-again, .px-ab-note-send, .px-lens-ask) {
  color: var(--t-primary); border-color: rgba(var(--rim-rgb), .5);
}
:is(.px-empty-retry, .px-ask-skip, .px-ask-send, .px-ask-again,
    .px-ab-note-skip, .px-ab-note-send, .px-lens-ask, .px-page-more):hover:not(:disabled) {
  background: var(--s-inter); color: var(--t-primary);
}
:is(.px-empty-retry, .px-ask-skip, .px-ask-send, .px-ask-again,
    .px-ab-note-skip, .px-ab-note-send, .px-lens-ask, .px-page-more):disabled {
  opacity: .5; cursor: default;
}

/* ---- the icon button ----
 * Close, collapse, the small square controls in a header. One size, one
 * ground on hover, one radius; the glyph is 14-16px inside it. */
:is(.auth-close, .pxpop-close, .un-close, .notice-close, .vg-close, .px-test-close, .proj-icon-btn) {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--ctl-h-sm); height: var(--ctl-h-sm); padding: 0;
  border: 0; border-radius: var(--r-ctl); background: transparent; cursor: pointer;
  color: var(--t-meta);
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
}
:is(.auth-close, .pxpop-close, .un-close, .notice-close, .vg-close, .px-test-close, .proj-icon-btn):hover {
  background: var(--s-inter); color: var(--t-primary);
}

/* ---- the dropdown, closed ----
 * The button's asset with a value's type: what it says is a choice, not a label,
 * so it stays in the reading face. The chevron is at the same inset as the text. */
px-select {
  display: inline-flex; align-items: center; gap: 8px;
  height: var(--ctl-h); padding: 0 var(--ctl-inset); min-width: 0; max-width: 100%;
  border-radius: var(--r-ctl); cursor: pointer; user-select: none;
  font: 400 var(--fs-base)/1 var(--sans);
  color: var(--t-primary); background: var(--s-inter); box-shadow: var(--lit-pill);
}
px-select:hover { color: var(--bone); }
px-select:disabled { cursor: default; opacity: .6; }
/* A setting's row or a form's field, where a select was width: 100%. */
px-select.px-select--wide { display: flex; width: 100%; }

/* ---- the dropdown, open ----
 * .ctx-menu.bar-pop for the surface and the motion, .bp-row--tight for the rows
 * and the check mark. All this adds is the inner scroller, a .px-scroll, so its
 * edge fade does not take the menu's glass and rim with it. */
/* The list is a .px-scroll (the scroll edge, above): it fades where it can scroll. */
.px-select-list .bp-row { cursor: pointer; }
.px-select-list .bp-row--tight .bp-name { font-weight: 400; }
.px-select-list .bp-row[aria-disabled="true"],
.px-select-list .bp-row[aria-disabled="true"]:hover { color: var(--t-faint); background: transparent; cursor: default; }
