/* ==========================================================================
   拼豆站点 · 页面级样式
   遵守规范：色块墙与大留白交替、连续高饱和 ≤2 屏、只用一道顶部高光
   ========================================================================== */

/* ─────────────────────────────────────────── 第一层：色块墙
     高度刻意压到 46vh：下方必须立即进入大留白，
     避免触犯「连续两屏高饱和」的红线（规范 §5.2） */
.wall {
  position: relative;
  height: 46vh;
  min-height: 340px;
  max-height: 500px;
  background: var(--color-bg-sunken);
  overflow: hidden;
}
.wall-cv { width: 100%; height: 100%; display: block; }
.wall-fade {
  position: absolute; inset: auto 0 0 0; height: 90px;
  background: linear-gradient(to bottom, transparent, var(--color-bg-page));
  pointer-events: none;
}
.wall-bar {
  position: absolute; inset: auto 0 0 0;
  padding-bottom: var(--space-5);
}
.wall-bar-in {
  display: flex; align-items: flex-end; gap: var(--space-6);
  flex-wrap: wrap;
}
.wall-stat { display: flex; flex-direction: column; gap: 2px; }
.wall-stat b {
  font-size: var(--text-h2); line-height: 1; letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.wall-stat span { font-size: var(--text-xs); color: var(--color-text-tertiary); }
.wall-stat-act { margin-left: auto; }
.wall-stat-act .btn {
  background: var(--color-brand); color: var(--color-text-inverse);
  border: 0.5px solid transparent;
  box-shadow: var(--highlight), 0 2px 0 rgba(45,42,36,0.14);
}
.wall-stat-act .btn .ring-icon { color: currentColor; }

/* ─────────────────────────────────────────── 第二层：大留白 + 上传区 */
.maker { padding: var(--space-12) 0; }
.maker-head { max-width: 640px; margin-bottom: var(--space-8); }
.maker-h1 {
  font-size: var(--text-display); line-height: 1.25; letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.maker-sub { font-size: var(--text-h3); color: var(--color-text-secondary); line-height: 1.6; }

.drop {
  position: relative;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-large);
  background: var(--color-bg-surface);
  transition: border-color var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.drop:hover { border-color: var(--color-action); }
.drop.hot { border-color: var(--color-action); border-style: solid; }
.drop:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.drop-in {
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-8) var(--space-6);
  min-height: 148px;
}
.drop-ring { color: var(--color-action); flex: none; }
.drop-txt { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.drop-txt b { font-size: var(--text-h3); font-weight: 600; }
.drop-txt span { font-size: var(--text-sm); color: var(--color-text-secondary); }
.drop-mask {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--color-bg-surface); border-radius: var(--radius-large);
}
.drop-mask b { font-size: var(--text-h2); color: var(--color-action); }
.drop-mask span { font-size: var(--text-sm); color: var(--color-text-secondary); }
.drop.hot .drop-mask { display: flex; }
.drop.hot .drop-in { opacity: 0; }

.maker-ticks {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5); margin-top: var(--space-8);
}
.maker-ticks li {
  display: flex; align-items: flex-start; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.6;
}
.maker-ticks .ring-icon { color: var(--color-action); margin-top: 2px; }

/* ─────────────────────────────────────────── 第三层：色相色带 */
.band-sec { padding: 0 0 var(--space-10); }
.band {
  width: 100vw; margin-left: calc(50% - 50vw);
  overflow: hidden;
}
.band-inner { display: flex; height: 88px; }
.band-c {
  flex: 1 1 0; min-width: 3px; height: 100%;
  transition: transform var(--dur-fast) var(--ease-out);
}
.band-c:hover { transform: scaleY(1.14); }
.band-foot { margin-top: var(--space-3); }
.band-foot .note-inline { font-size: var(--text-xs); color: var(--color-text-hint); }

/* ─────────────────────────────────────────── 通用区块 */
.sec { padding: var(--space-10) 0; }
.sec-sunken {
  background: var(--color-bg-sunken);
  border-top: 0.5px solid var(--color-border);
  border-bottom: 0.5px solid var(--color-border);
}

/* 图纸卡片网格 —— 桌面 4 / 平板 3 / 移动 2 */
.pgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
/* hidden 属性优先级低于 display:grid，需显式声明 */
.pgrid[hidden], .pal-grid[hidden] { display: none; }

/* ─────────────────────────────────────────── 步骤 */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
.steps li {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-text-primary);
}
.steps .step-n { font-size: var(--text-xs); color: var(--color-action); font-weight: 600; }
.steps b { font-size: var(--text-h3); font-weight: 600; }
.steps p { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.7; }

/* ─────────────────────────────────────────── 色卡体系卡 */
.sysgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.syscard { display: flex; flex-direction: column; }
.syscard-top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 0.5px solid var(--color-border);
}
.syscard-top b { font-size: var(--text-h3); font-weight: 600; }
.syscard-top span { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-tertiary); }
.sysstrip { display: flex; height: 56px; }
.sysstrip i { flex: 1 1 0; }
.syscard p {
  padding: var(--space-3) var(--space-4) var(--space-4);
  font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.6;
  flex: 1;
}

/* ══════════════════════════════════════════════════════════════════
   图纸库页
   ══════════════════════════════════════════════════════════════════ */
.page { padding: var(--space-8) 0 var(--space-10); }
.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-6); flex-wrap: wrap; }
.page-hd h1 { font-size: var(--text-h1); letter-spacing: -0.02em; }
.page-hd .sub { font-size: var(--text-sm); color: var(--color-text-secondary); margin-top: var(--space-1); }

.filters {
  position: sticky; top: var(--header-h); z-index: var(--z-sticky);
  background: var(--color-bg-page);
  border-bottom: 0.5px solid var(--color-border);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-6);
}
.filters-in { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 0.5px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  font-size: var(--text-sm); color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--color-text-hint); color: var(--color-text-primary); }
.chip.on {
  background: var(--color-text-primary); color: var(--color-bg-surface);
  border-color: var(--color-text-primary); font-weight: 500;
}
.chip .ring-icon { width: 10px; height: 10px; border-width: 1.5px; }
.filters .input { width: 220px; height: 32px; }
.filters .select { width: auto; height: 32px; }

/* 图纸卡 */
.pcard {
  display: flex; flex-direction: column;
  background: var(--color-bg-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-large);
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.pcard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-cell-hover);
  text-decoration: none;
}
.pcard:hover .pcard-cv { opacity: 1; }
.pcard-cv {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-bg-sunken);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-3);
}
.pcard-cv canvas { display: block; }
.pcard-tag {
  position: absolute; top: var(--space-2); left: var(--space-2);
}
.pcard-meta {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-3) 0;
}
.pcard-title {
  font-size: var(--text-h3); font-weight: 600; padding: 0 var(--space-3);
  margin-top: var(--space-1);
}
.pcard-sub {
  display: flex; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-2) var(--space-3) var(--space-3);
  font-size: var(--text-xs); color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}
.pcard-sub em { font-style: normal; color: var(--color-action); }
.pcard-strip { display: flex; height: 6px; margin-top: auto; }
.pcard-strip i { flex: 1 1 0; }

/* ══════════════════════════════════════════════════════════════════
   生成页
   ══════════════════════════════════════════════════════════════════ */
.gen {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  gap: var(--space-5);
  align-items: start;
}
.gen-side {
  position: sticky; top: calc(var(--header-h) + var(--space-4));
  display: flex; flex-direction: column; gap: var(--space-4);
  max-height: calc(100vh - var(--header-h) - var(--space-8));
  overflow-y: auto;
  padding-right: 2px;
}
.panel-t {
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
}
.panel-t .ring-icon { color: var(--color-action); }

.seg { display: flex; gap: 0; border: 0.5px solid var(--color-border-strong); border-radius: var(--radius-default); overflow: hidden; }
.seg button {
  flex: 1; height: 36px; border: 0; background: var(--color-bg-surface);
  font-size: var(--text-sm); color: var(--color-text-secondary); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 var(--space-2);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.seg button + button { border-left: 0.5px solid var(--color-border); }
.seg button.on { background: var(--color-brand); color: #fff; font-weight: 500; }
.seg button:hover:not(.on) { background: var(--color-bg-raised); }

.rangerow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.rangerow .v { font-family: var(--font-mono); font-size: var(--text-code); font-weight: 600; }

.stage {
  background: var(--color-bg-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-large);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.stage-bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 0.5px solid var(--color-border);
  flex-wrap: wrap;
  min-height: 48px;
}
.stage-bar .sep { width: 0.5px; height: 20px; background: var(--color-border); }
.stage-bar .spacer { flex: 1; }
.stage-bar .seg { flex: none; }
.stage-bar .seg button { height: 28px; font-size: var(--text-xs); }
.stage-bar .select { padding: 4px 8px; font-size: var(--text-xs); }
.zoom { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-tertiary); }
.zoom button {
  width: 28px; height: 28px; border: 0.5px solid var(--color-border);
  background: var(--color-bg-surface); border-radius: var(--radius-default);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.zoom button:hover { border-color: var(--color-text-hint); }

.canvas-wrap {
  position: relative;
  padding: var(--space-5);
  background: var(--color-bg-raised);
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
  min-height: 420px;
  max-height: 66vh;
  background-image: var(--color-border-dashed);
  background-size: 12px 12px;
}
.canvas-wrap.invert {
  background-color: var(--color-text-primary);
  background-image: none;
}
.canvas-wrap canvas { display: block; box-shadow: 0 0 0 0.5px var(--color-border); }
.canvas-wrap .drop-anim { --mask-bg: var(--color-bg-raised); }

.stage-foot {
  padding: var(--space-2) var(--space-3);
  border-top: 0.5px solid var(--color-border);
  font-size: var(--text-xs); color: var(--color-text-tertiary);
  display: flex; gap: var(--space-4); flex-wrap: wrap;
}
.stage-foot b { font-family: var(--font-mono); color: var(--color-text-primary); font-weight: 600; }

/* 进度：显示计数，禁用进度条（规范 §4.5） */
.prog-line {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  font-size: var(--text-sm);
}
.prog-dots { display: flex; gap: 3px; }
.prog-dots i {
  width: 8px; height: 8px; border-radius: var(--radius-full);
  background: var(--color-bg-sunken); border: 0.5px solid var(--color-border);
  transition: background var(--dur-fast) var(--ease-out);
}
.prog-dots i.on { background: var(--color-brand); }
.prog-dots i.done { background: var(--color-success); }

/* 色号表 */
.bom { max-height: 40vh; overflow: auto; }
.chipswatch { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.swatchchip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 8px 0 4px;
  border: 0.5px solid var(--color-border); border-radius: var(--radius-cell);
  background: var(--color-bg-surface); cursor: pointer;
  font-family: var(--font-mono); font-size: var(--text-xs);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.swatchchip:hover { border-color: var(--color-action); }
.swatchchip.on { border-color: var(--color-action); border-width: 1px; background: var(--color-bg-raised); }
.swatchchip i {
  width: 16px; height: 16px; border-radius: var(--radius-cell); flex: none;
  box-shadow: var(--highlight);
}

/* ══════════════════════════════════════════════════════════════════
   图纸详情页
   ══════════════════════════════════════════════════════════════════ */
.detail {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-6); align-items: start;
}
.detail-main { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.detail-side { position: sticky; top: calc(var(--header-h) + var(--space-4)); display: flex; flex-direction: column; gap: var(--space-4); }

.crumbs { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-tertiary); margin-bottom: var(--space-4); }
.crumbs a { color: var(--color-text-tertiary); }
.crumbs a:hover { color: var(--color-text-primary); }

.detail-hd { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.detail-hd h1 { font-size: var(--text-h1); letter-spacing: -0.02em; }
.detail-hd .meta { display: flex; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-sm); color: var(--color-text-tertiary); font-family: var(--font-mono); }

.prog-ring { display: flex; align-items: center; gap: var(--space-4); }
.prog-ring-n { font-family: var(--font-mono); font-size: var(--text-h1); font-weight: 600; line-height: 1; }

.bar { height: 6px; border-radius: var(--radius-full); background: var(--color-bg-sunken); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--color-brand); transition: width var(--dur-slow) var(--ease-out); }

/* ══════════════════════════════════════════════════════════════════
   色卡页
   ══════════════════════════════════════════════════════════════════ */
.pal-tools {
  position: sticky; top: var(--header-h); z-index: var(--z-sticky);
  background: var(--color-bg-page); border-bottom: 0.5px solid var(--color-border);
  padding: var(--space-3) 0; margin-bottom: var(--space-5);
}
.pal-tools-in { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.pal-tools-in .seg { flex: 1 1 320px; min-width: 0; }
.pal-tools-in .input { flex: 0 1 200px; min-width: 150px; }
.pal-tools-in .select { flex: 0 0 auto; }
.pal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--space-3);
}
.pal {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-default);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.pal:hover { transform: translateY(-2px); border-color: var(--color-text-hint); }
.pal-sw {
  width: 44px; height: 44px; border-radius: var(--radius-cell);
  flex: none; box-shadow: var(--highlight);
  position: relative;
}
.pal-sw b {
  position: absolute; inset: auto 0 3px 0; text-align: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: -0.02em;
}
.pal-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pal-txt .code { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; }
.pal-txt .nm { font-size: var(--text-xs); color: var(--color-text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-txt .hex { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-hint); }

/* 色卡详情弹层 */
.sheet {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(45, 42, 36, 0.42);
}
.sheet.open { display: flex; }
.sheet-in {
  background: var(--color-bg-surface);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  width: 100%; max-width: 680px;
  max-height: 88vh; overflow: auto;
  padding: var(--space-5);
  box-shadow: var(--shadow-sheet);
  animation: sheet-up var(--dur-base) var(--ease-out);
}
@keyframes sheet-up { from { transform: translateY(20px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 40px; height: 4px; border-radius: var(--radius-full); background: var(--color-border-strong); margin: 0 auto var(--space-4); }
.sheet-x { position: absolute; top: var(--space-4); right: var(--space-4); }

.cross { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-top: var(--space-3); }
.cross div {
  padding: var(--space-2); border: 0.5px solid var(--color-border);
  border-radius: var(--radius-default); text-align: center;
}
.cross div b { display: block; font-family: var(--font-mono); font-size: var(--text-sm); }
.cross div span { font-size: 12px; color: var(--color-text-tertiary); }
.cross div i { display: block; height: 34px; border-radius: var(--radius-cell); margin-bottom: 6px; }

/* ══════════════════════════════════════════════════════════════════
   响应式
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1279px) {
  .gen { grid-template-columns: 290px minmax(0, 1fr); }
  .gen-side.right { grid-column: 1 / -1; position: static; max-height: none; }
}

@media (max-width: 1023px) {
  .pgrid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .sysgrid { grid-template-columns: repeat(2, 1fr); }
  .maker-ticks { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

@media (max-width: 767px) {
  .wall { height: 46vh; min-height: 320px; }
  .wall-bar-in { gap: var(--space-4); }
  .wall-stat-act { margin-left: 0; width: 100%; }
  .wall-stat-act .btn { width: 100%; }
  .wall-stat b { font-size: var(--text-h2); }
  .maker { padding: var(--space-8) 0; }
  .drop-in { flex-direction: column; text-align: center; padding: var(--space-6) var(--space-4); gap: var(--space-4); }
  .drop-actions, .drop-actions .btn { width: 100%; }
  .maker-ticks { grid-template-columns: 1fr; gap: var(--space-3); }
  .band-inner { height: 120px; }
  .band { display: none; }
  .band-sec .band + .band-foot { display: none; }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .steps { grid-template-columns: 1fr; }
  .sysgrid { grid-template-columns: 1fr; }
  .gen { grid-template-columns: 1fr; }
  .canvas-wrap { padding: var(--space-3); min-height: 300px; max-height: 56vh; }
  .filters-in { gap: var(--space-2); }
  .filters .input { width: 100%; }
  .pal-grid { grid-template-columns: repeat(2, 1fr); }
  .cross { grid-template-columns: repeat(2, 1fr); }
  .page-hd { gap: var(--space-3); }
}

/* 移动端色带纵向版 */
.band-v { display: none; }
@media (max-width: 767px) {
  .band-v {
    overflow: hidden;
    display: flex; width: 100vw; margin-left: calc(50% - 50vw);
    height: 320px;
  }
  .band-v .band-c {
    flex: 1 1 0; height: 100%; width: 3px;
  }
}

/* 拖拽高度要求 ≥56px（规范 §3.3）——已在 .drop-in min-height 保证 */
/* Accessibility and safe overflow for small screens and enlarged grids. */
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 9999; padding: 12px 18px; background: var(--color-bg-surface); border: 2px solid var(--color-brand); border-radius: 4px; }
.skip-link:focus { top: 12px; }
main { min-width: 0; }
.modal-open { overflow: hidden; }
.canvas-wrap { align-items: safe center; justify-content: safe center; }
.canvas-wrap canvas { flex: none; }
.stage { min-width: 0; }
.stage[aria-busy="true"] { cursor: progress; }
button:disabled { opacity: .55; cursor: wait; }
.toast-wrap { width: max-content; max-width: calc(100vw - 32px); bottom: max(24px, env(safe-area-inset-bottom)); }
.toast { overflow-wrap: anywhere; }
.sheet-in { padding-top: 64px; }
@media (max-width: 767px) {
  .stage-bar { gap: 8px; }
  .stage-bar .btn { min-height: 40px; }
  .zoom button { min-width: 36px; min-height: 36px; }
  .swatchchip { min-height: 36px; }
  .bom, .panel { min-width: 0; }
  .bom { overflow-x: auto; }
  .sheet-in { max-height: 85dvh; }
}

.material-hint { font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 12px; }
.gen-side.right .tbl { font-size: var(--text-xs); }
.gen-side.right .tbl th, .gen-side.right .tbl td { padding: 8px 6px; }
.stage-bar .seg button { min-width: 76px; }

@media (max-width: 767px) {
  .hdr-cta { margin-left: auto; }
  .nav { visibility: hidden; }
  .nav.open { visibility: visible; }
}

/* Batch export */
.batch-section { padding-top: 32px; }
.batch-heading, .batch-actions, .batch-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.batch-heading > div { flex: 1; min-width: 180px; }
.batch-heading h2 { font-size: var(--text-h2); }
.batch-list { display: grid; gap: 8px; max-height: 240px; overflow: auto; margin: 16px 0; }
.batch-list li { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--color-border); padding-bottom: 8px; }
.batch-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.batch-item-status { font-size: var(--text-xs); color: var(--color-text-secondary); max-width: 45%; }
.batch-options { margin-bottom: 12px; }
.batch-options .select { width: auto; max-width: 100%; }
.batch-options label { display: flex; align-items: center; gap: 6px; }
.batch-actions [role="status"] { font-size: var(--text-sm); overflow-wrap: anywhere; }
.drop[aria-disabled="true"] { pointer-events: none; opacity: .55; }
.gen-side .field { margin-bottom: 12px; }
@media (max-width: 767px) {
  .batch-options { align-items: flex-start; }
  .batch-actions .btn { width: 100%; }
  .batch-list li { flex-wrap: wrap; }
  .batch-name { flex-basis: 100%; }
  .batch-item-status { max-width: none; flex: 1; }
}

@media (max-width: 767px) {
  .gen-side { position: static; max-height: none; overflow: visible; padding-right: 0; }
}

/* Direct bead editor */
.editor-entry { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:12px; margin-top:24px; }
.editor-entry span, #editStatus { font-size:var(--text-xs); color:var(--color-text-secondary); }
.editor-bar .seg { flex-wrap:wrap; }
.editor-bar .seg button { min-width:52px; }
.edit-palette { display:flex; flex-wrap:wrap; gap:6px; max-height:240px; overflow-y:auto; padding:4px 2px; }
.edit-palette .swatchchip { min-height:36px; }
.canvas-wrap canvas.editing { touch-action:none; user-select:none; }
#editSelected { margin:12px 0; }
@media (max-width:600px) {
  .editor-bar .seg { width:100%; }
  .editor-bar .seg button { min-height:40px; }
  .edit-palette { max-height:180px; }
}

@media (max-width: 760px) {
  .direct-edit .stage { order: 0; }
  .direct-edit .gen-side.right { order: 1; }
  .direct-edit .gen-side.left { order: 2; }
}

/* Studio edition: large editorial rhythm around a precise, useful workspace. */
.btn { background: var(--color-action); box-shadow: none; border-radius: 6px; font-weight: 600; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:disabled:hover { transform: none; }
.btn.ghost { color: var(--color-text-link); }
.hdr-in { gap: 48px; }
.logo { gap: 10px; font-size: 23px; }
.logo .ring-icon { border-width: 5px; }
.logo .ring-icon::after { display: none; }
.nav { justify-content: center; gap: 12px; }
.nav a { position: relative; border-radius: 0; }
.nav a.on { color: var(--color-text-primary); background: transparent; }
.nav a.on::after { content: ''; position: absolute; bottom: 0; left: 12px; right: 12px; height: 2px; background: var(--color-brand); }
.hdr-cta .btn { height: 40px; }
.page-hd { padding: 20px 0 28px; border-bottom: 1px solid var(--color-border-strong); }
.page-hd h1 { font-size: clamp(28px, 3vw, 44px); letter-spacing: -.045em; }
.page-hd .sub { max-width: 680px; line-height: 1.8; margin-top: 12px; }
.panel { background: var(--color-bg-surface); }
.pcard { border-radius: 8px; }
.pcard:hover { border-color: var(--color-border-strong); }
.pcard-cv { background: var(--color-bg-raised); }
.pcard-cv canvas { max-width: 100%; height: auto; }
.chip, .seg button { min-height: 40px; }
.seg button.on { background: var(--color-action); }
.skip-link:focus { top: 8px; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }
.studio-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 7%; padding-top: 52px; padding-bottom: 60px; align-items: center; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .13em; font-weight: 500; color: var(--color-text-secondary); line-height: 1.6; }
.status-dot { display: inline-block; height: 7px; width: 7px; border-radius: 50%; background: var(--color-brand); margin-right: 8px; }
.hero-copy h1 { font-size: clamp(58px, 6.4vw, 92px); line-height: 1.12; font-weight: 600; letter-spacing: -.065em; margin: 26px 0; }
.hero-copy h1 span { color: var(--color-brand); }
.hero-description { font-size: 16px; line-height: 1.9; color: var(--color-text-secondary); }
.hero-actions { display: flex; align-items: center; gap: 26px; margin-top: 30px; }
.hero-primary { height: 52px; padding: 0 24px; gap: 32px; }
.hero-primary span { font-size: 22px; font-weight: 400; }
.hero-link { color: var(--color-text-primary); font-size: 14px; padding: 12px 0; border-bottom: 1px solid var(--color-border-strong); }
.hero-link span { margin-left: 16px; }
.hero-note { font-size: 12px; color: var(--color-text-tertiary); margin-top: 18px; }
.hero-art { align-self: center; min-width: 0; border: 1px solid var(--color-border-strong); border-radius: 4px; background: var(--color-bg-raised); padding: 22px; position: relative; }
.art-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .06em; color: var(--color-text-secondary); }
.art-label { font-size: 12px; letter-spacing: 0; }
.bead-stage { aspect-ratio: 1; margin: 12px 0; }
.bead-stage canvas { width: 100%; height: 100%; }
.art-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.art-controls > div:first-child { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.art-caption { font-size: 12px; color: var(--color-text-secondary); }
.study-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--color-border-strong); border-radius: 6px; }
.study-switch button { border: 0; padding: 0 16px; min-height: 38px; background: transparent; border-radius: 3px; cursor: pointer; font-size: 12px; }
.study-switch button[aria-pressed="true"] { background: var(--color-text-primary); color: var(--color-bg-surface); }
.art-remix { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12px; color: var(--color-text-secondary); min-height: 26px; align-items: center; }
.studio-facts { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr) 1.5fr; align-items: center; gap: 24px; padding-top: 26px; padding-bottom: 26px; border-top: 1px solid var(--color-border-strong); border-bottom: 1px solid var(--color-border-strong); }
.studio-facts p { font-size: 13px; color: var(--color-text-secondary); }
.studio-facts p b { font-weight: 500; color: var(--color-text-primary); }
.studio-facts > div { display: flex; flex-direction: column; gap: 3px; }
.studio-facts > div b { font-size: 27px; font-weight: 400; letter-spacing: -.05em; line-height: 1.3; }
.studio-facts > div span { font-size: 12px; color: var(--color-text-secondary); }
.studio-facts > a { color: var(--color-text-primary); font-size: 12px; display: flex; justify-content: space-between; gap: 14px; }
.home-studio .maker { padding: 100px 0 90px; }
.home-studio .maker-head { max-width: 760px; margin-bottom: 32px; }
.home-studio .maker-head .eyebrow { margin-bottom: 20px; }
.home-studio .maker-h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.3; font-weight: 500; }
.home-studio .maker-sub { font-size: 15px; }
.home-studio .drop { border-radius: 6px; border-style: solid; border-color: var(--color-border-strong); }
.home-studio .drop:hover { border-color: var(--color-action); }
.home-studio .drop-in { min-height: 156px; }
.home-studio .drop-ring { color: var(--color-action); }
.home-studio .maker-ticks { gap: 24px; }
.home-studio .maker-ticks .ring-icon { width: 14px; height: 14px; margin-top: 3px; }
.home-studio .sec { padding: 80px 0; }
.home-studio .sec-head { margin-bottom: 36px; }
.home-studio .sec-head .eyebrow { margin-bottom: 12px; }
.home-studio .sec-head h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.04em; }
.home-studio .sec-head .sub { font-size: 14px; max-width: 640px; }
.home-studio .band-sec { padding: 64px 0 56px; background: var(--color-text-primary); color: var(--color-bg-page); }
.home-studio .band-sec .eyebrow, .home-studio .band-sec .sub, .home-studio .band-sec .note-inline { color: var(--color-bg-sunken); }
.home-studio .band-sec .btn { background: transparent; border-color: var(--color-bg-sunken); color: var(--color-bg-page); }
.home-studio .band-inner { height: 112px; }
.home-studio .band-foot { margin-top: 20px; }
.home-studio .pgrid { gap: 24px; }
.home-studio .pcard { background: transparent; border: 0; border-radius: 0; }
.home-studio .pcard-cv { border: 1px solid var(--color-border); border-radius: 4px; }
.home-studio .pcard-cv canvas { width: 78%; image-rendering: pixelated; }
.home-studio .pcard-title, .home-studio .pcard-meta, .home-studio .pcard-sub { padding-left: 0; }
.home-studio .pcard-strip { height: 3px; margin-top: 12px; }
.home-studio .steps { gap: 30px; }
.home-studio .steps .step-n { font-size: 34px; font-weight: 400; color: var(--color-text-tertiary); margin-bottom: 18px; }
.home-studio .steps b { font-size: 20px; font-weight: 500; }
.home-studio .steps li { border-top: 1px solid var(--color-border-strong); padding-top: 24px; }
.home-studio .syscard { border-radius: 4px; }
.home-studio .sec-sunken { padding-bottom: 88px; }
.home-studio .ftr { margin-top: 0; }
@media(min-width: 768px) { .hdr-cta { margin-left: auto; } }
@media(max-width: 1023px) {
  .studio-hero { gap: 5%; padding-top: 40px; }
  .hero-copy h1 { font-size: 66px; }
  .hero-art { padding: 16px; }
  .art-label { display: none; }
  .studio-facts { grid-template-columns: 1.3fr repeat(3, 1fr); }
  .studio-facts > a { display: none; }
  .nav { gap: 0; }
  .hdr-in { gap: 20px; }
}
@media(max-width: 767px) {
  :root { --header-h: 64px; }
  .hdr-in { justify-content: space-between; }
  .nav { align-items: stretch; }
  .nav a.on::after { left: 12px; right: auto; width: 24px; }
  .studio-hero { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; padding-bottom: 32px; }
  .hero-copy h1 { font-size: clamp(54px, 12vw, 76px); margin: 22px 0; }
  .hero-description { font-size: 14px; }
  .hero-actions { gap: 24px; margin-top: 24px; }
  .hero-art { padding: 16px; }
  .art-label { display: inline; }
  .studio-facts { grid-template-columns: repeat(3, 1fr); gap: 16px; padding-top: 20px; padding-bottom: 20px; margin: 0 16px; }
  .studio-facts p { display: none; }
  .studio-facts > div b { font-size: 26px; }
  .home-studio .maker { padding: 64px 0; }
  .home-studio .drop-in { padding: 24px 20px; gap: 18px; }
  .home-studio .drop-txt b { font-size: 16px; }
  .home-studio .maker-ticks { grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
  .home-studio .sec { padding: 56px 0; }
  .home-studio .band-sec { padding: 48px 0 36px; }
  .home-studio .band-inner { height: 80px; }
  .home-studio .band { display: block; width: 100%; margin-left: 0; }
  .home-studio .band-v { display: none; }
  .home-studio .band-c { min-width: 0; }
  .home-studio .pgrid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .home-studio .steps { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .home-studio .steps .step-n { margin-bottom: 8px; }
  .home-studio .sec-head { margin-bottom: 28px; }
  .home-studio .sysgrid { grid-template-columns: 1fr 1fr; }
  .home-studio .sec-sunken { padding-bottom: 56px; }
}
/* Small controls keep a comfortable touch target. */
.study-switch button { min-height: 44px; }
.art-remix { min-height: 44px; }
:focus-visible { outline-color: var(--color-secondary-dark); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--color-secondary-dark); outline-offset: 2px; }
@media (min-width: 768px) and (max-width: 1023px) {
  .home-studio .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
