/* Paper sheets: the lower page (keys, studio, passport, ocarina table) in the same
   language as the parchment cards and keycaps of the desk above.
   Loads after workstation.css. Only restyles; markup and JS hooks stay as they are. */

.ws {
  --sheet: linear-gradient(rgba(250, 243, 230, .74), rgba(243, 232, 213, .78)), var(--paper-image) center / 600px;
  --sheet-line: #cdbb9f;
  --sheet-ink: #2a1f17;
  --sheet-muted: #7a6656;
  --well: rgba(233, 220, 198, .55);
  --cap: linear-gradient(#f8f0e2, #e8dbc4);
  --cap-top: #3a2a20;
  --lift: 0 18px 40px -26px rgba(60, 35, 18, .55), inset 0 0 0 4px rgba(255, 252, 245, .35);
}

/* Sheet shell */
.ws .console { gap: 18px; border-top: 0; }
.ws .console-row,
.ws .passport,
.ws #articulations .table-scroll {
  position: relative;
  border: 1px solid var(--sheet-line);
  border-radius: 16px;
  background: var(--sheet);
  color: var(--sheet-ink);
  box-shadow: var(--lift);
}
.ws .console-row {
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px clamp(20px, 3vw, 44px);
  padding: clamp(20px, 2.2vw, 30px) clamp(20px, 2.4vw, 34px);
  border-bottom: 1px solid var(--sheet-line);
}
.ws .console-row > header { position: relative; padding-right: clamp(14px, 2vw, 26px); border-right: 1px solid var(--sheet-line); }
.ws .console-row > header::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin-bottom: 14px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M12 2v20M2 12h20M4.9 4.9l14.2 14.2M19.1 4.9 4.9 19.1'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M12 2v20M2 12h20M4.9 4.9l14.2 14.2M19.1 4.9 4.9 19.1'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ws .console-row > header h3 { font: 400 1.3rem/1.12 var(--display); letter-spacing: .01em; }
.ws.spoons .console-row > header h3 { font-size: 1.7rem; }
.ws .console-row > header p { margin-top: 10px; color: var(--sheet-muted); font-size: .8rem; line-height: 1.45; }

/* Shared controls */
.ws .recording-panel select,
.ws .studio-actions select,
.ws .studio-actions input,
.ws .rhythm-grid select {
  -webkit-appearance: none;
          appearance: none;
  min-height: 42px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--sheet-line);
  border-radius: 10px;
  background: #fbf6ec url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%237a6656' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 13px center / 11px 8px no-repeat;
  color: var(--sheet-ink);
  font-size: .92rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 6px 14px -12px rgba(60, 35, 18, .6);
  cursor: pointer;
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}
.ws .studio-actions input { padding-right: 10px; background-image: none; cursor: text; font-variant-numeric: tabular-nums; }
.ws .recording-panel select:hover:not(:disabled),
.ws .studio-actions select:hover:not(:disabled),
.ws .studio-actions input:hover:not(:disabled),
.ws .rhythm-grid select:hover:not(:disabled) { border-color: var(--cap-top); background-color: #fffaf1; }
.ws .recording-panel select:disabled, .ws .studio-actions select:disabled, .ws .rhythm-grid select:disabled, .ws .studio-actions input:disabled { opacity: .5; cursor: not-allowed; }
.ws .recording-panel .track-label { margin-bottom: 8px; color: var(--sheet-muted); font: 600 .66rem/1.2 var(--font); letter-spacing: .14em; }

/* Range: thin ink line, accent fill, cream thumb with accent ring */
.ws .recording-panel input[type="range"] {
  -webkit-appearance: none;
          appearance: none;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.ws .recording-panel input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: rgba(122, 102, 86, .28); }
.ws .recording-panel input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(122, 102, 86, .28); }
.ws .recording-panel input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.ws .recording-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: #fbf6ec;
  box-shadow: 0 2px 6px rgba(60, 35, 18, .35);
}
.ws .recording-panel input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid var(--accent); border-radius: 50%; background: #fbf6ec; }
.ws .recording-panel input[type="range"]:disabled { opacity: .45; cursor: not-allowed; }

/* Studio takes: transport + waveform well */
.ws .recording-pick { gap: 12px; }
.ws .recording-main { gap: 12px; padding: 12px 16px 10px 12px; border: 1px solid var(--sheet-line); border-radius: 14px; background: var(--well); box-shadow: inset 0 2px 8px -4px rgba(60, 35, 18, .35); }
.ws .recording-panel button {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--sheet-line);
  border-radius: 50%;
  background: var(--cap);
  color: var(--sheet-ink);
  box-shadow: 0 6px 12px -8px rgba(60, 35, 18, .7);
  transition: transform 90ms ease-out, background-color 120ms ease-out;
}
.ws .recording-panel button:hover:not(:disabled) { border-color: var(--cap-top); background: #fffaf1; }
.ws .recording-panel button:active:not(:disabled) { transform: translateY(1px); }
.ws .recording-panel button[data-play] {
  min-width: 54px;
  min-height: 54px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
  box-shadow: 0 0 0 4px rgba(251, 246, 236, .9), 0 0 0 5px var(--sheet-line), 0 10px 18px -10px rgba(60, 35, 18, .9);
}
.ws .recording-panel button[data-play]:hover:not(:disabled) { background: var(--cap-top); }
.ws .recording-panel button[data-stop] { font-size: .7rem; }
.ws .waveform { gap: 2px; min-height: 58px; }
.ws .waveform span { border-radius: 2px; background: rgba(122, 102, 86, .45); }
.ws .waveform span.played { background: var(--accent); }
.ws .recording-panel time { padding: 4px 9px; border-radius: 999px; background: rgba(251, 246, 236, .8); color: var(--sheet-muted); font-size: .76rem; }
.ws .recording-options { gap: 10px; color: var(--sheet-muted); }
.ws .recording-options button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ws .recording-options [data-rate] { min-height: 40px; padding: 0 30px 0 12px; background-position: right 11px center; }
.ws .recording-options [data-volume] { width: clamp(70px, 7vw, 110px); }

/* Own play: take recorder + sequencer */
.ws .workbench { gap: 0; grid-template-columns: minmax(220px, .7fr) minmax(0, 2fr); }
.ws .workbench section { padding: 0 clamp(18px, 2.4vw, 32px); }
.ws .workbench section:first-child { padding-left: 0; }
.ws .workbench section + section { padding-right: 0; border-left: 1px solid var(--sheet-line); }
.ws .workbench h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font: 400 1.08rem/1.2 var(--sub);
  letter-spacing: 0;
}
.ws .workbench h2::after { content: ""; flex: 1; height: 1px; background: var(--sheet-line); }
.ws .studio-actions { gap: 8px; }
.ws .studio-actions button, .ws .studio-download {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--sheet-line);
  border-radius: 999px;
  background: var(--cap);
  color: var(--sheet-ink);
  font-size: .86rem;
  box-shadow: 0 6px 12px -9px rgba(60, 35, 18, .7);
  transition: transform 90ms ease-out, background-color 120ms ease-out;
}
.ws .studio-actions button:hover:not(:disabled), .ws .studio-download:hover { border-color: var(--cap-top); background: #fffaf1; }
.ws .studio-actions button:active:not(:disabled) { transform: translateY(1px); }
.ws .studio-actions button[data-take-record], .ws .studio-actions button[data-rhythm-start] { gap: 9px; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ws .studio-actions button[data-take-record]:hover:not(:disabled), .ws .studio-actions button[data-rhythm-start]:hover:not(:disabled) { background: var(--cap-top); border-color: var(--cap-top); }
.ws .studio-actions button[data-take-record]::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ffb4a3; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.ws .studio-actions button[data-rhythm-start]::before { content: ""; border-left: 8px solid currentColor; border-block: 5px solid transparent; }
.ws .studio-actions label { gap: 8px; color: var(--sheet-muted); font-size: .8rem; }
.ws .studio-actions input { width: 5.2rem; }

/* Recorder face: a counter in a well, the lamp lights while recording */
.ws .take-panel .studio-actions { display: grid; grid-template-columns: 1fr 1fr; }
.ws .take-panel .studio-clock {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 14px 16px;
  border: 1px solid var(--sheet-line);
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 2px 8px -4px rgba(60, 35, 18, .35);
  color: var(--sheet-ink);
  font: 400 2.2rem/1 var(--sub);
  letter-spacing: .02em;
}
.ws .take-panel .studio-clock::after {
  content: "REC";
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sheet-muted);
  font: 600 .64rem/1 var(--font);
  letter-spacing: .14em;
  order: 3;
}
.ws .take-panel .studio-clock::before { content: ""; order: 2; width: 9px; height: 9px; margin-left: auto; margin-right: 6px; border-radius: 50%; background: rgba(122, 102, 86, .35); }
.ws .take-panel:has([data-take-stop]:not(:disabled)) .studio-clock::before { background: #c8321f; box-shadow: 0 0 0 4px rgba(200, 50, 31, .18); animation: paper-rec 1s ease-in-out infinite; }
.ws .take-panel:has([data-take-stop]:not(:disabled)) .studio-clock::after { color: #c8321f; }
.ws .take-panel .studio-actions button { justify-content: center; }
.ws .take-panel audio { width: 100%; margin-top: 12px; }
@keyframes paper-rec { 50% { opacity: .35; } }

/* Sequencer: keycaps in four beats */
.ws .rhythm-overflow { margin: 16px 0 14px; padding: 2px 2px 8px; }
.ws .rhythm-grid { grid-template-columns: 104px repeat(16, minmax(26px, 1fr)); gap: 5px 3px; }
.ws .rhythm-grid select { min-height: 40px; padding: 0 24px 0 10px; border-radius: 8px; background-position: right 8px center; font-size: .8rem; }
.ws .rhythm-count { align-self: end; padding-bottom: 2px; color: rgba(122, 102, 86, .7); font: 400 .78rem/1 var(--sub); }
.ws .rhythm-count:nth-of-type(4n + 2) { color: var(--sheet-ink); }
.ws .rhythm-count:nth-of-type(4n + 2)::before { content: ""; display: block; width: 4px; height: 4px; margin: 0 auto 4px; border-radius: 50%; background: var(--accent); }
.ws .rhythm-step {
  min-height: 40px;
  border: 1px solid var(--sheet-line) !important;
  border-top: 3px solid rgba(58, 42, 32, .35) !important;
  border-radius: 0 0 7px 7px;
  background: var(--cap) !important;
  box-shadow: 0 6px 10px -8px rgba(60, 35, 18, .8);
  transition: transform 80ms ease-out, background-color 100ms ease-out;
}
.ws .rhythm-step:nth-of-type(4n + 1) { margin-left: 6px; border-top-color: var(--cap-top) !important; }
.ws .rhythm-step:hover { background: #fffaf1 !important; border-color: var(--cap-top) !important; }
.ws .rhythm-step:active { transform: translateY(2px); }
.ws .rhythm-step[aria-pressed="true"] {
  border-color: var(--accent) !important;
  background: radial-gradient(circle, rgba(255, 238, 220, .9) 0 3px, transparent 3.5px), var(--accent) !important;
}
.ws .rhythm-step.is-current { box-shadow: 0 0 0 2px #fbf6ec, 0 0 0 3px var(--cap-top); transform: translateY(1px); }
.ws .rhythm-step[aria-pressed="true"].is-current { background: radial-gradient(circle, #fff 0 4px, transparent 4.5px), var(--cap-top) !important; }
.ws .rhythm-panel > .studio-actions:last-child button { background: transparent; box-shadow: none; }
.ws .rhythm-panel > .studio-actions:last-child button:hover { background: rgba(255, 250, 241, .8); }

/* Kontakt keys: keycaps like the strip on the desk */
.ws .fp-keys { gap: 10px; border-top: 0; }
.ws .fp-keys > .fp-key,
.ws .fp-keys[data-cols] > .fp-key:nth-child(n) {
  padding: 16px 16px 14px;
  border: 1px solid var(--sheet-line);
  border-top: 3px solid var(--tick, var(--mvp));
  border-radius: 0 0 14px 14px;
  background: var(--sheet);
  box-shadow: 0 14px 28px -22px rgba(60, 35, 18, .8);
  transition: transform 90ms ease-out, background-color 120ms ease-out;
}
.ws .fp-keys > .fp-key:not(.has-sub):hover { background: #fffaf1; }
.ws .fp-keys > .fp-key:not(.has-sub):active { transform: translateY(2px); }
.ws .fp-keys > .fp-key[aria-pressed="true"] { background: var(--cap-top); border-color: var(--cap-top); border-top-color: var(--tick, var(--mvp)); }
.ws .fp-keys > .fp-key.is-sounding { background: var(--accent); border-color: var(--accent); }
.ws .fp-key .fp-sub button { min-width: 32px; min-height: 30px; padding: 0 8px; border: 1px solid var(--sheet-line); border-radius: 999px; background: var(--cap); }
.ws .fp-key .fp-sub button:hover { border-color: var(--cap-top); background: #fffaf1; }
.ws .fp-key .fp-sub button[aria-pressed="true"], .ws .fp-key .fp-sub button.is-sounding { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

/* Passport: one sheet, ledger cells */
.ws .passport { overflow: hidden; }
.ws .passport > div { padding: 20px 24px 22px; border-bottom: 1px solid var(--sheet-line); }
.ws .passport > div:not(:nth-child(3n + 1)) { padding-left: 24px; border-left: 1px solid var(--sheet-line); }
.ws .passport > div:nth-last-child(-n + 3) { border-bottom: 0; }
.ws .passport dt { color: var(--sheet-muted); font-size: .66rem; letter-spacing: .14em; }
.ws .passport dd { font-size: 1.32rem; }
.ws .passport small { color: var(--sheet-muted); }

/* Ocarina technique table on a sheet */
.ws #articulations .table-scroll { padding: 6px 24px 10px; }
.ws #articulations .art-table th { border-bottom-color: var(--sheet-line); }

@media (max-width: 1180px) {
  .ws .console-row { grid-template-columns: 170px minmax(0, 1fr); }
  .ws .workbench { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ws .workbench section, .ws .workbench section:first-child { padding: 0; }
  .ws .workbench section + section { padding-top: 22px; border-left: 0; border-top: 1px solid var(--sheet-line); }
  .ws .take-panel .studio-actions { grid-template-columns: minmax(180px, 280px) auto auto; justify-content: start; }
  .ws .take-panel .studio-clock { grid-column: 1; grid-row: 1 / span 1; margin: 0; padding: 8px 14px; font-size: 1.7rem; }
}
@media (max-width: 900px) {
  .ws .console-row { grid-template-columns: minmax(0, 1fr); }
  .ws .console-row > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--sheet-line); }
  .ws .console-row > header::before { display: none; }
  .ws .console-row > header p { margin: 0; }
  .ws .passport > div { padding: 16px 18px; }
  .ws .passport > div:not(:nth-child(3n + 1)) { padding-left: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ws .take-panel:has([data-take-stop]:not(:disabled)) .studio-clock::before { animation: none; }
  .ws .rhythm-step, .ws .fp-keys > .fp-key, .ws .recording-panel button, .ws .studio-actions button { transition: none; }
}

/* Ocarina finger strip: fit the desk on laptops instead of overflowing it. */
@media (min-width: 901px) and (max-width: 1440px) {
  .ws .oc-fingers { min-width: 0; }
  .ws .oc-hand { flex: 1 1 0; min-width: 0; }
  .ws .oc-finger, .ws .oc-finger.is-small { flex: 1 1 0; width: auto; min-width: 0; }
  .ws .oc-fname { font-size: .68rem; }
}

/* Logo lockup in the instrument-page header. */
.ws .ws-brand { gap: 13px; }
.ws .ws-emblem { width: auto; height: 42px; }
.ws .ws-wordmark { display: grid; gap: 5px; }
.ws .ws-wordmark b { font: 400 1.22rem/1 "Old Standard TT", Georgia, serif; letter-spacing: .005em; white-space: nowrap; }
.ws .ws-wordmark small { color: var(--desk-muted); font: 600 .58rem/1 var(--font); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 900px) { .ws .ws-wordmark small { display: none; } }

/* Ocarina page: calmer serif pair instead of Marmelad/Alice. */
.edition.ocarina { --display: Prata, "Old Standard TT", Georgia, serif; --sub: "Old Standard TT", Georgia, serif; }
