/* ============================================
   Club720 Panel — Components
   ============================================ */

/* ---------- Buttons ----------
   **One place for every button shape in the panel.** The base control, its size modifiers and all four
   variants live together here, because `components.css` is the one sheet every layout loads: a variant
   declared in a screen's own sheet is a variant the next screen does not have, and the copy that drifts. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 6px 12px;
  min-height: var(--control-height);
  max-width: 100%;
  font-size: var(--fs-md);
  line-height: var(--lh-control);
  letter-spacing: var(--ls-none);
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}
.btn:focus-visible { box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
/* A control that is deliberately inert rather than momentarily unavailable - something whose screen
   is not part of this build. It is aria-disabled rather than disabled for the reason the topbar bell
   gives: a disabled control is not focusable, so the note explaining it would be the one thing about
   it that a keyboard user could not reach. It carries the disabled state's dimming, because the two
   mean the same thing to the eye. */
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-block { width: 100%; }

/* The smaller rhythm, for a control in a card head or at the foot of a dense row. */
.btn-sm {
  padding: 5px 10px;
  font-size: var(--fs-sm);
}

/* A button whose whole label is its glyph. Square rather than padded to the text rhythm, so a row of
   them is a row of one width and a glyph beside a badge lines up with it instead of standing taller
   than it. It is declared after `.btn-sm` because it is the modifier that wins on padding, and the
   control must carry an `aria-label`: a button with no visible text has no name at all without one. */
.btn-icon {
  width: var(--control-height);
  height: var(--control-height);
  flex-shrink: 0;
  padding: 0;
}
.btn-icon svg { width: 16px; height: 16px; }

/* The prototypes sized their button glyphs with width/height attributes at every use site. The
   panel's _Icon partial leaves sizing to CSS, so it is set once here rather than repeated on
   each button. */
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-outline:hover:not(:disabled) { background: var(--canvas-alt); }

.btn-ghost {
  background: transparent;
  color: var(--slate);
}
.btn-ghost:hover:not(:disabled) { background: var(--canvas-alt); color: var(--ink); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }

/* Danger-outline (visible text on light red bg) */
.btn-outline.btn-danger {
  background: var(--danger-tint);
  border-color: #fecaca;
  color: var(--danger);
}
.btn-outline.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* The square back control a record screen puts before its title. It carries its own box rather than
   `.btn`'s padding because it sits beside a page title and has to match that line's height. */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height); height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--slate);
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
  flex-shrink: 0;
}
.btn-back:hover { background: var(--canvas-alt); color: var(--ink); border-color: var(--border-strong); }

/* A control that reads as a link because the act it performs belongs to the sentence it sits in. */
.btn-link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  transition: color .12s ease;
}
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.label {
  font-size: var(--fs-sm);
  line-height: var(--lh-small);
  font-weight: 500;
  overflow-wrap: anywhere;
  color: var(--ink);
}

/* The asterisk a required label carries. The prototypes wrote it as an inline `style`, which the
   panel's content security policy refuses; it belongs to the label, so it is a rule beside `.label`
   rather than a word the views repeat. The `required` attribute on the control is the enforcement -
   this is only what says so before the person types. */
.label-required { color: var(--danger); }

.input {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  padding: 6px 10px;
  font: inherit;
  font-size: var(--fs-md);
  line-height: var(--lh-control); /* 18px — Eleken control style */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: var(--ring);
}
.input[aria-invalid="true"] {
  border-color: var(--danger);
}
.input[aria-invalid="true"]:focus { box-shadow: var(--ring-danger); }

/* A field the form draws as a value rather than a question - the edit screen's applicant, since 2026-10-19.
   It keeps the input's filled box so it still reads as part of the form, but drops the hover and focus
   treatment: there is nothing to type, and a focus ring on a read-only box promises an edit it cannot take. */
.input[readonly] { color: var(--muted); }
.input[readonly]:hover { border-color: var(--border); }
.input[readonly]:focus {
  outline: none;
  border-color: var(--border);
  background: var(--canvas-alt);
  box-shadow: none;
}

/* ---------- The reason fields a form carries for a browser without the script ----------
   The one place in the panel where a question is asked in the row rather than in a dialog: these are
   the controls inside `_ArchiveReasonFields`, which are wrapped in a `<noscript>` and so exist only
   where no script runs. `flex-basis: 100%` is what puts them on their own line inside the row's
   actions - a flex row of icons, which `app-shell.css` gives `flex-wrap` for exactly this - because
   a menu and a box squeezed in beside four 30px buttons is a question nobody can read, let alone
   answer. The label is stepped down to the control size for the same reason: at the dialog's 16px
   the two lines it takes would be taller than the row they are in. */
.archive-fields { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; align-items: flex-end; }

/* Capped as well as stretched, and the cap is what keeps the column from growing a third wider: a
   table's columns are sized from what they hold, so a control that can be any width makes every row
   of a wide table wider still. Past the cap they wrap instead - and a stack of two is what the
   narrowest screens show anyway. */
.archive-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; min-width: 120px; max-width: 180px; }
.archive-field .label { font-size: var(--fs-sm); line-height: var(--lh-small); }

/* ---------- Select fields ----------
   **The dropdown is the text box plus a chevron, and both class names get the same rules.** A view may
   draw `select.input` or `select.select`, and the two used to be styled in different sheets - so one
   of them had no chevron at all and the two disagreed about their fill. This is the one definition:
   the control's shape and spacing, then the fill each class already had. The chevron is a background
   image rather than a child element, so the `<select>` keeps its native keyboard and screen-reader
   behaviour, and it is why every fill below is `background-color` rather than the `background`
   shorthand - the shorthand would take the chevron away. */
select.input,
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  padding: 6px 32px 6px 10px;  /* right: room for the chevron */
  font: inherit;
  font-size: var(--fs-md);
  line-height: var(--lh-control);
  color: var(--ink);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
/* `select.input` keeps the filled field its `.input` class gives every other box; a bare `.select`
   keeps the white one the toolbar and record forms draw. */
select.input { background-color: var(--surface); }
select.input::-ms-expand { display: none; }
.select:hover,
select.input:hover { border-color: var(--border-strong); }
.select:focus,
select.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.select:disabled,
select.input:disabled { color: var(--muted); cursor: not-allowed; }

/* A multi-select is a list, not a dropdown: a chevron and the single-line padding the other selects
   use would both be wrong on it, and its height is the rows it draws rather than the control rhythm. */
select[multiple] {
  appearance: auto;
  background-image: none;
  padding-right: 14px;
  height: auto;
}

/* ---------- One-time code ----------
   The ordinary field with its digits spaced, so a code can be counted at a glance instead of read
   character by character. It is here rather than in `auth.css` because the profile's verify screen
   draws it from the signed-in layout, which never loads that sheet.

   The letter-spacing is added after every digit including the last, which would pull the code left of
   centre; the same amount back as text-indent puts it where it belongs. The placeholder is a word,
   not a code, so it opts out of both. */
.input-code {
  text-align: center;
  font-size: var(--fs-lg);
  letter-spacing: .35em;
  text-indent: .35em;
}
.input-code::placeholder {
  letter-spacing: normal;
  text-indent: 0;
}

/* ---------- Form layout ----------
   **The three shapes a form is drawn in, once each.** A form pairs fields two to a row or stacks them
   one to a row; the page caps its own reading width; the stack owns the vertical rhythm and the action
   row. Every screen that draws a form uses one of these rather than restating the grid or the gap, so
   "two columns collapse at 680px" is a fact about the panel rather than a fact about two pages. */

/* Two columns of related questions. `1fr 1fr` and not `auto`, so the right-hand box starts at the same
   x on every row. The `min-width: 0` on the children is what lets a long value shrink inside its half
   rather than pushing the grid wider than the card, which a grid track sized by its content would do.
   Collapsing at 680px is the width at which the two halves stop being readable side by side. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px var(--sp-4);
}
.form-grid > * {
  min-width: 0;
}
@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* The width a form page is read at. The main column is as wide as the window, which is what a table
   and a stack of cards both want - while a form does not: a text box spanning a 1,300px window leaves
   its label a long way from its value and the next field a long way from both. 880px is a card with
   the measure of a field inside it, and it is a max rather than a width, so a narrower window is drawn
   exactly as it was. */
.form-page { width: 100%; max-width: 880px; }

/* Align paired labels even when one wraps. Subgrid keeps hints below their own control. */
.form-grid > .field {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  align-content: start;
  row-gap: 6px;
}
.form-grid > .field > .label { align-self: end; }
.form-grid > .field > :not(.label) { align-self: start; }
.field--short > .input, .field--short > .select, .field--short > .picker { max-width: 12rem; }
.field--medium > .input, .field--medium > .select, .field--medium > .picker { max-width: 24rem; }
.form-grid > .field--full { grid-column: 1 / -1; }
textarea.input { min-height: 88px; resize: vertical; }
input[type="file"].input { height: auto; }

/* The vertical rhythm of a form. `.field` spaces its own label from its own control, but nothing
   spaced one field from the next, so a form's controls, alerts and buttons all stacked flush and read
   as a single block. It is a class rather than a rule on `form` so a page can opt in, and the gap does
   the work an alert's missing margin would otherwise need. */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* A button that is a direct child of the stack is its own width rather than the stack's. Every child
   of a flex column stretches, which is what a field, an alert and a card all want - a control as wide
   as the fields under it. A button is the one thing that does not want it: the panel's buttons are
   drawn at the width of their own label everywhere else, and a lone save stretched across the card
   reads as a banner the form ends with instead of the step it is. `align-self` rather than a width, so
   a button that is deliberately full width (`.btn-block`) keeps its `width: 100%`. */
.form-stack > .btn {
  align-self: flex-start;
}

/* A card carries its own bottom margin for the pages that stack cards as plain siblings, which is how
   the detail screen spaces them. Inside this stack the gap is the spacing, so leaving the margin on
   would add the two together - 32px between two cards that sit 16px apart everywhere else on the same
   page. Zeroing it here keeps one rhythm rather than two. Both selectors are needed because `.card.pad`
   is the class that carries the margin, and it outranks a bare `.card` child. */
.form-stack > .card,
.form-stack > .card.pad {
  margin-bottom: 0;
}

/* The same cancellation one level down, for a card a stack holds inside a `<noscript>`. A `<noscript>`
   is display:none in a browser that runs scripts, so it is not a flex item and never comes between two
   children of the stack; in a browser that does not, the UA stylesheet makes it a box and the card
   inside it becomes a grandchild - out of reach of the pair above, and carrying a margin that would
   double its own gap. The documents tab draws the review card this way, so that a browser with no
   script sees the card and one with a script sees the dialog.

   `display: contents` is deliberately not used to flatten the `<noscript>` instead: it is not supported
   on the element in every engine, and where it is ignored the card would be spaced twice. */
.form-stack > noscript > .card,
.form-stack > noscript > .card.pad {
  margin-bottom: 0;
}

/* The cards that sit *under* a form rather than inside it - the subscription card on the lender edit
   screen. The stack's gap spaces everything within the form, but it ends at the form's own edge, and a
   card carries only a bottom margin - so the save row and the first card below it were flush, with
   nothing between them at all. One rule on the card immediately after the form rather than a margin on
   each, so a second card below it is spaced by the first one's own bottom margin and a page that adds a
   third gets the same rhythm without another rule. Both selectors for the reason the pair above gives. */
.form-stack + .card,
.form-stack + .card.pad {
  margin-top: var(--sp-4);
}

/* Save and Cancel, side by side and left-aligned with the fields above them. It wraps rather than
   shrinking, so a narrow window puts Cancel under Save instead of squeezing the two together. */
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Input with trailing action (e.g. show password) */
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap.toolbar-search .input { padding-right: 12px; }
.input-wrap.toolbar-search .input::-webkit-search-cancel-button {
  position: relative;
  right: 4px;
}
.input-trail {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--slate);
  cursor: pointer;
}
.input-trail:hover { background: var(--border); color: var(--ink); }

/* The prototypes sized every icon with width/height attributes at each use site. The panel
   draws icons through _Icon, which fixes the viewBox and leaves the size to CSS, so the
   sizes those attributes carried live here instead - once per component that owns an icon. */
.input-trail svg { width: 18px; height: 18px; }

/* Show/hide password. The prototypes rendered both glyphs and had script set an inline
   `display` on each, which the panel's content security policy refuses. Here the control's
   own aria-pressed attribute picks which glyph is drawn, so the state a screen reader is
   told and the state the screen shows are the same value. */
.input-trail .icon-hide { display: none; }
.input-trail[aria-pressed="true"] .icon-show { display: none; }
.input-trail[aria-pressed="true"] .icon-hide { display: block; }

/* ---------- Feedback ---------- */
.error-msg {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  line-height: var(--lh-small);
  font-weight: 500;
  color: var(--danger);
}
.error-msg.visible { display: inline-flex; }
.error-msg svg { width: 12px; height: 12px; flex-shrink: 0; }

.form-alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  font-size: var(--fs-sm);
  line-height: var(--lh-small);
  font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid var(--danger-tint);
  background: var(--danger-tint);
  color: var(--danger);
}
.form-alert.visible { display: flex; }
.form-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }

/* A link inside an alert, which today means the sign-in notice's "Send a new code". The notice is
   drawn in the danger colour on its own tint, and a link in the panel's blue on that background
   reads as a piece of another component. It keeps the notice's colour and is underlined, which is
   the one thing that still has to say it can be clicked. */
.form-alert-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.form-alert--success {
  border-color: var(--success-tint);
  background: var(--success-tint);
  color: var(--success);
}

/* ---------- Content note ---------- */
/* A line explaining why a region of a page has nothing in it yet. The prototypes had no
   equivalent: every one of their pages was filled with demo data, so nothing ever needed to
   say "this part is not connected". The ported screens all need it until their API clients
   exist, which makes it a component rather than a rule repeated per page. It is deliberately
   neutral-coloured: it reports a state, it is not a warning about a fault. */
.content-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  font-size: var(--fs-sm);
  line-height: var(--lh-small);
  color: var(--slate);
  background: var(--canvas-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.content-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--muted); }

/* ---------- Hint ---------- */
/* The one line of small print under a control: what a box will accept, what leaving it blank
   means, why a control does nothing. It is the panel's smallest muted text and nothing else -
   it carries no margin, so the container's own gap is what spaces it, and the same sentence
   spaces the same whether it sits under a form field or under a card head.

   It lives here rather than in a page's own sheet because every layer of the panel draws one:
   the sign-up screens, the application and lender forms and the profile. `components.css` is
   what `_Layout` and `_AuthLayout` both load, so one rule covers both shells - and a page-local
   copy would be the copy that goes stale. */
.hint {
  font-size: var(--fs-xs);
  line-height: var(--lh-small);
  color: var(--muted);
}

/* ---------- Checkbox ---------- */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  line-height: var(--lh-small);
  color: var(--slate);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---------- Cards ----------
   **One surface for every card-like block in the panel.** A card is four declarations, and they are
   written once: the screens that draw one take these declarations from here rather than restating the
   same background, border, radius and shadow under their own class name. The feature names are listed
   because those blocks are cards - the auth screens' dialog card, the course tree's lesson and chapter,
   the notifications list's row, the whole-page state panel, the messages stream and the application
   form's step body - and each keeps only its own padding and layout in its own sheet.

   `background-color` rather than the `background` shorthand so a modifier that changes only the fill -
   the read notification's canvas - does not have to restate the rest. */
.card,
.auth-card,
.learning-lesson,
.learning-chapter,
.notice,
.state-panel,
.msg-stream,
.steps-body {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* The inner spacing a card gives its contents. Two class names because both are drawn in the views:
   the panel's own screens use `card card-pad`, the record screens use `card pad`. One value, so the
   same card does not breathe differently depending on which screen happens to hold it. */
.card-pad { padding: var(--card-padding); }
.card.pad { padding: var(--card-padding); margin-bottom: var(--sp-5); }

/* The heading inside a card. `display: flex` so a title and a glyph on its line share a baseline, and
   the bottom margin is the gap the card's own facts start under. A `.card-head` is the same title with
   a control on the right, so it zeroes that margin - the head owns the gap below it. */
.card-title {
  margin: 0 0 12px;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: var(--lh-label);
  letter-spacing: var(--ls-heading);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* A card whose title carries a control on its right. The title names the card and the control acts on
   what is under it, so they share a line rather than the control being pushed to the foot of the card,
   where it reads as part of the last key-value row. It wraps rather than squeezing both when the card
   is narrow, which puts the control under the title instead of truncating either. */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head > .card-title { margin-bottom: 0; }

/* The line explaining a head's dormant control, drawn directly under it. Both classes are named because
   `.hint` sets no margin at all, and this is the gap below rather than around: the head's own margin is
   the gap above, so the card's facts do not start flush against a sentence about a control. */
.hint.card-head-note { margin: 0 0 12px; }

/* A field the API has not filled in. An explicit dash is the design's own way of showing an absent
   value; this only gives it a colour, because an unstyled dash in a list of unstyled dashes reads as a
   rendering fault. No value is invented to fill the space. The `.kv` form is kept as well as the bare
   class, and it is not redundant: `.kv dd` sets the answer colour and outranks a single class, so a
   value inside a key-value block needs the two-class selector to be muted at all. */
.kv .value-absent,
.value-absent {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  background: var(--ink);   /* Chatbase-style dark mark */
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  box-shadow: var(--shadow-sm);
}
/* Modern Toggle Switch
   The slider is the picture; the checkbox is the control. It was `display: none` while nothing used
   this, which took the real control out of the tab order and left a label that only a pointer could
   work - so it is hidden from the eye the way `.sr-only` hides a table's caption, and stays focusable.
   The ring is drawn on the slider, because the input it belongs to is a one-pixel box. */
.status-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.status-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.status-switch:focus-within .status-slider {
  box-shadow: var(--ring);
}

.status-slider {
  position: relative;
  width: 52px;
  height: 28px;
  background-color: var(--border-strong);
  border-radius: 999px;
  transition: background-color 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.status-slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.status-switch input[type="checkbox"]:checked + .status-slider {
  background-color: var(--success);
}

.status-switch input[type="checkbox"]:checked + .status-slider::before {
  transform: translateX(24px);
}

.status-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  min-width: 24px;
}

/* A switch that cannot be moved - the notification settings screen's mandatory rows.

   The state is drawn, not hidden: the slider stays in its on colour and only its weight drops, so the
   person reads "always on" rather than "off and I cannot turn it on". Muting it is a second signal for
   the same fact the note under the grid states in words, and `cursor: default` keeps the pointer from
   promising a click the control will not take. The input is still in the document and still `disabled`,
   so a screen reader announces the state with the reason its own label gives. */
.status-switch--locked {
  cursor: default;
}

.status-switch--locked .status-slider {
  opacity: .55;
}

/* The two labels of one row on the settings grid: the category's name, and the dash in the cells of the
   channels it is not sent on - which is a different fact from an off switch and is drawn as one. */
.preference-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.preference-name + .hint {
  display: block;
  margin-top: 2px;
}

.preference-none {
  color: var(--border-strong);
  font-weight: 600;
}

/* ---------- Searchable picker ----------
   Drawn by picker.js over a `select[data-picker]`. The select is hidden and stays the value holder, so
   this is the visible control: a box holding the chosen items as chips, a text box that narrows the list
   as you type, and a popover listbox underneath.

   It is not the `.select` from app-shell.css and it deliberately does not reuse the dead `.menu*`
   popover rules: those belong to a component no view draws, and coupling this to them would be coupling
   a live control to code on its way out. The chevron is the select's own, copied so the two controls
   read the same - and so is the fill and the left padding. A dropdown drawn as `--canvas-alt`, the
   filled-field token the text inputs use, reads beside those white dropdowns as a disabled control
   rather than an empty one, which is the reading the colour was being asked for. */

.picker-native { display: none; }

.picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  min-width: 0;
  min-height: var(--control-height);
  padding: 4px 36px 4px 12px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: text;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.picker:hover { border-color: var(--border-strong); }
.picker:focus-within {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.picker.is-invalid { border-color: var(--danger); }
.picker.is-invalid:focus-within { box-shadow: var(--ring-danger); }
.picker.is-disabled { opacity: .6; cursor: not-allowed; }

/* A selected single value fills the field and keeps its dropdown affordance. */
.picker.is-filled {
  cursor: pointer;
}
.picker.is-filled .picker-chip {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.picker.is-filled .picker-chip-text { flex: 1 1 auto; }

/* `display: contents` so the chips take their place in the wrapper's own flex row rather than adding a
   box of their own around them. */
.picker-chips { display: contents; }

.picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 1px 2px 1px 8px;
  font-size: var(--fs-xs);
  line-height: 18px;
  color: var(--ink);
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint-2);
  border-radius: var(--r-pill);
}
.picker-chip-text { min-width: 0; overflow-wrap: anywhere; white-space: normal; }

/* A name that is not in the master list yet. The dashed edge and the badge are two ways of saying the
   same thing, because the chip is also the value the save will create rather than select. */
.picker-chip--new {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
}
.picker-chip-badge {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 0 5px;
  font-size: 9px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--r-pill);
}

.picker-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  padding: 0;
  font: inherit;
  line-height: 1;
  color: var(--slate);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.picker-change {
  width: 100%; min-width: 0; padding: 5px 0; border: 0;
  background: transparent; color: var(--ink); text-align: left;
  font: inherit; font-size: var(--fs-md); line-height: var(--lh-control);
  cursor: pointer; overflow-wrap: anywhere;
}
.picker-change[hidden] { display: none; }
.picker-note:empty { display: none; }

@media (pointer: coarse) {
  .picker-chip-remove { width: 44px; height: 44px; }
}
/* The glyph is a stylesheet rule rather than text picker.js writes, so the label a screen reader reads
   ("Remove California") and the mark the eye sees are decided in different places on purpose. */
.picker-chip-remove::before { content: "×"; }
.picker-chip-remove:hover { background: var(--primary-tint-2); color: var(--ink); }
.picker-chip-remove:focus-visible { outline: none; box-shadow: var(--ring); }
.picker-chip-remove:disabled { opacity: .45; cursor: not-allowed; }
.picker-chip-remove:disabled:hover { background: transparent; color: var(--slate); }

/* A single pick's own `×`, which is that button in another place: it sits after the box, because the
   answer it takes off is the box's own text rather than a chip inside `picker-chips`. The pair of
   classes is what hides it when there is no answer, and the rule is needed rather than the `hidden`
   attribute alone: `display: inline-flex` above beats the browser's own `[hidden]` rule, which is what
   would otherwise leave a blank button sitting in a box nobody has answered. */
.picker-clear[hidden] { display: none; }

.picker-input {
  flex: 1 1 60px;
  min-width: 60px;
  padding: 2px 0;
  font: inherit;
  font-size: var(--fs-md);
  line-height: var(--lh-control);
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}
.picker-input::placeholder { color: var(--muted); }
.picker-input:disabled { cursor: not-allowed; }

/* The page-wide focus ring belongs to the control and not to the box inside it. `base.css` rings every
   `:focus-visible` element, and this input is focused whenever somebody searches, so without this rule a
   second ring is drawn inside the field - which reads as a separate search box beside the chips, exactly
   the shape this control replaces. The picker's own ring is the one `:focus-within` puts on the wrapper. */
.picker .picker-input:focus,
.picker .picker-input:focus-visible {
  outline: none;
  box-shadow: none;
  border-radius: 0;
}

.picker-list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  margin: 0;
  padding: var(--sp-1);
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
/* The same list, above its box, for a field near the bottom of a scrolling container. See `place()` in
   picker.js: the class is added only when there is no room below and more room above. */
.picker-list--above {
  top: auto;
  bottom: calc(100% + 6px);
}

.picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 8px 10px;
  font-size: var(--fs-sm);
  line-height: var(--lh-small);
  color: var(--ink);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.picker-option.is-active { background: var(--canvas-alt); }
.picker-option[aria-selected="true"] { color: var(--primary); font-weight: 500; }
.picker-option-label { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.picker-option-check { flex: 0 0 auto; color: var(--primary); }

/* The row a creatable control draws for a name the list does not hold. It is a real option - arrowed to
   and entered like any other - rather than a bare Enter shortcut, so a half-typed name is never created
   by accident while somebody is only narrowing the list. */
.picker-option--add {
  margin-top: var(--sp-1);
  padding-top: 10px;
  color: var(--primary);
  font-weight: 500;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.picker-add-plus {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 1;
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint-2);
  border-radius: 50%;
}
.picker-add-label { flex: 1 1 auto; min-width: 0; }
.picker-empty {
  padding: 8px 10px;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* The count line, when a list was longer than what was drawn. It takes a full row of the wrapper's flex
   rather than sitting beside the input, so a long chip does not push it out of sight. */
.picker-note {
  flex-basis: 100%;
  font-size: var(--fs-xs);
  line-height: var(--lh-small);
  color: var(--muted);
}

@media (max-width: 600px) {
  .input, .select, .picker-input, .picker-change { font-size: 16px; }
  .field--short > .input, .field--short > .select, .field--short > .picker,
  .field--medium > .input, .field--medium > .select, .field--medium > .picker { max-width: none; }
}
