:root {
  --ink: #101f2f;
  --ink-soft: #405063;
  --paper: #f5f3ed;
  --paper-deep: #ebe8df;
  --white: #fffefb;
  --line: #d8d9d5;
  --line-strong: #bfc4c3;
  --blue: #275de1;
  --blue-deep: #1647bd;
  --mint: #20c4b2;
  --orange: #ff6a3d;
  --yellow: #f5c84c;
  --red: #c83e43;
  --green: #087d68;
  --shadow: 0 20px 60px rgba(16, 31, 47, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 31, 47, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 31, 47, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The compact patch station below supersedes the original landing-page styles. */

button,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  width: min(calc(100% - 48px), var(--content));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 34px;
  border-bottom: 1px solid rgba(16, 31, 47, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px 4px 10px 4px;
  color: var(--white);
  background: var(--ink);
  box-shadow: inset -4px -4px 0 var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: inherit;
  font-size: 15px;
  letter-spacing: -0.025em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-transform: none;
}

.brand-copy span + span {
  margin-top: 2px;
}

.site-nav {
  display: flex;
  gap: 25px;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--blue);
}

.local-pill,
.compatibility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 254, 251, 0.7);
  font-size: 12px;
  font-weight: 750;
}

.local-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(32, 196, 178, 0.15);
}

.hero {
  width: min(calc(100% - 48px), var(--content));
  min-height: 650px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(400px, 0.97fr);
  align-items: center;
  gap: 54px;
  padding: 76px 0 84px;
}

.eyebrow,
.step-label,
.progress-kicker {
  margin: 0;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 700px;
  margin: 18px 0 22px;
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.06;
  word-break: keep-all;
}

.hero-lede {
  max-width: 590px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.75;
  word-break: keep-all;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-link,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 8px 24px rgba(39, 93, 225, 0.2);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-link:hover,
.primary-button:not(:disabled):hover {
  background: var(--blue-deep);
  box-shadow: 0 10px 28px rgba(39, 93, 225, 0.28);
  transform: translateY(-1px);
}

.compatibility span {
  color: #b17a00;
  font-size: 9px;
}

.compatibility.is-supported span {
  color: var(--green);
}

.compatibility.is-unsupported {
  color: #8f3438;
  border-color: rgba(200, 62, 67, 0.35);
  background: rgba(255, 236, 235, 0.8);
}

.compatibility.is-unsupported span {
  color: var(--red);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 28px 0 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
  list-style: none;
}

.trust-list li::before {
  content: "✓";
  margin-right: 7px;
  color: var(--green);
  font-weight: 900;
}

.hero-machine {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 40px 12px 40px 12px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-machine::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  top: -80px;
  right: -70px;
  border-radius: 50%;
  background: var(--blue);
  filter: blur(2px);
  opacity: 0.9;
}

.hero-machine::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  bottom: -65px;
  left: -45px;
  border-radius: 50%;
  background: var(--mint);
  opacity: 0.85;
}

.machine-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.machine-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.machine-orbit::before {
  content: "";
  position: absolute;
  top: 9%;
  left: 13%;
  width: 9px;
  height: 9px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.machine-orbit-one {
  width: 340px;
  height: 340px;
}

.machine-orbit-two {
  width: 250px;
  height: 250px;
  border-style: dashed;
  transform: translate(-50%, -50%) rotate(25deg);
}

.machine-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170px;
  height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(16, 31, 47, 0.82);
  box-shadow: 0 0 0 14px rgba(39, 93, 225, 0.13);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.machine-core strong {
  margin: 7px 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.machine-core span {
  color: rgba(255, 255, 255, 0.63);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.machine-core .machine-kicker {
  color: var(--mint);
}

.machine-card {
  position: absolute;
  width: 170px;
  padding: 14px 15px 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(18, 39, 58, 0.86);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.machine-card span,
.machine-card strong {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.machine-card span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.machine-card strong {
  margin: 6px 0 11px;
  font-size: 12px;
}

.machine-card i {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.machine-card i::after {
  content: "";
  display: block;
  width: 70%;
  height: 100%;
  background: var(--mint);
}

.machine-card-input {
  top: 75px;
  left: 34px;
}

.machine-card-output {
  right: 31px;
  bottom: 62px;
}

.machine-card-output i::after {
  width: 100%;
  background: var(--yellow);
}

.machine-caption {
  position: absolute;
  bottom: 21px;
  left: 25px;
  color: rgba(255, 255, 255, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.patch-section {
  padding: 84px max(24px, calc((100% - var(--content)) / 2)) 96px;
  color: var(--ink);
  background: #e9eceb;
  border-top: 1px solid rgba(16, 31, 47, 0.08);
  border-bottom: 1px solid rgba(16, 31, 47, 0.08);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 0.74fr);
  align-items: end;
  gap: 60px;
  margin-bottom: 34px;
}

.section-heading h2,
.safety-intro h2 {
  margin: 8px 0 0;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.section-heading > p,
.safety-intro > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.75;
  word-break: keep-all;
}

.patch-console {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(16, 31, 47, 0.12);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.step-rail {
  padding: 34px 28px;
  color: var(--white);
  background: var(--ink);
}

.step-rail > p {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.47);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step-rail ol {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-rail ol::before {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 31px;
  left: 16px;
  width: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.step-rail li {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  align-items: center;
  margin-bottom: 27px;
  opacity: 0.43;
}

.step-rail li > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
}

.step-rail li div {
  display: flex;
  flex-direction: column;
}

.step-rail li strong {
  font-size: 13px;
}

.step-rail li small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

.step-rail li.is-current,
.step-rail li.is-complete {
  opacity: 1;
}

.step-rail li.is-current > span {
  color: var(--ink);
  border-color: var(--mint);
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(32, 196, 178, 0.1);
}

.step-rail li.is-complete > span {
  color: var(--mint);
  border-color: var(--mint);
}

.rail-note {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
  margin-top: 54px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  line-height: 1.55;
}

.rail-note > span {
  color: var(--mint);
  font-size: 17px;
}

.patch-workspace {
  min-width: 0;
  padding: 34px;
}

.release-card,
.file-step,
.apply-card,
.progress-panel,
.message-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.release-card {
  padding: 25px;
}

.card-heading,
.file-step-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.card-heading h3,
.file-step-heading h3,
.apply-card h3 {
  margin: 3px 0 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.state-chip,
.step-state {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 10px;
  font-weight: 850;
}

.state-chip.is-ready,
.step-state.is-complete {
  color: var(--green);
  background: rgba(32, 196, 178, 0.13);
}

.step-state.is-working {
  color: var(--blue-deep);
  background: rgba(39, 93, 225, 0.1);
}

.step-state.is-error {
  color: var(--red);
  background: rgba(200, 62, 67, 0.1);
}

.field-label {
  display: block;
  margin: 22px 0 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.select-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}

/* Game and version sit side by side only while both texts fit; otherwise
   each takes its own row. A cell's automatic minimum is its select's text
   width (min-content), capped at the row by max-width so an overlong label
   ellipsizes inside the card instead of overflowing it. */
.selector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.selector-grid > div {
  flex: 1 1 0;
  max-width: 100%;
}

.select-wrap::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--ink-soft);
  pointer-events: none;
  transform: translateY(-54%);
}

/* An auto width keeps the select's text width as its min-content
   contribution (a percentage width would collapse it to padding only);
   flex growth fills the cell and min-width: 0 lets it ellipsize.
   field-sizing narrows that text width from the widest option to the
   selected one where supported, so a short choice does not force a stack;
   elsewhere the widest option still sets it. */
.select-wrap select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  field-sizing: content;
  min-height: 48px;
  padding: 10px 45px 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
  font-size: 14px;
  font-weight: 750;
  appearance: none;
  text-overflow: ellipsis;
}

.select-wrap select:disabled {
  cursor: not-allowed;
  color: #737b7e;
  background: #f0f0ec;
}

.release-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.release-facts > div {
  min-width: 0;
  padding: 0 20px;
  border-right: 1px solid var(--line);
}

.release-facts > div:first-child {
  padding-left: 0;
}

.release-facts > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.release-facts dt {
  margin-bottom: 3px;
  color: #6b777f;
  font-size: 10px;
  font-weight: 750;
}

.release-facts dd {
  overflow: hidden;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-step {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  overflow: hidden;
  margin-top: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.file-step.is-active {
  border-color: rgba(39, 93, 225, 0.44);
  box-shadow: 0 0 0 3px rgba(39, 93, 225, 0.05);
}

.file-step.is-complete {
  border-color: rgba(8, 125, 104, 0.3);
}

.file-step-number {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 27px;
  border-right: 1px solid var(--line);
  color: #8c969a;
  background: #f4f4ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
}

.file-step.is-complete .file-step-number {
  color: var(--green);
  background: #effaf6;
}

.file-step-body {
  min-width: 0;
  padding: 25px;
}

.file-step-body > p {
  max-width: 660px;
  margin: 12px 0 17px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
  word-break: keep-all;
}

.file-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.file-button > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-button:not(:disabled):hover {
  border-color: var(--blue);
  background: rgba(39, 93, 225, 0.035);
}

.file-button:disabled,
.primary-button:disabled {
  color: #81888a;
  border-color: #d9dcda;
  background: #e8eae7;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.button-symbol {
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
}

.file-button:disabled .button-symbol {
  color: #92999a;
}

.file-selection {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(39, 93, 225, 0.12);
  border-radius: 10px;
  background: rgba(39, 93, 225, 0.035);
}

.file-type {
  min-width: 42px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--white);
  background: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 850;
}

.file-selection > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-selection strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-selection div span {
  color: var(--ink-soft);
  font-size: 10px;
}

.file-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: rgba(32, 196, 178, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.file-selection.is-verifying .file-check {
  color: var(--blue);
  background: rgba(39, 93, 225, 0.1);
}

.apply-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  padding: 25px;
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}

.apply-card .step-label {
  color: var(--mint);
}

.apply-card p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.apply-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.primary-button {
  min-width: 192px;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
}

.cancel-button {
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  color: var(--white);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.cancel-button:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

.progress-panel {
  margin-top: 14px;
  padding: 20px 22px;
  border-color: rgba(39, 93, 225, 0.3);
  background: #f5f8ff;
}

.progress-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.progress-copy > div {
  display: flex;
  flex-direction: column;
}

.progress-copy strong {
  margin-top: 3px;
  font-size: 14px;
}

#progressPercent {
  color: var(--blue-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 850;
}

.progress-panel progress {
  width: 100%;
  height: 7px;
  display: block;
  overflow: hidden;
  margin: 14px 0 10px;
  border: 0;
  border-radius: 99px;
  background: #dce4f4;
  appearance: none;
}

.progress-panel progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #dce4f4;
}

.progress-panel progress::-webkit-progress-value {
  border-radius: 99px;
  background: var(--blue);
  transition: width 140ms linear;
}

.progress-panel progress::-moz-progress-bar {
  border-radius: 99px;
  background: var(--blue);
}

.progress-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.message-panel {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 17px 19px;
}

.message-panel > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.message-panel strong {
  font-size: 13px;
}

.message-panel p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.cue-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 12px;
  margin-top: 12px;
}

.cue-button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(8, 125, 104, 0.35);
  border-radius: 8px;
  color: var(--green);
  background: var(--white);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.cue-button:not(:disabled):hover {
  border-color: var(--green);
  background: rgba(32, 196, 178, 0.06);
}

.cue-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.cue-action > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 11px;
}

.download-link {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid rgba(8, 125, 104, 0.35);
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.download-link.is-cue {
  color: var(--green);
  background: var(--white);
}

.download-link:hover,
.download-link:focus-visible {
  border-color: var(--green);
  filter: brightness(0.96);
}

.download-help {
  flex: 0 0 100%;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.message-panel.is-error {
  border-color: rgba(200, 62, 67, 0.25);
  background: #fff1f0;
}

.message-panel.is-error > span {
  color: var(--red);
  background: rgba(200, 62, 67, 0.11);
}

.message-panel.is-success {
  border-color: rgba(8, 125, 104, 0.26);
  background: #effbf7;
}

.message-panel.is-success > span {
  color: var(--green);
  background: rgba(32, 196, 178, 0.15);
}

.noscript-message {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(200, 62, 67, 0.28);
  border-radius: 10px;
  color: #8f3438;
  background: #fff1f0;
  font-size: 12px;
}

.release-notes {
  width: min(calc(100% - 48px), var(--content));
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
  gap: 70px;
  margin: 0 auto;
  padding: 88px 0 0;
}

.release-notes-intro h2 {
  margin: 10px 0 15px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.release-notes-intro > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
  word-break: keep-all;
}

.release-notes-card {
  align-self: end;
  padding: 28px;
  border: 1px solid rgba(177, 122, 0, 0.28);
  border-radius: var(--radius-md);
  background: #fff9e8;
}

.release-notes-card > span {
  color: #7c5a00;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.release-notes-card ul {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.release-notes-card li {
  position: relative;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.release-notes-card li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: #9a6a00;
}

.release-notes-card p {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(177, 122, 0, 0.2);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.safety-section {
  width: min(calc(100% - 48px), var(--content));
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.22fr);
  gap: 80px;
  margin: 0 auto;
  padding: 110px 0 86px;
}

.safety-intro > p {
  margin-top: 20px;
}

.safety-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.safety-list li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line-strong);
}

.safety-list > li > span {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 850;
}

.safety-list h3 {
  margin: -4px 0 5px;
  font-size: 18px;
}

.safety-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
  word-break: keep-all;
}

.requirements {
  width: min(calc(100% - 48px), var(--content));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto 96px;
  padding: 25px 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 254, 251, 0.7);
}

.requirements > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}

.requirements-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: rgba(39, 93, 225, 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.requirements h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.requirements p {
  max-width: 730px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.requirements a {
  color: var(--blue-deep);
  font-weight: 800;
  text-underline-offset: 0.16em;
}

.requirements a:hover {
  color: var(--blue);
}

.rights-disclosure {
  margin-top: 9px;
}

.rights-disclosure summary {
  width: fit-content;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.rights-disclosure[open] summary {
  margin-bottom: 8px;
}

.requirements code {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--green);
  background: rgba(32, 196, 178, 0.1);
  font-size: 9px;
  font-weight: 850;
}

.site-footer {
  min-height: 120px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 24px max(24px, calc((100% - var(--content)) / 2));
  color: var(--white);
  background: var(--ink);
}

.site-footer .brand-mark {
  color: var(--ink);
  background: var(--mint);
  box-shadow: inset -4px -4px 0 rgba(16, 31, 47, 0.25);
}

.site-footer .brand-copy span {
  color: rgba(255, 255, 255, 0.45);
}

.site-footer p {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 64px;
  }

  .hero-copy {
    max-width: 730px;
  }

  .hero-machine {
    min-height: 440px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .section-heading > p {
    max-width: 700px;
  }

  .patch-console {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .step-rail {
    padding: 30px 22px;
  }

  .patch-workspace {
    padding: 27px;
  }

  .safety-section {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .release-notes {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-behavior: auto;
  }

  .site-header {
    width: min(calc(100% - 32px), var(--content));
    min-height: 72px;
  }

  .site-nav,
  .local-pill {
    display: none;
  }

  .hero {
    width: min(calc(100% - 32px), var(--content));
    min-height: 0;
    padding: 55px 0 64px;
  }

  .hero h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .hero-lede {
    font-size: 16px;
  }

  .trust-list {
    display: grid;
    gap: 7px;
  }

  .hero-machine {
    min-height: 380px;
    border-radius: 28px 10px 28px 10px;
  }

  .machine-orbit-one {
    width: 280px;
    height: 280px;
  }

  .machine-orbit-two {
    width: 210px;
    height: 210px;
  }

  .machine-core {
    width: 145px;
    height: 145px;
  }

  .machine-card {
    width: 145px;
  }

  .machine-card-input {
    top: 32px;
    left: 18px;
  }

  .machine-card-output {
    right: 18px;
    bottom: 48px;
  }

  .patch-section {
    padding: 64px 16px 72px;
  }

  .patch-console {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .step-rail {
    padding: 20px;
  }

  .step-rail > p,
  .rail-note,
  .step-rail li div {
    display: none;
  }

  .step-rail ol {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .step-rail ol::before {
    top: 16px;
    right: 16.666%;
    bottom: auto;
    left: 16.666%;
    width: auto;
    height: 1px;
  }

  .step-rail li {
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .patch-workspace {
    padding: 16px;
  }

  .release-card,
  .file-step-body,
  .apply-card {
    padding: 20px;
  }

  .release-facts {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .release-facts > div,
  .release-facts > div:first-child,
  .release-facts > div:last-child {
    padding: 0;
    border: 0;
  }

  .file-step {
    grid-template-columns: 1fr;
  }

  .file-step-number {
    display: none;
  }

  .apply-card {
    align-items: stretch;
    flex-direction: column;
  }

  .apply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .cancel-button,
  .file-button {
    width: 100%;
  }

  .file-selection {
    display: none !important;
  }

  .safety-section,
  .release-notes,
  .requirements {
    width: min(calc(100% - 32px), var(--content));
  }

  .release-notes {
    padding-top: 62px;
  }

  .safety-section {
    padding: 76px 0 62px;
  }

  .requirements {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 64px;
  }

  .requirements code {
    align-self: flex-start;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 30px 20px;
  }

  .site-footer p {
    margin: 0;
  }
}

@media (max-width: 430px) {
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .compatibility {
    width: 100%;
    justify-content: center;
  }

  .hero-machine {
    min-height: 340px;
  }

  .machine-card-output {
    bottom: 35px;
  }

  .machine-caption {
    display: none;
  }

  .file-step-heading {
    gap: 10px;
  }

  .file-selection {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .file-selection .file-check {
    display: none;
  }
}

.patch-note-toggle {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}

.patch-note-toggle > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.patch-note-toggle small {
  color: var(--blue);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.patch-note-toggle strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-note-toggle > span:nth-child(2) {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.patch-note-toggle > span:last-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
}

.patch-note-toggle:hover:not(:disabled) {
  border-color: var(--blue);
  box-shadow: 0 8px 22px rgba(39, 93, 225, 0.12);
}

.patch-note-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.patch-note-dialog {
  width: min(1120px, calc(100vw - 28px));
  height: min(690px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: #f2f1ec;
  box-shadow: 0 28px 90px rgba(9, 19, 31, 0.42);
}

.patch-note-dialog::backdrop {
  background: rgba(7, 17, 29, 0.72);
  backdrop-filter: blur(6px);
}

.patch-note-dialog-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
}

.patch-note-dialog.is-summary-only {
  height: max-content;
  max-height: calc(100dvh - 28px);
  overflow: auto;
}

.patch-note-dialog.is-summary-only .patch-note-dialog-shell {
  height: auto;
  grid-template-rows: auto auto;
}

.patch-note-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 19px 14px;
  color: var(--white);
  background:
    radial-gradient(circle at 90% 0, rgba(39, 93, 225, 0.55), transparent 42%),
    var(--ink);
}

.patch-note-dialog-header span:first-child {
  color: #9db8ff;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.patch-note-dialog-header h2 {
  margin: 2px 0 0;
  font-size: clamp(18px, 2.4vw, 27px);
  line-height: 1.15;
}

.patch-note-close {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.patch-note-close span {
  font-size: 20px;
  line-height: 1;
}

.patch-note-summary {
  margin: 0;
  padding: 11px 19px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.patch-note-list {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(720px, calc(100vw - 72px));
  gap: 12px;
  padding: 13px 19px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--blue) var(--paper-deep);
}

.patch-note-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 9px;
  padding: 13px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.patch-note-card.is-wide-strip-card {
  grid-template-rows: auto auto auto;
  align-content: start;
}

.patch-note-card-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.patch-note-card-heading h3 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-note-evidence {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.35;
}

.patch-note-evidence.is-included,
.patch-note-evidence.is-included-reference {
  color: var(--green);
  background: rgba(8, 125, 104, 0.1);
}

.patch-note-evidence.is-ram-reference {
  color: #8a4a00;
  background: rgba(245, 200, 76, 0.26);
}

.patch-note-comparison {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.patch-note-comparison.is-wide-strip {
  align-content: center;
}

.patch-note-comparison.is-wide-strip .patch-note-figure {
  height: auto;
  align-self: center;
  grid-template-rows: auto auto;
}

.patch-note-comparison.is-wide-strip img {
  height: auto;
}

.patch-note-figure {
  min-width: 0;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #273549;
  border-radius: 10px;
  background: #050910;
}

.patch-note-figure figcaption {
  padding: 4px 7px;
  color: #bed0ff;
  border-bottom: 1px solid #273549;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.patch-note-figure img {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.patch-note-description {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-note-dialog-footer {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 19px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .patch-note-toggle {
    min-height: 34px;
    margin-top: 5px;
    gap: 6px;
    padding: 4px 7px;
    border-radius: 9px;
  }

  .patch-note-toggle small {
    display: none;
  }

  .patch-note-toggle strong {
    margin-top: 0;
    font-size: 10px;
  }

  .patch-note-toggle > span:nth-child(2) {
    font-size: 9px;
  }

  .patch-note-toggle > span:last-child {
    width: 24px;
    height: 24px;
  }

  .patch-note-dialog {
    width: calc(100vw - 10px);
    height: calc(100dvh - 10px);
    border-radius: 16px;
  }

  .patch-note-dialog-header {
    padding: 11px 12px 9px;
  }

  .patch-note-dialog-header h2 {
    font-size: 17px;
  }

  .patch-note-close {
    min-height: 38px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .patch-note-summary {
    padding: 8px 12px;
    font-size: 10px;
    line-height: 1.35;
  }

  .patch-note-list {
    grid-auto-columns: calc(100vw - 34px);
    gap: 7px;
    padding: 8px 12px;
  }

  .patch-note-card {
    gap: 7px;
    padding: 8px;
    border-radius: 12px;
  }

  .patch-note-card-heading {
    align-items: flex-start;
    gap: 6px;
  }

  .patch-note-card-heading h3 {
    font-size: 12px;
  }

  .patch-note-comparison.is-wide-strip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, auto);
  }

  .patch-note-evidence {
    max-width: 48%;
    padding: 2px 5px;
    overflow: hidden;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .patch-note-description {
    font-size: 9px;
  }

  .patch-note-dialog-footer {
    min-height: 30px;
    padding: 5px 12px;
    font-size: 8px;
  }

  .patch-note-dialog-footer span:last-child {
    display: none;
  }
}

@media (max-height: 620px) {
  .patch-note-dialog-header {
    padding-top: 8px;
    padding-bottom: 7px;
  }

  .patch-note-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .patch-note-list {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .local-pill-dot,
  .machine-card i::after {
    forced-color-adjust: none;
  }

  .primary-button,
  .primary-link,
  .file-button,
  .cancel-button {
    border: 2px solid ButtonText;
  }
}

/* Single-screen patch station ------------------------------------------------ */

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 82% 12%, rgba(39, 93, 225, 0.08), transparent 27%),
    linear-gradient(rgba(16, 31, 47, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 31, 47, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

@supports (height: 100dvh) {
  body {
    height: 100dvh;
  }
}

.site-header {
  position: relative;
  z-index: 40;
  width: 100%;
  min-height: 64px;
  height: auto;
  margin: 0;
  padding: 0 max(18px, calc((100% - 1440px) / 2));
  gap: 20px;
  border-bottom: 1px solid rgba(16, 31, 47, 0.13);
  background: rgba(255, 254, 251, 0.92);
  backdrop-filter: blur(14px);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.compatibility,
.local-pill {
  min-height: 30px;
  padding: 5px 10px;
  background: var(--white);
}

main {
  min-height: 0;
  overflow: hidden;
}

.patch-section {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 14px max(18px, calc((100% - 1440px) / 2)) 16px;
  border: 0;
  background: transparent;
}

.patch-console,
.patch-workspace,
.task-stage {
  min-height: 0;
}

.patch-console {
  height: 100%;
  grid-template-columns: 190px minmax(0, 1fr);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(16, 31, 47, 0.13);
}

.step-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 18px;
}

.step-rail > p {
  margin-bottom: 22px;
}

.step-rail li {
  margin-bottom: 19px;
}

.step-rail ol::before {
  bottom: 24px;
}

.rail-note {
  margin-top: auto;
  padding: 11px;
}

.patch-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  overflow: hidden;
  padding: 16px;
  background: #f0f1ed;
}

.release-card {
  min-height: 0;
  height: auto;
  align-self: start;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
}

.release-card .field-label {
  margin-top: 18px;
}

.release-facts {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 8px;
  padding-top: 12px;
}

.release-facts > div,
.release-facts > div:first-child,
.release-facts > div:last-child {
  min-width: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.release-facts > div:last-child {
  border-bottom: 0;
}

.task-stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 10px;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.task-stage [data-workflow-step] {
  position: relative;
  min-height: 0;
  height: auto;
  margin: 0;
}

.task-stage .file-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
}

.task-stage .apply-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0, rgba(39, 93, 225, 0.38), transparent 42%),
    var(--ink);
}

.task-stage .apply-card .apply-actions {
  flex: 0 0 min(330px, 48%);
  margin: 0;
}

.task-stage .apply-card .primary-button {
  width: 100%;
}

.task-stage .file-step-body {
  align-self: center;
  padding: 15px 17px;
}

.task-stage .file-step-body > p {
  max-width: 620px;
  margin: 7px 0 10px;
  font-size: 11px;
  line-height: 1.45;
}

.progress-panel,
.task-stage .message-panel.is-error {
  position: relative;
  z-index: 4;
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.task-stage .message-panel.is-success {
  position: relative;
  z-index: 5;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  align-self: center;
  margin: 22px;
}

.progress-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-panel .cancel-button {
  min-height: 32px;
  padding: 5px 10px;
  color: var(--red);
  border-color: rgba(200, 62, 67, 0.3);
  background: var(--white);
}

.progress-panel .cancel-button:hover {
  border-color: var(--red);
}

@media (max-height: 720px) and (min-width: 761px) {
  body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .site-header {
    height: auto;
    min-height: 56px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .patch-section {
    gap: 0;
    padding-top: 9px;
    padding-bottom: 10px;
  }

  .rail-note {
    display: none;
  }

  .step-rail {
    padding-top: 18px;
  }

  .step-rail li {
    margin-bottom: 14px;
  }

  .patch-workspace {
    padding: 12px;
  }

  .release-card {
    padding: 16px;
  }

  .release-facts > div,
  .release-facts > div:first-child,
  .release-facts > div:last-child {
    padding: 6px 0;
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  .patch-console {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .patch-workspace {
    grid-template-columns: minmax(190px, 0.64fr) minmax(0, 1.36fr);
  }

  .step-rail {
    padding-right: 15px;
    padding-left: 15px;
  }
}

@media (max-width: 760px) {
  body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .site-header {
    width: 100%;
    height: auto;
    min-height: 58px;
    padding: 6px 12px;
    gap: 9px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .brand-copy strong {
    max-width: 215px;
    font-size: 11px;
    line-height: 1.15;
  }

  .header-status .local-pill {
    display: none;
  }

  .brand-copy span {
    margin-top: 3px;
    font-size: 8px;
    letter-spacing: -0.01em;
    text-transform: none;
  }

  .header-status {
    min-width: 0;
    margin-left: auto;
  }

  .compatibility {
    max-width: 128px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .patch-section {
    gap: 0;
    padding: 5px 7px 7px;
  }

  .patch-console {
    grid-template-columns: 1fr;
    grid-template-rows: 38px minmax(0, 1fr);
    border-radius: 17px;
  }

  .step-rail {
    display: block;
    padding: 3px 12px;
  }

  .step-rail > p,
  .step-rail li div,
  .rail-note {
    display: none;
  }

  .step-rail ol {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .step-rail ol::before {
    top: 14px;
    right: 16.666%;
    bottom: auto;
    left: 16.666%;
    width: auto;
    height: 1px;
  }

  .step-rail li {
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .step-rail li > span {
    width: 28px;
    height: 28px;
  }

  .patch-workspace {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
  }

  .release-card {
    flex: 0 0 auto;
    height: auto;
    padding: 7px 9px;
  }

  .card-heading {
    align-items: center;
  }

  .card-heading .step-label {
    display: none;
  }

  .card-heading h3 {
    display: none;
  }

  .release-card .field-label {
    margin: 0 0 3px;
    font-size: 8px;
  }

  .selector-grid {
    gap: 7px;
  }

  /* Narrow side padding keeps both full labels side by side from a 372px
     phone up even where the select still sizes to its widest option. */
  .select-wrap select {
    min-height: 40px;
    padding-right: 22px;
    padding-left: 8px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 12px;
  }

  .select-wrap::after {
    right: 7px;
  }

  .release-facts {
    display: none;
  }

  .task-stage {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto);
    align-content: start;
    gap: 5px;
    overflow: hidden;
    border-radius: 0;
  }

  .task-stage [data-workflow-step],
  .task-stage [data-workflow-step].is-active {
    position: relative;
    z-index: auto;
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    height: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .task-stage .file-step,
  .task-stage .file-step.is-active {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-stage .apply-card,
  .task-stage .apply-card.is-active {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 9px;
  }

  .file-step-number {
    display: none;
  }

  .file-step-body {
    align-self: stretch;
    padding: 8px 9px;
  }

  .file-step-heading h3,
  .apply-card h3 {
    margin: 0;
    font-size: 13px;
  }

  .file-step-body > p {
    display: none;
  }

  .file-button {
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
  }

  .task-stage .apply-card > div:first-child {
    min-width: 0;
  }

  .task-stage .apply-card .step-label,
  .task-stage .apply-card #applyHint {
    display: none;
  }

  .task-stage .apply-card .apply-actions {
    flex: 0 0 48%;
    margin: 0;
  }

  .task-stage .apply-card .primary-button {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .progress-panel {
    padding: 13px 14px;
  }

  .progress-panel progress {
    margin: 9px 0 7px;
  }

  .task-stage .message-panel.is-success {
    margin: 12px;
  }
}

@media (max-height: 500px) and (min-width: 761px) {
  body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .site-header {
    height: auto;
    min-height: 48px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .patch-section {
    gap: 0;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .file-step-body > p {
    display: none;
  }

  .file-step-body {
    padding: 12px 16px;
  }

  .file-step-heading h3 {
    font-size: 16px;
  }
}

@media (max-width: 430px) {
  .file-selection {
    margin-top: 9px;
  }

  .stage-placeholder {
    padding: 18px;
  }

  .stage-placeholder strong {
    font-size: 15px;
  }
}

/* Reactive workflow zones --------------------------------------------------- */

.patch-console {
  display: block;
}

.patch-workspace {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(245px, 0.82fr) minmax(300px, 1.06fr) minmax(320px, 1.12fr);
  gap: 10px;
  padding: 10px;
}

.workflow-zone {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 7px 20px rgba(16, 31, 47, 0.045);
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    opacity 220ms ease;
}

.workflow-zone::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: -1px;
  padding: 2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, var(--blue), var(--mint), #e5a62c, var(--blue)) 0 0 / 260% 100%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.workflow-zone.is-active,
.workflow-zone.is-busy {
  border-color: rgba(39, 93, 225, 0.58);
  background: linear-gradient(145deg, #ffffff 8%, #edf3ff 100%);
  box-shadow: 0 10px 28px rgba(39, 93, 225, 0.13);
}

.workflow-zone.is-active::after,
.workflow-zone.is-busy::after {
  opacity: 1;
  animation: workflow-border-flow 2.1s linear infinite;
}

.workflow-zone.is-pending {
  color: #667178;
  background: linear-gradient(145deg, #fafaf7, #eff0ec);
  opacity: 0.74;
}

.workflow-zone.is-prepared,
.workflow-zone.is-verifying {
  border-color: rgba(39, 93, 225, 0.42);
  background: linear-gradient(145deg, #f9fbff, #e4edff);
  box-shadow: 0 9px 25px rgba(39, 93, 225, 0.09);
}

.workflow-zone.is-complete {
  border-color: rgba(8, 125, 104, 0.48);
  background:
    radial-gradient(circle at 100% 0, rgba(32, 196, 178, 0.2), transparent 44%),
    linear-gradient(145deg, #f7fffc, #dcf5ec);
  box-shadow: 0 10px 28px rgba(8, 125, 104, 0.11);
}

.workflow-zone.is-error {
  border-color: rgba(200, 62, 67, 0.62);
  background:
    radial-gradient(circle at 100% 0, rgba(200, 62, 67, 0.13), transparent 42%),
    linear-gradient(145deg, #fffafa, #ffe3e1);
  box-shadow: 0 10px 28px rgba(200, 62, 67, 0.12);
}

@keyframes workflow-border-flow {
  to {
    background-position: 260% 0;
  }
}

.release-card,
.source-zone,
.apply-card {
  padding: 18px;
}

.release-card {
  display: flex;
  flex-direction: column;
  height: auto;
  align-self: start;
}

/* The card keeps its content height but never grows past its grid area.
   When stacked selectors make it taller than a short screen allows, its
   lower rows scroll inside the card instead of being clipped by the
   workspace or hidden under the next zone. */
.release-card.workflow-zone {
  height: auto;
  max-height: 100%;
  align-self: start;
  overflow-y: auto;
}

/* The glow ring's outer 1px sat outside the padding box, where the card's
   overflow already hid it; in a scrolling card it would also count as
   overflow and give a card that fits a stray scrollbar. */
.release-card.workflow-zone::after {
  inset: 0;
  padding: 1px;
}

.card-heading,
.zone-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-heading h3,
.zone-heading h3 {
  min-width: 0;
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.state-chip,
.zone-state {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(16, 31, 47, 0.07);
  font-size: 10px;
  font-weight: 850;
}

.zone-state.is-working,
.zone-state.is-ready,
.zone-state.is-prepared {
  color: var(--blue-deep);
  background: rgba(39, 93, 225, 0.11);
}

.zone-state.is-complete,
.state-chip.is-ready {
  color: var(--green);
  background: rgba(32, 196, 178, 0.14);
}

.zone-state.is-error {
  color: var(--red);
  background: rgba(200, 62, 67, 0.12);
}

.release-card .field-label {
  margin-top: 14px;
}

.release-facts {
  margin-top: 8px;
}

.source-zone {
  display: flex;
}

.source-zone-body {
  width: 100%;
  min-width: 0;
  align-self: center;
}

.source-zone-body > p {
  margin: 14px 0 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.62;
  word-break: keep-all;
}

.source-zone .file-button {
  min-width: min(100%, 220px);
}

.apply-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  gap: 12px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--white);
}

.apply-main {
  min-width: 0;
}

.apply-main > p {
  margin: 10px 0 14px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  word-break: keep-all;
}

.apply-actions {
  width: 100%;
}

.apply-actions .primary-button {
  width: 100%;
  min-width: 0;
}

.patch-feedback {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-areas: "feedback";
  align-items: stretch;
}

.patch-feedback > * {
  grid-area: feedback;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.patch-feedback .progress-panel,
.patch-feedback .message-panel {
  position: relative;
  z-index: 4;
  overflow: hidden;
  border-radius: 11px;
}

.patch-feedback .progress-panel {
  padding: 14px;
}

.patch-feedback .message-panel {
  align-self: stretch;
  padding: 14px;
}

.workflow-zone.is-busy .apply-actions {
  display: none;
}

.workflow-zone:focus-within {
  box-shadow: 0 0 0 3px rgba(39, 93, 225, 0.17), 0 10px 28px rgba(16, 31, 47, 0.1);
}

@media (max-width: 980px) and (min-width: 761px) {
  .patch-workspace {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 7px;
    padding: 7px;
  }

  .release-card,
  .source-zone,
  .apply-card {
    padding: 14px;
  }
}

@media (max-width: 760px) {
  .patch-console {
    display: block;
    border-radius: 15px;
  }

  .patch-workspace {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(128px, 0.92fr) minmax(104px, 0.78fr) minmax(158px, 1.3fr);
    gap: 4px;
    padding: 4px;
  }

  .workflow-zone {
    height: 100%;
    border-radius: 11px;
  }

  .release-card,
  .source-zone,
  .apply-card {
    padding: 7px 9px;
  }

  .card-heading h3,
  .zone-heading h3 {
    font-size: 13px;
  }

  .state-chip,
  .zone-state {
    padding: 4px 7px;
    font-size: 9px;
  }

  .release-card .field-label {
    margin: 3px 0 2px;
    font-size: 8px;
  }

  .release-facts {
    display: none;
  }

  .source-zone-body {
    align-self: stretch;
  }

  .source-zone-body > p,
  .apply-main > p {
    display: none;
  }

  .source-zone .file-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin-top: 7px;
  }

  .file-selection {
    display: none !important;
  }

  .apply-card {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px;
  }

  .apply-actions {
    margin-top: 7px;
  }

  .apply-actions .primary-button {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .patch-feedback .progress-panel,
  .patch-feedback .message-panel {
    padding: 9px 10px;
  }

  .patch-feedback .message-panel {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }

  .patch-feedback .message-panel > span {
    width: 26px;
    height: 26px;
  }

  .patch-feedback .message-panel.is-error {
    overflow: auto;
  }

  .patch-feedback .message-panel p,
  .patch-feedback .progress-panel p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .patch-feedback .message-panel.is-error p {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }

  .download-actions {
    gap: 6px;
    margin-top: 7px;
  }

  .download-link {
    min-height: 44px;
    padding: 6px 7px;
    font-size: 10px;
  }

  .download-help {
    font-size: 9px;
    line-height: 1.25;
  }
}

@media (max-width: 360px) {
  body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .site-header {
    height: auto;
    min-height: 48px;
    padding: 6px 8px;
  }

  .brand-copy strong {
    max-width: 188px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .compatibility {
    width: 30px;
    min-width: 30px;
    padding: 5px 8px;
    overflow: hidden;
    color: transparent;
  }

  .compatibility > span {
    color: var(--green);
  }
}

@media (max-height: 620px) and (max-width: 760px) {
  .patch-section {
    padding-top: 3px;
    padding-bottom: 4px;
  }

  .patch-workspace {
    grid-template-rows: minmax(122px, 0.94fr) minmax(96px, 0.76fr) minmax(148px, 1.3fr);
  }

  .patch-feedback .progress-panel,
  .patch-feedback .message-panel {
    padding: 7px 9px;
  }

  .apply-card.is-complete {
    grid-template-rows: minmax(0, 1fr);
  }

  .apply-card.is-complete .apply-main {
    display: none;
  }

  .apply-card.is-complete .patch-feedback {
    height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workflow-zone,
  .workflow-zone::after {
    animation: none !important;
    transition: none !important;
  }

  .workflow-zone.is-active::after,
  .workflow-zone.is-busy::after {
    background: var(--blue);
  }
}

@media (forced-colors: active) {
  .workflow-zone.is-active,
  .workflow-zone.is-busy {
    outline: 3px solid Highlight;
    outline-offset: -3px;
  }

  .workflow-zone.is-complete {
    outline: 2px solid LinkText;
    outline-offset: -2px;
  }

  .workflow-zone.is-error {
    outline: 3px solid Mark;
    outline-offset: -3px;
  }

  .workflow-zone::after {
    display: none;
  }
}

.selector-grid > .font-selector {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
}

.font-selector.is-visual .select-wrap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none;
}

.font-selector.is-visual .select-wrap::after {
  content: none;
}

.font-selector .field-label {
  margin-top: 8px;
}

.font-preview-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.font-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: var(--white);
  cursor: pointer;
}

.font-preview[aria-pressed="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(39, 93, 225, 0.22);
}

.font-preview:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.font-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #0a1a48;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.font-preview span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.font-preview[aria-pressed="true"] span {
  color: var(--ink);
}

.patch-note-summary {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.patch-note-summary > strong {
  font-weight: 700;
}

.patch-note-summary > span {
  font-weight: 400;
}

.patch-note-dialog.is-summary-only .patch-note-summary {
  padding: 16px 19px;
  font-size: 13px;
  line-height: 1.65;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .release-card {
    overflow-y: auto;
  }
}

/* Keep all controls reachable when the font selector adds a row on a short
   desktop or a phone in landscape. Normal-height layouts remain unchanged. */
@media (min-width: 761px) and (max-height: 720px) {
  .workflow-zone {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 760px) and (max-height: 600px) {
  .patch-console {
    overflow-y: auto;
  }
}

#fontHelp {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.font-selector.is-visual #fontHelp {
  display: none;
}

@media (max-width: 760px) {
  .patch-workspace:has(.font-selector:not([hidden])) {
    grid-template-rows: auto minmax(88px, 0.54fr) minmax(148px, 1.3fr);
  }
}

@media (max-height: 620px) and (max-width: 760px) {
  .patch-workspace:has(.font-selector:not([hidden])) {
    grid-template-rows: auto minmax(84px, 0.5fr) minmax(140px, 1.3fr);
  }
}

.patch-note-bgm-table { width:100%; table-layout:fixed; border-collapse:collapse; white-space:normal; margin:20px 0; }
.patch-note-bgm-table caption { text-align:left; font-weight:700; margin-bottom:8px; }
.patch-note-bgm-table th, .patch-note-bgm-table td { text-align:left; vertical-align:top; border-bottom:1px solid currentColor; padding:9px 7px; overflow-wrap:anywhere; }
.patch-note-bgm-table th:first-child { width:27%; }
@media(max-width:520px) { .patch-note-bgm-table { font-size:12px; } .patch-note-bgm-table th:first-child { width:30%; } }

/* Native top-layer dialog keeps the note dialog and its scroll position intact. */
.patch-note-image-button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #050910;
  cursor: zoom-in;
}
.patch-note-image-button:focus-visible { outline: 3px solid #8eb6ff; outline-offset: -3px; }
.patch-note-comparison.is-wide-strip .patch-note-image-button { height: auto; }
html.is-patch-notes-open, html.is-patch-image-open { overflow: hidden; }
.patch-note-dialog.is-image-viewing .patch-note-list { overflow: hidden; }
.patch-image-dialog {
  width: calc(100dvw - 16px);
  height: calc(100dvh - 16px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #fff;
  border: 1px solid #354259;
  border-radius: 14px;
  background: #050910;
}
.patch-image-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.patch-image-dialog::backdrop { background: rgba(0, 0, 0, 0.88); }
.patch-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #273549;
}
.patch-image-header h2 { margin: 0; font-size: 14px; line-height: 1.4; }
.patch-image-header .patch-note-close { min-height: 40px; flex: 0 0 auto; }
.patch-image-stage { display: block; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.patch-image-stage img { display: block; width: max(100%, var(--patch-image-width, 100%)); height: auto; max-width: none; max-height: none; image-rendering: pixelated; }

.patch-note-body { display: contents; }
.patch-note-dialog.is-scrollable-notes { container-type: size; --patch-note-image-max-height: max(140px, calc(100cqh - 170px)); }
.patch-note-dialog.is-scrollable-notes .patch-note-dialog-shell { grid-template-rows: auto minmax(0, 1fr); }
.patch-note-dialog.is-scrollable-notes .patch-note-body {
  display: block;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.patch-note-dialog.is-scrollable-notes .patch-note-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  grid-template-rows: max-content;
  align-items: start;
  gap: 19px;
  scroll-padding-inline: 19px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
}
.patch-note-dialog.is-scrollable-notes .patch-note-card {
  display: block;
  margin-bottom: 0;
  overflow: visible;
}
.patch-note-dialog.is-scrollable-notes .patch-note-card-heading { margin-bottom: 10px; }
.patch-note-dialog.is-scrollable-notes .patch-note-comparison { grid-template-columns: minmax(0, 1fr); }
.patch-note-dialog.is-scrollable-notes .patch-note-figure { display: block; }
.patch-note-dialog.is-scrollable-notes .patch-note-image-button { display: block; height: auto; }
.patch-note-dialog.is-scrollable-notes .patch-note-figure img {
  width: min(100%, calc(var(--patch-note-image-max-height) * var(--patch-note-image-ratio, 1)));
  height: auto;
  margin-inline: auto;
}
@media (min-width: 740px) {
  .patch-note-dialog.is-scrollable-notes .patch-note-comparison {
    grid-template-columns: minmax(0, var(--patch-note-as-is-fr, 1fr)) minmax(0, var(--patch-note-to-be-fr, 1fr));
    align-items: start;
  }
}
@media (max-width: 620px) {
  .patch-note-dialog.is-scrollable-notes .patch-note-list { gap: 12px; scroll-padding-inline: 12px; }
}
.patch-note-navigation { display: flex; gap: 6px; margin-left: auto; }
.patch-note-navigation[hidden] { display: none; }
.patch-note-navigation button { width: 36px; min-height: 38px; justify-content: center; padding: 0; font-size: 24px; }
.patch-note-navigation button:disabled { opacity: 0.3; cursor: default; }
.patch-note-dialog.is-image-viewing .patch-note-body { overflow: hidden; }
.patch-image-header h2 { flex: 1; }
.patch-image-zoom {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid #536076;
  border-radius: 10px;
  background: #152033;
  color: #fff;
  font-size: 21px;
  cursor: pointer;
}
