@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600;700&family=UnifrakturMaguntia&display=swap');

:root {
  color-scheme: dark;
  --ink: #20150d;
  --paper: #e8d4a3;
  --paper-deep: #c8a96d;
  --wood: #2b1b11;
  --wood-light: #4a2e1b;
  --brass: #c8a44e;
  --brass-pale: #ead695;
  --green: #34714b;
  --green-bright: #4f9865;
  --amber: #a87629;
  --red: #8f3a32;
  --red-bright: #b55145;
  --cream: #f3e7c9;
  --muted: #c8b88f;
  --line: rgba(224, 195, 123, 0.28);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #140e09; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: "EB Garamond", Georgia, serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(169, 122, 52, .18), transparent 28rem),
    repeating-linear-gradient(94deg, rgba(255,255,255,.012) 0 1px, transparent 1px 6px),
    linear-gradient(145deg, #170f0a, #2c1b10 50%, #130d08);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.page-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 30px 0 22px; }
.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 14px 4px 26px;
  border-bottom: 1px solid var(--line);
}
.seal {
  width: 64px; height: 64px; display: grid; place-items: center;
  border: 1px solid var(--brass); border-radius: 50%;
  color: var(--brass-pale); font: 42px/1 "UnifrakturMaguntia", serif;
  box-shadow: inset 0 0 0 5px #2b1b11, inset 0 0 0 6px rgba(234,214,149,.35), 0 8px 22px #0008;
  background: radial-gradient(circle, #71431f, #2b1a10 70%);
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 4rem); font-weight: 500; line-height: .95; letter-spacing: -.03em; color: #f0dfb3; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 600; line-height: 1.05; }
.eyebrow, .kicker { color: var(--brass); font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.lede { margin-top: 8px; color: var(--muted); font-style: italic; font-size: 1.05rem; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #1c120c; cursor: pointer; }
.icon-button:hover { border-color: var(--brass); color: var(--brass-pale); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.language-control select { width: 66px; min-height: 42px; padding-inline: 10px 26px; border-color: var(--line); background-color: #1c120c; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
main { display: grid; gap: 18px; padding: 24px 0; }
.control-panel, .quality-panel, .card, .notice {
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(46, 29, 18, .96), rgba(31, 20, 13, .98)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255,255,255,.02) 4px 5px);
  box-shadow: var(--shadow);
}
.control-panel, .quality-panel { padding: clamp(18px, 3vw, 30px); }
.section-heading, .card-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.section-heading h2, .card-heading h2 { margin-top: 5px; }
.live-note, .meter-hint { color: var(--muted); font-style: italic; text-align: right; max-width: 360px; }
.control-grid { display: grid; grid-template-columns: 1.35fr .7fr .65fr; gap: 14px; margin-top: 24px; }
.segmented, .field { border: 0; padding: 0; margin: 0; min-width: 0; }
.segmented legend, .field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; align-content: end; }
.segmented legend { grid-column: 1 / -1; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span, select, .input-suffix {
  min-height: 44px; display: flex; align-items: center; border: 1px solid var(--line); background: #160f0a; color: var(--cream);
}
.segmented span { justify-content: center; padding: 8px 12px; cursor: pointer; }
.segmented label:first-of-type span { border-radius: 7px 0 0 7px; }
.segmented label:last-of-type span { border-radius: 0 7px 7px 0; border-left: 0; }
.segmented input:checked + span { color: #191007; background: linear-gradient(#e1c77f, #b9923e); border-color: #e9d89c; font-weight: 700; }
select, .input-suffix { width: 100%; border-radius: 7px; }
select { padding: 0 36px 0 12px; cursor: pointer; }
.input-suffix input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; padding: 0 4px 0 12px; color: var(--cream); background: transparent; }
.input-suffix span { padding-right: 12px; color: var(--muted); }
.slider-block { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.slider-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.slider-title span { font-weight: 700; font-size: 1.05rem; }
.slider-title small { display: block; color: var(--muted); }
.slider-title output { color: var(--brass-pale); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.range { width: 100%; margin: 20px 0 8px; accent-color: var(--brass); direction: rtl; }
.preset-row { position: relative; height: 30px; margin: 0 8px; }
.preset { position: absolute; translate: -50% 0; padding: 3px 7px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: .72rem; cursor: pointer; white-space: nowrap; }
.preset::before { content: ""; display: block; width: 1px; height: 6px; margin: -2px auto 2px; background: var(--brass); }
.preset:hover, .preset.current { color: var(--brass-pale); background: #120c08; }
.range-legend { display: flex; justify-content: space-between; color: #9e8d6c; font-size: .78rem; font-style: italic; }
.quality-panel { overflow: hidden; }
.compact { margin-bottom: 20px; }
.quality-meter { display: grid; grid-template-columns: repeat(12, minmax(56px, 1fr)); grid-template-rows: repeat(2, 66px); min-width: 760px; border: 1px solid #100b08; border-radius: 7px; overflow: hidden; }
.quality-panel { overflow-x: auto; }
.key-segment { --quality-hue: 48; position: relative; min-height: 66px; padding: 10px 5px; border: 0; border-right: 1px solid rgba(0,0,0,.45); background: linear-gradient(hsl(var(--quality-hue) 42% 43%), hsl(var(--quality-hue) 48% 27%)); cursor: pointer; transition: filter .15s ease, transform .15s ease, background .15s ease; }
.key-segment.major { border-bottom: 1px solid rgba(0,0,0,.45); }
.key-segment:nth-child(12n) { border-right: 0; }
.key-segment:hover { filter: brightness(1.16); z-index: 2; }
.key-segment:focus-visible { outline: 2px solid white; outline-offset: -4px; z-index: 3; }
.key-segment.center { box-shadow: inset 0 0 0 3px var(--brass-pale), inset 0 0 20px #e6c36544; }
.key-segment.playing { filter: brightness(1.25); transform: translateY(-2px); }
.key-name { display: block; font-size: 1.32rem; font-weight: 700; }
.meter-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 12px; color: var(--muted); font-size: .86rem; }
.meter-legend > span { display: inline-flex; gap: 6px; align-items: center; }
.swatch { width: 9px; height: 9px; border-radius: 50%; }
.swatch.good { background: var(--green-bright); }.swatch.mixed { background: #c18b37; }.swatch.wolf { background: var(--red-bright); }
.meter-legend .active-readout { margin-left: auto; color: var(--brass-pale); }
.workspace-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; }
.card { min-width: 0; padding: 22px; }
.text-button, .tab { border: 0; background: transparent; color: var(--brass-pale); cursor: pointer; }
.text-button { border-bottom: 1px dotted var(--brass); }
.table-wrap { max-height: 430px; overflow: auto; margin-top: 16px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; border-bottom: 1px solid rgba(224,195,123,.14); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; background: #25170f; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.note-cell strong { font-size: 1.05rem; }.note-cell small { display: block; color: var(--muted); }
.tabs { display: flex; margin-top: 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 18px; color: var(--muted); }
.tab.active { color: var(--brass-pale); border-bottom: 2px solid var(--brass); }
.mapping-control { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 14px 0 0; padding: 0; border: 0; }
.mapping-control[hidden] { display: none; }
.mapping-control legend { width: 100%; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mapping-options { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.mapping-options label { cursor: pointer; }
.mapping-options input { position: absolute; opacity: 0; pointer-events: none; }
.mapping-options span { display: block; min-width: 106px; padding: 7px 12px; color: var(--muted); text-align: center; }
.mapping-options label + label span { border-left: 1px solid var(--line); }
.mapping-options input:checked + span { color: #1b1108; background: var(--brass-pale); font-weight: 700; }
.mapping-options input:focus-visible + span { outline: 2px solid white; outline-offset: -3px; }
.mapping-control small { color: #9e8d6c; font-style: italic; }
textarea { width: 100%; min-height: 285px; resize: vertical; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: #e7d7b4; background: #120d09; font: .78rem/1.55 ui-monospace, Consolas, monospace; }
textarea:focus { border-color: var(--brass); }
.export-actions { display: flex; gap: 10px; margin-top: 12px; }
.primary-button, .secondary-button { min-height: 42px; padding: 0 18px; border-radius: 6px; cursor: pointer; }
.primary-button { border: 1px solid #e3cc84; color: #1b1108; background: linear-gradient(#e2c97f, #b9943f); font-weight: 700; }
.secondary-button { border: 1px solid var(--line); background: #1c120c; }
.notice { padding: 14px 18px; color: var(--muted); border-left: 4px solid var(--amber); box-shadow: none; }
.notice strong { color: var(--cream); }
footer { display: flex; justify-content: space-between; gap: 18px; padding: 12px 4px 0; border-top: 1px solid var(--line); color: #9d8a66; font-size: .82rem; font-style: italic; }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 10px 16px; border: 1px solid var(--brass); border-radius: 99px; color: #1c120b; background: var(--brass-pale); box-shadow: 0 10px 30px #0009; transition: .2s ease; font-weight: 700; }
.toast.show { opacity: 1; translate: -50% 0; }

.help-dialog {
  width: min(940px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: auto;
  border: 1px solid #d0a84d;
  border-radius: 6px;
  color: #38220f;
  background:
    radial-gradient(ellipse at 25% 0, rgba(255,255,255,.42), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(86,51,24,.035) 6px),
    linear-gradient(135deg, #ead8a9, #c4a46c 68%, #e2c98f);
  box-shadow: 0 28px 90px #000c, inset 0 0 38px rgba(85,47,18,.22);
}
.help-dialog::backdrop { background: rgba(15,8,4,.78); backdrop-filter: blur(3px); }
.help-dialog form { padding: 28px 32px 30px; }
.help-heading { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 13px; border-bottom: 1px solid rgba(84,48,20,.34); }
.help-heading h2 { margin-top: 4px; color: #5f2118; font-size: 1.85rem; }
.help-heading .kicker { color: #81501e; }
.dialog-close { width: 34px; height: 34px; border: 1px solid #80501d; border-radius: 50%; color: #ead79e; background: #4c2714; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.help-intro { margin-top: 18px; font-size: 1.07rem; line-height: 1.42; font-style: italic; }
.help-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; margin-top: 22px; }
.help-sections section:last-child { grid-column: 1 / -1; }
.help-sections h3 { margin: 0 0 5px; color: #67261c; font-size: 1.05rem; }
.help-sections p { color: #4e351d; line-height: 1.38; }
.help-try p { white-space: pre-line; line-height: 1.65; }
.history-section { margin-top: 30px; padding-top: 27px; border-top: 2px solid rgba(92,51,20,.32); }
.history-heading { max-width: 720px; margin: 0 auto 23px; text-align: center; }
.history-heading h2 { margin-top: 5px; color: #5f2118; font-size: 1.7rem; }
.history-heading > p:last-child { margin-top: 10px; color: #50361e; font-size: 1.02rem; line-height: 1.42; font-style: italic; }
.history-timeline { display: grid; gap: 25px; }
.story-card { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); overflow: hidden; border: 1px solid rgba(91,50,19,.48); background: rgba(255,244,207,.28); box-shadow: 0 8px 18px rgba(71,38,15,.14); }
.story-card:nth-child(even) figure { order: 2; }
.story-card figure { min-height: 100%; margin: 0; background: #2c180d; }
.story-card img { display: block; width: 100%; height: 100%; min-height: 290px; object-fit: cover; }
.story-copy { padding: 22px 23px 20px; }
.story-era { color: #875624; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.story-copy h3 { margin: 5px 0 9px; color: #63241b; font-size: 1.35rem; line-height: 1.08; }
.story-copy > p:not(.story-era) { color: #4a321c; line-height: 1.4; }
.tradeoffs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 17px; }
.tradeoffs > div { padding: 11px 12px 9px; border-top: 3px solid; background: rgba(255,250,225,.35); }
.tradeoffs .advantages { border-color: #567c43; }
.tradeoffs .drawbacks { border-color: #9a4936; }
.tradeoffs h4 { margin: 0 0 6px; font-size: .82rem; letter-spacing: .03em; }
.advantages h4 { color: #365c2b; }
.drawbacks h4 { color: #7d2f25; }
.tradeoffs ul { margin: 0; padding-left: 17px; color: #4b351f; font-size: .86rem; line-height: 1.34; }
.tradeoffs li + li { margin-top: 4px; }
.help-dismiss { display: block; margin: 24px auto 0; }

@media (max-width: 820px) {
  .control-grid, .workspace-grid { grid-template-columns: 1fr; }
  .quality-panel { margin-inline: -14px; border-inline: 0; border-radius: 0; }
  .quality-meter { min-width: 720px; }
  .live-note { display: none; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 20px, 1180px); padding-top: 14px; }
  .masthead { grid-template-columns: auto 1fr; gap: 12px; }
  .masthead .icon-button { display: none; }
  .seal { width: 46px; height: 46px; font-size: 30px; }
  h1 { font-size: 2.25rem; }
  .lede { font-size: .9rem; }
  .section-heading, .card-heading { align-items: start; }
  .meter-hint { display: none; }
  .segmented { grid-template-columns: 1fr; }
  .segmented label:first-of-type span { border-radius: 7px 7px 0 0; }
  .segmented label:last-of-type span { border-radius: 0 0 7px 7px; border-left: 1px solid var(--line); border-top: 0; }
  .preset { font-size: .62rem; padding-inline: 3px; }
  footer { flex-direction: column; }
}

/* Renaissance instrument cabinet -------------------------------------------------
   The functional layout remains fluid inside a deliberately bounded, framed body.
   Ornament is structural rather than a stretched illustration, so it survives
   desktop, tablet, and mobile proportions without becoming distorted. */
body {
  background:
    radial-gradient(ellipse at 50% -12%, rgba(228, 188, 101, .18), transparent 38rem),
    repeating-linear-gradient(88deg, rgba(255,255,255,.012) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(4deg, transparent 0 17px, rgba(0,0,0,.08) 18px 19px),
    linear-gradient(128deg, #100a07, #2a170d 45%, #120b07);
  padding: clamp(10px, 2.5vw, 34px) 0;
}

.page-shell {
  position: relative;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: clamp(18px, 3vw, 38px);
  border: 1px solid #0a0604;
  outline: 1px solid rgba(232, 198, 112, .48);
  outline-offset: -9px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 10%, transparent 90%, rgba(0,0,0,.18)),
    repeating-linear-gradient(93deg, rgba(255,255,255,.016) 0 1px, transparent 1px 7px),
    linear-gradient(145deg, #4b2b17, #26150d 48%, #3b2113);
  box-shadow:
    0 34px 95px rgba(0,0,0,.68),
    inset 0 0 0 5px #1b0f09,
    inset 0 0 0 7px rgba(205,165,73,.7),
    inset 0 0 0 12px #351d10,
    inset 0 0 42px rgba(0,0,0,.78);
}

.page-shell::before,
.page-shell::after {
  position: absolute;
  z-index: 3;
  top: 15px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #d4b15c;
  border: 1px solid rgba(226,197,118,.55);
  border-radius: 50%;
  background: radial-gradient(circle, #6a4421, #24130b 68%);
  box-shadow: inset 0 0 0 3px #2a170e, 0 4px 12px #0008;
  font-size: 1rem;
  content: "✦";
}
.page-shell::before { left: 15px; }
.page-shell::after { right: 15px; }

.masthead {
  position: relative;
  margin: 0 8px;
  padding: clamp(20px, 3vw, 31px) clamp(18px, 4vw, 42px);
  border: 1px solid #d4b15c;
  border-radius: 46% 46% 10px 10px / 18px 18px 10px 10px;
  color: #2a190f;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255,255,255,.42), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(83,50,24,.035) 6px),
    linear-gradient(135deg, #ead8a9, #cbae72 55%, #e2ca93);
  box-shadow:
    inset 0 0 0 4px rgba(75,43,22,.3),
    inset 0 0 28px rgba(86,49,21,.24),
    0 12px 28px rgba(0,0,0,.35);
}
.masthead::after {
  content: "❦";
  position: absolute;
  left: 50%;
  bottom: -13px;
  translate: -50% 0;
  min-width: 52px;
  color: #d7b65e;
  background: #352015;
  border: 1px solid #b98e3d;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  box-shadow: 0 3px 10px #0008;
}
.masthead h1 { color: #342014; text-shadow: 0 1px rgba(255,255,255,.45); }
.masthead .eyebrow { color: #7b4c21; }
.masthead .lede { color: #664c31; }
.seal {
  width: 72px;
  height: 72px;
  border: 2px solid #9a742e;
  color: #f0d98e;
  background: radial-gradient(circle at 36% 30%, #8f5a2d, #2a170d 70%);
  box-shadow: inset 0 0 0 5px #392014, inset 0 0 0 7px #c69d45, 0 7px 18px #51301888;
}
.header-actions select,
.header-actions .icon-button { color: #ead8a9; border-color: #7f5b2b; background-color: #2a180f; }

.renaissance-frieze {
  position: relative;
  z-index: 1;
  width: min(94%, 980px);
  margin: 16px auto -8px;
  padding: 0;
  pointer-events: none;
  filter: drop-shadow(0 13px 12px rgba(0,0,0,.55));
}
.renaissance-frieze::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 9%;
  right: 9%;
  bottom: 4%;
  height: 24%;
  border-radius: 50%;
  background: rgba(8,4,2,.54);
  filter: blur(18px);
}
.renaissance-frieze img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

main {
  gap: 22px;
  padding: 32px 8px 24px;
}

.control-panel,
.quality-panel,
.card,
.notice {
  position: relative;
  border: 1px solid #b58a3d;
  outline: 1px solid rgba(237,211,143,.2);
  outline-offset: -5px;
  border-radius: 5px;
  background:
    linear-gradient(rgba(45,27,17,.965), rgba(28,17,11,.985)),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.015) 8px);
  box-shadow: 0 15px 35px rgba(0,0,0,.38), inset 0 0 32px rgba(0,0,0,.22);
}
.control-panel::before,
.quality-panel::before,
.card::before {
  content: "✦";
  position: absolute;
  top: 8px;
  right: 10px;
  color: rgba(220,184,91,.48);
  font-size: .66rem;
}
.control-panel,
.quality-panel { padding: clamp(22px, 3.5vw, 36px); }
.section-heading,
.card-heading { padding-bottom: 12px; border-bottom: 1px solid rgba(217,177,82,.22); }
.section-heading h2,
.card-heading h2 { color: #f0dfb3; letter-spacing: .015em; }
.kicker { color: #d8b25b; }

.control-grid {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(205,164,77,.24);
  background: rgba(15,9,6,.27);
  box-shadow: inset 0 0 22px rgba(0,0,0,.32);
}
.slider-block { border-top-color: rgba(216,178,87,.34); }
.range { accent-color: #deb95d; }
.preset.current { outline: 1px solid rgba(213,176,88,.36); }

.quality-meter {
  border-color: #c49b49;
  border-radius: 3px;
  box-shadow: 0 0 0 4px #21130c, 0 0 0 5px rgba(219,184,96,.45), inset 0 0 16px #0008;
}
.key-segment { text-shadow: 0 1px 2px rgba(0,0,0,.72); }
.key-segment.center { box-shadow: inset 0 0 0 3px #f0daa0, inset 0 0 20px #e6c36555; }

.workspace-grid { gap: 22px; }
.card { padding: clamp(22px, 3vw, 30px); }
.pitch-card {
  color: #2b1a10;
  background:
    radial-gradient(ellipse at 25% 0, rgba(255,255,255,.38), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(86,51,24,.035) 6px),
    linear-gradient(135deg, #e2cf9e, #c3a36a 60%, #ddc38c);
  box-shadow: 0 15px 35px rgba(0,0,0,.4), inset 0 0 34px rgba(85,47,18,.25);
}
.pitch-card .kicker { color: #7a4b20; }
.pitch-card .card-heading h2 { color: #321e12; }
.pitch-card .card-heading,
.pitch-card .table-wrap { border-color: rgba(74,43,21,.35); }
.pitch-card .text-button { color: #5e3719; border-color: #7f511f; }
.pitch-card th { color: #684b2c; background: #cfb47d; }
.pitch-card th,
.pitch-card td { border-bottom-color: rgba(73,43,22,.2); }
.pitch-card .note-cell small { color: #6f5233; }

.export-card textarea {
  border-radius: 2px;
  border-color: rgba(221,185,95,.4);
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(205,170,87,.045) 24px),
    #100b08;
  box-shadow: inset 0 0 22px #0008;
}
.primary-button,
.secondary-button,
.segmented span,
select,
.input-suffix { border-radius: 2px; }
.primary-button { box-shadow: inset 0 1px rgba(255,255,255,.35), 0 4px 10px #0006; }
.notice { border-left: 4px solid #d1a64d; }

footer {
  margin: 0 8px;
  padding: 18px 8px 2px;
  border-top: 1px solid rgba(220,184,92,.42);
  color: #bda879;
}

@media (max-width: 820px) {
  body { padding-block: 8px; }
  .page-shell { width: min(100% - 14px, 1240px); padding: 22px 16px; }
  .page-shell::before, .page-shell::after { top: 11px; width: 28px; height: 28px; }
  .page-shell::before { left: 11px; }
  .page-shell::after { right: 11px; }
  .masthead { margin-inline: 2px; }
  .renaissance-frieze { width: 100%; margin-top: 12px; }
  main { padding-inline: 2px; }
  .quality-panel { margin-inline: 0; border-inline: 1px solid #b58a3d; }
}

@media (max-width: 560px) {
  .page-shell { width: calc(100% - 10px); padding: 16px 11px; outline-offset: -6px; }
  .page-shell::before, .page-shell::after { display: none; }
  .masthead { padding: 18px 14px; border-radius: 6px; }
  .masthead::after { display: none; }
  .renaissance-frieze { margin: 8px auto -4px; filter: drop-shadow(0 7px 8px rgba(0,0,0,.48)); }
  main { padding-top: 18px; gap: 14px; }
  .control-panel, .quality-panel, .card { padding: 18px 14px; }
  .control-grid { padding: 12px; }
}

/* Fixed Renaissance console ------------------------------------------------------
   A single 1024 × 1536 instrument plate supplies the architecture. Live HTML is
   pinned to its empty parchment fields; the plate never reflows or stretches. */
html { min-width: 320px; background: #100906; }
body {
  min-width: 1024px;
  padding: 18px 0 34px;
  overflow-x: auto;
  background:
    radial-gradient(ellipse at 50% 0, rgba(200,150,70,.16), transparent 50rem),
    linear-gradient(120deg, #0b0604, #211108 48%, #0b0604);
}

.page-shell {
  position: relative;
  width: 1024px;
  height: 1536px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  outline: 0;
  overflow: hidden;
  background: #3a1c0d url("./assets/renaissance-fixed-console-v6.png") center / 100% 100% no-repeat;
  box-shadow: 0 35px 100px rgba(0,0,0,.72);
}
.page-shell::before,
.page-shell::after { display: none; }

.masthead {
  position: absolute;
  z-index: 2;
  top: 68px;
  left: 204px;
  width: 626px;
  height: 126px;
  margin: 0;
  padding: 13px 18px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  border: 0;
  border-radius: 0;
  color: #2d1a0d;
  background: transparent;
  box-shadow: none;
}
.masthead::after { display: none; }
.masthead h1 { font-size: 2.55rem; line-height: .94; color: #301b0e; text-shadow: 0 1px rgba(255,255,255,.48); }
.masthead-copy {
  width: 100%;
  text-align: center;
  transform: translateY(13px);
}
.masthead .eyebrow { font-size: .58rem; color: #79501f; }
.masthead .lede { margin-top: 5px; color: #684522; font-size: .88rem; }
.masthead .seal { width: 54px; height: 54px; font-size: 34px; }
.header-actions { align-self: start; }
.header-actions select,
.header-actions .icon-button { min-height: 34px; height: 34px; }
.header-actions .icon-button { width: 34px; }
.language-control select { width: 74px; padding-inline: 8px 22px; }

.renaissance-frieze { display: none; }
main { display: block; padding: 0; }

.control-panel,
.quality-panel,
.card,
.notice {
  position: absolute;
  z-index: 2;
  margin: 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  color: #2d1b0e;
  background: transparent;
  box-shadow: none;
}
.control-panel::before,
.quality-panel::before,
.card::before { display: none; }
.section-heading,
.card-heading { padding: 0 0 7px; border-bottom: 1px solid rgba(79,47,20,.28); }
.section-heading h2,
.card-heading h2,
.pitch-card .card-heading h2 { color: #311c0d; }
.eyebrow,
.kicker,
.pitch-card .kicker { color: #74491c; }
.live-note,
.meter-hint,
.segmented legend,
.field > span,
.slider-title small,
.range-legend,
.meter-legend,
.mapping-control legend,
.mapping-control small,
.pitch-card .note-cell small { color: #6b4a29; }

.control-panel {
  top: 259px;
  left: 203px;
  width: 622px;
  height: 276px;
  padding: 13px 16px 10px;
}
.control-panel .section-heading h2 { font-size: 1.42rem; }
.control-panel .live-note { max-width: 250px; font-size: .75rem; }
.control-panel .section-heading h2,
.control-panel .kicker,
.control-panel .live-note,
.control-panel .segmented span,
.control-panel .field > span,
.control-panel .slider-title > div > span { white-space: nowrap; }
.control-grid {
  grid-template-columns: 1.3fr .68fr .62fr;
  gap: 9px;
  margin-top: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.segmented legend,
.field > span { margin-bottom: 4px; font-size: .66rem; }
.segmented span,
select,
.input-suffix { min-height: 35px; }
.input-suffix input { height: 33px; }
.segmented span { padding: 5px 7px; font-size: .82rem; }
.slider-block { margin-top: 12px; padding-top: 10px; border-top-color: rgba(79,47,20,.28); }
.slider-title span { font-size: .9rem; }
.slider-title small { font-size: .71rem; }
.slider-title output { color: #694315; font-size: 1rem; }
.range { margin: 11px 0 2px; }
.preset-row { height: 23px; }
.preset { color: #6b4a29; font-size: .64rem; }
.preset:hover,
.preset.current { color: #f3dfaa; background: #321a0c; }
.range-legend { font-size: .68rem; }

.quality-panel {
  top: 612px;
  left: 203px;
  width: 622px;
  height: 162px;
  padding: 4px 14px 5px;
  overflow: hidden;
}
.quality-panel > * { transform: translateY(11px); }
.quality-panel .section-heading {
  align-items: center;
  padding-bottom: 3px;
  line-height: .9;
}
.quality-panel .kicker { font-size: .56rem; }
.quality-panel h2 { font-size: 1.2rem; }
.quality-panel .meter-hint {
  max-width: 250px;
  font-size: .64rem;
  line-height: .95;
}
.compact { margin-bottom: 3px; }
.quality-meter {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, 39px);
  border: 1px solid #5f3517;
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(66,35,14,.42);
}
.key-segment { min-height: 39px; padding: 3px 1px; }
.key-name { font-size: .88rem; }
.meter-legend { gap: 10px; margin-top: 5px; font-size: .67rem; }

.workspace-grid {
  position: absolute;
  top: 846px;
  left: 115px;
  width: 795px;
  height: 486px;
  display: grid;
  grid-template-columns: 352px 352px;
  gap: 91px;
}
.card {
  position: relative;
  width: 352px;
  height: 486px;
  padding: 13px 15px;
  overflow: hidden;
}
.pitch-card { color: #2d1b0e; background: transparent; }
.card .kicker { font-size: .58rem; }
.card-heading h2 { margin-top: 2px; font-size: 1.28rem; }
.text-button { color: #633a16; border-color: #704419; font-size: .78rem; }
.table-wrap { max-height: 420px; margin-top: 7px; border-top-color: rgba(79,47,20,.28); }
th,
td { padding: 5px 4px; border-bottom-color: rgba(73,43,22,.18); }
th { color: #654321; background: rgba(207,180,125,.88); font-size: .62rem; }
.note-cell strong { font-size: .86rem; }
.note-cell small { font-size: .68rem; }

.export-card { color: #2d1b0e; }
.tabs { margin-top: 7px; border-bottom-color: rgba(79,47,20,.28); }
.tab { padding: 5px 13px; color: #765330; }
.tab.active { color: #4c2b10; border-bottom-color: #714312; }
.mapping-control { margin-top: 7px; gap: 4px 8px; }
.mapping-options { border-color: rgba(79,47,20,.4); }
.mapping-options span { min-width: 88px; padding: 4px 8px; color: #6b4a29; }
.mapping-options input:checked + span { color: #f7e9c4; background: #633a17; }
.export-card textarea {
  min-height: 0;
  height: 276px;
  margin-top: 7px;
  padding: 8px;
  color: #eadbb9;
  background: rgba(30,17,9,.94);
  font-size: .66rem;
  line-height: 1.35;
}
.export-actions { gap: 7px; margin-top: 7px; }
.primary-button,
.secondary-button { min-height: 32px; padding: 0 12px; font-size: .78rem; }

.notice {
  top: 1405px;
  left: 145px;
  width: 736px;
  height: 68px;
  padding: 13px 18px;
  overflow: hidden;
  color: #644322;
  border: 0;
  font-size: .78rem;
}
.notice strong { color: #321c0e; }
footer { display: none; }

html[lang="zh"] body { font-family: "Microsoft YaHei", "Noto Serif SC", serif; }
html[lang="ja"] body { font-family: "Yu Mincho", "Noto Serif JP", serif; }

/* The requested surface is deliberately fixed. On narrower screens it remains
   one intact instrument and can be panned horizontally instead of reflowing. */
@media (max-width: 1050px) {
  body { padding-left: 8px; padding-right: 8px; }
}

/* Primary visual hierarchy ------------------------------------------------------- */
.masthead h1 {
  color: #6e2018;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.025em;
  white-space: nowrap;
  text-shadow: 0 1px #fff4cf, 0 2px 0 rgba(90,48,17,.18);
}
.masthead .seal { display: none; }
.header-actions {
  position: absolute;
  top: -38px;
  right: -154px;
}
.header-actions select {
  border-color: #b58a3d;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.header-actions .help-button {
  color: #f0dda1;
  border-color: #b58a3d;
  background: #4d2614;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  font-weight: 700;
}

@media (max-width: 650px) {
  .help-dialog form { padding: 22px 20px 24px; }
  .help-sections { grid-template-columns: 1fr; }
  .help-sections section:last-child { grid-column: auto; }
  .story-card { grid-template-columns: 1fr; }
  .story-card:nth-child(even) figure { order: 0; }
  .story-card img { min-height: 0; aspect-ratio: 3 / 2; }
  .tradeoffs { grid-template-columns: 1fr; }
}
.masthead .eyebrow {
  color: #8c5a1e;
  font-size: .64rem;
  letter-spacing: .2em;
}
.masthead .lede { color: #50351d; font-size: .94rem; }
.masthead .seal {
  width: 58px;
  height: 58px;
  border-color: #b68a32;
  color: #ffe49b;
  background: radial-gradient(circle at 36% 30%, #96372a, #49140f 72%);
  box-shadow: inset 0 0 0 4px #4a180f, inset 0 0 0 6px #d2a84e, 0 5px 12px #4b271e88;
}

.slider-block {
  margin-top: 9px;
  padding: 8px 11px 6px;
  border: 1px solid #8e5d24;
  background: linear-gradient(100deg, rgba(96,31,22,.94), rgba(66,23,18,.92));
  box-shadow: inset 0 0 0 2px rgba(232,195,100,.18), 0 3px 8px rgba(61,30,12,.2);
}
.slider-title span { color: #fff0bf; font-size: 1.02rem; letter-spacing: .02em; }
.slider-title small { color: #dbc99d; font-size: .73rem; }
.slider-title output { color: #ffe07c; font-size: 1.18rem; font-weight: 700; }
.range {
  width: 100%;
  height: 10px;
  margin: 10px 0 2px;
  border: 1px solid #e3c167;
  border-radius: 99px;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, #9a3027, #c69a35 50%, #3f7848);
  box-shadow: inset 0 1px 3px #2a100d, 0 1px rgba(255,245,201,.35);
}
.range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #fff0b3;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #b77e25 62%, #58310f);
  box-shadow: 0 2px 6px #1b0908;
  cursor: grab;
}
.range::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 2px solid #fff0b3;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #b77e25 62%, #58310f);
  box-shadow: 0 2px 6px #1b0908;
  cursor: grab;
}
.preset { color: #dfcba0; }
.preset::before { background: #f3cf6d; }
.range-legend { color: #d3bd8e; }

.quality-panel h2 {
  color: #6e2018;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 1px rgba(255,255,255,.48);
}
.quality-panel .kicker { color: #94601f; font-size: .58rem; }
.quality-panel .meter-hint { color: #56381e; font-size: .64rem; }
.quality-meter {
  grid-template-rows: repeat(2, 36px);
  border: 2px solid #7b241a;
  box-shadow: 0 0 0 2px #d0a347, 0 4px 9px rgba(62,25,11,.34), inset 0 0 13px #0007;
}
.key-segment { min-height: 36px; padding: 2px 1px; }
.key-name { font-size: .92rem; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.meter-legend {
  margin-top: 3px;
  color: #5c3d20;
  font-size: .66rem;
  font-weight: 600;
  line-height: 1;
}
.meter-legend .active-readout { color: #6e2018; font-weight: 700; }
