/* hallmark: locked-system; scope: app; redesign: full; built: project; v2.0.0
 * Critique: paired scientific scenes and their controls are the material.
 * User requested all three palettes; SVG depicts model geometry, not photography.
 */
@font-face {
  font-family: "Onest Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-latin-wght-normal.woff2) format("woff2-variations");
  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;
}

:root[data-design="scene"][data-theme="dark"] {
  --bg: #080f13;
  --panel: #101b20;
  --ink: #eff7f0;
  --muted: #a9bbb4;
  --line: #34474c;
  --field: #15252b;
  --subtle: #172c32;
  --braid: #b2e7bf;
  --knit: #f4be89;
  --chamber: #31424c;
  --chamber-highlight: #718895;
  --chamber-line: #66818e;
  --fiber: #b1bec5;
}
:root[data-design="scene"][data-theme="light"] {
  --bg: #e5eee8;
  --panel: #f8fcf8;
  --ink: #15291f;
  --muted: #4c6656;
  --line: #baccc0;
  --field: #ffffff;
  --subtle: #dceadf;
  --braid: #216b49;
  --knit: #a44a20;
  --chamber: #c6ddce;
  --chamber-highlight: #f4fcf5;
  --chamber-line: #779b82;
  --fiber: #587b66;
}
:root[data-design="editorial"][data-theme="light"] {
  --bg: #eee8db;
  --panel: #faf6ed;
  --ink: #29251f;
  --muted: #6c5b4e;
  --line: #cfc0a9;
  --field: #fffbf2;
  --subtle: #eee2cd;
  --braid: #314bc2;
  --knit: #9f422b;
  --chamber: #ded8c1;
  --chamber-highlight: #fff7dc;
  --chamber-line: #9d9070;
  --fiber: #82755c;
}
:root[data-design="editorial"][data-theme="dark"] {
  --bg: #191612;
  --panel: #242019;
  --ink: #f6eddd;
  --muted: #c6b29c;
  --line: #574938;
  --field: #2d271e;
  --subtle: #372d21;
  --braid: #b7c3ff;
  --knit: #f2b28d;
  --chamber: #5b513e;
  --chamber-highlight: #a19170;
  --chamber-line: #9e8b65;
  --fiber: #c1b291;
}
:root[data-design="product"][data-theme="light"] {
  --bg: #eef0f7;
  --panel: #ffffff;
  --ink: #252536;
  --muted: #5c617a;
  --line: #d8dced;
  --field: #f7f8fe;
  --subtle: #edf0fd;
  --braid: #5749ba;
  --knit: #a6482f;
  --chamber: #d5dff2;
  --chamber-highlight: #f5f8ff;
  --chamber-line: #8198b9;
  --fiber: #657a9c;
}
:root[data-design="product"][data-theme="dark"] {
  --bg: #11131d;
  --panel: #1c2030;
  --ink: #f2f3ff;
  --muted: #b8bfd9;
  --line: #3e4865;
  --field: #151a29;
  --subtle: #272e46;
  --braid: #c5b9ff;
  --knit: #ffb89d;
  --chamber: #354965;
  --chamber-highlight: #738bad;
  --chamber-line: #8ea3be;
  --fiber: #a4b4d1;
}

body {
  font-family: "Onest Variable", "Segoe UI", sans-serif;
}
.design-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  min-height: 54px;
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.design-picker > span {
  color: var(--muted);
  font-size: 11px;
  margin-right: 14px;
}
.design-picker button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 7px 17px;
  border-radius: 99px;
  font-size: 12px;
}
.design-picker button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--panel);
}
.app-header {
  max-width: 1800px;
  margin: auto;
}
.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-actions button {
  border-radius: 99px;
  padding: 10px 17px;
  font-size: 11px;
  min-height: 40px;
}
aside {
  top: 54px;
  max-height: calc(100dvh - 54px);
}
.mesh-controls .label-line label {
  max-width: 160px;
}
.mesh-basis-control label {
  line-height: 1.5;
}
#mesh-note {
  margin-top: 10px;
  line-height: 1.6;
}
#braid-slider {
  accent-color: var(--braid);
}
#stitch-slider {
  accent-color: var(--knit);
}
#braid-count-value {
  color: var(--braid);
}
#stitch-value {
  color: var(--knit);
}
.control input[type="range"] {
  margin-bottom: 0;
}
.control + .control {
  margin-top: 22px;
}
#load-play,
#play {
  border-radius: 99px;
}
.construction-title {
  font-family: inherit;
}

/* Scene: one dark scientific stage; material, light and precise controls. */
:root[data-design="scene"] .app-header {
  padding-block: 36px;
  border-bottom: 0;
  background: var(--bg);
  align-items: flex-end;
}
:root[data-design="scene"] .app-header h1 {
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.04;
  max-width: 15ch;
  font-weight: 500;
  letter-spacing: -0.035em;
}
:root[data-design="scene"] .app-header p {
  margin-top: 15px;
  font-size: 12px;
}
:root[data-design="scene"] .workspace {
  gap: 0;
  max-width: 1800px;
}
:root[data-design="scene"] aside {
  background: var(--bg);
  border-right: 0;
  padding-top: 30px;
}
:root[data-design="scene"] main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px 0 0 0;
}
:root[data-design="scene"] .muscle {
  padding-top: 26px;
}
:root[data-design="scene"] .muscle h2 {
  font-size: 20px;
  font-weight: 500;
}
:root[data-design="scene"] .muscle > svg {
  height: 450px;
}
:root[data-design="scene"] .readouts dd {
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
}
:root[data-design="scene"] .construction-title {
  font-size: 27px;
  font-weight: 500;
}
:root[data-design="scene"] #load-play {
  background: var(--braid);
  color: var(--bg);
  border-color: var(--braid);
}
:root[data-design="scene"] .structure {
  margin-top: 40px;
}

/* Editorial: a warm page, big serif titles and a measured, ruled composition. */
:root[data-design="editorial"] .app-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 36px 36px 30px;
}
:root[data-design="editorial"] .app-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 5.7vw, 88px);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
:root[data-design="editorial"] .app-header p {
  margin-top: 17px;
}
:root[data-design="editorial"] .header-actions {
  max-width: 340px;
}
:root[data-design="editorial"] .workspace {
  max-width: 1800px;
}
:root[data-design="editorial"] .muscle h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
}
:root[data-design="editorial"] .readouts dd {
  font-size: 24px;
  font-weight: 500;
}
:root[data-design="editorial"] .construction-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 400;
}
:root[data-design="editorial"] .construction-figure {
  border-top-color: var(--ink);
}
:root[data-design="editorial"] button {
  border-radius: 0;
}
:root[data-design="editorial"] .design-picker button {
  border-radius: 0;
}
:root[data-design="editorial"] #load-play,
:root[data-design="editorial"] #play {
  border-radius: 0;
}

/* Product: compact utility in a soft, clear shell; the experiment remains first. */
:root[data-design="product"] .app-header {
  padding: 28px 30px;
  background: var(--bg);
  border: 0;
}
:root[data-design="product"] .app-header h1 {
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
}
:root[data-design="product"] .workspace {
  max-width: 1760px;
  gap: 20px;
  padding: 0 20px 20px;
}
:root[data-design="product"] aside {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
}
:root[data-design="product"] main {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding-inline: 28px;
}
:root[data-design="product"] .muscle h2 {
  font-size: 21px;
}
:root[data-design="product"] .muscle-pair {
  background: var(--subtle);
  border-radius: 16px;
}
:root[data-design="product"] .muscle {
  padding: 24px 20px;
}
:root[data-design="product"] .readouts dd {
  font-size: 21px;
}
:root[data-design="product"] .scale-tools {
  padding-bottom: 12px;
}
:root[data-design="product"] .construction-title {
  font-size: 25px;
  font-weight: 600;
}
:root[data-design="product"] .structure {
  margin-top: 32px;
}

@media (max-width: 1100px) {
  :root[data-design="editorial"] .app-header {
    grid-template-columns: 1fr;
  }
  :root[data-design="editorial"] .header-actions {
    max-width: none;
    justify-content: flex-start;
  }
  :root[data-design="product"] .workspace {
    gap: 12px;
    padding-inline: 12px;
  }
  :root[data-design="product"] main {
    padding-inline: 20px;
  }
  .app-header {
    gap: 24px;
  }
  .header-actions {
    max-width: 340px;
  }
}
@media (max-width: 700px) {
  .design-picker {
    padding: 8px 12px;
    gap: 4px;
    min-height: 54px;
  }
  .design-picker > span {
    margin-right: 6px;
    font-size: 11px;
  }
  .design-picker button {
    padding: 8px 12px;
    font-size: 11px;
    min-height: 38px;
  }
  .app-header,
  :root[data-design="scene"] .app-header,
  :root[data-design="editorial"] .app-header,
  :root[data-design="product"] .app-header {
    padding: 24px 16px;
    display: block;
  }
  :root[data-design="scene"] .app-header h1 {
    font-size: 42px;
  }
  :root[data-design="editorial"] .app-header h1 {
    font-size: 49px;
  }
  :root[data-design="product"] .app-header h1 {
    font-size: 32px;
  }
  .app-header h1 {
    max-width: 15ch;
  }
  .header-actions {
    justify-content: flex-start;
    max-width: none;
    margin-top: 20px;
    gap: 7px;
  }
  .header-actions button {
    padding: 8px 12px;
    min-height: 44px;
    font-size: 10px;
  }
  aside {
    position: static;
    max-height: none;
  }
  :root[data-design="product"] .workspace {
    padding: 0 10px 18px;
  }
  :root[data-design="product"] aside {
    margin-bottom: 12px;
  }
  :root[data-design="product"] main {
    padding-inline: 14px;
  }
  :root[data-design="scene"] main {
    border-radius: 0;
  }
  :root[data-design="scene"] .muscle,
  :root[data-design="product"] .muscle {
    padding: 20px 10px;
  }
  .muscle h2,
  :root[data-design="scene"] .muscle h2,
  :root[data-design="editorial"] .muscle h2,
  :root[data-design="product"] .muscle h2 {
    font-size: 17px;
  }
  .readouts dd,
  :root[data-design="scene"] .readouts dd,
  :root[data-design="editorial"] .readouts dd,
  :root[data-design="product"] .readouts dd {
    font-size: 18px;
  }
  :root[data-design="scene"] .muscle > svg {
    height: 330px;
  }
  :root[data-design="editorial"] .construction-title {
    font-size: 30px;
  }
}

.settings-shell {
  display: contents;
  border: 0;
  padding: 0;
}
.settings-shell > summary {
  display: none;
}
@media (max-width: 700px) {
  .settings-shell {
    display: block;
    padding: 0;
    border: 1px solid var(--line);
    margin: 0 0 12px;
    background: var(--panel);
  }
  .settings-shell > summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    min-height: 58px;
    padding: 12px 16px;
  }
  .settings-shell > summary span {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    max-width: 150px;
  }
  .settings-shell[open] > summary {
    border-bottom: 1px solid var(--line);
  }
  body[data-section="comparison"]
    .settings-shell[open]
    aside
    .control:not([hidden]),
  body[data-section="comparison"] .settings-shell[open] aside .initial {
    display: block !important;
  }
  :root[data-design="product"] .settings-shell {
    border-radius: 14px;
  }
  :root[data-design="product"] .settings-shell aside {
    border: 0;
    margin: 0;
  }
}

@media (max-width: 700px) {
  .app-header,
  :root[data-design="scene"] .app-header,
  :root[data-design="editorial"] .app-header,
  :root[data-design="product"] .app-header {
    padding: 16px;
  }
  :root[data-design="scene"] .app-header h1 {
    font-size: 34px;
  }
  :root[data-design="editorial"] .app-header h1 {
    font-size: 40px;
  }
  :root[data-design="product"] .app-header h1 {
    font-size: 28px;
  }
  .app-header p,
  :root[data-design="scene"] .app-header p,
  :root[data-design="editorial"] .app-header p {
    margin-top: 10px;
  }
  .header-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    margin-top: 14px;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }
  .header-actions button {
    flex: 0 0 auto;
    font-size: 11px;
  }
  .design-picker button {
    min-height: 44px;
  }
}
@media (min-width: 701px) and (max-height: 800px) {
  :root[data-design="scene"] .app-header,
  :root[data-design="editorial"] .app-header {
    padding-block: 20px;
  }
  :root[data-design="scene"] .app-header h1,
  :root[data-design="editorial"] .app-header h1 {
    font-size: 48px;
  }
  .muscle > svg,
  :root[data-design="scene"] .muscle > svg {
    height: 330px;
  }
}

/* Hallmark · P2k · locked-system scientific workbench · app · custom
 * Critique: oversized masthead and remote controls obscured the paired experiment.
 * Kept: Onest, three user-requested palettes, calculations and every export.
 */
html,
body {
  overflow-x: clip;
}
:root {
  --font-interface: "Onest Variable", "Segoe UI", sans-serif;
  --font-editorial: Georgia, serif;
}
:root[data-design] .app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  max-width: 1720px;
  margin: 0 auto;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}
:root[data-design] .app-header h1 {
  font-size: 30px;
  line-height: 1.15;
  max-width: none;
  overflow-wrap: break-word;
  min-width: 0;
  letter-spacing: -0.03em;
}
:root[data-design="editorial"] .app-header h1 {
  font-family: var(--font-editorial);
  font-size: 36px;
}
:root[data-design] .app-header p {
  margin: 8px 0 0;
  font-size: 12px;
}
:root[data-design] .design-picker {
  grid-column: 2;
  grid-row: 1;
  position: static;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-end;
  gap: 4px;
}
.design-picker > span {
  display: none;
}
:root[data-design] .design-picker button {
  padding: 9px 14px;
  min-height: 40px;
  font-size: 12px;
}
:root[data-design] .header-actions {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  gap: 8px;
  max-width: none;
}
:root[data-design] .app-header > div:first-child {
  grid-row: 1 / 3;
}
:root[data-design] .header-actions button {
  font-size: 12px;
  padding: 9px 16px;
  min-height: 40px;
}
:root[data-design] .workspace {
  max-width: 1720px;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  margin: 24px auto;
  padding: 0 28px;
}
:root[data-design] main {
  padding: 0 28px 32px;
  border-radius: 0;
  border: 0;
  background: var(--panel);
  min-width: 0;
}
:root[data-design="scene"] main {
  background: var(--bg);
}
:root[data-design] aside {
  padding: 22px 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  top: 20px;
  max-height: calc(100dvh - 40px);
}
:root[data-design] aside > h2 {
  font-size: 20px;
  margin-bottom: 24px;
}
.sync-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
  line-height: 1.5;
}
.sync-control input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--braid);
}
:root[data-design] .muscle-pair {
  background: transparent;
  border-radius: 0;
  border-top: 1px solid var(--line);
  gap: 0;
}
:root[data-design] .muscle {
  padding: 24px 22px 0;
  min-width: 0;
}
:root[data-design] .muscle h2 {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 20px;
  line-height: 1.3;
}
:root[data-design="editorial"] .muscle h2 {
  font-family: var(--font-editorial);
  font-size: 28px;
}
.muscle .control {
  margin: 0;
  padding: 0;
  text-align: left;
}
.muscle .label-line label {
  max-width: none;
  font-size: 12px;
}
.muscle .label-line output {
  font-size: 18px;
  font-weight: 600;
}
.muscle input[type="range"] {
  width: 100%;
  height: 32px;
  margin: 4px 0 8px;
}
.muscle .motion-note {
  display: none;
}
.shell-diameter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  text-align: left;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.shell-diameter input {
  width: 78px;
  min-height: 38px;
  margin: 0;
  padding: 6px 8px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
:root[data-design] .muscle > svg {
  height: 720px;
  max-height: none;
  width: 100%;
  margin: 18px 0 8px;
}
:root[data-design] .readouts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
:root[data-design] .readouts dd {
  font-size: 25px;
  font-weight: 500;
}
.readouts dt {
  font-size: 12px;
}
:root[data-design] .scale-tools {
  margin: 0;
  padding: 12px 0;
}
:root[data-design] .scale-tools button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}
.braid-strand {
  stroke-width: 0.58;
  opacity: 0.72;
}
.braid-back {
  stroke-width: 0.45;
  opacity: 0.1;
}
.fragment-zone .braid-strand {
  stroke-width: 0.7;
  opacity: 1;
}
.crossing-under {
  stroke-width: 2;
}
:root[data-design] .construction-columns {
  margin-top: 24px;
  gap: 40px;
}
:root[data-design] .construction-title {
  font-size: 26px;
  margin-bottom: 22px;
}
:root[data-design] .construction-figure {
  border-top: 1px solid var(--line);
  height: 420px;
}
:root[data-design] .construction-figure > svg {
  height: 330px;
  max-height: none;
}
.status {
  height: 18px;
  font-size: 12px;
  margin: -12px 0 10px;
}
.status:empty {
  display: block;
  visibility: hidden;
}
@media (max-width: 1050px) and (min-width: 701px) {
  :root[data-design] .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
    padding: 0 20px;
  }
  :root[data-design] main {
    padding-inline: 12px;
  }
  :root[data-design] .muscle {
    padding-inline: 14px;
  }
  :root[data-design] .muscle h2 {
    font-size: 21px;
  }
}
@media (max-width: 700px) {
  :root[data-design] .app-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px 16px;
    gap: 16px;
  }
  :root[data-design] .app-header > div:first-child {
    width: 100%;
  }
  :root[data-design] .app-header h1 {
    font-size: 28px;
  }
  :root[data-design="editorial"] .app-header h1 {
    font-size: 32px;
  }
  :root[data-design] .design-picker {
    width: 100%;
    justify-content: flex-start;
  }
  :root[data-design] .header-actions {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
  }
  :root[data-design] .header-actions button {
    font-size: 11px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 12px;
  }
  :root[data-design] .workspace {
    display: block;
    margin: 16px 0;
    padding: 0 12px;
  }
  :root[data-design] .settings-shell {
    border-radius: 0;
    background: transparent;
  }
  :root[data-design] aside {
    max-height: none;
    padding: 16px;
  }
  :root[data-design] main {
    padding: 0 8px 24px;
  }
  :root[data-design] .muscle {
    padding: 18px 8px 0;
  }
  :root[data-design] .muscle h2 {
    font-size: 18px;
    min-height: 46px;
    margin-bottom: 12px;
  }
  .muscle .label-line {
    align-items: center;
    gap: 4px;
  }
  .muscle .label-line label {
    font-size: 12px;
    max-width: 90px;
    min-height: 36px;
  }
  .muscle .label-line output {
    font-size: 18px;
  }
  .shell-diameter {
    display: block;
    font-size: 12px;
  }
  .shell-diameter input {
    display: block;
    width: 100%;
    margin-top: 6px;
    min-height: 44px;
  }
  :root[data-design] .muscle > svg {
    height: 680px;
    margin-top: 12px;
  }
  :root[data-design] .readouts {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  :root[data-design] .readouts dd {
    font-size: 20px;
  }
  :root[data-design] .construction-figure {
    height: 350px;
  }
  :root[data-design] .construction-figure > svg {
    height: 270px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .design-picker button {
    transition: none;
  }
}

@media (max-width: 700px) {
  :root[data-design] .muscle {
    display: flex;
    flex-direction: column;
  }
  .muscle h2 {
    order: 0;
  }
  .muscle .status {
    order: 1;
  }
  .muscle .control {
    order: 2;
  }
  :root[data-design] .muscle > svg {
    order: 3;
    height: 680px;
  }
  .muscle .shell-diameter {
    order: 4;
  }
  .muscle .readouts {
    order: 5;
  }
}

.header-tools {
  display: contents;
}
button:disabled {
  opacity: 1;
  color: var(--muted);
  background: var(--subtle);
  border-color: var(--line);
  cursor: not-allowed;
}
.header-tools > summary {
  display: none;
}
@media (max-width: 700px) {
  :root[data-design] .design-picker {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 2px;
  }
  :root[data-design] .design-picker button {
    padding-inline: 10px;
    min-height: 44px;
    font-size: 11px;
  }
  .header-tools {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .header-tools > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
  }
  .header-tools[open] {
    flex-basis: 100%;
  }
  :root[data-design] .header-tools[open] .header-actions {
    display: flex;
    margin-top: 10px;
    flex-wrap: wrap;
    overflow: visible;
  }
  .muscle .label-line label {
    min-height: 40px;
    max-width: 90px;
  }
}

/* The phone opens on the experiment; actions and conditions stay discoverable. */
@media (max-width: 700px) {
  :root[data-design] .app-header {
    padding: 12px 16px;
    gap: 8px;
  }
  :root[data-design] .app-header h1 {
    font-size: 22px;
    line-height: 1.15;
  }
  :root[data-design] .app-header p {
    display: none;
  }
  :root[data-design] .workspace {
    margin-block: 8px;
  }
  :root[data-design] .settings-shell {
    margin-bottom: 8px;
  }
  .settings-shell > summary {
    min-height: 44px;
    padding: 8px 12px;
  }
  nav[aria-label="Разделы модели"] {
    min-height: 44px;
    padding-block: 0;
    margin-block: 0;
    gap: 12px;
  }
  nav[aria-label="Разделы модели"] button {
    min-height: 44px;
    padding: 8px 0;
  }
  :root[data-design] .scale-tools {
    padding-block: 4px;
  }
  :root[data-design] .muscle {
    padding-top: 12px;
  }
  :root[data-design] .muscle h2 {
    min-height: 24px;
    margin-bottom: 10px;
    font-size: 16px;
  }
  .muscle .label-line label {
    min-height: 20px;
    max-width: none;
  }
  .muscle input[type="range"] {
    min-height: 44px;
    height: 44px;
    margin-block: 0;
  }
}

/* Readable complete muscles; the loop detail remains a separate scientific view. */
@media (min-width: 701px) {
  :root[data-design] .muscle {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media (max-width: 700px) {
  :root[data-design] .muscle-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  :root[data-design] .muscle + .muscle {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
