* { box-sizing: border-box; }
/* System colors prevent a white flash before x-theme defines its local tokens. */
:root { color-scheme: light dark; --x-color-bg: Canvas; --x-color-text: CanvasText; }
body { margin: 0; background: var(--x-color-bg); color: var(--x-color-text); }
x-theme { display: block; min-height: 100vh; color: var(--x-color-text); background: var(--x-color-bg); font-family: var(--x-font-family); }
x-container, x-card, x-grid, x-form { min-width: 0; }
x-typography { overflow-wrap: anywhere; }
x-typography[variant=body2], x-typography[variant=small], x-typography[variant=caption], x-typography[variant=overline] { --x-typography-color: var(--x-color-text-muted); }
a { color: var(--x-color-primary); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--x-color-focus-ring); outline-offset: 4px; }
/* A link that acts as a button has the size of an x-button of the size md: a secondary button, or a primary one. */
.action-link { display: inline-flex; align-items: center; justify-content: center; gap: var(--x-space-sm); min-height: var(--x-button-height-md, 2.5rem);
  padding: 0 var(--x-button-padding-inline, 0.95rem); border: 1px solid var(--x-color-border); border-radius: var(--x-button-radius, var(--x-radius-md));
  color: var(--x-color-text); background: var(--x-color-surface); font: inherit; font-size: var(--x-button-font-size-md, 0.9375rem);
  font-weight: var(--x-font-weight-semibold); line-height: 1.2; white-space: nowrap; }
.action-link:hover { background: var(--x-color-surface-hover); }
.action-link[aria-disabled=true] { opacity: var(--x-opacity-disabled); }
.action-link[aria-disabled=true] { pointer-events: none; }
/* The main action of a screen is a filled primary link, as the primary x-button. The label is white, as the label of
   the primary x-button and of the publish control: the theme has no token for the text on the primary colour. */
.action-link.primary { border-color: var(--x-color-primary); background: var(--x-color-primary); color: white; }
.action-link.primary:hover { border-color: var(--x-color-primary-hover); background: var(--x-color-primary-hover); }
/* A link inside a table row is a plain link: a bordered button in each row makes the list heavy. */
x-table-cell .action-link:not(.primary) { min-height: 0; padding: 4px 6px; border-color: transparent; background: transparent; color: var(--x-color-primary);
  font-size: var(--x-font-size-sm); font-weight: var(--x-font-weight-medium); }
x-table-cell .action-link:not(.primary):hover { background: var(--x-color-surface-hover); text-decoration: underline; }
x-card { --x-card-background: var(--x-color-surface); --x-card-color: var(--x-color-text); --x-card-border-color: var(--x-color-border); }
/* Static surfaces follow theme changes immediately, without a gray intermediate frame. */
x-card:not([interactive]) { --x-card-transition-duration: 0ms; }
x-form-field { --x-form-field-input-bg: var(--x-color-surface); --x-form-field-input-color: var(--x-color-text); --x-form-field-label-color: var(--x-color-text); --x-form-field-hint-color: var(--x-color-text-muted); --x-form-field-error-color: var(--x-color-danger); --x-form-field-input-border: 1px solid var(--x-color-border); --x-form-field-focus-ring-color: var(--x-color-focus-ring); }
x-text-area { --x-text-area-bg: var(--x-color-surface); --x-text-area-color: var(--x-color-text); --x-text-area-label-color: var(--x-color-text); --x-text-area-hint-color: var(--x-color-text-muted); --x-text-area-error-color: var(--x-color-danger); --x-text-area-border: 1px solid var(--x-color-border); --x-text-area-focus-ring-color: var(--x-color-focus-ring); }
x-select { --x-select-bg: var(--x-color-surface); --x-select-fg: var(--x-color-text); --x-select-border: var(--x-color-border); --x-select-focus-ring: var(--x-color-focus-ring); }
x-form:not(:defined), x-grid:not(:defined), x-card:not(:defined), x-container:not(:defined) { display: block; visibility: hidden; }
/* admin.js defines x-tabs after the parse (see tools/baredom-bundle/entry.js). Until then the tab row has the geometry of
   the shadow styles of x-tabs, so the layout does not move. */
x-tabs:not(:defined) { display: flex; flex-wrap: nowrap; }
x-tabs:not(:defined):not([orientation=vertical]) > x-tab { margin-inline-end: var(--x-tabs-gap, 8px); }
x-typography.field-label { --x-typography-color: var(--x-color-text); }
form[hidden] { display: none; }
x-container[hidden], x-image[hidden], input[hidden] { display:none !important; }
div[hidden], aside[hidden] { display: none !important; }
/* The title of a row opens its entry. The rows of one list keep one weight; the kind icon shows the level. */
.row-title { color: var(--x-color-text); font-weight: var(--x-font-weight-medium); text-decoration: none; overflow-wrap: anywhere; }
.row-title:hover, .row-title:focus-visible { color: var(--x-color-primary); text-decoration: underline; }
