/* The lights page's own furniture, over hithlain's design system
   (public/styles.css, served beside this file). Tokens only: a colour or a
   step this needs and the system lacks goes into that file's :root.

   One column, sized for a phone held in one hand, because that is where the
   lights get switched. A wider screen gets the same column, centred. */

.lt-shell {
  max-width: 40rem; margin: 0 auto;
  padding: var(--space-12) var(--space-12) var(--space-64);
  display: flex; flex-direction: column; gap: var(--space-16);
}

/* The mark: a panel of amber bulbs, three by three. */
.lt-mark {
  display: inline-block; flex: none; width: 24px; height: 24px;
  border-radius: var(--radius-sm); border: 1px solid var(--color-neutral-900);
  background: radial-gradient(circle, var(--color-accent) 0 2px, var(--led-unlit) 2.5px 3px, transparent 3.5px) 0 0 / 8px 8px,
    var(--led-substrate);
}
.login .logo .lt-mark { width: 38px; height: 38px; background-size: 12.67px 12.67px, auto; }

/* The bar's narrow rule drops every word in the indicator but its icon, and
   the dot here is the icon. */
#conn .blip { display: inline-block; }

/* ---- tabs: a segmented strip under the bar, sticky with it ---- */
.lt-tabs {
  position: sticky; top: 52px; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4);
  padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}
@media (width >= 45em) { .lt-tabs { top: 56px; } }
.lt-tab {
  min-height: 40px; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; color: var(--color-neutral-400);
  font-size: var(--text-14); font-weight: var(--font-weight-medium);
}
.lt-tab:hover { color: var(--color-text); }
.lt-tab.is-on { background: var(--color-neutral-900); color: var(--color-text); }

.lt-panel { display: flex; flex-direction: column; gap: var(--space-14); }

.lt-card {
  display: flex; flex-direction: column; gap: var(--space-12);
  padding: var(--space-16); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}

.lt-inline { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-end; }
.lt-inline > .input, .lt-inline > .field { flex: 1 1 8rem; min-width: 0; }
.lt-form { gap: var(--space-14); }
.lt-error { color: var(--color-bad); }

/* ---- the switch ---- */
/* The cabinet's own switch, so the arcade face, as Blackout wears it. */
.lt-switch {
  min-height: 96px; border-radius: var(--radius-lg); cursor: pointer;
  font-family: var(--font-display); font-size: var(--text-title); text-transform: uppercase;
  color: var(--color-neutral-300); background: var(--led-substrate);
  border: 1px solid var(--color-neutral-700);
  box-shadow: var(--lift) var(--lift) 0 0 var(--color-neutral-900);
}
.lt-switch:active { transform: translate(var(--lift), var(--lift)); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .lt-switch:active { transform: none; } }
.lt-switch.is-on {
  color: var(--color-bg); background: var(--color-accent-400); border-color: var(--color-accent-400);
  box-shadow: var(--lift) var(--lift) 0 0 var(--color-accent-700), 0 0 24px color-mix(in srgb, var(--color-accent) 35%, transparent);
}

.lt-slider {
  display: grid; grid-template-columns: 6.5rem 1fr 3rem; align-items: center; gap: var(--space-10);
  font-size: var(--text-13); color: var(--color-neutral-300);
}
.lt-slider input { width: 100%; height: 6px; }
.lt-slider input::-webkit-slider-thumb { width: 24px; height: 24px; }
.lt-slider input::-moz-range-thumb { width: 24px; height: 24px; }
.lt-slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--color-neutral-400); }

/* ---- the show ---- */
.lt-legend {
  display: block; font-size: var(--text-12); margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.lt-palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--space-8); }
.lt-palette { display: flex; align-items: center; gap: var(--space-8); min-height: 44px; text-align: left; }
.lt-swatches { display: inline-flex; gap: var(--space-2); flex: none; }
.lt-swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px var(--color-neutral-800); }
/* Overlapped, so the six of a rainbow leave its name room in a chip. */
.lt-swatch + .lt-swatch { margin-left: -5px; }

/* ---- controllers ---- */
.lt-controller-head { display: flex; align-items: center; gap: var(--space-8); }
.lt-controller-head .card-title { flex: 1; min-width: 0; }
.lt-details summary { cursor: pointer; font-size: var(--text-13); color: var(--color-neutral-400); }
.lt-dl {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-4) var(--space-12);
  margin: var(--space-8) 0 0; font-size: var(--text-13);
}
.lt-dl dt { color: var(--color-neutral-500); }
.lt-dl dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- the layout editor ---- */
.lt-rows { display: flex; flex-direction: column; gap: var(--space-8); }
.lt-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: var(--space-8); align-items: end;
  padding: var(--space-10); border-radius: var(--radius-md); background: var(--color-neutral-900);
}
.lt-row-title { grid-column: 1 / -1; font-size: var(--text-12); color: var(--color-neutral-400); }
.lt-row-wide { grid-column: 1 / -1; }
.lt-runs { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.lt-runs:empty { display: none; }
.lt-run { display: grid; grid-template-columns: 1fr 9.5rem auto; gap: var(--space-6); align-items: center; }
.lt-row > .lt-inline { grid-column: 1 / -1; }

/* On a phone the dialog is the screen. */
@media (width < 45em) {
  #layoutDialog { padding: 0; place-items: stretch; }
  #layoutDialog .dialog { width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .lt-run { grid-template-columns: 1fr auto; }
  .lt-run > select[data-field="reverse"] { grid-row: 2; }
}
