:root {
  --bg: #0d1016;
  --bg-elevated: #151923;
  --bg-soft: #1b2130;
  --bg-muted: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f0ea;
  --text-soft: #b5bccd;
  --text-dim: #8c94a8;
  --brand: #ff7a3d;
  --brand-soft: rgba(255, 122, 61, 0.14);
  --mint: #8ef0cb;
  --gold: #f6cf68;
  --danger: #ff6e6e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 122, 61, 0.12), transparent 34%),
    radial-gradient(circle at top right, rgba(142, 240, 203, 0.08), transparent 30%),
    linear-gradient(180deg, #0a0d12, #0d1016 36%, #090b11);
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1440px, calc(100vw - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
  backdrop-filter: blur(22px);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 10px);
  gap: 4px;
}

.brand-mark span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 20px currentColor;
}

.brand-mark span:nth-child(1),
.brand-mark span:nth-child(9) { color: #ff7a3d; background: currentColor; }
.brand-mark span:nth-child(2) { color: #ffd56c; background: currentColor; }
.brand-mark span:nth-child(3) { color: #c3ff73; background: currentColor; }
.brand-mark span:nth-child(4) { color: #67d6ff; background: currentColor; }
.brand-mark span:nth-child(5) { color: #ff84c7; background: currentColor; }
.brand-mark span:nth-child(6) { color: #d07cff; background: currentColor; }
.brand-mark span:nth-child(7) { color: #ff6464; background: currentColor; }
.brand-mark span:nth-child(8) { color: #5cf1b9; background: currentColor; }

.brand-copy {
  flex: 1;
  min-width: 0;
}

.brand-copy h1 {
  margin: 3px 0 0;
  font-family: "Baskerville", "Times New Roman", serif;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: 0.02em;
}

.brand-kicker,
.brand-badge {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--text-dim);
}

.brand-badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 122, 61, 0.3);
  background: rgba(255, 122, 61, 0.08);
  color: #ffc49d;
}

.mode-nav {
  display: flex;
  gap: 10px;
  padding: 14px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mode-tab {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-muted);
  color: var(--text-soft);
  font-weight: 700;
}

.mode-tab.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 122, 61, 0.16), rgba(255, 122, 61, 0.06));
  border-color: rgba(255, 122, 61, 0.28);
}

.app-main {
  overflow: hidden;
}

.view-panel {
  display: none;
  height: 100%;
  overflow: hidden;
}

.view-panel.active {
  display: block;
}

.scroll-shell {
  height: 100%;
  overflow: auto;
  padding: 18px 24px 24px;
  scrollbar-gutter: stable;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-top: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 36px rgba(0, 0, 0, 0.18);
}

.card:first-child {
  margin-top: 0;
}

.hero-card-home,
.hero-card-records {
  background:
    radial-gradient(circle at top right, rgba(255, 122, 61, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.hero-card-home {
  padding: 22px 22px 20px;
}

.flow-card {
  padding-top: 14px;
  padding-bottom: 14px;
}

.card-pill,
.section-kicker {
  margin: 0 0 6px;
  color: #ffbf9e;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
}

.hero-card-home h2 {
  margin: 0;
  font-family: "Baskerville", "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  max-width: 10ch;
}

.hero-copy,
.records-copy,
.muted-copy,
.section-meta,
.flow-item p,
.empty-card p,
.image-meta p,
.footer-note,
.save-hint,
.mini-hint {
  color: var(--text-soft);
  line-height: 1.6;
}

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

.records-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.records-actions .primary-btn,
.records-actions .secondary-btn {
  flex: 1 1 180px;
}

.primary-btn,
.secondary-btn,
.link-btn,
.small-btn,
.chip,
.tool-chip,
.compare-badge {
  border: 0;
  border-radius: 14px;
}

.primary-btn {
  min-height: 48px;
  padding: 0 22px;
  background: linear-gradient(135deg, #ff7a3d, #ffaf6e);
  color: #140d08;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(255, 122, 61, 0.22);
}

.primary-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-btn-wide,
.secondary-btn-wide {
  width: 100%;
}

.secondary-btn {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 700;
}

.link-btn {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  margin-top: 14px;
}

.section-head,
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3,
.section-head h3,
.empty-card h3 {
  margin: 0;
  font-size: 20px;
}

.flow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flow-card .section-head {
  margin-bottom: 12px;
}

.flow-item,
.record-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.flow-item {
  min-height: 100%;
  align-items: flex-start;
  padding: 12px 14px;
}

.flow-item > div {
  display: grid;
  gap: 4px;
  align-content: start;
}

.flow-item strong {
  font-size: 15px;
  line-height: 1.2;
}

.flow-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.flow-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #ffc49d;
  font-weight: 800;
  font-size: 12px;
  margin-top: 1px;
}

.record-item {
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  border: 1px solid transparent;
}

.record-item.active {
  border-color: rgba(255, 122, 61, 0.28);
  background: rgba(255, 122, 61, 0.08);
}

.record-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.record-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-title {
  font-weight: 700;
  font-size: 14px;
}

.record-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.record-status.is-draft { background: rgba(140, 148, 168, 0.16); color: #d4d8e5; }
.record-status.is-ready { background: rgba(142, 240, 203, 0.16); color: #9ff6d5; }
.record-status.is-making { background: rgba(255, 122, 61, 0.16); color: #ffc49d; }
.record-status.is-done { background: rgba(246, 207, 104, 0.18); color: #ffe49c; }

.record-meta,
.record-progress {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}

.record-progress {
  color: var(--text-dim);
}

.record-open {
  min-height: 40px;
  min-width: 76px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
}

.empty-card {
  text-align: center;
  display: grid;
  place-items: center;
  min-height: 240px;
}

.empty-mark {
  font-size: 40px;
  margin-bottom: 8px;
}

.empty-state {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-soft);
}

.preview-empty-state {
  align-content: center;
  gap: 12px;
}

.preview-empty-state .empty-mark {
  margin: 0;
  line-height: 1;
}

.preview-empty-state p {
  margin: 0;
}

.studio-layout {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.stepbar {
  display: flex;
  gap: 14px;
  padding: 18px 24px 12px;
  margin: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.01);
  border-radius: 0 0 24px 24px;
}

.step {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--text-dim);
  padding: 10px 6px 12px;
  border-radius: 18px;
  transition: background 180ms ease, color 180ms ease;
}

.step-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 800;
}

.step.active .step-num,
.step.done .step-num {
  border-color: rgba(255, 122, 61, 0.26);
  background: rgba(255, 122, 61, 0.14);
  color: var(--text);
}

.step.active,
.step.done {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
}

.step.done .step-num {
  border-color: rgba(142, 240, 203, 0.28);
  background: rgba(142, 240, 203, 0.14);
}

.step-label {
  font-size: 12px;
  font-weight: 700;
}

.studio-main {
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.studio-step {
  display: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.studio-step.active {
  display: block;
}

.preview-stage,
.confirm-preview-frame,
.make-board {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0f131b;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-stage {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 42%),
    linear-gradient(180deg, #121722, #0e131b);
}

.preview-image {
  width: auto;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.28));
}

.loading-state,
.stage-loading,
.make-loading {
  display: grid;
  place-items: center;
  gap: 12px;
}

.loading-state,
.make-loading {
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 21, 0.82);
  z-index: 3;
  pointer-events: none;
}

.stage-loading {
  height: 100%;
}

.dots {
  display: flex;
  gap: 8px;
}

.dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  animation: bounce 0.82s ease-in-out infinite;
}

.dots span:nth-child(1) { background: #ff7a3d; }
.dots span:nth-child(2) { background: #ffd56c; animation-delay: 0.12s; }
.dots span:nth-child(3) { background: #8ef0cb; animation-delay: 0.24s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(0.8); opacity: 0.5; }
  50% { transform: translateY(-8px) scale(1); opacity: 1; }
}

.image-meta {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 12px;
}

.image-meta img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 12px;
}

.card-head.split {
  align-items: center;
}

.field {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.field span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--brand);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.chip,
.tool-chip {
  min-height: 42px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-weight: 700;
}

.chip.active,
.tool-chip.active {
  border-color: rgba(255, 122, 61, 0.28);
  background: rgba(255, 122, 61, 0.12);
  color: var(--text);
}

.chip-warn {
  color: #ffc49d;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.loading { background: rgba(246, 207, 104, 0.14); color: #ffd56c; }
.status-pill.warn { background: rgba(255, 122, 61, 0.14); color: #ffbd9c; }
.status-pill.ok { background: rgba(142, 240, 203, 0.14); color: #baf5dd; }
.status-pill.muted { background: rgba(255, 255, 255, 0.06); color: var(--text-soft); }

.confirm-layout {
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(180px, 0.56fr);
  gap: 14px;
  padding: 0 24px 24px;
}

.confirm-preview-shell {
  min-height: 0;
  min-width: 0;
}

.confirm-preview-frame {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(180deg, #121722, #0d1219);
}

.confirm-preview-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.compare-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  right: auto;
  bottom: auto;
  max-width: calc(100% - 28px);
  padding: 9px 11px;
  background: rgba(12, 15, 21, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.confirm-stats {
  min-width: 0;
}

.toolbar-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.small-btn {
  min-width: 42px;
  min-height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.inline-info {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-grid .stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.stat-grid .n {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.stat-grid .l {
  font-size: 12px;
  color: var(--text-soft);
}

.legend-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.confirm-legend-card {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 14px;
}

.confirm-legend-card .legend-list {
  min-height: 0;
  overflow: auto;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding-right: 8px;
  padding-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.legend-text {
  display: grid;
  gap: 2px;
}

.legend-code {
  font-weight: 800;
  font-size: 11px;
}

.legend-count {
  font-size: 10px;
  color: var(--text-soft);
}

.make-top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 12px;
  flex-wrap: wrap;
}

.tool-chip {
  min-height: 40px;
}

.tool-pin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.tool-pin-label {
  white-space: nowrap;
}

.tool-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.tool-zoom-group .small-btn {
  min-width: 40px;
  min-height: 36px;
}

.save-hint {
  margin-left: auto;
  font-size: 12px;
}

.make-shell {
  height: calc(100% - 52px);
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

.make-board {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: 32px minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  isolation: isolate;
  contain: layout paint;
}

.axis-corner,
.axis-top,
.axis-left {
  background: rgba(10, 13, 19, 0.9);
}

.axis-corner {
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.axis-top {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.axis-left {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.axis-track {
  position: relative;
}

.axis-label {
  position: absolute;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.axis-label.active {
  color: var(--mint);
}

.axis-guide {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
}

.axis-guide.col {
  width: 1px;
  top: 0;
  bottom: 0;
}

.axis-guide.row {
  height: 1px;
  left: 0;
  right: 0;
}

.make-board.strong-guides .axis-corner,
.make-board.strong-guides .axis-top,
.make-board.strong-guides .axis-left {
  border-color: transparent;
}

.make-board.strong-guides .axis-guide {
  background: rgba(255, 255, 255, 0.32);
}

.make-scroll {
  grid-column: 2;
  grid-row: 2;
  overflow: auto;
  background: #0f131b;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  overscroll-behavior: contain;
  cursor: grab;
  touch-action: none;
}

.make-scroll.dragging {
  cursor: grabbing;
  user-select: none;
}

.make-scroll.locked {
  cursor: default;
}

.make-stage {
  position: relative;
  width: max-content;
  height: max-content;
  max-width: none;
  max-height: none;
}

#makeCanvas {
  display: block;
}

.make-sidebar {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.mark-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact {
  margin-top: 10px;
}

.number-shell {
  margin-top: 12px;
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 168px;
  overflow: auto;
}

.number-btn {
  min-width: 40px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-weight: 700;
}

.number-btn.done {
  background: rgba(142, 240, 203, 0.18);
  border-color: rgba(142, 240, 203, 0.4);
  color: #baf5dd;
}

.number-btn.done.col {
  background: rgba(120, 180, 255, 0.16);
  border-color: rgba(120, 180, 255, 0.36);
  color: #acd1ff;
}

.mark-bar {
  margin-top: 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.mark-tags,
.mark-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mark-tags {
  margin-bottom: 8px;
}

.mark-tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mark-tag.row { background: rgba(142, 240, 203, 0.14); color: #baf5dd; }
.mark-tag.col { background: rgba(120, 180, 255, 0.14); color: #c0dfff; }
.mark-tag.bead { background: rgba(246, 207, 104, 0.16); color: #ffe49c; cursor: default; }

.mark-progress span {
  font-size: 12px;
  color: var(--text-soft);
}

.muted-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.006));
}

.stack-actions {
  display: grid;
  gap: 10px;
}

.stack-actions-inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-legend {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  margin-top: 14px;
}

.studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.02));
}

.footer-actions {
  display: flex;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(12, 15, 21, 0.92);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  z-index: 30;
}

@media (min-width: 981px) {
  #homeView .scroll-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 14px;
    align-content: start;
  }

  #homeView .scroll-shell > .card {
    margin-top: 0;
  }

  .hero-card-home {
    min-height: 100%;
  }

  #homeView .scroll-shell:has(#homeRecentCard.hidden) .hero-card-home {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .flow-card {
    grid-column: 1 / -1;
    align-self: start;
  }

  #step1Panel .scroll-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 360px);
    gap: 14px;
    align-content: start;
  }

  #step1Panel .scroll-shell > .card {
    margin-top: 0;
  }

  #step1Panel .scroll-shell > .card:first-child {
    grid-row: 1 / span 3;
  }

  .confirm-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
  }

  .confirm-preview-shell {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .confirm-stats {
    grid-column: 2;
    grid-row: 1;
  }

  .confirm-legend-card {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
  }

  .confirm-legend-card .legend-list {
    flex: 1;
  }
}

@media (max-width: 1100px) {
  .make-shell {
    grid-template-columns: 1fr;
  }

  .make-sidebar {
    max-height: 38vh;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .app-header,
  .mode-nav,
  .stepbar,
  .make-top-tools,
  .studio-footer,
  .scroll-shell,
  .confirm-layout,
  .make-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-card-home h2 {
    max-width: none;
  }

  .stepbar {
    margin: 0 16px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-item {
    grid-template-columns: 1fr;
  }

  .record-thumb {
    width: 100%;
    height: 170px;
  }

  .flow-list {
    grid-template-columns: 1fr;
  }

  .record-open,
  .secondary-btn,
  .primary-btn,
  .link-btn {
    width: 100%;
  }

  .records-actions .primary-btn,
  .records-actions .secondary-btn {
    flex-basis: 100%;
  }

  .make-top-tools {
    flex-wrap: wrap;
  }

  .save-hint {
    margin-left: 0;
  }

  .tool-zoom-group {
    order: 3;
  }

  .stack-actions-inline {
    grid-template-columns: 1fr;
  }
}
