:root {
  --bg: #0f1115;
  --bg-soft: #161a22;
  --bg-card: #1c212c;
  --bg-elev: #232a38;
  --border: #2c3344;
  --border-soft: #232a38;
  --text: #e8ecf3;
  --text-soft: #b3bac9;
  --muted: #7a8294;
  --accent: #f59e0b;
  --accent-soft: #fbbf24;
  --accent-contrast: #1a1205;
  --danger: #ef4444;
  --success: #22c55e;
  --info: #38bdf8;
  --amp: #f59e0b;
  --drum: #a78bfa;
  --pa: #38bdf8;
  --di: #22c55e;
  --monitor: #f472b6;
  --mic: #fb923c;
  --other: #94a3b8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0,0,0,0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Header */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
}
.brand-mark { color: var(--accent); }
.brand-accent { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 48px 0 32px;
}
.hero h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  margin: 0 0 12px;
}
.lead {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin: 0 0 20px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
}
.card-row:last-child { border-bottom: none; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-amp { background: var(--amp); }
.dot-drum { background: var(--drum); }
.dot-pa { background: var(--pa); }
.dot-di { background: var(--di); }
.muted { color: var(--muted); font-size: 0.85rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent-soft); }
.btn-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

/* Sections */
section { padding: 32px 0; }
.section-head { margin-bottom: 20px; }
.section-head h2 {
  font-size: 1.6rem;
  margin: 0 0 6px;
}
.section-head p {
  color: var(--text-soft);
  margin: 0;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel-wide { grid-column: 1 / -1; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.panel-head h3 {
  margin: 0;
  font-size: 1.1rem;
}
.badge {
  background: var(--bg-elev);
  color: var(--text-soft);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-live { background: rgba(34,197,94,0.15); color: var(--success); }

/* Planner grid */
.planner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Forms */
.field { margin-bottom: 14px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 4px;
}
input, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input::placeholder { color: var(--muted); }
small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Chips */
.chip-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.85rem;
}
.chip-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.chip-remove:hover { color: var(--danger); }
.preset-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.chip-btn:hover { color: var(--text); border-color: var(--accent); }

/* Gear form */
.gear-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.gear-form .field { margin-bottom: 0; }

/* Table */
.table-wrap { overflow-x: auto; }
.gear-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.gear-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}
.gear-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.gear-table tr:last-child td { border-bottom: none; }
.gear-table .cat-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.cat-amp { background: var(--amp); }
.cat-drum { background: var(--drum); }
.cat-pa { background: var(--pa); }
.cat-monitor { background: var(--monitor); }
.cat-di { background: var(--di); }
.cat-mic { background: var(--mic); }
.cat-other { background: var(--other); }
.source-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.source-band { background: rgba(245,158,11,0.15); color: var(--amp); }
.source-shared { background: rgba(167,139,250,0.15); color: var(--drum); }
.source-venue { background: rgba(56,189,248,0.15); color: var(--pa); }
.row-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
}
.row-remove:hover { color: var(--danger); }
.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}
.empty-state.hidden { display: none; }

/* Output */
.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.matrix-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
}
.matrix-item:last-child { border-bottom: none; }
.matrix-item .item-name { font-weight: 600; }
.matrix-item .item-owner { color: var(--text-soft); font-size: 0.85rem; }
.load-order {
  margin: 0;
  padding-left: 20px;
}
.load-order li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.load-order li:last-child { border-bottom: none; }
.circuit-output .circuit-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.circuit-output .circuit-row:last-child { border-bottom: none; }
.circuit-total {
  font-weight: 700;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}
.circuit-ok { color: var(--success); }
.circuit-warn { color: var(--accent); }
.circuit-danger { color: var(--danger); }
.stage-notes {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.save-status {
  color: var(--success);
  font-size: 0.85rem;
  margin-left: auto;
}

/* Notes */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.note-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--accent);
}
.note-card ul {
  margin: 0;
  padding-left: 18px;
}
.note-card li {
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.assumptions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.assumptions h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.assumptions p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.footer-inner p { margin: 0; font-size: 0.85rem; color: var(--text-soft); }
.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.85rem;
}
.footer-nav a:hover { color: var(--accent); }

/* Print */
@media print {
  .site-header, .site-footer, .hero-actions, .action-bar, .planner, .notes, .site-nav { display: none !important; }
  body { background: white; color: black; }
  .panel { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .output { padding: 0; }
  .stage-notes { border: 1px solid #ccc; }
}

/* Responsive */
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .planner-grid { grid-template-columns: 1fr; }
  .output-grid { grid-template-columns: 1fr; }
  .gear-form { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .gear-form { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
  .action-bar .btn { width: auto; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
