.ratio-share-app { grid-template-rows: auto auto minmax(0, 1fr); }
.ratio-share-app [hidden] { display: none !important; }
.ratio-share-app .icon path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ratio-share-app .toolbar label { font-weight: 700; }

.ratio-share-activity {
  display: grid;
  align-content: start;
  gap: clamp(14px, 2.7vh, 24px);
  width: min(100%, 1600px);
  min-width: 0;
  margin-inline: auto;
  padding: clamp(16px, 3vh, 32px) clamp(12px, 2vw, 30px);
}

.ratio-share-activity h2 {
  margin: 0;
  color: #153b50;
  text-align: center;
  font-size: clamp(1.65rem, 3.4vw, 3.1rem);
  line-height: 1.12;
}

.ratio-share-board {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(320px, 3fr);
  min-height: clamp(340px, 62vh, 560px);
  border: 1px solid #cbdde7;
  border-radius: 14px;
  background: white;
}

.ratio-share-model {
  min-width: 0;
  display: grid;
  place-items: center stretch;
  padding: clamp(12px, 3vw, 48px);
  background: #f8fcfe;
  border-radius: 14px 0 0 14px;
}

.ratio-share-model > * { margin: 0; min-width: 0; }
.ratio-share-model .expanded-bar-model { width: 100%; gap: clamp(14px, 3vh, 25px); }
.ratio-share-model .bar-model-whole-bracket span { color: #153b50; font-size: clamp(1.5rem, 3.5vw, 3.15rem); }
.ratio-share-model .bar-model-group-labels > span { font-size: clamp(.89rem, 2vw, 1.6rem); }
.ratio-share-model .expanded-bar-model .bar-model-strip { min-height: clamp(118px, 23vh, 238px); }
.ratio-share-model .bar-model-strip > span { min-width: 0; }
.ratio-share-model .bar-model-strip > [role="button"] { cursor: pointer; }
.ratio-share-model .bar-model-strip > [role="button"]:hover { box-shadow: inset 0 0 0 2px #08769d; }
.ratio-share-model .bar-model-strip > [aria-pressed="true"] { box-shadow: inset 0 0 0 5px #08597b; }
.ratio-share-model .bar-model-strip > [role="button"]:focus-visible { position: relative; z-index: 1; }

.ratio-share-working {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  padding: clamp(16px, 2.5vw, 38px);
  border-inline-start: 1px solid #cbdde7;
  min-width: 0;
}

.ratio-share-working :is(h3, p) { margin: 0; }
.ratio-share-working h3 { color: #0f405b; font-size: clamp(1.32rem, 2.3vw, 2rem); line-height: 1.12; }
#ratioStepTitle:focus { outline: none; }
.ratio-share-working p, .ratio-share-entry { font-size: clamp(1rem, 1.48vw, 1.25rem); line-height: 1.3; }
.ratio-share-working .ratio-share-equation { color: #085678; font-weight: 750; }
.ratio-share-working form, .ratio-share-answers, .ratio-share-results { display: grid; gap: 9px; }
#ratioCount { color: #34566a; font-weight: 700; }
.ratio-share-entry {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-weight: 750;
}

.ratio-share-entry input {
  width: 4.25em;
  min-height: 48px;
  border: 1px solid #819dae;
  border-radius: 8px;
  color: #153b50;
  font: inherit;
  text-align: center;
}

.ratio-share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ratio-share-actions button {
  min-height: 48px;
  padding: 4px 13px;
  border: 1px solid #a6bcca;
  border-radius: 8px;
  background: white;
  color: #153b50;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ratio-share-actions .ratio-share-primary { background: #08597b; border-color: #08597b; color: white; }
.ratio-share-app :focus-visible { outline: 3px solid #08769d; outline-offset: 2px; }
#ratioFeedback { color: #873913; font-weight: 700; }
#ratioFeedback:empty { display: none; }

@media screen and (max-width: 809px) {
  .ratio-share-activity h2 { font-size: clamp(1.4rem, 6.25vw, 2.35rem); }
  .ratio-share-board { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ratio-share-model { padding: 24px 12px 19px; border-radius: 14px 14px 0 0; }
  .ratio-share-model .expanded-bar-model .bar-model-strip { min-height: 72px; }
  .ratio-share-working { border-inline-start: none; border-block-start: 1px solid #cbdde7; }
}

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  .ratio-share-app { display: block; height: auto; min-height: 0; }
  .ratio-share-app .toolbar, .ratio-share-app .top-actions, .ratio-share-actions, #ratioFeedback { display: none !important; }
  .ratio-share-activity { padding: 4mm 0 0; }
  .ratio-share-activity h2 { font-size: 25pt; }
  .ratio-share-board { min-height: 104mm; break-inside: avoid; print-color-adjust: exact; }
  .ratio-share-model { padding: 7mm; }
  .ratio-share-model .expanded-bar-model .bar-model-strip { min-height: 32mm; }
  .ratio-share-working { padding: 7mm; }
}
