/* Flasher page — theme tokens only (never style the shared site header). */
.flash-shell {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 3.5rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
}
.flash-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(42%);
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 18px;
}
.flash-heading .flash-link {
  text-align: end;
}
.flash-shell h1 {
  font-size: var(--font-page-title);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.35;
  margin: 0;
  color: var(--text-main);
}
.flash-heading .intro {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
.flash-link {
  display: inline-block;
  margin-inline-start: auto;
  padding-block: 5px;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.flash-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.flash-shell .flash-card {
  background: var(--card-fill);
  padding: clamp(1rem, 4vw, 1.625rem);
  border: 1px solid var(--surface-line);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
.flash-setup, .flash-feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.flash-setup { gap: 16px; }
.flash-feedback { gap: 8px; }
.flash-fields, .flash-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}
.flash-field {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.flash-board-field { grid-column: 1 / -1; }
.flash-field :is(select, .xk-select) { width: 100%; }
.flash-release {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.flash-release #release { flex: 1 1 14rem; }
.flash-release .flash-link { padding-block: 0; }
.flash-field > label {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.flash-shell #board-usage {
  margin-top: 24px;
}
.flash-shell #board-usage h2 {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.4;
}
.flash-shell #usage-steps {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 400;
}
.flash-shell #usage-steps li + li {
  margin-top: 8px;
}
.flash-shell #board-usage h3 {
  margin: 20px 0 12px;
  font-size: 15px;
  line-height: 1.5;
}
.flash-shell #usage-display {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}
.flash-shell #usage-tree,
.flash-shell #usage-tree ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.flash-shell #usage-tree li {
  margin-top: 8px;
}
.flash-actions .btn {
  display: flex;
  width: 100%;
  justify-content: center;
  height: auto;
  min-height: var(--control-h-touch);
  max-height: none;
  padding: 8px 16px;
  white-space: normal;
  font-size: var(--font-btn);
  font-weight: 650;
  box-sizing: border-box;
}
#manual-flash code {
  display: block;
  padding: 8px 10px;
  background: var(--input-bg);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
@media (max-width: 420px) {
  .flash-fields, .flash-actions { grid-template-columns: minmax(0, 1fr); }
}
.flash-shell p,
.flash-shell details {
  font-size: 13px;
  line-height: 1.7;
}
.flash-shell .flash-card > p,
.flash-release p,
.flash-feedback p {
  margin: 0;
}
.flash-shell #release,
.flash-shell #status,
.flash-shell details {
  color: var(--text-muted);
}
.flash-shell #status.flash-written {
  color: var(--text-main);
  background: var(--input-bg);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.flash-help {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-inline: 4px;
}
.flash-faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 4px 20px;
}
@media (max-width: 540px) {
  .flash-faq { grid-template-columns: minmax(0, 1fr); }
}
.flash-help details p { margin: 4px 0 8px; }
.flash-shell summary {
  cursor: pointer;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h-compact);
  gap: var(--chevron-gap, 0.45rem);
}
.flash-shell pre {
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 170px;
  overflow: auto;
  color: var(--text-muted);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--input-bg);
  box-sizing: border-box;
  margin: 8px 0 0;
}
.flash-shell .flash-discussion {
  margin-top: 28px;
}
.flash-shell .back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--chevron-gap, 0.45rem);
  text-align: center;
  margin-top: 28px;
  font-size: 12px;
  color: var(--accent-primary);
  text-decoration: none;
}
.flash-shell .back:hover {
  text-decoration: none;
}
.flash-shell .flash-link:focus-visible,
.flash-shell .back:focus-visible,
.flash-shell summary:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  color: var(--accent-primary);
}

#board-trigger.has-board {
  height: auto !important;
  max-height: none !important;
}
.board-selection {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-block: 8px;
  overflow-wrap: anywhere;
}
.board-selection small {
  color: var(--text-muted);
  font-size: 12px;
}
#board-picker {
  width: min(26rem, calc(100vw - 16px));
  max-width: none;
  padding: 12px;
}
#board-picker #board-search {
  width: 100%;
  min-width: 0;
  font-size: 16px;
}
#board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
#board-filters button {
  min-height: var(--control-h-compact);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  padding: 2px 10px;
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: var(--font-btn-compact);
  cursor: pointer;
}
#board-filters button[aria-pressed="true"] {
  background: var(--surface-selected);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}
#board-clear.btn {
  height: auto;
  min-height: var(--control-h-compact);
  max-height: none;
  min-width: 0;
  padding: 4px 10px;
  white-space: normal;
}
#board-filters button:focus-visible, #board-picker .board-option:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}
#board-clear {
  margin-bottom: 8px;
}
#board-results {
  display: grid;
  max-height: 17rem;
  overflow: auto;
}
#board-picker .board-option {
  display: grid;
  gap: 3px;
  min-height: var(--control-h-touch);
  overflow-wrap: anywhere;
}
.board-option span {
  color: var(--text-muted);
  font-size: 12px;
}
#board-no-results {
  margin: 8px;
  color: var(--text-muted);
}

#firmware-updates h3 {
  font-size: 14px;
  margin: 0 0 .5rem;
}
#firmware-update-list {
  display: grid;
  justify-items: start;
  gap: .4rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
#firmware-update-list .btn {
  height: auto;
  max-height: none;
  padding-block: .4rem;
  text-align: start;
  overflow-wrap: anywhere;
}
