/*! tux.css v0.1.0 | MIT License | github.com/elee1766/tuxcss */

/* -- tokens -- */
/* sizing (constant across themes) */
:root {
  --tux-font: "Cousine", "JetBrains Mono", "IBM Plex Mono",
    "Fira Code", "Source Code Pro", ui-monospace, monospace;
  --tux-text-xs: 0.75rem;
  --tux-text-sm: 0.875rem;
  --tux-text-micro: 10px;
  --tux-max-width: 80rem;
  --tux-radius-sm: 2px;
  --tux-density: 1;
}

/* light (default) -- jellybeans-inspired, neutral gray base */
:root, [data-theme="light"] {
  --tux-bg-base: #ebebeb;
  --tux-bg-surface: #f5f5f5;
  --tux-bg-raised: #e0e0e0;
  --tux-bg-muted: #d0d0d0;
  --tux-bg-overlay: #151515;
  --tux-text: #303030;
  --tux-text-secondary: #404040;
  --tux-text-tertiary: #606060;
  --tux-text-muted: #777777;
  --tux-text-faint: #b0b0b0;
  --tux-text-inverse: #f5f5f5;
  --tux-border: #cfcfcf;
  --tux-border-subtle: #e0e0e0;
  --tux-border-strong: #a0a0a0;
  --tux-primary: #3d7a8a;
  --tux-primary-hover: #42717b;
  --tux-primary-strong: #345f6a;
  --tux-primary-soft: #5a949f;
  --tux-primary-subtle: #e0ecef;
  --tux-success: #4a7030;
  --tux-success-soft: #578d3b;
  --tux-success-subtle: #e4edda;
  --tux-success-muted: #578d3b;
  --tux-warning: #c07018;
  --tux-warning-soft: #e2a959;
  --tux-warning-subtle: #f2ebdd;
  --tux-warning-muted: #9a5510;
  --tux-error: #b83030;
  --tux-error-soft: #d43131;
  --tux-error-hover: #982020;
  --tux-error-subtle: #f2e0e0;
  --tux-interactive: #505050;
  --tux-interactive-hover: #353535;
  --tux-interactive-soft: #6d878d;
  color-scheme: light;
}

/* dark -- jellybeans terminal palette */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tux-bg-base: #181818;
    --tux-bg-surface: #1c1c1c;
    --tux-bg-raised: #252525;
    --tux-bg-muted: #353535;
    --tux-bg-overlay: #101010;
    --tux-text: #e0d8e0;
    --tux-text-secondary: #c8c0c0;
    --tux-text-tertiary: #908888;
    --tux-text-muted: #6d6060;
    --tux-text-faint: #403838;
    --tux-text-inverse: #181818;
    --tux-border: #353535;
    --tux-border-subtle: #282828;
    --tux-border-strong: #505050;
    --tux-primary: #7dc1cf;
    --tux-primary-hover: #4e9fb1;
    --tux-primary-strong: #42717b;
    --tux-primary-soft: #7dc1cf;
    --tux-primary-subtle: #1a2a30;
    --tux-success: #b8d68c;
    --tux-success-soft: #578d3b;
    --tux-success-subtle: #1e2818;
    --tux-success-muted: #578d3b;
    --tux-warning: #e2a959;
    --tux-warning-soft: #f39713;
    --tux-warning-subtle: #2a2218;
    --tux-warning-muted: #f39713;
    --tux-error: #e84f4f;
    --tux-error-soft: #d43131;
    --tux-error-hover: #ff5555;
    --tux-error-subtle: #2a1818;
    --tux-interactive: #908888;
    --tux-interactive-hover: #c8c0c0;
    --tux-interactive-soft: #6d878d;
    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --tux-bg-base: #181818;
  --tux-bg-surface: #1c1c1c;
  --tux-bg-raised: #252525;
  --tux-bg-muted: #353535;
  --tux-bg-overlay: #101010;
  --tux-text: #e0d8e0;
  --tux-text-secondary: #c8c0c0;
  --tux-text-tertiary: #908888;
  --tux-text-muted: #6d6060;
  --tux-text-faint: #403838;
  --tux-text-inverse: #181818;
  --tux-border: #353535;
  --tux-border-subtle: #282828;
  --tux-border-strong: #505050;
  --tux-primary: #7dc1cf;
  --tux-primary-hover: #4e9fb1;
  --tux-primary-strong: #42717b;
  --tux-primary-soft: #7dc1cf;
  --tux-primary-subtle: #1a2a30;
  --tux-success: #b8d68c;
  --tux-success-soft: #578d3b;
  --tux-success-subtle: #1e2818;
  --tux-success-muted: #578d3b;
  --tux-warning: #e2a959;
  --tux-warning-soft: #f39713;
  --tux-warning-subtle: #2a2218;
  --tux-warning-muted: #f39713;
  --tux-error: #e84f4f;
  --tux-error-soft: #d43131;
  --tux-error-hover: #ff5555;
  --tux-error-subtle: #2a1818;
  --tux-interactive: #908888;
  --tux-interactive-hover: #c8c0c0;
  --tux-interactive-soft: #6d878d;
  color-scheme: dark;
}

/* -- reset -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  font-family: var(--tux-font);
  font-size: var(--tux-text-xs);
  line-height: 1.5;
  color: var(--tux-text);
  background: var(--tux-bg-base);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* -- typography -- */
:is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--tux-font);
  font-weight: 600;
  color: var(--tux-text);
  line-height: 1.3;
  text-transform: lowercase;
}

h1 { font-size: 1.5rem; margin-bottom: 0.75rem; margin-top: 1.5rem; }  /* 24px */
h2 { font-size: 1.25rem; margin-bottom: 0.5rem; margin-top: 1.25rem; } /* 20px */
h3 { font-size: 1rem; margin-bottom: 0.5rem; margin-top: 1rem; }      /* 16px */
h4 { font-size: var(--tux-text-sm); margin-bottom: 0.25rem; margin-top: 0.75rem; } /* 14px */
h5 { font-size: var(--tux-text-xs); color: var(--tux-text-secondary); margin-bottom: 0.25rem; } /* 12px */
h6 { font-size: var(--tux-text-xs); color: var(--tux-text-tertiary); margin-bottom: 0.25rem; }  /* 12px */

:is(h1, h2, h3, h4):first-child { margin-top: 0; }

p { margin-bottom: 0.5rem; color: var(--tux-text-secondary); }
small { font-size: var(--tux-text-micro); color: var(--tux-text-muted); }
strong, b { font-weight: 700; }

/* -- links -- */
a { color: var(--tux-primary); text-decoration: none; cursor: pointer; }
a:hover { color: var(--tux-primary-strong); text-decoration: underline; }

/* -- layout -- */
body > header {
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  background: var(--tux-bg-surface);
  border-bottom: 1px solid var(--tux-border);
  font-size: var(--tux-text-xs);
  line-height: 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
  user-select: none;
}

body > header a { color: var(--tux-text-muted); text-decoration: none; padding: 0; }
body > header a:hover { color: var(--tux-text-secondary); text-decoration: none; background: none; }

main {
  padding: 1rem 0.75rem;
}

body > footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--tux-border);
  color: var(--tux-text-muted);
  font-size: var(--tux-text-xs);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--tux-text-xs);
}

nav a { color: var(--tux-text-muted); text-decoration: none; padding: 0.25rem 0.75rem; }
nav a:hover { background: var(--tux-bg-raised); color: var(--tux-text-secondary); text-decoration: none; }
nav a:is([aria-current="page"], .active) { color: var(--tux-text); }

/* -- cards (section, article, aside) -- */
:is(section, article, aside) {
  background: var(--tux-bg-surface);
  border: 1px solid var(--tux-border);
  margin-bottom: 0.75rem;
}

:is(section, article, aside) > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  background: var(--tux-bg-raised);
  border-bottom: 1px solid var(--tux-border-subtle);
  color: var(--tux-text-tertiary);
  font-size: var(--tux-text-xs);
}

:is(section, article, aside) > :not(header):not(table):not(details) {
  padding: 0.5rem;
}

:is(section, article, aside) > table {
  border: none;
}

/* nested cards: inset from parent, no double border */
:is(section, article, aside) :is(section, article, aside) {
  margin: 0.5rem;
}

/* -- tables -- */
table { width: 100%; border-collapse: collapse; font-size: var(--tux-text-xs); }
thead tr { background: var(--tux-bg-muted); }
th { text-align: left; padding: 0.25rem 0.5rem; color: var(--tux-text-tertiary); font-weight: 400; white-space: nowrap; }
td { padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--tux-border-subtle); }
tbody tr:hover { background: var(--tux-bg-raised); }
:is(th, td)[data-align="right"] { text-align: right; }

/* -- forms -- */
label { display: block; font-size: var(--tux-text-xs); color: var(--tux-text-tertiary); margin-bottom: 0.125rem; }

input:is([type="text"], [type="email"], [type="password"], [type="number"],
  [type="url"], [type="search"], [type="tel"], [type="date"],
  [type="datetime-local"]),
textarea,
select {
  font-family: var(--tux-font);
  font-size: var(--tux-text-xs);
  padding: 0.5rem;
  border: 1px solid var(--tux-border-strong);
  border-radius: 0;
  background: var(--tux-bg-surface);
  color: var(--tux-text);
  width: 100%;
  outline: none;
  appearance: none;
  line-height: normal;
}

:is(input, textarea, select):focus {
  border-color: var(--tux-primary);
  outline: 1px solid var(--tux-primary);
  outline-offset: -1px;
}

input:is([type="checkbox"], [type="radio"]) {
  accent-color: var(--tux-primary);
  margin-right: 0.25rem;
  vertical-align: middle;
}

textarea { resize: vertical; min-height: 4rem; line-height: 1.8; }

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.5rem;
}

fieldset { border: 1px solid var(--tux-border); padding: 0.5rem; margin-bottom: 0.5rem; }
legend { font-size: var(--tux-text-xs); color: var(--tux-text-tertiary); padding: 0 0.25rem; }

/* -- buttons -- */
:is(button, input:is([type="submit"], [type="reset"], [type="button"])) {
  font-family: var(--tux-font);
  font-size: var(--tux-text-xs);
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  border: none;
  background: var(--tux-primary);
  color: var(--tux-text-inverse);
  text-transform: lowercase;
  line-height: normal;
}

:is(button, input[type="submit"], input[type="button"]):hover {
  background: var(--tux-primary-hover);
}

:is(button, input):disabled { opacity: 0.5; cursor: not-allowed; }

input[type="reset"] { background: var(--tux-interactive-soft); color: var(--tux-text-inverse); }
input[type="reset"]:hover { background: var(--tux-interactive); }

button[data-variant="ghost"] { background: transparent; color: var(--tux-text-tertiary); }
button[data-variant="ghost"]:hover { background: var(--tux-bg-raised); }
button[data-variant="danger"] { background: var(--tux-error); }
button[data-variant="danger"]:hover { background: var(--tux-error-hover); }
button[data-variant="soft"] { background: var(--tux-interactive-soft); }
button[data-variant="soft"]:hover { background: var(--tux-interactive); }

/* -- code -- */
code { font-family: var(--tux-font); font-size: inherit; background: var(--tux-bg-raised); padding: 0.1875rem 0.25rem 0.0625rem; color: var(--tux-text-secondary); }
pre { background: var(--tux-bg-surface); border: 1px solid var(--tux-border); padding: 0.5rem; overflow-x: auto; margin-bottom: 0.5rem; font-size: var(--tux-text-xs); line-height: 1.5; }
pre code { background: none; padding: 0; }
:is(section, article, aside) pre { border: none; background: var(--tux-bg-raised); margin: 0; }
kbd { font-family: var(--tux-font); font-size: var(--tux-text-micro); padding: 0.0625rem 0.25rem; border: 1px solid var(--tux-border-strong); background: var(--tux-bg-raised); color: var(--tux-text-secondary); }
samp { font-family: var(--tux-font); color: var(--tux-text-tertiary); }

/* -- lists -- */
:is(ul, ol) { padding-left: 1.25rem; margin-bottom: 0.5rem; color: var(--tux-text-secondary); }
li { margin-bottom: 0.125rem; }
li::marker { color: var(--tux-text-muted); }
dl { margin-bottom: 0.5rem; }
dt { color: var(--tux-text-tertiary); font-weight: 400; }
dd { color: var(--tux-text); margin-bottom: 0.25rem; margin-left: 0; }

/* -- details -- */
details { border: 1px solid var(--tux-border); margin-bottom: 0.5rem; }
summary { cursor: pointer; padding: 0.25rem 0.5rem; background: var(--tux-bg-raised); color: var(--tux-text-tertiary); font-size: var(--tux-text-xs); list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "\25b6\00a0"; font-size: 0.5em; vertical-align: middle; display: inline-block; transition: transform 0.1s; }
details[open] > summary::before { transform: rotate(90deg); }
details[open] > summary { border-bottom: 1px solid var(--tux-border-subtle); }
details > :not(summary) { padding: 0.5rem; }

/* -- alerts -- */
:is([role="alert"], .alert, [data-alert]) {
  font-size: var(--tux-text-xs);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--tux-primary-subtle);
  color: var(--tux-primary);
  border: 1px solid transparent;
}

[data-alert="error"]   { background: var(--tux-error-subtle);   color: var(--tux-error);   border-color: var(--tux-error-soft); }
[data-alert="success"] { background: var(--tux-success-subtle); color: var(--tux-success); border-color: var(--tux-success-muted); }
[data-alert="warning"] { background: var(--tux-warning-subtle); color: var(--tux-warning); border-color: var(--tux-warning-soft); }
[data-alert="info"]    { background: var(--tux-primary-subtle); color: var(--tux-primary); border-color: var(--tux-primary-soft); }

/* -- progress & meter -- */
progress {
  appearance: none; width: 100%; height: 6px;
  border: none; border-radius: var(--tux-radius-sm);
  overflow: hidden; background: var(--tux-bg-muted);
}
progress::-webkit-progress-bar { background: var(--tux-bg-muted); border-radius: var(--tux-radius-sm); }
progress::-webkit-progress-value { background: var(--tux-primary-soft); border-radius: var(--tux-radius-sm); }
progress::-moz-progress-bar { background: var(--tux-primary-soft); border-radius: var(--tux-radius-sm); }

meter {
  appearance: none; width: 100%; height: 6px;
  border: none; border-radius: var(--tux-radius-sm);
  overflow: hidden; background: var(--tux-bg-muted);
}
meter::-webkit-meter-bar { background: var(--tux-bg-muted); border-radius: var(--tux-radius-sm); border: none; }
meter::-webkit-meter-optimum-value { background: var(--tux-success-soft); }
meter::-webkit-meter-suboptimum-value { background: var(--tux-warning-soft); }
meter::-webkit-meter-even-less-good-value { background: var(--tux-error-soft); }

/* -- misc elements -- */
hr { border: none; border-top: 1px solid var(--tux-border); margin: 0.75rem 0; }
blockquote { border-left: 2px solid var(--tux-border-strong); padding: 0.25rem 0.5rem; margin-bottom: 0.5rem; color: var(--tux-text-secondary); font-style: italic; }
:is(img, video, canvas, svg) { max-width: 100%; height: auto; display: block; }
figure { margin-bottom: 0.5rem; }
figcaption { font-size: var(--tux-text-micro); color: var(--tux-text-muted); margin-top: 0.25rem; }
mark { background: var(--tux-warning-subtle); color: var(--tux-warning-muted); padding: 0 0.125rem; }
del { color: var(--tux-error); text-decoration: line-through; }
ins { color: var(--tux-success); text-decoration: none; border-bottom: 1px solid var(--tux-success); }

/* -- dialog -- */
dialog {
  font-family: var(--tux-font);
  font-size: var(--tux-text-xs);
  color: var(--tux-text);
  background: var(--tux-bg-surface);
  border: 1px solid var(--tux-border);
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog > header { padding: 0.5rem 1rem; border-bottom: 1px solid var(--tux-border-subtle); background: var(--tux-bg-raised); font-size: var(--tux-text-sm); font-weight: 600; }
dialog > footer { padding: 0.5rem 1rem; border-top: 1px solid var(--tux-border-subtle); display: flex; justify-content: flex-end; gap: 0.5rem; }
dialog > :not(header):not(footer) { padding: 1rem; }

/* -- grid utility -- */
[data-grid] { display: grid; gap: 0.5rem; }
[data-grid="2"] { grid-template-columns: repeat(2, 1fr); }
[data-grid="3"] { grid-template-columns: repeat(3, 1fr); }
[data-grid="4"] { grid-template-columns: repeat(4, 1fr); }

/* -- layout utility -- */
[data-layout] { display: grid; gap: 0.75rem; min-height: 0; }
[data-layout="sidebar-left"]  { grid-template-columns: 14rem 1fr; }
[data-layout="sidebar-right"] { grid-template-columns: 1fr 14rem; }
[data-layout="two-column"]    { grid-template-columns: 1fr 1fr; }
[data-layout="three-column"]  { grid-template-columns: 1fr 1fr 1fr; }

/* -- responsive -- */
@media (max-width: 640px) {
  body { font-size: var(--tux-text-xs); }
  main { padding: 0.5rem; }
  body > header { padding: 0 0.5rem; }
  nav { gap: 0.25rem; }
  nav a { padding: 0.25rem 0.375rem; }
  :is([data-grid="2"], [data-grid="3"], [data-grid="4"]) { grid-template-columns: 1fr; }
  [data-layout] { grid-template-columns: 1fr; }
  :is(section, article, aside) > :not(header):not(table):not(details) { padding: 0.375rem; }
  table { display: block; overflow-x: auto; }
  dialog { width: calc(100% - 1rem); }
}

@media (min-width: 641px) and (max-width: 1024px) {
  :is([data-grid="3"], [data-grid="4"]) { grid-template-columns: repeat(2, 1fr); }
  [data-layout="three-column"] { grid-template-columns: 1fr 1fr; }
}

/* -- tabs (ARIA) -- */
[role="tablist"] {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--tux-border);
  font-size: var(--tux-text-xs);
}

[role="tab"] {
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--tux-text-tertiary);
  font-family: var(--tux-font);
  font-size: var(--tux-text-xs);
  text-transform: lowercase;
  margin-bottom: -1px;
}

[role="tab"]:hover { background: var(--tux-bg-raised); color: var(--tux-text-secondary); }
[role="tab"][aria-selected="true"] {
  background: var(--tux-bg-surface);
  color: var(--tux-text);
  border-color: var(--tux-border);
  border-bottom-color: var(--tux-bg-surface);
}
[role="tab"]:focus-visible { outline-offset: -2px; }

[role="tabpanel"] {
  border: 1px solid var(--tux-border);
  border-top: none;
  padding: 0.5rem;
  background: var(--tux-bg-surface);
}
[role="tabpanel"][hidden] { display: none; }

/* -- toolbar (ARIA) -- */
[role="toolbar"] {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--tux-border);
  background: var(--tux-bg-raised);
  font-size: var(--tux-text-xs);
}

[role="toolbar"] button {
  padding: 0.25rem 0.5rem;
  background: var(--tux-bg-surface);
  color: var(--tux-text);
  border: 1px solid var(--tux-border);
}
[role="toolbar"] button:hover { background: var(--tux-bg-muted); }
[role="toolbar"] [aria-pressed="true"] {
  background: var(--tux-interactive);
  color: var(--tux-text-inverse);
  border-color: var(--tux-interactive);
}

/* -- toggle switch -- */
/* usage: <label data-switch><input type="checkbox"> label text</label> */
[data-switch] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: var(--tux-text-xs);
  color: var(--tux-text);
  user-select: none;
}

[data-switch] input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 1.75rem;
  height: 1rem;
  background: var(--tux-bg-muted);
  border: 1px solid var(--tux-border-strong);
  border-radius: 0;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  transition: background 0.15s;
}

[data-switch] input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 0;
  background: var(--tux-text-muted);
  transition: transform 0.15s;
}

[data-switch] input[type="checkbox"]:checked {
  background: var(--tux-primary);
  border-color: var(--tux-primary);
}

[data-switch] input[type="checkbox"]:checked::after {
  background: var(--tux-text-inverse);
  transform: translateX(0.75rem);
}

/* -- chips / badges -- */
[data-chip] {
  display: inline-block;
  font-size: var(--tux-text-micro);
  font-family: var(--tux-font);
  padding: 0.0625rem 0.375rem;
  font-weight: 600;
}

[data-chip]          { background: var(--tux-bg-muted); color: var(--tux-text-secondary); }
[data-chip="info"]   { background: var(--tux-primary-subtle); color: var(--tux-primary); }
[data-chip="success"]{ background: var(--tux-success-subtle); color: var(--tux-success); }
[data-chip="warning"]{ background: var(--tux-warning-subtle); color: var(--tux-warning); }
[data-chip="error"]  { background: var(--tux-error-subtle); color: var(--tux-error); }

/* -- flex utility -- */
[data-flex]          { display: flex; gap: 0.5rem; }
[data-flex="row"]    { flex-direction: row; }
[data-flex="column"] { flex-direction: column; }
[data-flex="wrap"]   { flex-wrap: wrap; }
[data-flex~="center"]  { align-items: center; }
[data-flex~="between"] { justify-content: space-between; }
[data-flex~="end"]     { justify-content: flex-end; }

/* -- ARIA states & accessibility -- */

/* skip link */
[href="#main"] {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem;
  background: var(--tux-primary);
  color: var(--tux-text-inverse);
}
[href="#main"]:focus { left: 0; }

/* visually hidden */
[data-visually-hidden],
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* aria-busy: loading state */
[aria-busy="true"] {
  opacity: 0.6;
  cursor: wait;
}

/* aria-disabled: not truly disabled but non-interactive */
[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* aria-invalid: form validation */
[aria-invalid="true"] {
  border-color: var(--tux-error) !important;
  outline: 1px solid var(--tux-error);
  outline-offset: -1px;
}

/* aria-required indicator */
[aria-required="true"] + label::after,
label:has(+ [aria-required="true"])::after {
  content: " *";
  color: var(--tux-error);
}

/* live regions */
[role="status"],
[role="log"],
[aria-live] {
  /* no visual change by default -- these are semantic markers */
}

/* role=status: subtle notification area */
[role="status"] {
  font-size: var(--tux-text-xs);
  color: var(--tux-text-tertiary);
  padding: 0.25rem 0.5rem;
}

/* role=log: scrollable event log */
[role="log"] {
  max-height: 15rem;
  overflow-y: auto;
  font-size: var(--tux-text-xs);
}

/* current item in lists/navs */
[aria-current="step"]  { font-weight: 700; color: var(--tux-primary); }
[aria-current="date"]  { font-weight: 700; background: var(--tux-primary-subtle); }
[aria-current="true"]  { font-weight: 700; }

/* expanded/collapsed indicators */
[aria-expanded="false"]::before { content: "\25b6\00a0"; font-size: 0.5em; }
[aria-expanded="true"]::before  { content: "\25bc\00a0"; font-size: 0.5em; }

/* sort indicators on table headers */
th[aria-sort="ascending"]::after  { content: " \2191"; color: var(--tux-text-muted); }
th[aria-sort="descending"]::after { content: " \2193"; color: var(--tux-text-muted); }

/* -- a11y -- */
:focus-visible { outline: 2px solid var(--tux-primary); outline-offset: 1px; }
::selection { background: var(--tux-primary-subtle); color: var(--tux-primary-strong); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* -- print -- */
@media print {
  body { background: #fff; color: #000; font-size: 10pt; }
  :is(body > header, body > footer, nav) { display: none; }
  main { max-width: 100%; padding: 0; }
  :is(section, article, aside) { border-color: #ccc; break-inside: avoid; }

  /* print annotations: show link URLs and abbreviation titles */
  a[href]::after { content: " (" attr(href) ")"; color: #666; font-size: 0.8em; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: none; }
  abbr[title]::after { content: " (" attr(title) ")"; color: #666; font-size: 0.8em; }

  /* reveal collapsed details */
  details { border: 1px solid #ccc; }
  details > summary { list-style: none; }
  details > summary::before { content: none; }
  details:not([open]) > :not(summary) { display: block; padding: 0.5rem; }
}
