
/* ── Package picker ──────────────────────────────────────────────── */
.cw-pick-title { flex: 0 0 auto; font-size: 0.76rem; font-weight: 800; opacity: 0.85; padding: 2px 2px 6px; }
.cw-body:has(.cw-pick-title) { flex-direction: column; min-height: 0; }
/* Pack header inside the picker list — groups widgets by manifest author. */
.cw-pick-group {
  flex: 0 0 auto;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.9);
  padding: 8px 2px 3px; margin-top: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cw-pick-list > .cw-pick-group:first-child { padding-top: 0; margin-top: 0; }
/* Search + category chips. Only rendered once the list is long enough to be
   worth filtering, so short lists keep every pixel for the rows themselves. */
.cw-pick-filter { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 0 2px 8px; }
.cw-pick-search { position: relative; display: flex; }
.cw-pick-input {
  flex: 1 1 auto; min-width: 0;
  /* Comfortable on the touchscreen without eating the list. */
  padding: 8px 10px; border-radius: 9px;
  font: inherit; font-size: 0.74rem; font-weight: 600; color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cw-pick-input::placeholder { opacity: 0.5; }
.cw-pick-input:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.08);
}
.cw-pick-input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; cursor: pointer; }
/* One scrollable line — wrapping chips would push the list off a short tile. */
.cw-pick-chips {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.cw-pick-chips::-webkit-scrollbar { display: none; }
.cw-pick-chip {
  flex: 0 0 auto; cursor: pointer;
  padding: 5px 10px; border-radius: 999px;
  font: inherit; font-size: 0.66rem; font-weight: 700; color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cw-pick-chip:hover { background: rgba(255, 255, 255, 0.1); }
.cw-pick-chip.is-on {
  color: rgba(var(--accent-rgb), 1);
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.5);
}
.cw-pick-empty {
  flex: 0 0 auto; padding: 14px 2px; text-align: center;
  font-size: 0.72rem; font-weight: 600; opacity: 0.6;
}
/* Installed packages the rescan refused. Pinned under the list rather than in
   it, so it stays on screen while the list scrolls and while a search is
   filtering everything else away — the case it exists for is a search that
   finds nothing because the widget never loaded. */
.cw-pick-broken {
  flex: 0 0 auto; margin-top: 8px; padding: 8px 10px; border-radius: 9px;
  border: 1px solid rgba(255, 176, 32, 0.35); background: rgba(255, 176, 32, 0.07);
}
.cw-pick-broken-title { font-size: 0.7rem; font-weight: 800; opacity: 0.9; }
.cw-pick-broken-row {
  font-size: 0.68rem; font-weight: 600; opacity: 0.8; margin-top: 3px;
  overflow-wrap: anywhere;
}
.cw-pick-broken-hint { font-size: 0.66rem; font-weight: 600; opacity: 0.6; margin-top: 5px; }
.cw-pick-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; padding: 1px 4px 0 0;
  scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), 0.55) transparent;
}
.cw-pick-list::-webkit-scrollbar { width: 6px; }
.cw-pick-list::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.5); border-radius: 999px; }
.cw-pick-list::-webkit-scrollbar-track { background: transparent; }
.cw-pick-row {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.09); background: rgba(255,255,255,0.04);
}
.cw-pick-txt { flex: 1 1 auto; min-width: 0; }
.cw-pick-name {
  font-size: 0.76rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cw-pick-meta { font-size: 0.66rem; font-weight: 700; opacity: 0.55; margin-top: 1px; }
.cw-pick-desc {
  font-size: 0.7rem; font-weight: 600; opacity: 0.75; line-height: 1.35; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}

/* ── The questions the host puts for a widget ─────────────────────────
   Their window is the request window (components/AskSheet, question() in
   js/deck/approval-keys.js): it reads as Xenon asking, not as the widget's own UI, and
   it sits above whatever raised it. Here is only what goes inside. */
.cw-perm-desc { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.cw-perm-sec { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cw-perm-lead { font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.cw-perm-items { margin: 0; padding: 0; list-style: none; }
.cw-perm-items li { font-size: 15px; line-height: 1.4; color: var(--muted-text); overflow-wrap: anywhere; }
.cw-perm-note { font-size: 14px; line-height: 1.4; color: var(--muted-text); overflow-wrap: anywhere; }
/* User-filled host slots: the address fields a package's `userHosts` declares.
   Sized for the Xeneon Edge touchscreen (44px rows), and the error line is
   reserved space rather than inserted on demand so a message never reflows the
   dialog under the finger that's typing. */
.cw-perm-fields { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.cw-perm-field { display: flex; flex-direction: column; gap: 4px; }
.cw-perm-field-label { font-size: 14px; color: var(--muted-text); }
.cw-perm-input {
  min-height: 44px; padding: 8px 12px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: var(--radius-control);
  font: inherit; font-size: 15px;
  color: inherit; background: color-mix(in srgb, var(--text) 8%, transparent);
}
.cw-perm-input::placeholder { color: var(--muted-text); opacity: 0.7; }
.cw-perm-input:focus-visible { outline: none; border-color: var(--accent); }
.cw-perm-input--bad { border-color: var(--color-danger); }
.cw-perm-field-err { min-height: 18px; font-size: 13px; line-height: 18px; color: var(--color-danger); }
:root[data-appearance="light"] .cw-perm-field-err { color: color-mix(in srgb, var(--color-danger) 65%, var(--text)); }

/* What is about to be copied, or the site about to open: the one thing to read. */
.cw-well {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.cw-clip-val {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 17px; font-weight: 700; overflow-wrap: anywhere;
}
.cw-clip-eye {
  flex: 0 0 auto; min-height: 44px; min-width: 68px; padding: 0 12px;
  border: 0; border-radius: var(--radius-control); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700;
  background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text);
}
.cw-clip-eye:hover { background: color-mix(in srgb, var(--text) 16%, transparent); }
.cw-clip-eye:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* The domain is the decision the user is making, so it is the one thing set large;
   the path sits under it, dimmed and truncated, and can never push it out of view. */
.cw-ext-urlbox { flex-direction: column; align-items: stretch; gap: 4px; }
.cw-ext-host {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 20px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere;
}
.cw-ext-path {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 14px; font-weight: 400; line-height: 1.35; color: var(--muted-text); overflow-wrap: anywhere;
}

/* ── SDK badge chips — Widget SDK `badge` capability (js/widget-sdk/sdk-badges.js) ──
   Small always-on readouts next to the clock, one per granted package (up to a
   few at once). #clock-sdkbadges is a plain span inside .clock in the base
   markup; in the minimal chrome topbar-minimal.js reparents it into the island
   pill as the 'badges' segment, where the segment system draws its own hairline
   divider and padding (.island-seg::before) — so NO divider/padding belongs
   here, or it double-draws. Spacing in the full bar comes from .clock-meta's
   own gap, exactly like the vitals chips next door. The chips themselves are
   FLAT text — no fill, no outline — for the same reason the weather chip is:
   next to the plain clock and date, a raised pill reads as a button you can
   press, and this one does nothing when tapped. Two chips stay legible apart on
   the row gap alone, exactly like the vitals chips. */
.clock-sdkbadges { display: inline-flex; align-items: center; gap: 10px; }
/* An author `display` overrides the UA stylesheet's [hidden] { display: none },
   so the empty row would keep its box — and, as an island segment, keep drawing
   the segment hairline: a stray trailing divider with nothing after it. */
.clock-sdkbadges[hidden] { display: none; }
.sdk-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; line-height: 1;
  color: var(--text, #e7e9ee);
  white-space: nowrap;
}
/* ── SDK mini slot — Widget SDK `mini` capability (js/widget-sdk/sdk-mini.js) ──
   A row of host-drawn blocks living among the topbar BUTTONS rather than in the
   clock, wherever the user placed it (Settings → Dynamic Island → Bottoni della
   barra). It borrows the island's block styles verbatim — the same renderer
   draws them — and adds only the container: a plate that reads as one object
   sitting between buttons, at the buttons' own height so the bar never grows.
   In Minimal the whole thing rides its rail, which is a vertical flex, so the
   plate must not assume a horizontal neighbourhood beyond its own contents. */
.topbar-mini-slot { display: inline-flex; align-items: center; gap: 8px; }
.topbar-mini-slot[hidden] { display: none; }
.topbar-mini-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  padding: 5px 10px;
  border-radius: 11px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  --island-accent: var(--accent);
}
/* Text inside the slot is the one thing that can run long, and the bar has no
   room to give: cut it rather than let one package push the buttons off. */
.topbar-mini-item .sdk-island-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A chip that CAN be tapped (`badge: { action: true }`) is a real <button>, and
   it has to look like one — the comment above explains that a raised pill next
   to the clock reads as pressable, which is exactly what this one is. It keeps
   the flat chip's type and spacing and adds only the affordance: a faint plate,
   a pressed state, and a comfortable target on the Edge touchscreen. */
.sdk-badge-btn {
  border: 0;
  border-radius: 9px;
  padding: 4px 8px;
  margin: -4px 0;   /* the plate must not raise the clock row */
  background: rgba(255,255,255,0.06);
  font: inherit;
  font-size: 13px; font-weight: 700; line-height: 1;
  color: var(--text, #e7e9ee);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.sdk-badge-btn:hover { background: rgba(255,255,255,0.12); }
.sdk-badge-btn:active { transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) {
  .sdk-badge-btn { transition: none; }
  .sdk-badge-btn:active { transform: none; }
}
/* The widget's own glyph. Its colour is set inline from the (hex-validated)
   badge payload — a star is gold, a battery is green — and falls back to the
   chip's text colour when the widget names none. */
.sdk-badge-ico { display: inline-flex; line-height: 1; }
.sdk-badge-ico[hidden] { display: none; }
