/* appearance-panel.css — shared popover styling. Token-driven, so it inherits whichever brand's
 * tokens-<brand>.css is loaded on the page automatically — this file never sets a brand colour.
 * The one per-brand touch is the ".ap-panel::before" accent rule, which reuses that portal's
 * existing signature element (see FLAVOURS.md) rather than a generic panel header, so the
 * popover still reads as "this company's settings" even though the layout is shared.
 */
.ap-panel {
  width: 300px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  padding: var(--space-4);
  z-index: 60;
  font-family: var(--font-body);
  color: var(--tx1);
}
.ap-panel[hidden] { display: none; }
.ap-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}
.ap-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--tx2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.ap-close:hover { color: var(--tx1); border-color: var(--accent); }
.ap-group {
  border: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}
.ap-group:last-of-type { margin-bottom: 0; }
.ap-group legend {
  font-size: var(--text-meta);
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: var(--space-2);
  padding: 0;
}
.ap-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ap-opt-wrap { position: relative; }
.ap-opt-wrap input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.ap-opt {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--tx2);
  font-size: var(--text-meta);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.ap-opt-wrap input:checked + .ap-opt {
  border-color: var(--accent);
  color: var(--on-accent);
  background: var(--accent-fill);
}
.ap-opt-wrap input:focus-visible + .ap-opt {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.ap-opt-wrap:hover .ap-opt { border-color: var(--accent); }

/* Trigger button (bell/gear icon + optional label) that opens the panel */
.appearance-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-meta);
}
.appearance-trigger[aria-expanded="true"] { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .ap-opt { transition: none; }
}
