/* Lato + Yanone Kaffeesatz (SIL Open Font License), served from this site
   itself instead of Google Fonts -- so no visitor IP goes to Google. */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/lato-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/lato-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/lato-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/lato-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/yanone-kaffeesatz-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/yanone-kaffeesatz-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/yanone-kaffeesatz-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/yanone-kaffeesatz-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   ELC Fixture Library Editor — shared styles
   House style derived from elclighting.com's build CSS:
   primary navy #00004a (rgb(0,0,74), elclighting.com's own
   --ui-color-primary-500), secondary amber #e6a428, tertiary cream #f9f7f3
   ============================================================ */

:root {
  /* Site is light-themed only, no dark variant -- without this, Safari in
     particular re-skins native form controls (buttons, selects) to the OS
     dark-mode palette, which can override the colors below and make
     ghost-button text unreadable. Chrome is far less aggressive about
     this, which is why it only ever showed up in Safari. */
  color-scheme: light;

  --navy-50:  #e6e6ff;
  --navy-100: #b8b8ff;
  --navy-200: #8a8aff;
  --navy-300: #5c5cff;
  --navy-400: #2e2eff;
  --navy-500: #00004a;   /* brand primary -- rgb(0,0,74) */
  --navy-600: #00003d;
  --navy-700: #000031;
  --navy-800: #000024;
  --navy-900: #000018;

  --amber-50:  #fff8e6;
  --amber-100: #ffe5b8;
  --amber-200: #ffd38a;
  --amber-300: #ffc05c;
  --amber-400: #ffaa2e;
  --amber-500: #e6a428;  /* brand secondary / accent */
  --amber-600: #b37f1f;
  --amber-700: #805b17;

  --cream-50:  #ffffff;
  --cream-100: #fcfcfa;
  --cream-200: #f9f7f3;  /* brand tertiary background */
  --cream-300: #f2f1e8;
  --cream-400: #edebe0;
  --cream-600: #d4d1c9;
  --cream-700: #ada89f;
  --cream-900: #605c54;

  --ink: var(--navy-500);
  --muted: #5c5c72;
  --border: #e2e0da;
  --radius: 0;
  --shadow: 0 2px 10px rgba(0, 0, 36, 0.06), 0 1px 2px rgba(0, 0, 36, 0.08);

  --font-body: "Lato", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Yanone Kaffeesatz", "Oswald", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }

input, select, textarea, button {
  border-radius: 0;
}

/* Used to force a consistent custom dropdown arrow via appearance:none +
   a background-image here -- on iOS Safari specifically, that combination
   made the native option picker show ONLY the placeholder row, every real
   option effectively invisible/unreachable (the options were always
   correctly in the HTML -- confirmed directly against a live page -- this
   was purely a rendering problem). Native appearance is the only thing
   that reliably keeps the real picker working everywhere, so the custom
   arrow isn't worth it; each platform's own default chevron is used
   instead now. */
select {
  padding-right: 14px;
}
/* Desktop only (mouse/trackpad, so never the iOS picker above): macOS
   Safari's native select is a rounded, shorter pill that doesn't line up
   with the square inputs next to it, while Chrome already draws a plain
   box. Drawing our own chevron here makes both browsers look the same. */
@media (hover: hover) and (pointer: fine) {
  select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231f1f3d' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 11px 7px;
    padding-right: 28px !important;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-500);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy-500);
  margin: 0 0 0.4em;
}

h1 { font-size: 2.6rem; font-weight: 700; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy-600); }

p { margin: 0 0 1em; color: var(--muted); }

a { color: var(--navy-500); text-decoration: none; }
a:hover { color: var(--amber-600); }

/* ---------- layout shell ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--navy-500);
  border-bottom: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 0.02em;
}
.brand .brand-sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-header .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.site-header .btn-ghost:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}
.site-header .header-meta {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 0;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  /* Safari (unlike Chrome) partly renders <button>/<a> as native controls
     unless appearance is explicitly reset -- without this, the OS can
     still paint its own text/background colour over the ones below,
     which is what made ghost buttons unreadable there specifically. */
  -webkit-appearance: none;
  appearance: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--navy-500);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-600); color: #fff; }

.btn-accent {
  background: var(--amber-500);
  color: var(--navy-900);
}
/* Text colour repeated on hover: the general a:hover (amber text) is more
   specific than .btn-*, so a link-button's text turned the same amber as
   its own background. */
.btn-accent:hover { background: var(--amber-600); color: var(--navy-900); }

.btn-ghost {
  background: transparent;
  color: var(--navy-500);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--navy-300); background: var(--cream-200); color: var(--navy-500); }

.btn-small {
  padding: 6px 16px;
  font-size: 0.8rem;
}

.btn-small {
  padding: 6px 16px;
  font-size: 0.8rem;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- page 1: landing / gate ---------- */

.landing {
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.landing-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px 36px;
  text-align: center;
}

.landing-card .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-600);
  margin-bottom: 10px;
}

.landing-card h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.landing-card .lede {
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background-color: #fff;
  color: var(--ink);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--navy-300);
  box-shadow: 0 0 0 3px var(--navy-50);
}

.landing-card .btn { width: 100%; margin-top: 8px; padding: 13px 20px; font-size: 0.95rem; }

.landing-foot {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- page 2: dashboard ---------- */

.dashboard {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 24px;
}

.dashboard-head {
  text-align: center;
  margin-bottom: 48px;
}
.dashboard-head h1 { color: #fff; }
.dashboard-head p { color: rgba(255,255,255,0.7); }

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.action-card {
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,36,0.1);
  border-color: var(--navy-200);
}

.action-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--navy-50);
  color: var(--navy-500);
}
.action-card.accent .action-icon { background: var(--amber-50); color: var(--amber-600); }

.action-card h2 { font-size: 1.25rem; margin-bottom: 2px; }
.action-card p { font-size: 0.88rem; margin: 0; }

/* ---------- editor page ---------- */

.editor-wrap {
  max-width: 1800px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.editor-head {
  margin-bottom: 24px;
}
.editor-head h1 { color: #fff; }
.editor-head p { color: rgba(255,255,255,0.7); }
.editor-head .back-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
}
.editor-head .back-link:hover { color: #fff; }

.picker-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 28px;
}
.picker-bar .field { margin-bottom: 0; min-width: 220px; flex: 1 1 220px; }
.picker-bar .btn { flex: 0 0 auto; height: 44px; }

.fixture-summary {
  display: none;
  align-items: center;
  gap: 14px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.fixture-summary.show { display: flex; }
.fixture-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: 0 0 auto;
  border: 1px solid rgba(0,0,36,0.15);
}
.fixture-summary .meta strong { font-size: 1.05rem; color: var(--navy-700); }
.fixture-summary .meta div { font-size: 0.85rem; color: var(--muted); }

.param-category {
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.param-category > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy-600);
  background: var(--cream-200);
  user-select: none;
}
.param-category > summary::-webkit-details-marker { display: none; }
.param-category > summary .count {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--navy-500);
  background: var(--navy-50);
  border-radius: 999px;
  padding: 3px 10px;
}
.param-category > summary .chevron {
  margin-left: auto;
  margin-right: 10px;
  transition: transform 0.15s ease;
  color: var(--muted);
}
.param-category[open] > summary .chevron { transform: rotate(90deg); }

.param-table {
  width: 100%;
  border-collapse: collapse;
}
.param-table thead th:first-child,
.param-table tbody td:first-child {
  padding-left: 24px;
}
.param-table thead th:last-child,
.param-table tbody td:last-child {
  padding-right: 24px;
}
.param-table thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.param-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.param-table tbody tr:last-child { border-bottom: none; }
.param-table td[data-label="Default"] { padding-right: 4px; }
.param-table td[data-label="Highlight"] { padding-left: 4px; }

/* skip no longer dims the row -- everything stays equally readable */
.param-table td {
  padding: 10px 16px;
  font-size: 0.88rem;
  vertical-align: middle;
}
.param-name { font-weight: 700; color: var(--navy-700); }

/* "Approvals" nav link when there's something waiting for admin review */
.site-header .btn-ghost.nav-pending {
  color: #9a5b00;
  background: #fff1d6;
  border-color: #ffd27a;
}
.site-header .btn-ghost.nav-pending:hover {
  color: #9a5b00;
  background: #ffe6b3;
  border-color: #ffd27a;
}

/* fields/rows that are part of someone else's not-yet-approved edit */
.pending-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9a5b00;
  background: #fff1d6;
  border: 1px solid #ffd27a;
  border-radius: 999px;
  padding: 1px 9px;
}
tr.row-pending {
  background: #fff8ec;
  box-shadow: inset 3px 0 0 0 #ffb020;
}
.field-pending label {
  color: #9a5b00;
}
.pending-notice {
  background: #fff1d6 !important;
  border-color: #ffd27a !important;
}

.param-table input[type="number"],
.param-table input[type="text"] {
  width: 84px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: #fff;
  color: var(--ink);
}
.param-table select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  max-width: 220px;
  background-color: #fff;
  color: var(--ink);
}

/* edit.php's row-collapse chevron (see .collapsible-rows below): the name
   input's own wrapper, not the <td>, is flexed -- same reason as the
   comment just below. Hidden by default/on desktop; only shown, and only
   on phones, inside a table that opted in via .collapsible-rows. */
.param-name-row { display: flex; align-items: center; gap: 4px; }
.row-toggle-btn {
  display: none;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* Never set display:flex/grid directly on a <td> -- the browser
   "blockifies" it, it stops participating as a real table-cell/column,
   and its content silently renders stacked under the previous column
   instead of beside it (looked like wrapping, was actually broken
   column layout). Flex only the inline wrapper elements inside the
   cell instead; the <td> itself stays a normal table-cell. */
.matrix-cell {
  white-space: nowrap;
}
/* Shown above Insert/Copy/Remove in the row's actions cell while the
   matrix toggle is on: all four fields on one line, tightly spaced. */
.matrix-fields {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}
.matrix-fields[hidden] {
  display: none;
}
.matrix-fields input[type="number"] {
  width: 48px;
}
.matrix-fields select {
  width: 92px;
}

.param-table td.row-actions .btn-small {
  padding: 6px 10px;
}

.add-row-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--cream-600);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.toggle .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.toggle input:checked + .slider { background: var(--navy-500); }
.toggle input:checked + .slider::before { transform: translateX(16px); }

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  position: sticky;
  bottom: 16px;
}
.editor-actions-inner {
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .big-icon { font-size: 2.4rem; margin-bottom: 10px; }

.macro-list {
  padding: 4px 22px 18px;
  font-size: 0.85rem;
  color: var(--muted);
}
.macro-list .macro-item { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.macro-list .macro-item:last-child { border-bottom: none; }
.macro-list .macro-item strong { color: var(--navy-600); }
/* Macro name + step fields: same compact square boxes as the parameter
   table above, instead of the browser's bare default controls. */
.macro-item .field input[type="text"],
.macro-item .repeat-row select,
.macro-item .repeat-row input[type="text"] {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background-color: #fff;
  color: var(--ink);
}
.macro-item .field label { margin-bottom: 4px; }
.macro-item .repeat-row select:disabled,
.macro-item .repeat-row input[type="text"]:disabled {
  background-color: var(--cream-200);
  color: var(--muted);
  opacity: 0.6;
}
.macro-item .field input:focus,
.macro-item .repeat-row select:focus,
.macro-item .repeat-row input[type="text"]:focus {
  outline: none;
  border-color: var(--navy-300);
  box-shadow: 0 0 0 3px var(--navy-50);
}
.macro-list code {
  background: var(--cream-200);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-500);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- simple pages (suggestie / nieuw) ---------- */

.simple-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.simple-page > h1 { color: #fff; }
.simple-page > p { color: rgba(255,255,255,0.7); }
.card {
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}

/* ---------- Users page: one compact row per admin ---------- */

.admin-row {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 10px 22px;
  border-top: 1px solid var(--border);
}
.admin-email {
  min-width: 220px;
  word-break: break-all;
}
.admin-notify,
.admin-actions {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  margin: 0;
}
.admin-notify label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.admin-actions { gap: 6px; margin-left: auto; }
.admin-actions form { margin: 0; }

/* Matrix "Check" button in the param table header, and the row a choice
   from its popup just switched on. */
.param-table th .matrix-check-btn { padding: 2px 8px; font-size: 0.7rem; margin-left: 4px; }
.repeat-row.matrix-flash > td { background: var(--amber-50); transition: background 0.3s; }

/* ---------- modal (login stub) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,24,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 30px;
  width: 100%;
  max-width: 380px;
}
.modal-box .close-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -10px;
}
.modal-box .close-row button {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
}

/* ============================================================
   Mobile -- this site is used almost exclusively on a phone, so
   everything below is a deliberate, first-class layout, not a
   bolt-on afterthought. Breakpoint matches the one dashboard rule
   that already existed.
   ============================================================ */
@media (max-width: 760px) {
  body { font-size: 15px; }

  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.25rem; }
  .dashboard-head h1,
  .editor-head h1 { font-size: 1.9rem; }

  /* ---- header / nav ---- */
  .site-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }
  .brand .brand-sub { font-size: 0.92rem; }
  .nav-actions {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
  }
  .nav-actions .btn-small {
    padding: 7px 12px;
    font-size: 0.78rem;
  }
  .nav-actions .header-meta {
    width: 100%;
    order: -1;
  }

  /* ---- generic layout ---- */
  .dashboard,
  .editor-wrap,
  .simple-page {
    padding-left: 14px;
    padding-right: 14px;
  }
  .action-grid { grid-template-columns: 1fr; }
  .action-card { padding: 22px 18px; }

  .picker-bar {
    padding: 16px 14px;
    gap: 12px;
  }
  .picker-bar .field { min-width: 0; flex: 1 1 100%; }
  .picker-bar .btn { width: 100%; }

  .fixture-summary { padding: 14px 16px; }

  /* Buttons are tap targets now, not mouse targets -- 36px is the
     practical minimum before mis-taps become routine. */
  .btn { min-height: 40px; }
  .btn-small { min-height: 36px; padding: 7px 14px; }

  /* ---- every "chip row" (range low/high/label, macro step
     action/param/value/fade) wraps instead of overflowing -- these
     already use inline display:flex with no wrap set, so a plain
     class rule is enough with no specificity fight. ---- */
  .repeat-row { flex-wrap: wrap; row-gap: 6px; }

  /* ---- the parameter table: table -> stacked cards. This is the
     main screen people spend their time in, so it gets the most
     deliberate treatment, not just "shrink it and hope". ---- */
  .param-table { display: block; }
  .param-table thead { display: none; }
  .param-table tbody { display: block; }
  /* Card = a flex row that wraps, with explicit `order` per cell so the
     visual grouping (line 1: #/move/name, line 2: default/highlight/
     skip) doesn't have to match DOM order. Line 1's three items sum to
     exactly 100% (name absorbs whatever's left via flex-grow), line 2's
     three sum to ~90%+gaps -- either way the next item in order can't
     fit what's left on that line, so it wraps on its own without
     needing an explicit break marker. */
  .param-table tbody tr.repeat-row {
    display: flex;
    align-items: flex-start;
    column-gap: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    margin: 10px;
    background: var(--cream-50);
  }
  .param-table tbody tr.repeat-row.row-pending {
    border-color: #ffb020;
  }
  .param-table td {
    display: block;
    flex: 1 1 100%;
    min-width: 0 !important;
    padding: 6px 0;
    border-bottom: none;
  }
  .param-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 3px;
  }
  /* Line 1: "#" + move buttons + name, all on one row. */
  .param-table td.row-number {
    order: 1;
    flex: 0 0 auto;
    font-size: 1.05rem;
    padding-right: 0;
  }
  .param-table td.move-cell {
    order: 2;
    flex: 0 0 auto;
    padding: 0;
  }
  /* flex-wrap decides line breaks using each item's flex-BASIS, before
     flex-grow redistributes space -- a basis of 0 here would make the
     browser think line 1 still has lots of room, letting default/
     highlight/skip pack onto it too. Basis has to already claim
     "the rest of the line" (row-number + move-cell's own width
     subtracted) so nothing else fits beside it. */
  .param-table td.param-name-cell {
    order: 3;
    flex: 1 1 calc(100% - 120px);
    min-width: 70px !important;
  }
  /* Line 2: default + highlight + skip, side by side. */
  .param-table td[data-label="Default"],
  .param-table td[data-label="Highlight"] {
    order: 4;
    flex: 1 1 30%;
  }
  .param-table td[data-label="Skip"] {
    order: 5;
    flex: 1 1 30%;
    text-align: left !important;
  }
  /* Everything else keeps its own full line, same as before. */
  .param-table td[data-label="Function / range"] { order: 6; }
  .param-table td.matrix-cell { order: 7; }
  .param-table td.row-actions {
    order: 8;
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
  }
  .param-table td.row-actions .btn { flex: 1 1 0; }
  /* matrix fields get their own full-width line above the buttons */
  .param-table td.row-actions { flex-wrap: wrap; }
  .param-table td.row-actions .matrix-fields { flex: 0 0 100%; }

  .param-table select,
  .param-table input[type="text"] {
    max-width: 100%;
  }

  /* edit.php only (table has .collapsible-rows -- new.php's table doesn't,
     and keeps showing every field, since there's nothing "live" there yet
     to collapse): a row shows just #, move buttons and name until the
     chevron is tapped. Selectors need to out-specificity the data-label/
     order rules above (same cells), not replace them, so flex/order stay
     intact once a row opens. */
  .param-table.collapsible-rows .row-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .param-table.collapsible-rows tr.repeat-row.row-open .row-toggle-btn {
    transform: rotate(90deg);
  }
  .param-table.collapsible-rows tr.repeat-row td[data-label="Default"],
  .param-table.collapsible-rows tr.repeat-row td[data-label="Highlight"],
  .param-table.collapsible-rows tr.repeat-row td[data-label="Function / range"],
  .param-table.collapsible-rows tr.repeat-row td[data-label="Skip"],
  .param-table.collapsible-rows tr.repeat-row td.matrix-cell,
  .param-table.collapsible-rows tr.repeat-row td.row-actions {
    display: none;
  }
  .param-table.collapsible-rows tr.repeat-row.row-open td[data-label="Default"],
  .param-table.collapsible-rows tr.repeat-row.row-open td[data-label="Highlight"],
  .param-table.collapsible-rows tr.repeat-row.row-open td[data-label="Function / range"],
  .param-table.collapsible-rows tr.repeat-row.row-open td[data-label="Skip"],
  .param-table.collapsible-rows tr.repeat-row.row-open td.matrix-cell {
    display: block;
  }
  .param-table.collapsible-rows tr.repeat-row.row-open td.row-actions {
    display: flex;
  }
  /* The range/step chip rows' individually pixel-width'd selects and
     inputs (set inline per-field in the PHP templates) need to give
     up that fixed width on a phone screen -- !important is the only
     way to win against an inline style attribute from a stylesheet
     rule, and this is scoped tightly enough (mobile-only, repeat-row
     descendants only) that it won't leak anywhere else. */
  .repeat-row select,
  .repeat-row input[type="text"] {
    width: auto !important;
    flex: 1 1 64px;
    min-width: 0 !important;
  }
  .repeat-row .remove-row-btn { flex: 0 0 auto; }

  .editor-actions {
    bottom: 10px;
  }
  .editor-actions-inner {
    width: calc(100% - 20px);
    justify-content: space-between;
  }
  .editor-actions-inner .btn { flex: 1 1 0; }

  .macro-item.repeat-row {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .modal-box { padding: 26px 20px; }

  /* The desktop "breathing room" padding on the table's first/last
     column (added for the wide multi-column layout) doesn't apply here
     -- every cell is its own full-width line in the stacked card, so it
     just shifted the first field out of line with the rest. */
  .param-table tbody td:first-child,
  .param-table thead th:first-child {
    padding-left: 0;
  }
  .param-table tbody td:last-child,
  .param-table thead th:last-child {
    padding-right: 0;
  }

  /* Overview is read-only, so on a phone it's worth more as a dense
     scannable list than as big stacked cards -- one compact line per
     fixture, Macro/Last updated dropped (still on desktop), Name
     truncates instead of wrapping so the line never grows. */
  .overview-table tbody tr.repeat-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
  }
  .overview-table tbody tr.repeat-row:last-child { border-bottom: none; }
  .overview-table td {
    display: block;
    width: auto;
    padding: 0;
  }
  .overview-table td[data-label]::before {
    content: none;
  }
  .overview-table td[data-label="Macro"],
  .overview-table td[data-label="Last updated"] {
    display: none;
  }
  .overview-table td[data-label="Name"] {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .overview-table td[data-label="Mode"],
  .overview-table td[data-label="Parameters"] {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
  }
  .overview-table td[data-label="Parameters"]::after {
    content: " params";
  }
}

/* "+ Insert" / "Copy" / "Remove" in the parameter table must never wrap
   onto two lines (the "+" ended up above "Insert" in narrow range rows). */
.param-table .btn {
  white-space: nowrap;
}

/* changelog.php: a fixture's earlier changes, one collapsed entry per date */
.changelog-earlier {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.changelog-earlier-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.changelog-date {
  margin-bottom: 4px;
}
.changelog-date > summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--navy-600);
}

/* Edit/New parameter table on desktop: wide enough parameter names to
   read them, and only minimal spacing between the fields. (Phones keep
   their stacked-card layout from the max-width: 760px block above.) */
@media (min-width: 761px) {
  .editor-table thead th,
  .editor-table td {
    padding: 4px 3px;
  }
  .editor-table thead th:first-child,
  .editor-table tbody td:first-child {
    padding-left: 10px;
  }
  .editor-table thead th:last-child,
  .editor-table tbody td:last-child {
    padding-right: 10px;
  }
  .editor-table td.param-name-cell {
    min-width: 240px;
  }
  .editor-table td [data-repeat-key] > .repeat-row {
    gap: 3px !important;
    margin-bottom: 3px !important;
  }
}

/* Astera editor: compact checkbox grid of modes / lamps */
.astera-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2px 12px;
  margin-bottom: 20px;
  font-size: 0.82rem;
}
.astera-mode-grid label {
  color: var(--ink);
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.astera-mode-grid .astera-ch { color: var(--muted); margin-left: auto; padding-left: 6px; }
.astera-shared {
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

/* Outline button for directly on the navy page background. */
.btn-on-dark {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
.btn-on-dark:hover { color: var(--navy-900); background: #fff; border-color: #fff; }
.btn-danger { color: #b3261e; border-color: #f0b9b4; }
.btn-danger:hover { color: #fff; background: #b3261e; border-color: #b3261e; }
.actions-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }

/* Footer: cookie notice */
.site-footer {
  max-width: 1800px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
}
.remember-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--navy-600);
  margin: 0 0 10px;
  text-align: left;
}

/* GDTF Share search panel (New + Edit) */
.gdtf-share-credit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.gdtf-share-credit a { text-decoration: underline; }
.gdtf-share-note { font-size: 0.85rem; color: var(--muted); margin: -14px 0 14px; }
.gdtf-share-error { color: #b3261e; font-weight: 700; font-size: 0.88rem; margin: 0 0 12px; }
.gdtf-share-results { background: transparent; border: 1px solid var(--border); }
.uploader-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.uploader-badge.manuf { color: #1a7a3a; background: #e8f7ec; }
.uploader-badge.user { color: #9a5b00; background: #fff1d6; }
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--navy-500);
  text-decoration: underline;
  cursor: pointer;
}

.gdtf-specs-notice {
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  color: var(--navy-700);
  font-size: 0.85rem;
  padding: 8px 14px;
  margin: -12px 0 12px;
}

/* Dashboard tiles only admins see (Delete fixture, Astera editor) */
.action-card.admin-only {
  background: var(--amber-500);
  border-color: var(--amber-600);
}
.action-card.admin-only h2,
.action-card.admin-only p { color: var(--navy-900); }
.action-card.admin-only:hover { border-color: var(--navy-500); }

/* Settings page: one box per topic, stacked */
.settings-panel { padding: 20px 24px; margin-bottom: 24px; }
.settings-panel > h3 {
  font-size: 1.15rem;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--amber-500);
}
.settings-panel p { font-size: 0.88rem; margin: 0 0 14px; }
.settings-mail-counters { grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
.settings-mail-counters .action-card { border-color: var(--border); box-shadow: none; padding: 18px; }
.settings-mail-list { border: 1px solid var(--border); }
.settings-mail-list > div:first-child { border-top: 0 !important; }

/* "Power and connectors are the same for every mode" under the specs fields */
.specs-shared-note {
  flex: 1 1 100%;
  margin: -8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Settings: fixtures whose modes have different power/connectors */
.specs-conflicts summary { cursor: pointer; font-weight: 700; color: var(--navy-700); margin-bottom: 8px; }
.specs-conflict-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.specs-conflict-name { min-width: 220px; font-weight: 700; }
.specs-conflict-row label { display: flex; align-items: center; gap: 6px; margin: 0; }
.specs-conflict-row select { height: 32px; padding: 2px 6px; font-size: 0.85rem; max-width: 360px; }

/* Edit: search bar above the manufacturer/fixture picker */
.fixture-search { position: relative; margin-bottom: 12px; }
.fixture-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 0;
  box-shadow: var(--shadow);
}
.fixture-search-results a {
  display: block;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--navy-700);
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.fixture-search-results a:first-child { border-top: 0; }
.fixture-search-results a:hover,
.fixture-search-results a.active { background: var(--amber-50); }
.fixture-search-results .fs-maker { color: var(--muted); }
.fixture-search-results .fs-name { font-weight: 700; }
.fixture-search-results .fs-mode,
.fixture-search-results .fs-ch { color: var(--muted); font-size: 0.8rem; }
.fixture-search-results .fs-empty { padding: 8px 12px; font-size: 0.85rem; color: var(--muted); }

/* ELC import page: totals, preview table, per-manufacturer details */
.elc-totals { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.elc-total { border: 1px solid var(--border); background: #fff; padding: 8px 14px; display: flex; flex-direction: column; min-width: 120px; }
.elc-total strong { font-size: 1.3rem; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.elc-total span { font-size: 0.78rem; color: var(--muted); }
.elc-total.elc-cat-conflict, .elc-total.elc-cat-removed { border-color: #f3b4ae; background: #fdecea; }
.elc-total.elc-cat-added, .elc-total.elc-cat-updated { border-color: var(--amber-200); background: var(--amber-50); }
.elc-table td, .elc-table th { font-size: 0.85rem; }
.elc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.elc-details summary { cursor: pointer; }
.elc-list { font-size: 0.8rem; color: var(--navy-700); margin: 6px 0 0; line-height: 1.5; }
.elc-list-head { display: inline-block; font-weight: 700; margin-right: 6px; }
.elc-list-head.elc-cat-conflict, .elc-list-head.elc-cat-removed { color: #b3261e; }
.elc-badge { font-size: 0.7rem; font-weight: 700; color: #9a5b00; background: #fff1d6; border-radius: 999px; padding: 2px 8px; }

/* Settings: tabs + side-by-side small panels + folded "How it works" */
.settings-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.settings-tabs a { padding: 9px 18px; border: 1px solid rgba(255,255,255,0.35); color: #fff; font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.settings-tabs a:hover { border-color: var(--amber-500); color: #fff; }
.settings-tabs a.active { background: var(--amber-500); border-color: var(--amber-500); color: var(--navy-900); }
.settings-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 24px; }
.settings-row > .settings-panel { display: flex; flex-direction: column; align-items: flex-start; }
.settings-row > .settings-panel > h3 { align-self: stretch; }
.settings-help { margin: -6px 0 14px; font-size: 0.82rem; color: var(--muted); }
.settings-help summary { cursor: pointer; font-weight: 600; color: var(--navy-700); }
.settings-help p { margin: 6px 0 0 !important; font-size: 0.82rem !important; }
.gdtf-map-table td { padding: 6px 8px; }
.gdtf-map-table input:not([type=checkbox]) { width: 100%; min-width: 70px; height: 32px; padding: 4px 8px; font-size: 0.85rem; }
.gdtf-map-table td:nth-child(1) input, .gdtf-map-table td:nth-child(2) input { min-width: 150px; }
.gdtf-map-table td.chk { text-align: center; }
