/* Spatial UI — Hearth design tokens, setup shell, and components.
 * Hearth is the only theme; see docs/design/colors.md for the palette and the
 * rules that govern it. The [data-theme] attribute is still emitted by the
 * shell but every value resolves here.
 */

:root {
  /* Surfaces, recessed to raised. */
  --sunken: #1c1d22;
  --bg: #16171c;
  --surface: #1f2026;
  --soft: #26272e;
  --neutral: #26272e;

  /* Text, strongest to weakest. Never skip a level for emphasis. */
  --ink: #edeae2;
  --ink-2: #b9b6be;
  --muted: #8f8d96;
  --dim: #5a5b63;
  /* Foreground for text drawn on a parchment fill. Never a background. */
  --ink-on-light: #232427;

  /* Lines. --line-quiet divides inside an already-bordered surface. */
  --line: #2b2c34;
  --line-2: #1c1d22;
  --line-quiet: #3a3b42;

  /* Ember is the identity colour: interaction, selection, active state. */
  --primary: #e1954b;
  --primary-deep: #c96f1f;
  --primary-tint: #3a2e20;
  --primary-text: #f0b478;
  --accent: #e1954b;
  /* Foreground for text drawn on an ember fill. */
  --primary-ink: #16171c;

  /* Semantic. Each of these means one thing and is not a general accent. */
  --secondary: #7e9cc0;
  --cool: #7e9cc0;
  --ok: #6d8b5b;
  --alert: #e17a8f;
  --alert-tint: #2e2226;
  --alert-border: #4a2f38;
  --event: #b89cff;

  /* Domain tones. */
  --light-tone: #e1954b;
  --climate-tone: #e1954b;
  --cover-tone: #b89cff;
  --media-tone: #ff86bc;
  --sensor-tone: #6d8b5b;

  /* Geometry. */
  --r-card: 18px;
  --r-control: 10px;
  --r-pill: 99px;
  --sidebar-w: 248px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============ Setup shell ============ */
/* The app is a fixed sidebar plus a scrolling main column. `body` is the
 * flex row, so the sidebar can own full viewport height without sticky. */
body.has-sidebar {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--sunken);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 6px 10px 12px;
  text-decoration: none;
  display: block;
}

.sidebar-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.sidebar-brand-name span {
  font-weight: 600;
  color: var(--muted);
}

.sidebar-brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-label {
  margin: 14px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-control);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--soft);
  color: var(--ink);
}

.sidebar-link.active {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
}

/* Trailing count on a nav row: a plain tally, or an ember/alert one when the
 * row is asking for attention. */
.sidebar-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-count.attention {
  color: var(--alert);
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.sidebar-foot .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--ok);
  flex-shrink: 0;
}

.sidebar-foot .dot.degraded {
  background: var(--alert);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.01em;
}

/* ============ Page ============ */
/* The main column beside the sidebar. Its header is flush with the content
 * gutter (26px) and the body below it owns the remaining height. */
.page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wall-page {
  min-height: 100vh;
  padding: 0;
  max-width: none;
  margin: 0;
  flex: 1;
}

.page-head {
  padding: 22px 26px 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head h1 em {
  font-style: normal;
  color: var(--primary);
}

.page-head .sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.page-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Page body. The single-column default; `.split` adds the 360px inspector. */
.page-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 26px 22px;
  align-content: start;
}

.page-body.split {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-content: stretch;
}

.page-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

@media (max-width: 1100px) {
  .page-body.split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ Setup components ============ */

/* Pill controls. `.pill` is the resting state; the modifiers are the three
 * emphases the design uses — ember for the primary action, parchment for a
 * selected filter, bare border for everything else. */
.pill {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.pill:hover {
  border-color: var(--line-quiet);
  color: var(--ink);
}

.pill.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
}

.pill.primary:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  color: var(--primary-ink);
}

.pill.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-on-light);
  font-weight: 700;
}

.pill.danger {
  color: var(--alert);
  border-color: var(--alert-border);
}

.pill.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

/* Filter row: pills on the left, search pushed to the right. */
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-search {
  margin-left: auto;
  height: 30px;
  width: 220px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px;
  font-size: 12px;
  color: var(--ink);
  font-family: inherit;
}

.filter-search::placeholder {
  color: var(--dim);
}

.filter-search:focus-visible {
  outline: none;
  border-color: var(--primary);
}

/* Panel: the standard bordered surface everything sits in. */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.panel-head .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.panel-scroll {
  overflow-y: auto;
  min-height: 0;
}

.panel-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Row: one clickable record inside a panel. */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  font-family: inherit;
}

.row:first-child {
  border-top: 0;
}

.row:hover {
  background: var(--soft);
}

.row.selected {
  background: var(--primary-tint);
}

.row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

/* A selected row promotes its name to ember, matching the active nav row. */
.row.selected .row-name {
  color: var(--primary);
}

/* Fixed trailing columns so a stack of rows reads as a table. */
.row-col {
  width: 90px;
  text-align: right;
  font-size: 12px;
  color: var(--ink-2);
  flex-shrink: 0;
}

.row-col.narrow {
  width: 60px;
}

.row-note {
  font-size: 12px;
  color: var(--muted);
}

.row-end {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Status dot. Bare = inactive; the modifier carries the meaning, and every
 * use is paired with a text label per the palette rules. */
.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--dim);
  flex-shrink: 0;
  display: inline-block;
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--primary);
}

.dot.bad {
  background: var(--alert);
}

/* Monospaced identifier. Slugs, keys, ids — always at the dim level. */
.id {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--dim);
}

/* Table: a header strip plus `.row`s, used by Devices and Topology. */
.table-head {
  display: grid;
  gap: 10px;
  padding: 9px 16px;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.table-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
}

.table-row:first-of-type {
  border-top: 0;
}

.table-row:hover {
  background: var(--soft);
}

.table-row.selected {
  background: var(--primary-tint);
}

/* Banner: a callout above the content. Ember asks for action, rose reports a
 * fault. Both pair the colour with text, never colour alone. */
.banner {
  border-radius: var(--r-card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-tint);
}

.banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.banner-note {
  font-size: 12px;
  color: var(--ink-2);
  margin: 0;
}

.banner.alert {
  background: var(--alert-tint);
  border: 1px solid var(--alert-border);
}

.banner.alert .banner-title {
  color: var(--alert);
}

/* Inspector: the 360px right-hand column. */
.inspector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  max-height: 100%;
  overflow-y: auto;
}

.inspector-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin: 0;
}

.inspector h3 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspector-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.inspector-value {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
}

.inspector-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  flex-wrap: wrap;
}

.inspector-empty {
  color: var(--muted);
  font-size: 13px;
}

/* Chip: a small static tag (links, exposure targets, roles). */
.chip {
  display: inline-grid;
  place-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--sunken);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip.on {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Segmented control: mutually exclusive views inside one page. */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--sunken);
}

.seg a,
.seg button {
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.seg .active {
  background: var(--ink);
  color: var(--ink-on-light);
  font-weight: 700;
}

/* Toggle: a bound on/off switch. */
.toggle {
  width: 40px;
  height: 24px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--muted);
  transition: transform 140ms ease;
}

.toggle[aria-pressed='true'] {
  background: var(--primary-tint);
  border-color: var(--primary);
}

.toggle[aria-pressed='true'] span {
  background: var(--primary);
  transform: translateX(16px);
}

/* Setting row: label plus control, used by Preferences and plugin settings. */
.setting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-2);
}

.setting:first-child {
  border-top: 0;
}

.setting-body {
  flex: 1;
  min-width: 0;
}

.setting-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.setting-note {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

/* Event stream: one monospaced line per bus event, category-coloured. */
.stream {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  overflow-y: auto;
  min-height: 0;
}

.stream-line {
  display: grid;
  grid-template-columns: 74px 68px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid var(--line-2);
}

.stream-time {
  color: var(--muted);
}

.stream-kind {
  font-weight: 500;
}

.stream-kind.state {
  color: var(--ok);
}
.stream-kind.command {
  color: var(--event);
}
.stream-kind.plugin {
  color: var(--primary);
}
.stream-kind.mqtt {
  color: var(--cool);
}
.stream-kind.sse {
  color: var(--muted);
}
.stream-kind.error {
  color: var(--alert);
}

.stream-body {
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.stream-body em {
  font-style: normal;
  color: var(--dim);
}

/* Raw state dump. */
.raw {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 12px;
  margin: 0;
  overflow: auto;
  white-space: pre;
}

.raw mark {
  background: none;
  color: var(--alert);
}

/* Metric: a headline number over a label. */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.metric-value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

select {
  width: 100%;
  padding: 13px 44px 13px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--line) 88%, transparent);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--surface) 94%, transparent), color-mix(in oklab, var(--soft) 55%, var(--surface)));
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--surface) 78%, transparent),
    0 10px 24px -22px color-mix(in oklab, var(--ink) 40%, transparent);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

select:hover {
  border-color: color-mix(in oklab, var(--primary) 30%, var(--line));
  transform: translateY(-1px);
}

select:focus-visible,
.btn:focus-visible,
.pill:focus-visible {
  outline: none;
  border-color: color-mix(in oklab, var(--primary) 70%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 16%, transparent);
}

.configure-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.configure-empty {
  padding: 22px 18px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.configure-plugin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, color-mix(in oklab, var(--soft) 72%, var(--surface)), var(--surface));
}

.configure-plugin-name {
  font-size: 12px;
  color: var(--ink);
}

.configure-plugin-health {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.configure-plugin-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.configure-plugin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plugin-shell-card {
  display: grid;
  gap: 18px;
}

.plugin-shell-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.plugin-shell-top h1,
.plugin-shell-top h2 {
  margin: 10px 0 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.plugin-shell-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.plugin-shell-back:hover {
  color: var(--ink);
}

.plugin-shell-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.plugin-notice {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  border: 1px solid var(--line);
}

.plugin-notice.is-success {
  background: color-mix(in oklab, var(--ok) 10%, var(--surface));
  color: color-mix(in oklab, var(--ok) 80%, var(--ink));
}

.plugin-notice.is-error {
  background: color-mix(in oklab, #ef4444 10%, var(--surface));
  color: #b91c1c;
}

.plugin-settings-form {
  display: grid;
  gap: 14px;
}

.plugin-settings-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 0;
}

.plugin-settings-section legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
}

.plugin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plugin-settings-field {
  display: grid;
  gap: 6px;
}

.plugin-settings-field.is-checkbox {
  grid-column: 1 / -1;
}

.plugin-settings-field label {
  color: var(--ink-2);
  font-size: 12.5px;
}

.plugin-settings-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.plugin-settings-field input:focus-visible {
  outline: none;
  border-color: color-mix(in oklab, var(--primary) 60%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 14%, transparent);
}

.plugin-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.plugin-settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.plugin-table-wrap {
  overflow-x: auto;
}

.plugin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.plugin-table th,
.plugin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.plugin-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
}

.plugin-table-muted {
  color: var(--muted);
}

.plugin-surface-frame {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--soft) 72%, var(--surface)), var(--surface));
  overflow: auto;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-chip.ok {
  background: color-mix(in oklab, var(--ok) 15%, var(--surface));
  color: color-mix(in oklab, var(--ok) 70%, var(--ink));
}

.status-chip.warn {
  background: color-mix(in oklab, var(--accent) 38%, var(--surface));
  color: color-mix(in oklab, var(--ink) 80%, var(--surface));
}

.status-chip.muted {
  background: var(--soft);
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.btn {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  border-color: color-mix(in oklab, var(--primary) 45%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -20px color-mix(in oklab, var(--ink) 45%, transparent);
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

@media (max-width: 1100px) {

  .configure-plugin-row {
    align-items: flex-start;
  }

  .configure-plugin-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .plugin-settings-grid {
    grid-template-columns: 1fr;
  }

}

/* Scene quick-action bar (Home) */
.scenes-bar {
  margin: 10px 0 16px;
}
.scenes-bar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 8px;
}
.scenes-bar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.scene-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scene-status {
  font-size: 12px;
  color: var(--muted);
}
.scene-status .scene-ok {
  color: var(--ok);
  font-weight: 600;
}
.scene-status .scene-warn {
  color: var(--climate-tone);
  font-weight: 600;
}
.scene-status .scene-failures {
  margin: 4px 0 0;
  padding-left: 16px;
  color: var(--ink-2);
}
