/*
 * Mist skin (the Rainlet design system) for the xoong site. Loaded last. Palette values are in brand.css (Mist is the default);
 * this file is the shape and manner: 1px lines, soft grey page, white cards, 40px controls, 8px/12px radius, soft shadow only on
 * floating things, selected = accent tint + accent text + a 3px bar, status badges with their own glyph, sentence-case labels.
 * "Docs variant": prose is 16px/1.65 and headings are 600; everything else follows Mist admin.
 */
:root { --shadow-sm: 0 1px 2px color-mix(in srgb, var(--xo-color-text) 6%, transparent); --shadow-float: 0 12px 32px color-mix(in srgb, var(--xo-color-text) 14%, transparent), 0 2px 6px color-mix(in srgb, var(--xo-color-text) 8%, transparent); --xo-shadow-pop: var(--shadow-float); --xo-shadow-raised: none; --xo-focus: 2px solid var(--xo-color-accent); --xo-focus-thin: 2px solid var(--xo-color-accent); }

/* ---- type ---- */
body { font: 400 16px/1.65 var(--font); background: var(--xo-color-bg); color: var(--xo-color-text); }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }
.content > h1, .page-head h1 { font-size: 40px; line-height: 1.15; letter-spacing: -.015em; }
.content h2 { font-size: 28px; line-height: 1.25; } .content h3 { font-size: 20px; }
.lede, .content > .lede { font-size: 18px; color: var(--xo-color-text-2); }
code, kbd { font-size: 14px; } :not(pre) > code { background: var(--xo-color-subtle); border-radius: 4px; }
.eyebrow { font: 600 13px/1 var(--font); letter-spacing: 0; text-transform: none; color: var(--xo-color-muted); }
:focus-visible { outline: var(--xo-focus); outline-offset: 2px; border-radius: 4px; }
a { color: var(--xo-color-accent-strong); } a:hover { color: var(--xo-color-accent); }

/* ---- chrome ---- */
header.top { background: var(--xo-color-surface); backdrop-filter: none; border-bottom: 1px solid var(--xo-color-border); }
header.top .wrap { min-height: 56px; padding-block: 0; }
.brand img { display: block; height: 28px; width: auto; }
header.top nav a { color: var(--xo-color-text-2); font: 500 14px/1 var(--font); padding: 11px 12px; border-radius: 8px; }
header.top nav a:hover { background: var(--xo-color-subtle); color: var(--xo-color-text); }
header.top nav a[aria-current="page"] { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); font-weight: 600; }
.palette-toggle { border: 1px solid var(--xo-color-control-border); font: 500 14px/1 var(--font); border-radius: 8px; padding: 11px 14px; }
.palette-toggle:hover { background: var(--xo-color-subtle); }
.shell > nav.side { background: var(--xo-color-surface); border-right: 1px solid var(--xo-color-border); }
.shell nav.side h2 { font: 600 12px/1 var(--font); letter-spacing: 0; text-transform: none; color: var(--xo-color-muted); margin: 20px 0 6px; padding-left: 12px; }
.shell nav.side a { min-height: 36px; padding: 0 12px; font: 500 14px/1.2 var(--font); color: var(--xo-color-text-2); border-radius: 8px; }
.shell nav.side a:hover { background: var(--xo-color-subtle); color: var(--xo-color-text); }
.shell nav.side a[aria-current="page"] { background: light-dark(var(--xo-color-accent-soft), color-mix(in srgb, var(--xo-color-accent) 24%, var(--xo-color-surface))); color: var(--xo-color-accent-strong); font-weight: 600; box-shadow: inset 3px 0 0 var(--xo-color-accent); }
.shell nav.side .icon { color: var(--xo-color-muted); }
.rail ol a[aria-current="true"] { color: var(--xo-color-accent-strong); border-left-color: var(--xo-color-accent); }
footer.foot { background: var(--xo-color-surface); }

/* ---- surfaces: one border, white card, 12px ---- */
.card, .panel, .example, .table-frame, .preset, .state, .skeleton, .tile, .person { background: var(--xo-color-surface); border: 1px solid var(--xo-color-border); border-radius: var(--radius); box-shadow: none; }
.card:hover { transform: none; border-color: var(--xo-color-control-border); }
.example-head { background: var(--xo-color-subtle); }
.preview { background: var(--xo-color-bg); background-image: none; }
.preview .panel { border-radius: var(--radius); }
.card .no { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); }

/* ---- buttons ---- */
button, .button { font: 500 14px/1 var(--xo-font); padding: 0 16px; gap: 8px; }
button:hover, button.is-hover, .button:hover { background: var(--xo-color-subtle); border-color: var(--xo-color-control-border); }
button:active, button.is-active { background: var(--xo-color-border); transform: none; }
button.primary { font-weight: 600; color: var(--xo-color-primary-text); background: var(--xo-color-primary); border-color: var(--xo-color-primary); }
button.primary:hover, button.primary.is-hover { color: var(--xo-color-primary-text); background: color-mix(in srgb, var(--xo-color-primary) 84%, #000); border-color: color-mix(in srgb, var(--xo-color-primary) 84%, #000); }
button.primary:disabled { background: var(--xo-color-subtle); color: var(--xo-color-muted); border-color: var(--xo-color-border); }
button.danger { color: var(--xo-color-danger); border-color: var(--xo-color-danger); }
button.danger:hover { background: color-mix(in srgb, var(--xo-color-danger) 10%, var(--xo-color-surface)); border-color: var(--xo-color-danger); }
button.ghost { background: transparent; border-color: transparent; } button.ghost:hover, button.ghost.is-hover { background: var(--xo-color-subtle); border-color: transparent; }
button:disabled, button[aria-disabled="true"] { color: var(--xo-color-muted); background: var(--xo-color-subtle); border-color: var(--xo-color-border); opacity: 1; }
button.sm { padding: 0 12px; font-size: 13px; }
.btn { height: 40px; padding: 0 16px; border: 1px solid var(--xo-color-control-border); border-radius: 8px; background: var(--xo-color-surface); color: var(--xo-color-text); font: 500 14px/1 var(--font); box-shadow: none; }
.btn:hover { transform: none; box-shadow: none; background: var(--xo-color-subtle); color: var(--xo-color-text); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; box-shadow: none; }
.btn.primary:hover, .btn.primary:active { transform: none; box-shadow: none; background: color-mix(in srgb, var(--primary) 84%, #000); color: var(--primary-text); }
.xo-form > .xo-submit, button.xo-submit, .xo-confirm-ok { background: var(--xo-color-primary); color: var(--xo-color-primary-text); border-color: var(--xo-color-primary); }
.xo-confirm-ok { background: var(--xo-kind, var(--xo-color-danger)); border-color: var(--xo-kind, var(--xo-color-danger)); color: var(--xo-color-surface); }

/* ---- fields ---- */
input:not([type="checkbox"], [type="radio"], [type="color"], [type="range"], [type="file"]), select, textarea { font: 400 14px/1.4 var(--xo-font); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--xo-color-muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .is-focus.field-control { outline: var(--xo-focus); outline-offset: 0; border-color: var(--xo-color-accent); box-shadow: none; }
.field > label, .field > .label, .xo-field > label { font: 600 14px/1.3 var(--xo-font); }
.field .hint, .xo-hint { font-size: 13px; }

/* ---- badges: every one has its own glyph ---- */
.badge { gap: 6px; min-height: 24px; padding: 0 10px; font: 600 12px/1 var(--xo-font); color: var(--xo-color-accent-strong); background: var(--xo-color-accent-soft); }
.badge::before { content: ""; flex: none; width: 8px; height: 8px; background: currentColor; transform: rotate(45deg) scale(.86); }
.badge.ok::before { border-radius: 50%; transform: none; } .badge.warn::before { border-radius: 1px; transform: none; } .badge.danger::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: none; }
.badge.ok { color: color-mix(in srgb, var(--xo-color-success) 55%, var(--xo-color-text)); } .badge.warn { color: color-mix(in srgb, var(--xo-color-warning) 35%, var(--xo-color-text)); }

/* ---- tabs: underline; pills become the Mist segmented control ---- */
[role="tablist"], xo-tabs > [role="tablist"] { gap: 24px; }
[role="tab"], xo-tabs [role="tab"] { min-height: 44px; padding: 0; font: 500 14px/1 var(--xo-font); color: var(--xo-color-muted); }
[role="tab"]:hover, xo-tabs [role="tab"]:hover { color: var(--xo-color-text); background: none; }
[role="tab"][aria-selected="true"], xo-tabs [role="tab"][aria-selected="true"] { color: var(--xo-color-accent-strong); font-weight: 600; border-bottom-color: var(--xo-color-accent); }
.example-head [role="tablist"] { gap: 20px; padding-left: 16px; }
.tabs-pills, [role="tablist"].tabs-pills, xo-tabs.tabs-pills > [role="tablist"] { gap: 2px; padding: 3px; background: var(--xo-color-subtle); border: 0; border-radius: 10px; width: fit-content; }
.tabs-pills [role="tab"], xo-tabs.tabs-pills [role="tab"] { min-height: 34px; padding: 0 16px; margin: 0; border: 0; border-radius: 8px; font-weight: 500; color: var(--xo-color-text-2); }
.tabs-pills [role="tab"]:hover { background: var(--xo-color-border); color: var(--xo-color-text); }
.tabs-pills [role="tab"][aria-selected="true"], xo-tabs.tabs-pills [role="tab"][aria-selected="true"] { background: var(--xo-color-surface); color: var(--xo-color-accent-strong); box-shadow: var(--shadow-sm), inset 0 0 0 1px color-mix(in srgb, var(--xo-color-accent) 22%, var(--xo-color-surface)); }
.chip { border-radius: 8px; font: 500 14px/1 var(--xo-font); } .chip[aria-pressed="true"] { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); border-color: var(--xo-color-accent); font-weight: 600; }

/* ---- notices: tinted row, icon and words, no frame ---- */
.notice { border: 0; border-radius: 8px; padding: 12px 16px; background: var(--xo-color-accent-soft); box-shadow: none; }
.notice.ok { background: color-mix(in srgb, var(--xo-color-success) 12%, var(--xo-color-surface)); } .notice.warn { background: color-mix(in srgb, var(--xo-color-warning) 14%, var(--xo-color-surface)); } .notice.error { background: color-mix(in srgb, var(--xo-color-danger) 10%, var(--xo-color-surface)); }
.notice.info .icon { color: var(--xo-color-accent-strong); } .notice.warn .icon { color: color-mix(in srgb, var(--xo-color-warning) 35%, var(--xo-color-text)); }

/* ---- floating things ---- */
.menu-panel, xo-menu [role="menu"], .xo-combobox-list, .xo-richtext-more { border: 1px solid var(--xo-color-border); border-radius: var(--radius); box-shadow: var(--xo-shadow-pop); }
.menu-panel [role="menuitem"], xo-menu [role^="menuitem"] { min-height: 40px; font: 500 14px/1 var(--xo-font); }
.menu-panel [role="menuitem"]:hover, xo-menu [role^="menuitem"]:hover { background: var(--xo-color-subtle); }
.menu-panel [role="menuitem"][aria-current="true"], xo-menu [role="menuitem"][aria-current="true"] { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); font-weight: 600; }
.tooltip, .xo-tooltip { background: var(--xo-color-inverse); color: var(--xo-color-inverse-text); font: 500 12px/1.3 var(--xo-font); border-radius: 6px; padding: 6px 10px; outline: 0; box-shadow: none; }
.toast, .xo-toast { background: var(--xo-color-surface); color: var(--xo-color-text); border: 1px solid var(--xo-color-border); border-left: 1px solid var(--xo-color-border); border-radius: var(--radius); box-shadow: var(--xo-shadow-pop); outline: 0; font-weight: 600; }
.toast .icon { color: var(--xo-color-success); } .toast.toast-error .icon { color: var(--xo-color-danger); }
.xo-toast-action { color: var(--xo-color-accent-strong); border-color: var(--xo-color-control-border); background: transparent; }
xo-dialog > dialog, .xo-confirm { border: 1px solid var(--xo-color-border); border-radius: var(--radius); box-shadow: var(--xo-shadow-pop); }
.xo-confirm-actions { border-top: 1px solid var(--xo-color-border); margin: 20px -24px -24px; padding: 16px 24px; }

/* ---- tables ---- */
table.std thead th, .xo-table th { background: var(--xo-color-bg); color: var(--xo-color-muted); font: 600 12px/1.3 var(--xo-font); letter-spacing: 0; text-transform: none; padding: 8px 16px; }
table.std td, .xo-table td { padding: 6px 16px; height: 48px; }
table.std tbody tr:hover td, .xo-table tbody tr:hover td { background: var(--xo-color-bg); } table.std tbody tr:hover, .xo-table tbody tr:hover { background: none; }
table.std tbody tr[aria-selected="true"] td, .xo-table tbody tr:has(input[type="checkbox"]:checked) td { background: var(--xo-color-accent-soft); }
table.std tbody tr[aria-selected="true"] td:first-child, .xo-table tbody tr:has(input[type="checkbox"]:checked) td:first-child { box-shadow: inset 3px 0 0 var(--xo-color-accent); }
table.std tbody tr[aria-selected="true"], .xo-table tbody tr:has(input[type="checkbox"]:checked) { background: none; }
.table-bulk, .xo-bulk { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); }
.xo-richtext-box, .xo-combobox-box { border-radius: var(--xo-radius); }

/* ---- landing page ---- */
.hero { background: var(--xo-color-surface); background-image: none; border-bottom: 1px solid var(--xo-color-border); }
.hero h1 { font: 600 clamp(36px, 5vw, 56px)/1.08 var(--f-brand); letter-spacing: -.02em; }
.hero h1 em { color: var(--xo-color-accent); } .hero h1 em::after { display: none; }
.hero .lede { font-size: 18px; } .pot-badge { display: none; }
.window { background: #1e2e38; border: 0; border-radius: var(--radius); box-shadow: var(--xo-shadow-pop); color: #e8eef2; }
.window .bar { background: #16232c; color: #aab7c2; } .window .bar i { width: 10px; height: 10px; background: #3a4d5b; } .window .bar i:nth-child(2), .window .bar i:nth-child(3) { background: #3a4d5b; }
.cursor { background: #6aa8f0; } .t-tag { color: #9cc7f6; } .t-attr { color: #e0b04a; } .t-str { color: #5fc88f; } .t-mute { color: #8fa0ad; }
.pills li { background: var(--xo-color-surface); border-radius: 8px; font: 500 13px/1 var(--mono); } .pills b { color: var(--xo-color-accent); }
.band { background: var(--xo-color-surface); color: var(--xo-color-text); border-block: 1px solid var(--xo-color-border); }
.band strong { color: var(--xo-color-text); font-weight: 600; letter-spacing: -.02em; } .band span { color: var(--xo-color-muted); }
.recipe li { background: var(--xo-color-surface); border-radius: var(--radius); box-shadow: none; }
.recipe li::before { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); border: 0; box-shadow: none; font-weight: 600; }
pre.plain { background: var(--xo-color-subtle); border: 0; box-shadow: none; border-radius: 8px; }
.cta .box { background: var(--xo-color-accent-soft); color: var(--xo-color-text); border: 1px solid var(--xo-color-border); border-radius: var(--radius); box-shadow: none; }
.cta .btn { color: var(--xo-color-text); border-color: var(--xo-color-control-border); } .cta .btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.page-head { background: var(--xo-color-surface); background-image: none; }
.note { border: 0; border-radius: 8px; background: color-mix(in srgb, var(--xo-color-warning) 14%, var(--xo-color-surface)); box-shadow: none; }

/* ---- fixes found on first render ---- */
button.icon-only, button.icon-only.sm, button.icon-only.lg { padding: 0; }
button.icon-only { width: var(--xo-control-height); } button.icon-only.sm { width: var(--xo-control-height-sm); } button.icon-only.lg { width: var(--xo-control-height-lg); }
footer.foot .brand img { width: auto; height: 24px; }
.rail h2 { font: 600 12px/1 var(--font); letter-spacing: 0; text-transform: none; color: var(--xo-color-muted); }
.rail ol { border-left-color: var(--xo-color-border); }
.brand img { height: 32px; }
@media (min-width: 62rem) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* busy: the label stays readable (dimmed) and a small spinner leads it */
button[aria-busy="true"], button.danger[aria-busy="true"] { color: var(--xo-color-text); opacity: 1; cursor: progress; }
button.danger[aria-busy="true"] { color: var(--xo-color-danger); }
button.primary[aria-busy="true"] { color: var(--xo-color-primary-text); opacity: 1; cursor: progress; }
button[aria-busy="true"]::after { position: static; flex: none; order: -1; width: 14px; height: 14px; border-color: currentColor; border-right-color: transparent; }

/* menu divider (xoong v0.0.27: <hr> in <xo-menu> is role=separator) */
xo-menu [role="separator"], .menu-panel hr { margin: 4px 8px; border: 0; border-top: 1px solid var(--xo-color-border); height: 0; }

/* brand type: Be Vietnam Pro for headings and brand surfaces, the system font for the interface and prose */
h1, h2, h3, .hero h1, .page-head h1, .eyebrow { font-family: var(--f-brand); }
.card h3, .recipe h3, .band strong { font-family: var(--f-brand); }

/* ======== Admin patterns asked by the Rainlet dev (docs/widget-classes.md): form rhythm, segmented groups, modal, hit area, table cards ======== */
:root { --xo-field-gap: 6px; --xo-form-gap: 20px; }
.field { margin: 0 0 var(--xo-form-gap); }
.xo-form, .xo-fields { display: grid; gap: var(--xo-form-gap); align-content: start; }
.xo-form .field, .xo-fields .field, .xo-form .xo-field, .xo-fields .xo-field { margin: 0; }
.xo-prose { max-width: 720px; }
xo-tabs > [role="tabpanel"] { padding-top: var(--xo-form-gap); }
[hidden] { display: none !important; }

/* icon-only buttons: the visible button stays 40px (32px small), the hit area is 44px */
button.icon-only { position: relative; }
button.icon-only::before { content: ""; position: absolute; inset: -2px; }
button.icon-only.sm::before { inset: -6px; }

/* any group of button[aria-pressed] can be the Mist segmented control: add class xo-seg to the group */
.xo-seg { align-items: center; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.xo-seg button { flex: none; white-space: nowrap; }
.xo-seg__badge { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; font: 700 11px/1 var(--xo-font); color: color-mix(in srgb, var(--xo-color-warning) 40%, var(--xo-color-text)); background: color-mix(in srgb, var(--xo-color-warning) 22%, var(--xo-color-surface)); }
.xo-seg__badge[data-state="invalid"] { color: var(--xo-color-danger); background: color-mix(in srgb, var(--xo-color-danger) 14%, var(--xo-color-surface)); }

/* modal: dialog.xo-modal > .xo-modal__head + .xo-modal__body + .xo-modal__foot (media picker, crop, add block) */
dialog.xo-modal { padding: 0; width: min(40rem, calc(100vw - 2rem)); max-height: min(90vh, 52rem); color: var(--xo-color-text); background: var(--xo-color-surface); border: 1px solid var(--xo-color-border); border-radius: var(--radius); box-shadow: var(--xo-shadow-pop); overflow: hidden; }
dialog.xo-modal[open] { display: flex; flex-direction: column; }
dialog.xo-modal--wide { width: min(60rem, calc(100vw - 2rem)); } dialog.xo-modal--full { width: min(96rem, calc(100vw - 2rem)); }
dialog.xo-modal::backdrop { background: color-mix(in srgb, #1f2a33 45%, transparent); }
.xo-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--xo-color-border); }
.xo-modal__head h2 { margin: 0; padding: 0; border: 0; font: 600 18px/1.3 var(--f-brand); letter-spacing: -.005em; }
.xo-modal__body { flex: 1; min-height: 0; padding: 20px; overflow: auto; }
.xo-modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--xo-color-border); }
.xo-modal__foot .grow { margin-right: auto; }
@media (max-width: 47.99rem) { dialog.xo-modal, dialog.xo-modal--wide, dialog.xo-modal--full { width: 100vw; max-width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; } }

/* tables under 768px become row cards. Class xo-cards on the table frame (xo-table adds it when it has the `cards` attribute); every td has data-label
   (xo-table writes it from the column label); td[data-title] is the card title, td[data-status] the status badge, the actions cell is td.cell-actions or td > .xo-actions.
   A container query: it follows the width of the table's own box, not the window, so it also works in a narrow pane. */
.xo-cards { container-type: inline-size; }
@container (max-width: 47.99rem) {
  .xo-cards table, .xo-cards tbody, .xo-cards tr, .xo-cards td { display: block; }
  .xo-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .xo-cards tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--xo-color-border); background: none; box-shadow: none; }
  .xo-cards tbody tr:last-child { border-bottom: 0; }
  .xo-cards tbody tr:hover td, .xo-cards tbody tr td { height: auto; padding: 0; border: 0; background: none; box-shadow: none; }
  .xo-cards td[data-label]::before { content: attr(data-label); display: block; font: 600 12px/1.4 var(--xo-font); color: var(--xo-color-muted); }
  .xo-cards td[data-title] { grid-column: 1; font-weight: 600; }
  .xo-cards td[data-title]::before, .xo-cards td[data-status]::before { display: none; }
  .xo-cards td.select, .xo-cards td:has(> input[type="checkbox"]:only-child) { grid-column: 1 / -1; width: auto; padding-bottom: 6px; }
  .xo-cards td.select::before, .xo-cards td:has(> input[type="checkbox"]:only-child)::before { display: none; }
  .xo-cards td[data-status] { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; }
  .xo-cards td:not([data-title], [data-status], .select, .cell-actions, :has(> .xo-actions), :has(> input[type="checkbox"]:only-child)) { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  .xo-cards td:not([data-title], [data-status], .select, .cell-actions, :has(> .xo-actions), :has(> input[type="checkbox"]:only-child))::before { flex: 0 0 6.5rem; }
  .xo-cards td.cell-actions, .xo-cards td:has(> .xo-actions) { grid-column: 1 / -1; width: auto; text-align: left; padding-top: 6px; }
  .xo-cards tbody tr[aria-selected="true"], .xo-cards tbody tr:has(input[type="checkbox"]:checked) { background: var(--xo-color-accent-soft); box-shadow: inset 3px 0 0 var(--xo-color-accent); }
}

/* static carousel sketch on states.html (same Mist look as the xo-carousel parts) */
.carousel .arrow { width: 40px; height: 40px; border: 1px solid var(--xo-color-control-border); border-radius: var(--xo-radius); background: var(--xo-color-surface); color: var(--xo-color-text); box-shadow: none; font-weight: 500; }
.carousel .arrow:hover { background: var(--xo-color-subtle); transform: none; box-shadow: none; } .carousel .arrow:active { background: var(--xo-color-border); transform: none; box-shadow: none; }
.carousel .arrow[disabled] { opacity: 1; color: var(--xo-color-muted); background: var(--xo-color-subtle); border-color: var(--xo-color-border); }
.carousel .dots button { width: 8px; height: 8px; border: 0; background: var(--xo-color-control-border); }
.carousel .dots button[aria-current="true"] { width: 24px; background: var(--xo-color-accent); }
.carousel .count { font: 600 13px/1 var(--xo-font); color: var(--xo-color-muted); }
.thumbs button { border: 0; border-radius: var(--xo-radius); box-shadow: inset 0 0 0 1px var(--xo-color-border); }
.thumbs button[aria-current="true"] { box-shadow: none; outline: 2px solid var(--xo-color-accent); outline-offset: 2px; }

/* a link that looks like a button (row actions, "New article", "View site"): <a class="button [primary|ghost|danger|sm]"> */
.button { text-decoration: none; }
.button:hover { text-decoration: none; color: var(--xo-color-text); }
.button.primary { font-weight: 600; color: var(--xo-color-primary-text); background: var(--xo-color-primary); border-color: var(--xo-color-primary); }
.button.primary:hover { color: var(--xo-color-primary-text); background: color-mix(in srgb, var(--xo-color-primary) 84%, #000); border-color: color-mix(in srgb, var(--xo-color-primary) 84%, #000); }
.button.ghost { background: transparent; border-color: transparent; } .button.ghost:hover { background: var(--xo-color-subtle); }
.button.danger { color: var(--xo-color-danger); border-color: var(--xo-color-danger); }
.button.sm { min-height: var(--xo-control-height-sm); padding: 0 12px; font-size: 13px; }
.button.icon-only { width: var(--xo-control-height); padding: 0; } .button.icon-only.sm { width: var(--xo-control-height-sm); }
.button[aria-disabled="true"] { color: var(--xo-color-muted); background: var(--xo-color-subtle); border-color: var(--xo-color-border); pointer-events: none; }

/* <summary class="button"> (a details/summary menu button): summary is display:list-item by default; make it a button and hide the marker */
summary.button { display: inline-flex; list-style: none; cursor: pointer; }
summary.button::-webkit-details-marker { display: none; }
summary.button::marker { content: ""; }
details[open] > summary.button { background: var(--xo-color-subtle); }

/* header tools (Palette menu + theme toggle): same family as the buttons (8px radius, 40px), not the old pill with a dark-ringed dot */
header.top nav xo-menu.palette { margin-inline-start: 8px; }
header.top nav xo-menu.palette > button[xo-menu-trigger] { min-height: 40px; padding: 0 12px; gap: 8px; border-radius: var(--xo-radius); border: 1px solid var(--xo-color-control-border); background: var(--xo-color-surface); color: var(--xo-color-text); font: 500 14px/1 var(--font); box-shadow: none; }
header.top nav xo-menu.palette > button[xo-menu-trigger]:hover { background: var(--xo-color-subtle); }
header.top nav xo-menu.palette .dot { width: 10px; height: 10px; border: 0; background: var(--xo-color-accent); box-shadow: 0 0 0 3px var(--xo-color-accent-soft); }
header.top nav xo-theme-toggle { margin-inline-start: 4px; }
header.top nav > a { font: 500 14px/1 var(--font); padding: 11px 12px; border-radius: var(--xo-radius); color: var(--xo-color-text-2); }
header.top nav > a:hover { background: var(--xo-color-subtle); color: var(--xo-color-text); }
header.top nav > a[aria-current="page"] { background: var(--xo-color-accent-soft); color: var(--xo-color-accent-strong); font-weight: 600; }
header.top nav xo-theme-toggle > button.icon-only[aria-pressed] { background: transparent; border-color: transparent; color: var(--xo-color-text-2); }
header.top nav xo-theme-toggle > button.icon-only[aria-pressed]:hover { background: var(--xo-color-subtle); color: var(--xo-color-text); }

/* the header theme toggle is empty until its script runs: keep its 40px so the palette button does not shift sideways */
header.top nav xo-theme-toggle:not(:defined) { display: inline-block; width: 40px; height: 40px; }

/* docs sidebar groups: nav.side > .grp > h2 + a... (a rule between groups, room under the label) */
.shell nav.side .grp { display: grid; gap: 2px; }
.shell nav.side .grp + .grp { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--xo-color-border); }
.shell nav.side .grp > h2 { margin: 10px 0 8px; }
.shell nav.side .grp:first-child > h2 { margin-top: 0; }

/* built-in dialogs of @xoong/ui: dialog.xo-confirm[data-kind] > .xo-confirm-body (icon + content) + .xo-confirm-actions; the dialog sets --xo-kind */
dialog.xo-confirm { padding: 24px; width: min(26rem, calc(100vw - 2rem)); max-width: none; }
dialog.xo-confirm[data-kind="info"] { --xo-kind: var(--xo-color-accent); }
dialog.xo-confirm[data-kind="success"] { --xo-kind: var(--xo-color-success); }
dialog.xo-confirm[data-kind="warning"] { --xo-kind: var(--xo-color-warning); }
dialog.xo-confirm[data-kind="danger"] { --xo-kind: var(--xo-color-danger); }
.xo-confirm-body { display: flex; gap: 16px; align-items: flex-start; }
.xo-confirm-icon { flex: none; box-sizing: border-box; width: 40px; height: 40px; padding: 10px; color: var(--xo-kind, var(--xo-color-accent)); background: color-mix(in srgb, var(--xo-kind, var(--xo-color-accent)) 14%, var(--xo-color-surface)); border-radius: 50%; }
.xo-confirm-content { flex: 1; min-width: 0; display: grid; gap: 8px; }
.xo-confirm-content > * { margin: 0; }
.xo-confirm .xo-confirm-title { font: 600 18px/1.3 var(--f-brand, var(--font)); letter-spacing: -.005em; color: var(--xo-color-text); }
.xo-confirm-content p { font-size: 14px; line-height: 1.5; color: var(--xo-color-text-2); }
.xo-confirm-content p.xo-hint { font-size: 13px; color: var(--xo-color-muted); }
.xo-confirm-field { display: grid; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--xo-color-text); }
.xo-confirm-field input { width: 100%; }
.xo-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.xo-confirm-actions button { min-width: 88px; }
button.xo-confirm-danger { color: var(--xo-color-surface); background: var(--xo-color-danger); border-color: var(--xo-color-danger); }
button.xo-confirm-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--xo-color-danger) 88%, #000); }
button.xo-confirm-ok:hover:not(:disabled) { background: color-mix(in srgb, var(--xo-kind, var(--xo-color-danger)) 88%, #000); }
@media (max-width: 30rem) { .xo-confirm-actions { flex-direction: column-reverse; } .xo-confirm-actions button { width: 100%; } }
/* titled xo-dialog: dialog.xo-modal in a small size */
dialog.xo-modal--sm { width: min(26rem, calc(100vw - 2rem)); }

/* modal with a form: the head stays on top and the action row (div.xo-form-actions, submit first) stays at the bottom while the body scrolls */
.xo-modal__body { --xo-modal-pad: 20px; padding: var(--xo-modal-pad); }
.xo-modal__body .xo-form { max-width: none; }
.xo-modal__body .xo-form-actions { display: flex; flex-wrap: wrap; align-items: center; position: sticky; bottom: calc(-1 * var(--xo-modal-pad)); z-index: 1; justify-content: flex-end; gap: 8px; margin: var(--xo-modal-pad) calc(-1 * var(--xo-modal-pad)) calc(-1 * var(--xo-modal-pad)); padding: 12px var(--xo-modal-pad) max(12px, env(safe-area-inset-bottom)); background: var(--xo-color-surface); border-top: 1px solid var(--xo-color-border); box-shadow: 0 -10px 14px -12px color-mix(in srgb, var(--xo-color-text) 30%, transparent); }
.xo-modal__body .xo-form-actions > .xo-submit { order: 2; }
/* a dialog that has its own foot (editor dialogs): the form's row stays an ordinary row, no second bar */
dialog.xo-modal:has(> .xo-modal__foot) .xo-modal__body .xo-form-actions { position: static; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
@media (max-width: 47.99rem) { .xo-modal__body .xo-form-actions { flex-direction: row; } .xo-modal__head, .xo-modal__foot { padding-inline: 16px; } .xo-modal__body { --xo-modal-pad: 16px; } }
