:root {
  --sheet-ink: #111827;
  --sheet-muted: #475569;
  --sheet-line: #c7d0de;
  --sheet-soft-line: #d4dce8;
  --sheet-gold: #d69425;
}

body {
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.strum-sheet-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.strum-sheet-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin: 14px 0 22px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(20, 36, 70, 0.72);
  box-shadow: 0 18px 36px rgba(4, 10, 24, 0.2);
}

.controls-title h1 {
  margin: 0;
  color: #f5f7fb;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.02;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 16px 28px;
  align-items: start;
}

.control-grid-primary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 8px 12px;
  min-width: 0;
}

.control-hint {
  grid-column: 1 / -1;
  color: rgba(214, 229, 247, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

.control-grid-secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.control-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.control-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 0 34px 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: #0e1d39;
  color: #f5f7fb;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

.control-field select option {
  background: #0e1d39;
  color: #f5f7fb;
  font-weight: 700;
}

.control-field select optgroup {
  background: #0e1d39;
  color: rgba(214, 229, 247, 0.55);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-field select[multiple] {
  height: auto;
  min-height: 158px;
  padding: 8px 10px;
}

.control-field select[multiple] option {
  padding: 7px 8px;
  border-radius: 6px;
}

.control-field small {
  color: rgba(214, 229, 247, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.control-note {
  margin: 0;
  color: rgba(214, 229, 247, 0.86);
  font-size: 14px;
  line-height: 1.4;
}

.control-print-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.print-sheet-btn {
  width: auto;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #2a9db5;
  color: #081634;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  flex-shrink: 0;
}

.print-page {
  color: var(--sheet-ink);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(4, 10, 24, 0.24);
  padding: 34px;
}

.print-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 2px solid #bfc9d8;
}

.print-sheet-brand {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.print-sheet-logo {
  width: 150px;
  height: auto;
}

.print-sheet-brand-copy {
  margin: 0;
  color: var(--sheet-muted);
  font-size: 13px;
}

.print-sheet-title-group {
  text-align: right;
}

.print-sheet-title-group h2 {
  margin: 0;
  color: #0f172a;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
}

.print-sheet-meta {
  margin-top: 10px;
  color: #334155;
  font-size: 14px;
}

.print-sheet-meta strong {
  color: #0f172a;
}

.pattern-grid {
  display: grid;
  gap: 12px;
}

.pattern-card {
  border: 1.5px solid var(--sheet-line);
  border-radius: 10px;
  padding: 10px 12px;
}

.pattern-head {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.pattern-title {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.1;
}

.pattern-sub {
  margin: 0;
  color: #334155;
  font-size: 13px;
}

.pattern-sub strong {
  color: #0f172a;
}

.pattern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.pattern-table th,
.pattern-table td {
  border: 1px solid var(--sheet-soft-line);
  border-radius: 6px;
  padding: 4px 3px;
  text-align: center;
}

.pattern-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pattern-table .row-label {
  width: 48px;
}

.pattern-table td {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.pattern-table .slot-stroke {
  font-size: 18px;
  font-weight: 800;
}

.stroke-down  { color: #3a8a00; font-weight: 800; }
.stroke-up    { color: #1a6fbe; font-weight: 800; }
.stroke-chuck { color: #c06000; font-weight: 800; }
.stroke-rest  { color: #94a3b8; font-weight: 600; }

.stroke-accent {
  display: inline-block;
  font-size: 1.25em;
  font-weight: 900;
  transform: scaleY(1.2);
  transform-origin: center;
}
.stroke-light  { opacity: 0.45; font-size: 0.82em; font-weight: 600; }

.slot-accent { background: #f0f7e6; }
.slot-light  { background: #f8fafc; }

.legend-light { opacity: 0.5; font-size: 0.9em; }

.sheet-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--sheet-soft-line);
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

.sheet-footer-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.sheet-footer-note {
  margin: 0;
  max-width: 40rem;
  color: #64748b;
  font-size: 10px;
  line-height: 1.45;
}

.sheet-footer-credit {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 9px;
}

@media (max-width: 800px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .strum-sheet-page {
    width: min(100% - 16px, 1180px);
  }

  .print-page {
    padding: 16px 8px;
  }

  .pattern-card {
    padding: 8px 6px;
  }

  .pattern-table {
    border-spacing: 2px;
  }

  .pattern-table th,
  .pattern-table td {
    padding: 3px 2px;
  }

  .pattern-table .row-label {
    width: 28px;
  }

  .pattern-table .row-label-strum {
    width: 20px;
    min-width: 20px;
    padding: 2px 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .pattern-table .slot-stroke {
    font-size: 16px;
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 14mm 14mm 14mm 28mm;
  }

  html, body {
    background: #fff !important;
    color: #111827 !important;
  }

  .skip-link,
  .nav,
  .strum-sheet-controls,
  .sheet-footer-credit {
    display: none !important;
  }

  .strum-sheet-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #111827 !important;
  }

  .stroke-down  { color: #3a8a00 !important; }
  .stroke-up    { color: #1a6fbe !important; }
  .stroke-chuck { color: #c06000 !important; }
  .stroke-rest  { color: #94a3b8 !important; }
  .slot-accent  { background: #f0f7e6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pattern-card { break-inside: avoid; }
  .slot-light   { background: #f8fafc !important; }
}
