/* Look of the Gymi domain console (react-domain-console, Metronic): Inter 13 px, navy headings, orange #FF5F00 actives.
   Laid out as a full-height app so a 14" laptop shows filters, the whole phone and the use case without page scroll. */
:root {
  --bg: #fcfcfc; --header: #ffffff; --card: #ffffff; --card-border: #f1f1f4; --card-shadow: 0 3px 4px rgba(0, 0, 0, .03);
  --heading: #1b2e5b; --text: #071437; --text-2: #252f4a; --muted: #78829d; --soft: #99a1b7; --link: #2770b7;
  --primary: #ff5f00; --primary-light: #ffe3cc; --light: #f9f9f9; --light-hover: #f1f1f4;
  --input: #f9f9f9; --input-border: #dbdfe9; --focus: #ff5f00; --stage: #f5f6f9;
  --warning-bg: #fff8dd; --warning: #a16a00; --menu-active-bg: #f9f9f9;
  --success-bg: #e8f7ef; --success: #1a7f4b; --danger-bg: #fdecec; --danger: #c62828;
  --header-shadow: 0 10px 30px rgba(82, 63, 105, .05);
}
:root[data-ui="dark"] {
  --bg: #0f1014; --header: #0d0e12; --card: #15171c; --card-border: #1e2027; --card-shadow: none;
  --heading: #e8edf7; --text: #f5f5f5; --text-2: #b5b7c8; --muted: #808290; --soft: #636674; --link: #5aa2e6;
  --primary-light: #172331; --light: #1b1c22; --light-hover: #26272f; --input: #1b1c22; --input-border: #26272f;
  --stage: #111216; --warning-bg: #2a2410; --warning: #e6b84a; --menu-active-bg: #1b1c22; --header-shadow: none;
  --success-bg: #12261b; --success: #4cc38a; --danger-bg: #2c1515; --danger: #f07171;
}
* { box-sizing: border-box; }
html { font-size: 13px; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; overflow: hidden; font-family: Inter, Helvetica, sans-serif;
       color: var(--text); background: var(--bg); }
button, select { font: inherit; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }

.app-header { flex: none; display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px; background: var(--header);
              box-shadow: var(--header-shadow); position: relative; z-index: 2; }
.logo-link { display: inline-flex; }
.logo { height: 20px; }
:root[data-ui="dark"] .logo { filter: brightness(0) invert(1); }
.menu { display: flex; gap: 2px; flex: none; }
.menu-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 6px; font-weight: 500;
             color: var(--link); text-decoration: none; white-space: nowrap; }
.menu-link:hover { background: var(--menu-active-bg); }
.menu-link.active { color: var(--primary); background: var(--menu-active-bg); }
.badge { min-width: 18px; padding: 1px 6px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 11px;
         font-weight: 600; text-align: center; }
.badge:empty { display: none; }
.status { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
          background: var(--light); color: var(--text-2); }
.status.proposed, .status.frozen { background: var(--warning-bg); color: var(--warning); }
.status.validated, .status.merged, .status.closed { background: var(--success-bg); color: var(--success); }
.status.rejected { background: var(--danger-bg); color: var(--danger); }
.status.open { background: var(--primary-light); color: var(--primary); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 420px; padding: 12px 16px; border-radius: 8px;
         background: var(--heading); color: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; }
.breadcrumb { list-style: none; display: flex; flex: 1; min-width: 0; margin: 0; padding: 0; font-size: 12px; color: var(--soft);
              white-space: nowrap; overflow: hidden; }
.breadcrumb li { overflow: hidden; text-overflow: ellipsis; }
.breadcrumb li + li::before { content: '-'; margin: 0 6px; }
.breadcrumb li:last-child { color: var(--text); }
.totals { font-size: 12px; white-space: nowrap; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 6px; cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn:hover { background: var(--light); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .sun, :root[data-ui="dark"] .icon-btn .moon { display: none; }
:root[data-ui="dark"] .icon-btn .sun { display: block; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 5.5px; padding: 7px 12px; font-weight: 500;
       font-size: 12.35px; cursor: pointer; color: var(--text-2); background: var(--light); white-space: nowrap; }
.btn:hover { background: var(--light-hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-light-primary { background: var(--primary-light); }
.btn-light-primary:hover { background: var(--primary); color: #fff; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr);
             gap: 12px; padding: 12px 16px; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 8px; box-shadow: var(--card-shadow); min-height: 0; }
.label { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }

.panel { padding: 10px 12px; overflow: auto; display: flex; flex-direction: column; gap: 7px; }
.field { display: block; min-width: 0; }
.form-select { width: 100%; height: 32px; padding: 0 30px 0 10px; border: 1px solid var(--input-border); border-radius: 6px;
               background: var(--input) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2378829d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 10px center / 11px;
               color: var(--text); appearance: none; font-size: 12.5px; text-overflow: ellipsis; }
.form-select:focus { outline: none; border-color: var(--focus); }
.btn-group { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 5.5px; overflow: hidden; }
.btn-group button { border: 0; padding: 6px 6px; font-size: 12.35px; font-weight: 500; cursor: pointer; color: var(--text-2);
                    background: var(--primary-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-group button:hover { filter: brightness(.97); }
.btn-group button.on { background: var(--primary); color: #fff; }
.field[hidden] { display: none; }

.stage { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 14px 6px; }
.stage-title { min-width: 0; }
.stage-title h1 { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--heading); }
.stage-title .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper .btn { padding: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 8px; }
.chips:empty { display: none; }
.chip { border: 0; border-radius: 5.5px; padding: 4px 9px; font-size: 12px; font-weight: 500; background: var(--light);
        color: var(--text-2); cursor: pointer; }
.chip:hover { background: var(--light-hover); }
.chip.on { background: var(--primary); color: #fff; }
.chip.missing { cursor: default; background: var(--warning-bg); color: var(--warning); }
.phone-area { flex: 1; min-height: 0; margin: 0 14px 14px; background: var(--stage); border-radius: 8px; padding: 10px;
              display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: auto; }
/* At real size the phone may be larger than the stage: start-aligned with auto margins so all of it can be scrolled to. */
.phone-area.real { justify-content: flex-start; align-items: flex-start; }
.phone-area.real > * { margin-left: auto; margin-right: auto; }
/* Phone shell drawn by the viewer: everything in points times --k, the scale chosen by applyScale(). */
.device { --u: calc(var(--k) * 1px); position: relative; flex: none; background: #16171a;
          width: calc((var(--w) + 2 * var(--sx)) * var(--u)); height: calc((var(--h) + var(--top) + var(--bottom)) * var(--u));
          border-radius: calc(var(--outer) * var(--u));
          box-shadow: inset 0 0 0 calc(2 * var(--u)) #3a3c42, 0 calc(16 * var(--u)) calc(36 * var(--u)) rgba(15, 20, 35, .18); }
.screen-clip { position: absolute; overflow: hidden; background: #000;
               left: calc(var(--sx) * var(--u)); top: calc(var(--top) * var(--u));
               width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); border-radius: calc(var(--r) * var(--u)); }
.screen { position: absolute; top: 0; left: 0; width: calc(var(--w) * 1px); height: calc(var(--h) * 1px);
          transform: scale(var(--k)); transform-origin: 0 0; }
/* The screen answers to touch (static/frame.js): options, fields and scrolling, never navigation. */
.screen iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.cam { position: absolute; left: 50%; transform: translateX(-50%); background: #000; z-index: 5; }
.island .cam { top: 11px; width: 122px; height: 36px; border-radius: 20px; }
.notch .cam { top: 0; width: 160px; height: 32px; border-radius: 0 0 20px 20px; }
.punch .cam { top: 12px; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(120, 120, 130, .25); }
.home .cam, .bezel .cam, .fold .cam, .plain .cam { display: none; }
/* Unfolded foldables: the hinge runs down the middle of the inner screen. */
.fold .screen-clip::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: calc(3 * var(--u));
                            transform: translateX(-50%); background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.10), rgba(0,0,0,0));
                            pointer-events: none; }
.key { position: absolute; width: calc(4 * var(--u)); background: #2b2d32; border-radius: calc(2 * var(--u)); }
.ios .k1 { left: calc(-3 * var(--u)); top: calc(118 * var(--u)); height: calc(30 * var(--u)); }
.ios .k2 { left: calc(-3 * var(--u)); top: calc(176 * var(--u)); height: calc(60 * var(--u)); }
.ios .k3 { left: calc(-3 * var(--u)); top: calc(250 * var(--u)); height: calc(60 * var(--u)); }
.ios .k4 { right: calc(-3 * var(--u)); top: calc(210 * var(--u)); height: calc(96 * var(--u)); }
.android .k1 { right: calc(-3 * var(--u)); top: calc(170 * var(--u)); height: calc(56 * var(--u)); }
.android .k2 { right: calc(-3 * var(--u)); top: calc(250 * var(--u)); height: calc(110 * var(--u)); }
.android .k3, .android .k4 { display: none; }
.speaker { position: absolute; left: 50%; top: calc(38 * var(--u)); width: calc(52 * var(--u)); height: calc(6 * var(--u));
           transform: translateX(-50%); border-radius: 99px; background: #2b2d32; }
.lens { position: absolute; left: calc(50% - 50 * var(--u)); top: calc(36 * var(--u)); width: calc(10 * var(--u)); height: calc(10 * var(--u));
        border-radius: 50%; background: #2b2d32; }
.bezel .speaker { top: calc(17 * var(--u)); }
.bezel .lens { top: calc(15 * var(--u)); }
.home-btn { position: absolute; left: 50%; bottom: calc(16 * var(--u)); width: calc(52 * var(--u)); height: calc(52 * var(--u));
            transform: translateX(-50%); border-radius: 50%; box-shadow: inset 0 0 0 calc(2 * var(--u)) #3a3c42; }
.phone-caption { flex: none; font-size: 12px; color: var(--muted); text-align: center; }
.phone-caption .relaid { font-size: 11.5px; color: var(--soft); margin-top: 2px; }
.phone-caption b { color: var(--text); font-weight: 600; }
.not-drawn { text-align: center; color: var(--muted); }
.not-drawn p { margin: 0 0 14px; }
.not-drawn .btn-group { display: inline-grid; }

.side { padding: 14px 16px; overflow: auto; line-height: 1.5; }
.side .id { color: var(--primary); font-weight: 600; font-size: 12px; }
.side h2 { margin: 2px 0 10px; font-size: 15px; font-weight: 600; color: var(--heading); }
.side h3 { margin: 16px 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.side h3:first-child { margin-top: 0; }
.side p { margin: 0 0 6px; }
.side .row b { color: var(--text-2); font-weight: 600; }
.side ol, .side ul { margin: 0; padding-left: 18px; }
.side li { margin: 0 0 5px; }
.side .chips { padding: 6px 0 0; }
.side .alt { border-left: 3px solid var(--card-border); padding: 2px 0 2px 12px; margin: 0 0 12px; }
.side .alt > b { font-weight: 600; color: var(--text-2); }
.side dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.side dt { color: var(--muted); }
.side dd { margin: 0; }
.side code { font-size: 11.5px; word-break: break-word; color: var(--link); }
.cu-list { display: flex; flex-direction: column; gap: 8px; }
.cu-list button { text-align: left; border: 1px solid var(--card-border); background: transparent; color: var(--text); border-radius: 6px;
                  padding: 9px 11px; cursor: pointer; font: inherit; }
.cu-list button:hover { border-color: var(--primary); }
.hint { color: var(--muted); }

/* Left panel: what is on screen and the open changes */
.panel-block { background: var(--light); border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; }
.viewing { display: flex; flex-direction: column; gap: 2px; }
.viewing-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.viewing-top b { font-size: 14px; color: var(--heading); }
.viewing .muted { font-size: 11.5px; line-height: 1.35; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row .label { margin: 0; }
.link-small { font-size: 11.5px; color: var(--link); text-decoration: none; font-weight: 500; }
.link-small:hover { color: var(--primary); }
.mini-list { display: flex; flex-direction: column; gap: 4px; }
.mini-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; text-align: left; font: inherit;
             font-size: 12px; border: 1px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 6px;
             padding: 5px 7px; cursor: pointer; }
.mini-item:hover, .mini-item.on { border-color: var(--primary); }
.mini-title { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.mini-screens { padding: 2px 0 4px; }
.mini-screens .chip { font-size: 11px; padding: 3px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel .hint { margin: 0; font-size: 12px; }

.changes-block > summary { cursor: pointer; list-style: none; }
.changes-block > summary::-webkit-details-marker { display: none; }
.changes-block > summary .label::before { content: '▸ '; }
.changes-block[open] > summary .label::before { content: '▾ '; }
.changes-block[open] > summary { margin-bottom: 6px; }
.zoom-toggle button { padding: 5px 9px; }
/* Short windows: tighter fields so the whole panel still fits without scrolling. */
@media (max-height: 700px) {
  .panel { gap: 4px; padding: 8px 10px; }
  .panel .form-select { height: 28px; }
  .label { margin-bottom: 2px; }
  .panel-block { padding: 6px 8px; gap: 4px; }
  .btn-group button { padding: 5px 6px; }
}

/* Signed-in person, login and tokens */
.user-box { display: flex; align-items: center; gap: 8px; flex: none; }
.user-name { font-weight: 600; color: var(--heading); white-space: nowrap; }
/* Login: a brand panel with three phones of the design ranges, and the form. Shows nothing about who may enter. */
.login-body { overflow: auto; background: var(--card); }
.login-page { flex: 1; width: 100%; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
               align-items: center; gap: 4vh; padding: 40px;
               background: radial-gradient(120% 90% at 100% 0%, #2770b7 0%, transparent 55%),
                           radial-gradient(90% 70% at 0% 100%, rgba(255, 95, 0, .45) 0%, transparent 60%),
                           linear-gradient(160deg, #1b2e5b 0%, #0e1a38 100%); }
.login-brand::before { content: ""; position: absolute; inset: 0; opacity: .5;
                       background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
                       background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 30%, transparent 100%); }
.login-glow { position: absolute; width: 60%; aspect-ratio: 1; left: 20%; top: 18%; border-radius: 50%;
              background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); filter: blur(10px); }
.login-phones { position: relative; width: min(100%, 460px); height: auto; max-height: 58vh; overflow: visible;
                stroke: none; stroke-width: 0; }
.login-phones .body { fill: rgba(255, 255, 255, .07); stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }
.login-phones .notch { fill: rgba(255, 255, 255, .55); }
.login-phones .ink { fill: rgba(255, 255, 255, .75); }
.login-phones .block { fill: rgba(255, 255, 255, .13); }
.login-phones .hero { fill: rgba(39, 112, 183, .55); }
.login-phones .cta { fill: #ff5f00; }
.login-phones .p1, .login-phones .p3 { opacity: .7; }
.login-phones .p2 .body { fill: rgba(14, 26, 56, .55); stroke: rgba(255, 255, 255, .85); }
.login-phones .phone { animation: login-float 7s ease-in-out infinite; transform-box: fill-box; }
.login-phones .p1 { animation-delay: -2s; }
.login-phones .p3 { animation-delay: -4.5s; }
@keyframes login-float { 50% { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .login-phones .phone { animation: none; } }
.login-brand-text { position: relative; display: flex; flex-direction: column; align-items: center; color: #fff; line-height: 1; }
.login-kicker { font-size: 12px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; opacity: .7; }
.login-wordmark { margin-top: 8px; font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.02em; }
.login-wordmark::after { content: "."; color: #ff5f00; }

.login-side { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--card); }
.login-form { width: min(340px, 100%); display: flex; flex-direction: column; gap: 22px; }
.login-logo { height: 46px; align-self: flex-start; }
:root[data-ui="dark"] .login-logo { filter: brightness(0) invert(1); }
.login-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--heading); }
.login-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.login-fields { display: flex; flex-direction: column; gap: 14px; }
.login-fields[hidden] { display: none; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span:first-child { font-size: 12px; font-weight: 600; color: var(--text-2); }
.login-input { position: relative; display: flex; align-items: center; height: 44px; border: 1px solid var(--input-border);
               border-radius: 10px; background: var(--input); transition: border-color .15s, box-shadow .15s, background .15s; }
.login-input:focus-within { border-color: var(--focus); background: var(--card); box-shadow: 0 0 0 4px rgba(255, 95, 0, .12); }
.login-input > svg { flex: none; margin-left: 13px; width: 17px; height: 17px; color: var(--soft); }
.login-input:focus-within > svg { color: var(--primary); }
.login-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text);
                     font: inherit; font-size: 14px; padding: 0 12px 0 10px; }
.login-eye { flex: none; display: grid; place-items: center; width: 40px; height: 100%; border: 0; background: transparent;
             color: var(--soft); cursor: pointer; border-radius: 0 10px 10px 0; }
.login-eye:hover, .login-eye.on { color: var(--heading); }
.login-error { margin: -6px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-bg); color: var(--danger);
               font-weight: 500; }
.login-error:empty { display: none; }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 10px;
                background: linear-gradient(135deg, #ff7a26, #ff5f00); color: #fff; font: inherit; font-size: 14.5px;
                font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(255, 95, 0, .7);
                transition: transform .15s, box-shadow .15s, filter .15s; }
.login-submit svg { width: 17px; height: 17px; transition: transform .15s; }
.login-submit:hover { filter: brightness(1.04); box-shadow: 0 12px 24px -10px rgba(255, 95, 0, .8); }
.login-submit:hover svg { transform: translateX(3px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { opacity: .7; cursor: progress; }
.login-submit:focus-visible, .login-eye:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { flex-direction: row; gap: 14px; padding: 22px 16px; }
  .login-phones, .login-glow { display: none; }
  .login-brand-text { align-items: flex-start; }
  .login-wordmark { font-size: 28px; }
  .login-side { align-items: flex-start; padding: 28px 16px; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .login-form { gap: 16px; }
  .login-logo { height: 38px; }
  .login-phones { max-height: 52vh; }
}
.form-input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: 6px;
              background: var(--input); color: var(--text); font: inherit; }
.form-input:focus { outline: none; border-color: var(--focus); }
.login-card .btn-primary { justify-content: center; height: 40px; font-size: 13px; }
.form-error { color: var(--danger); font-weight: 500; }
.tokens-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.token-once { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all;
              background: var(--stage); border-radius: 6px; padding: 10px; user-select: all; }
table.tokens { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tokens th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 600; padding: 6px 6px; }
table.tokens td { border-top: 1px solid var(--card-border); padding: 8px 6px; vertical-align: top; }
pre.snippet { background: var(--stage); border-radius: 6px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 6px 0; }

/* Changes and versions pages */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #e55600; }
.workspace:has(.change-list) { grid-template-columns: 270px minmax(0, 1fr) 380px; }
.workspace.versions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.btn-group.grid-filter { display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; }
.btn-group.grid-filter button { border-radius: 5.5px; flex: 1 0 auto; }
.change-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.change-item { text-align: left; border: 1px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 6px;
               padding: 9px 10px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px; }
.change-item:hover, .change-item.on { border-color: var(--primary); }
.change-item .muted { font-size: 11.5px; }
.change-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.change-title { font-weight: 500; }
.diff-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; gap: 8px; padding: 0 14px 10px; }
.compare { flex: 1; min-height: 0; margin: 0 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-side { min-height: 0; background: var(--stage); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; }
.compare-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 6px; }
.compare-phone { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.compare-side .not-drawn { flex: 1; display: flex; align-items: center; justify-content: center; }
.detail-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.checks, .files, .plain, .timeline { list-style: none; padding: 0; margin: 0; }
.check { display: flex; gap: 8px; padding: 4px 0; }
.check-icon { width: 18px; flex: none; font-weight: 700; }
.check.ok .check-icon { color: var(--success); }
.check.error .check-icon { color: var(--danger); }
.check.warning .check-icon { color: var(--warning); }
.check .muted { font-size: 12px; }
.files li { margin: 0 0 2px; }
.plain li { margin: 0 0 6px; }
.timeline li { border-left: 2px solid var(--card-border); padding: 0 0 10px 10px; margin: 0; }
.timeline .muted { font-size: 11.5px; }
.callout { border-radius: 6px; padding: 10px 12px; margin: 10px 0; background: var(--primary-light); }
.callout.danger { background: var(--danger-bg); color: var(--danger); }
.form-text { width: 100%; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input); color: var(--text);
             font: inherit; padding: 8px 10px; resize: vertical; }
.form-text:focus { outline: none; border-color: var(--focus); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin: 8px 0; flex-wrap: wrap; }
.version { border-top: 1px solid var(--card-border); padding: 10px 0 4px; }
.side .changelog { list-style: none; padding: 0; margin: 4px 0 0; }
.side .changelog li { margin: 0 0 10px; }
.changelog p { margin: 2px 0 0; color: var(--text-2); }
.changelog-text { white-space: pre-wrap; }
/* The impact of each change, stronger as it bumps a higher part of the number. */
.status.impact-flujo, .status.impact-visual, .status.impact-ajuste { text-transform: capitalize; }
.status.impact-flujo { background: var(--primary); color: #fff; }
.status.impact-visual { background: var(--primary-light); color: var(--primary); }
.change-link { color: var(--text); text-decoration: none; }
.change-link:hover { color: var(--primary); }

/* Smaller windows keep the fixed-height shell with narrower side columns; only below 900 x 500 does the page scroll. */
@media (max-width: 1240px) {
  .workspace { grid-template-columns: 210px minmax(0, 1fr) 300px; }
  .totals { display: none; }
}
@media (max-width: 900px), (max-height: 500px) {
  body { overflow: auto; height: auto; }
  .workspace { flex: none; grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .stage { min-height: 75vh; }
  .app-header { gap: 10px; padding: 0 12px; }
  .breadcrumb, #copyLink span { display: none; }
}
