:root {
  --dark: #111315;
  --dark-2: #191c1f;
  --dark-3: #23272a;
  --line-dark: rgba(255,255,255,.12);
  --paper: #f6f5f2;
  --paper-2: #ffffff;
  --line: #dedbd5;
  --text: #1e2124;
  --muted: #7a7d82;
  --muted-dark: #a4a9ad;
  --red: #d64332;
  --green: #43a96d;
  --blue: #2e69d1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 1260px;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--text);
  background: #e9e7e2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.auth-page {
  min-width: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background: #0e1214;
}
button, textarea, input, select { font: inherit; }
button, select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}
button:hover { border-color: #bbb6ae; }
button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(620px, 1fr) 340px;
  grid-template-rows: 42px minmax(0, 1fr);
  height: 100vh;
  min-width: 1260px;
  overflow: hidden;
}
.app-shell.left-collapsed {
  grid-template-columns: 0 minmax(760px, 1fr) 340px;
}
.app-shell.left-collapsed .left-panel {
  padding: 0;
  border-right: 0;
  overflow: hidden;
}
.app-shell.left-collapsed .left-panel > * {
  display: none;
}
.app-shell.routes-collapsed .routes-area {
  padding-bottom: 6px;
}
.app-shell.routes-collapsed .route-list {
  display: none;
}
.app-shell.routes-collapsed .viewer-wrap {
  height: clamp(440px, calc(100vh - 285px), 700px);
}
.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  align-items: center;
  color: #f0efea;
  background: linear-gradient(180deg, #1d2022, #111315);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 850;
}
.brand span {
  color: #bde5c8;
  font-size: 12px;
  font-weight: 700;
}
.brand span:before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}
.project { align-items: center; color: #8f9692; display: flex; font-size: 12px; gap: 9px; }
.project input {
  background: rgba(255,255,255,.05);
  border: 1px solid transparent;
  border-radius: 5px;
  color: #e5e7e4;
  font-size: 13px;
  height: 28px;
  max-width: 260px;
  padding: 0 8px;
  width: min(24vw, 260px);
}
.project input:focus { border-color: rgba(255,255,255,.25); outline: 0; }
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 18px;
}
.top-actions button {
  height: 30px;
  padding: 0 6px;
  color: #eee;
  background: transparent;
  border-color: transparent;
}
.account-email {
  color: #9fa6a2;
  display: inline-block;
  font-size: 11px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#logoutBtn { border-left-color: rgba(255,255,255,.16); border-radius: 0; padding-left: 12px; }

.project-dialog {
  background: #181d1c;
  border: 1px solid #4a5551;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  color: #efefec;
  max-height: min(660px, 80vh);
  max-width: 650px;
  padding: 0;
  width: min(650px, calc(100vw - 40px));
}
.project-dialog::backdrop { background: rgba(4,6,6,.72); backdrop-filter: blur(5px); }
.project-dialog-head { align-items: flex-start; border-bottom: 1px solid #343d3a; display: flex; justify-content: space-between; padding: 20px 22px; }
.project-dialog-head strong { font-size: 18px; }.project-dialog-head p { color: #929c97; font-size: 12px; margin: 6px 0 0; }
.project-dialog-head button, .project-list button { background: #222a27; border-color: #48534e; color: #e9ece9; }
.project-list { max-height: 520px; min-height: 120px; overflow: auto; padding: 10px 22px 22px; }
.project-row { align-items: center; border-bottom: 1px solid #303936; display: grid; gap: 14px; grid-template-columns: minmax(0,1fr) auto; padding: 14px 0; }
.project-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.project-row span { color: #929c97; display: block; font-size: 11px; margin-top: 5px; }.project-row-actions { display: flex; gap: 7px; }
.project-empty { color: #9da6a1; padding: 28px 0; text-align: center; }

.left-panel,
.right-panel {
  min-height: 0;
  overflow: auto;
  background: var(--paper-2);
}
.left-panel {
  padding: 0 16px 22px;
  border-right: 1px solid #d6d3cd;
}
.right-panel {
  padding: 14px;
  border-left: 1px solid #d6d3cd;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
}
.left-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 -16px 18px;
  padding: 12px 16px 0;
  background: #fff;
  border-bottom: 1px solid #e2dfd8;
}
.left-tabs button {
  height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #606368;
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}
.left-tabs button.active {
  color: #16191b;
  border-color: var(--red);
  font-weight: 800;
}
label {
  display: block;
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 780;
}
label span {
  float: right;
  padding: 2px 5px;
  color: #999;
  border: 1px solid #ddd8d0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
textarea,
select {
  width: 100%;
  border: 1px solid #d7d3cc;
  border-radius: 7px;
  color: #25282a;
  background: #fff;
}
textarea {
  min-height: 160px;
  padding: 13px;
  resize: vertical;
  line-height: 1.65;
}
textarea.small { min-height: 72px; }
select { height: 36px; padding: 0 10px; }
.counter {
  margin-top: 5px;
  text-align: right;
  color: #8d8a84;
  font-size: 12px;
}
.primary {
  width: 100%;
  height: 42px;
  color: #fff;
  background: linear-gradient(180deg, #1c1e20, #111315);
  border-color: #111315;
  font-weight: 850;
}
.reference-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ece8e1;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 850;
}
.section-title button {
  height: 26px;
  padding: 0 8px;
  color: #999;
  background: #f8f7f4;
}
.reference-block p {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 750;
}
.ref-grid {
  display: grid;
  grid-template-columns: 72px 72px 72px;
  gap: 14px;
}
.portrait,
.scene-thumb,
.add-ref {
  height: 72px;
  border-radius: 7px;
  border: 1px solid #d9d5ce;
  overflow: hidden;
}
.portrait {
  background: center / cover no-repeat url("./assets/ui/portrait-female.png");
}
.portrait.male {
  background-image: url("./assets/ui/portrait-male.png");
}
.scene-thumb.one { background: center / cover no-repeat url("./assets/ui/scene-one.png"); }
.scene-thumb.two { background: center / cover no-repeat url("./assets/ui/scene-two.png"); }
.add-ref {
  border-style: dashed;
  color: #9a9790;
  font-size: 32px;
  background: #faf9f6;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.add-ref input {
  display: none;
}
.uploaded-ref {
  height: 72px;
  border-radius: 7px;
  border: 1px solid #d9d5ce;
  background: center / cover no-repeat #efede8;
}
.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.segment.key-segment {
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}
.segment button {
  height: 36px;
  border-radius: 0;
}
.segment button:first-child { border-radius: 6px 0 0 6px; }
.segment button:last-child { border-radius: 0 6px 6px 0; }
.segment.key-segment button {
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segment button.active {
  color: var(--red);
  border-color: var(--red);
  background: #fff7f5;
  font-weight: 800;
}
.mini-title {
  margin: 14px 0 8px;
  color: #6f7377;
  font-size: 12px;
  font-weight: 850;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.asset-picker {
  margin-top: 8px;
  padding: 8px;
  background: #fbfaf7;
  border: 1px solid #e1ddd6;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(20,20,20,.08);
}
.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.picker-head strong {
  font-size: 12px;
}
.picker-head button {
  height: 24px;
  padding: 0 7px;
  font-size: 11px;
}
.asset-grid button {
  height: 34px;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f7f6f2;
  font-size: 12px;
  font-weight: 750;
}
.asset-grid button:hover {
  background: #fff;
  border-color: var(--red);
}
.waypoint-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.waypoint-actions button,
.wide-soft {
  min-height: 34px;
  padding: 0 8px;
  background: #f7f6f2;
  font-size: 12px;
  font-weight: 800;
}
.wide-soft {
  width: 100%;
  margin-top: 8px;
}
.waypoint-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.waypoint-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 5px 6px;
  color: #45494d;
  background: #f8f7f4;
  border: 1px solid #e2ded7;
  border-radius: 6px;
  font-size: 12px;
}
.waypoint-row button {
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
}

.main-board {
  min-width: 0;
  overflow: auto;
  color: #f0efeb;
  background: var(--dark);
}
.routes-area {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line-dark);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 16px;
}
.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head button,
.stage-tools button,
.stage-tools select,
.playbar button,
.playbar select {
  height: 30px;
  color: #ddd;
  background: #202326;
  border-color: var(--line-dark);
}
.route-list {
  display: grid;
  gap: 8px;
}
.route-card {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 128px 64px minmax(120px, .86fr) minmax(120px, .86fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 9px 12px;
  color: #e8e5df;
  background: linear-gradient(180deg, #1e2225, #171a1d);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
}
.route-card.active {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(214,67,50,.65);
}
.route-card h3 {
  margin: 0 0 5px;
  font-size: 13px;
  line-height: 1.25;
}
.route-card p {
  margin: 0;
  color: #a9adb1;
  font-size: 11px;
  line-height: 1.35;
}
.route-thumb {
  height: 52px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.08);
  background: center / cover no-repeat #15191b;
}
.route-stat {
  display: grid;
  gap: 3px;
  color: #c8c7c2;
  font-size: 11px;
}
.route-bars {
  display: flex;
  align-items: center;
  gap: 6px;
}
.route-bars i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #787b7d;
}
.route-card.active .route-bars i { background: #bc4a40; }
.route-curve {
  width: 100%;
  height: 38px;
}

.stage-area {
  padding: 10px 16px 14px;
}
.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}
.stage-head span {
  display: block;
  color: #b0b3b5;
  font-size: 13px;
}
.stage-head strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}
.stage-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stage-tools select {
  width: auto;
  flex: 0 0 108px;
  min-width: 96px;
}
.stage-tools button {
  flex: 0 0 auto;
}
.stage-tools button.active {
  border-color: var(--red);
  color: #fff;
  background: rgba(214,67,50,.18);
}
.stage-tools #frameAllBtn,
.stage-tools #eyeLevelBtn,
.stage-tools #keyboardHelpBtn {
  padding: 0 9px;
}
.stage-tools label {
  display: flex;
  gap: 5px;
  align-items: center;
  margin: 0;
  color: #c7c7c1;
  font-size: 12px;
  font-weight: 600;
}
.viewer-wrap {
  position: relative;
  height: clamp(380px, calc(100vh - 430px), 620px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: #111516;
}
#stage3d,
#stage3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d4d0ca;
  background: #111516;
  z-index: 6;
}
.depth-rail {
  position: absolute;
  left: 18px;
  top: 42px;
  display: grid;
  gap: 8px;
  pointer-events: auto;
}
.depth-rail button {
  height: 26px;
  padding: 0 10px;
  color: #c9cbca;
  background: rgba(18,20,22,.64);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-size: 12px;
}
.depth-rail button:before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border: 1px solid #8c8e8f;
  border-radius: 50%;
}
.depth-rail button.active {
  color: #fff;
  border-color: var(--red);
  background: rgba(214,67,50,.22);
}
.timecode {
  position: absolute;
  left: 16px;
  bottom: 44px;
  color: #d8d5cf;
  font-size: 13px;
  pointer-events: none;
}
.playbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 72px 76px 72px minmax(84px, 1fr) 58px;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(12,14,16,.74);
}
.playbar button,
.playbar select {
  min-width: 0;
  padding: 0 8px;
  white-space: nowrap;
  font-size: 12px;
}
.playbar .play {
  width: auto;
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}
.shot-strip-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 12px 0 0;
  color: #ebe8e2;
}
.shot-strip-head strong {
  font-size: 14px;
}
.shot-strip-head span {
  color: #9fa4a7;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}
.shot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 10px 0 12px;
}
.shot-card {
  min-height: 76px;
  padding: 8px;
  text-align: left;
  color: #e8e5df;
  background: linear-gradient(145deg, #202326, #171a1d);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
}
.shot-card.active {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(214,67,50,.55);
}
.shot-card strong { display: block; font-size: 13px; }
.shot-card span { display: block; margin-top: 8px; color: #aeb2b4; font-size: 12px; }
.shot-card em { float: right; color: #f0eee9; font-style: normal; }
.add-shot {
  display: grid;
  place-items: center;
  min-height: 76px;
  color: #d5d2cc;
  background: #2a2d30;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  font-size: 24px;
}

.export-card,
.export-list {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #dedbd5;
  border-radius: 7px;
}
.export-card h3,
.export-card p {
  margin: 0 0 8px;
}
.export-card h3 { font-size: 15px; }
.export-card h3 span { color: #888; font-size: 12px; font-weight: 600; }
.export-card p,
.export-card small,
.export-list span {
  color: #8a8883;
  font-size: 12px;
}
.export-card .primary {
  margin: 8px 0;
  background: var(--red);
  border-color: var(--red);
}
.export-card .dark {
  width: 100%;
  height: 42px;
  margin: 8px 0;
  color: #fff;
  background: #151719;
  border-color: #151719;
  font-weight: 850;
}
.export-list {
  display: grid;
  gap: 9px;
}
.export-list span:before {
  content: "✓";
  margin-right: 6px;
  color: #57996b;
}

.right-panel section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #ebe8e2;
}
.control-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.control-scroll section:last-child {
  border-bottom: 0;
}
.preview-section {
  z-index: 4;
  padding-top: 2px;
  background: #fff;
}
.right-panel section:last-child { border-bottom: 0; }
.right-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.right-title h2 {
  margin: 0;
  font-size: 16px;
}
.right-title span {
  color: #46a86d;
  font-size: 12px;
  font-weight: 800;
}
.right-panel h3 {
  margin: 16px 0 8px;
  font-size: 13px;
}
.right-panel p {
  margin: 0;
  color: #50545a;
  font-size: 13px;
  line-height: 1.6;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  padding: 7px 10px;
  border: 1px solid #e1ded8;
  border-radius: 5px;
  color: #575b60;
  background: #faf9f6;
  font-size: 12px;
}
.preview-monitor {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  border: 1px solid #d9d6d0;
  border-radius: 7px;
  background: #111516;
}
.preview-monitor canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.preview-actions button {
  height: 32px;
  font-size: 12px;
}
.collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: #f7f6f2;
  font-size: 13px;
  font-weight: 850;
}
.collapse-head b {
  color: #777a7d;
  font-size: 11px;
}
.export-section label {
  margin-top: 8px;
}
.export-section select {
  margin-bottom: 10px;
}
.export-red,
.export-dark {
  width: 100%;
  height: 38px;
  margin-bottom: 8px;
  color: #fff;
  border-color: transparent;
  font-weight: 850;
}
.export-red {
  background: var(--red);
  border-color: var(--red);
}
.export-dark {
  background: #151719;
  border-color: #151719;
}
.export-section .export-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  padding: 10px 0 0;
  border: 0;
  background: transparent;
}
.export-section .export-list span {
  color: #777a7d;
  font-size: 12px;
}
.object-list {
  display: grid;
  gap: 7px;
}
.object-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e0ddd7;
  border-radius: 6px;
  background: #faf9f6;
}
.object-row.active {
  border-color: var(--red);
  background: #fff7f5;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.object-color {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #c8c3ba;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}
.object-color::-webkit-color-swatch-wrapper {
  padding: 0;
}
.object-color::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}
.object-row button {
  height: 24px;
  padding: 0 7px;
  color: #777;
  background: #fff;
  font-size: 11px;
}
.object-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.object-actions button { height: 32px; }
.key-status {
  margin-top: 8px;
  padding: 8px 10px;
  color: #5d6064;
  background: #faf8f4;
  border: 1px solid #e3dfd7;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}
.key-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.key-actions button {
  height: 32px;
  font-size: 12px;
}
.camera-mark-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 8px;
}
.camera-mark-actions button {
  height: 32px;
  font-size: 12px;
}
.right-panel input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}
.apply {
  width: 100%;
  height: 40px;
  margin-top: 16px;
  color: #fff;
  background: #151719;
  border-color: #151719;
  font-weight: 850;
}
.keyboard-panel {
  position: fixed;
  right: 354px;
  top: 54px;
  z-index: 30;
  width: 240px;
  padding: 12px;
  color: #f2eee8;
  background: rgba(18,20,22,.96);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  box-shadow: 0 18px 45px rgba(0,0,0,.36);
}
.keyboard-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.keyboard-panel strong {
  font-size: 13px;
}
.keyboard-panel button {
  height: 26px;
  color: #ddd;
  background: #272b2f;
  border-color: rgba(255,255,255,.18);
  font-size: 12px;
}
.keyboard-panel p {
  margin: 7px 0;
  color: #c8cbce;
  font-size: 12px;
  line-height: 1.35;
}
kbd {
  display: inline-block;
  min-width: 20px;
  padding: 2px 5px;
  margin: 0 2px;
  color: #fff;
  background: #383d42;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 1260px) {
  body { min-width: 0; }
  .app-shell {
    grid-template-columns: 280px minmax(560px, 1fr);
    grid-template-rows: 42px auto auto;
  }
  .right-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .right-panel section {
    border-bottom: 0;
    margin-bottom: 0;
  }
}
