:root {
  --bg: #f4f6f5;
  --panel: #ffffff;
  --ink: #10231e;
  --sub: #53645f;
  --line: #dce4e1;
  --accent: #147a63;
  --accent-2: #e8f3f0;
  --warning: #b65911;
  --danger: #a83131;
  --shadow: 0 12px 32px rgba(20, 44, 38, .07);
  --radius: 18px;
  --paper-work-height: min(62vh, 680px);
}
* { box-sizing: border-box; }
html { font-family: var(--world-font-sans); color: var(--ink); background: var(--world-page-background, var(--bg)); }
body { margin: 0; }
button, input, textarea { font: inherit; }
.topbar { height: 70px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 max(calc((100vw - 1200px) / 2), 24px); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; gap: 13px; align-items: center; }
.brand-mark { width: 34px; height: 38px; border: 2px solid var(--accent); border-radius: 6px; position: relative; background: var(--panel); }
.brand-mark::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.brand strong { display: block; font-size: 20px; line-height: 1; }
.brand div span { color: var(--sub); font-size: 12px; display: block; margin-top: 4px; }
.badge { padding: 8px 13px; border-radius: 999px; background: var(--accent-2); color: var(--accent); font-size: 12px; font-weight: 700; }
.shell { max-width: 1200px; margin: 28px auto 50px; padding: 0 24px; display: grid; gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 26px; box-shadow: var(--shadow); }
.hero { display: grid; grid-template-columns: minmax(360px, 1.2fr) minmax(280px, .8fr); gap: 36px; padding: 38px; }
.eyebrow { letter-spacing: .14em; color: var(--accent); font-size: 11px; font-weight: 800; margin: 0 0 10px; }
h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.18; margin: 0 0 16px; letter-spacing: -.04em; }
h2 { font-size: 23px; margin: 0; letter-spacing: -.03em; }
.lead { color: var(--sub); line-height: 1.85; margin: 0; max-width: 610px; }
.privacy-card { background: #f0f6f4; border-radius: 14px; padding: 23px; }
.privacy-card h2 { font-size: 18px; margin-bottom: 12px; }
.privacy-card p { line-height: 1.7; font-size: 14px; margin: 0 0 12px; }
.privacy-card .minor { font-size: 12px; color: var(--sub); margin-bottom: 0; }
.workflow { display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.step { height: 38px; padding: 0 18px; border-radius: 20px; display: inline-flex; align-items: center; font-size: 13px; color: var(--sub); border: 1px solid var(--line); background: white; }
.step.active { color: var(--accent); background: var(--accent-2); border-color: #bddeD6; font-weight: 700; }
.line { width: 34px; height: 1px; background: var(--line); }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 20px; }
.dropzone { min-height: 185px; border: 2px dashed #b4cfca; border-radius: 14px; background: #fbfcfc; display: grid; place-content: center; text-align: center; gap: 10px; cursor: pointer; transition: border-color .18s, background .18s; }
.dropzone.drag, .dropzone:hover { border-color: var(--accent); background: var(--accent-2); }
.dropzone strong { font-size: 19px; }
.dropzone span { color: var(--sub); }
.dropzone small { color: var(--sub); font-size: 12px; margin-top: 6px; }
.source-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.source-item { width: 152px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fafbfb; }
.source-item canvas { height: 92px; width: 100%; display: block; object-fit: contain; background: #26312e; }
.source-item span { display: block; padding: 8px; color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.demo-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.demo-actions .button { min-height: 40px; padding-inline: 13px; font-size: 13px; }
.actions.compact { margin-top: 0; }
.button { border-radius: 10px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; font-weight: 700; cursor: pointer; transition: opacity .15s, border-color .15s; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: white; background: var(--accent); }
.button.secondary { background: var(--accent-2); color: var(--accent); border-color: #c6ded8; }
.button.ghost { background: white; border-color: var(--line); color: var(--ink); }
.button:hover:not(:disabled) { opacity: .84; }
.hidden { display: none !important; }
.stats { color: var(--sub); font-size: 13px; text-align: right; }
.hint { color: var(--sub); font-size: 13px; margin: -8px 0 20px; }
.workspace-tools { display: grid; justify-items: end; gap: 10px; }
.strip-board { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 0; min-height: calc(var(--paper-work-height) + 112px); padding: 55px 15px 55px; background: #eef1ef; border-radius: 14px; border: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.strip-card { flex: 0 0 auto; padding: 0; background: transparent; border: 0; border-radius: 0; cursor: grab; display: block; overflow: visible; position: relative; line-height: 0; }
.strip-card.dragging { opacity: .35; }
.strip-card-controls { position: absolute; top: -43px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .14s ease, visibility .14s ease; }
.strip-card-footer { position: absolute; bottom: -43px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .14s ease, visibility .14s ease; }
.strip-card.is-selected .strip-card-controls,
.strip-card.is-selected .strip-card-footer { opacity: 1; visibility: visible; }
.strip-card canvas { display: block; width: auto; height: var(--paper-work-height); background: white; }
/* OCR用合成と同様に、接続部は1pxだけ寄せて背景由来の細線を残しにくくする。 */
.strip-boundary + .strip-card { margin-left: -1px; }
.strip-boundary { flex: 0 0 0; width: 0; height: var(--paper-work-height); position: relative; z-index: 4; }
.link-button { position: absolute; left: 0; top: calc(var(--paper-work-height) / 2 - 15px); transform: translateX(-50%); pointer-events: auto; width: 30px; height: 30px; border-radius: 999px; border: 1px solid #bdd8d1; background: rgba(255,255,255,.96); cursor: pointer; color: var(--accent); font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 6px rgba(0,0,0,.15); transition: background .15s, color .15s, transform .15s; }
.link-button:hover { background: var(--accent-2); transform: translateX(-50%) scale(1.05); }
.link-button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.trash-button, .restore-button { pointer-events: auto; min-height: 31px; min-width: 32px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.94); cursor: pointer; color: var(--sub); font-size: 16px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 5px rgba(0,0,0,.14); }
.trash-button:hover { color: var(--danger); border-color: #e0b0b0; background: #fff5f5; }
.restore-button { font-size: 12px; padding: 0 9px; color: var(--accent); background: var(--accent-2); border-color: #c6ded8; }
.excluded-panel { margin-top: 16px; border: 1px dashed #cfdbd7; border-radius: 12px; padding: 14px; background: #fafbfb; }
.excluded-head { display: flex; gap: 10px; align-items: center; margin-bottom: 5px; font-size: 14px; }
.excluded-head span { color: var(--sub); font-size: 12px; }
.excluded-panel p { color: var(--sub); font-size: 12px; margin: 0 0 12px; }
.excluded-board { display: flex; flex-wrap: wrap; gap: 10px; }
.excluded-card { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.excluded-card canvas { height: 88px; width: auto; background: #f0f2f2; display: block; opacity: .7; }
.processing-canvas { display: none; }
.preview-status { color: var(--accent); background: var(--accent-2); border: 1px solid #c6ded8; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 0 0 12px; }
.progress { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; margin-bottom: 12px; }
.progress div { height: 8px; border-radius: 4px; background: var(--accent); }
.progress span { color: var(--sub); font-size: 13px; }
textarea { width: 100%; height: 220px; resize: vertical; border-radius: 12px; border: 1px solid var(--line); padding: 16px; line-height: 1.7; color: var(--ink); }
textarea:focus { outline: 2px solid #b3d8ce; border-color: var(--accent); }
.guide h2 { margin-bottom: 20px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.guide-grid div { padding: 15px; background: #f6f8f7; border-radius: 11px; }
.guide-grid strong { color: var(--accent); }
.guide-grid p { font-size: 13px; line-height: 1.65; color: var(--sub); margin: 8px 0 0; }
.footer { border-top: 1px solid var(--line); text-align: center; color: var(--sub); font-size: 12px; padding: 25px; }
@media (max-width: 800px) {
  .topbar { padding-inline: 16px; }
  .shell { padding: 0 12px; }
  .hero { grid-template-columns: 1fr; padding: 25px; }
  .panel { padding: 18px; }
  .workflow { overflow-x: auto; justify-content: start; }
  .guide-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .demo-actions { width: 100%; justify-content: stretch; }
  .demo-actions .button { flex: 1 1 auto; }
  .workspace-tools { justify-items: start; width: 100%; }
  :root { --paper-work-height: min(52vh, 470px); }
}

/* Text recognition and workspace */
.ocr-head { align-items: end; }
.ocr-controls { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.ocr-controls label { display: grid; gap: 6px; color: var(--sub); font-size: 12px; font-weight: 700; }
select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); padding: 0 12px; }
.ocr-summary { border: 1px solid #c5ded7; background: #f1f8f5; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ocr-summary strong { font-size: 25px; color: var(--accent); }
.ocr-summary span { color: var(--sub); font-size: 13px; }
.ocr-review { border: 1px solid #f0d3aa; background: #fff9ef; border-radius: 12px; padding: 13px 15px; margin-bottom: 12px; }
.ocr-review h3 { font-size: 14px; margin: 0 0 8px; color: var(--warning); }
.ocr-review ul { margin: 0; padding-left: 19px; display: grid; gap: 6px; font-size: 13px; color: var(--sub); }
.ocr-runs-panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.ocr-runs-panel summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.ocr-runs { display: grid; gap: 10px; margin-top: 12px; }
.ocr-run { border-radius: 9px; background: #f6f8f7; padding: 10px; }
.ocr-run header { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 7px; }
.ocr-run pre { white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--sub); font-size: 12px; line-height: 1.55; max-height: 160px; overflow: auto; }
.editor-label { font-size: 13px; color: var(--sub); display: block; margin: 14px 0 8px; font-weight: 700; }
@media (max-width: 800px) { .ocr-controls { width: 100%; } .ocr-controls label, .ocr-controls select, .ocr-controls .button { width: 100%; } }


/* Paper rotation correction */
.strip-actions { display: inline-flex; align-items: center; justify-content: center; pointer-events: auto; }
.rotate-button, .trash-button { opacity: 1; }
.rotate-button { pointer-events: auto; min-height: 31px; min-width: 32px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.94); cursor: pointer; color: var(--accent); font-size: 18px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 5px rgba(0,0,0,.14); line-height: 1; }
.rotate-button:hover { background: var(--accent-2); border-color: #b7d8ce; }


/* Automatic analysis and guidance */
.analysis-guidance { margin-top: 16px; border: 1px solid #ebd3a9; background: #fff9ef; border-radius: 12px; padding: 14px 16px; }
.analysis-guidance h3 { margin: 0 0 9px; font-size: 14px; color: var(--warning); }
.analysis-guidance ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; color: var(--sub); font-size: 13px; line-height: 1.55; }


/* Public free-plan presentation */
.badge.free-plan { background: #fff5df; color: #8c5a00; border-color: #edd19a; }
.free-output-note { margin-top: 18px; border-radius: 12px; padding: 14px 16px; background: #fff8e9; border: 1px solid #efd5a1; display: flex; gap: 11px; align-items: baseline; flex-wrap: wrap; }
.free-output-note strong { font-size: 13px; color: #8c5a00; }
.free-output-note span { font-size: 13px; color: var(--sub); }
.button.locked { background: #f5f5f2; border-color: #dddcd5; color: #666861; display: inline-flex; align-items: center; gap: 8px; }
.button.locked span { font-size: 10px; letter-spacing: .06em; border-radius: 999px; padding: 3px 7px; color: #8c5a00; background: #fff1cf; }

/* クロスカットの自由配置・スナップ作業台 */
.strip-board.crosscut-board {
  display: block;
  position: relative;
  min-height: 720px;
  padding: 0;
  overflow: auto;
  background: #e8eeeb;
  border: 1px solid var(--line);
}
.crosscut-page-shadow {
  position: absolute;
  background: #fff;
  box-shadow: 0 1px 1px rgba(18,34,30,.05), 0 7px 26px rgba(18,34,30,.09);
  border-radius: 2px;
  pointer-events: none;
}
.crosscut-card {
  position: absolute;
  touch-action: none;
  cursor: grab;
  z-index: 2;
  transition: box-shadow .13s ease;
}
.crosscut-card.dragging { opacity: .66; z-index: 9; cursor: grabbing; }
.crosscut-card canvas { width: 100%; height: 100%; object-fit: fill; display: block; background: transparent; }
.crosscut-card .strip-card-controls,
.crosscut-card .strip-card-footer {
  left: auto; right: 4px; transform: none;
}
.crosscut-card .strip-card-controls { top: 4px; }
.crosscut-card .strip-card-footer { bottom: 4px; }
.crosscut-card.is-selected { z-index: 20; }
.crosscut-card.is-selected .strip-card-controls,
.crosscut-card.is-selected .strip-card-footer { opacity: 1; visibility: visible; }
.crosscut-card .rotate-button,
.crosscut-card .trash-button { width: 30px; height: 30px; font-size: 14px; }
.crosscut-card .strip-card-controls { display: flex; gap: 3px; }
.crosscut-card .fine-rotate { width: 27px; font-size: 13px; }


/* 原品質クロスカット調整・辺接合・ズーム */
.zoom-indicator {
  min-width: 54px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f2f6f5;
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.edge-legend {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 12px;
}
.legend-edge {
  display: inline-block;
  width: 28px;
  height: 4px;
  border-radius: 4px;
  margin-left: 8px;
}
.legend-edge.open { background: #d14949; }
.edge-tools {
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid #c6ded8;
  border-radius: 11px;
  background: #eff7f4;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--sub);
  font-size: 13px;
}
.edge-tools strong { color: var(--accent); }
.edge-tools .button { min-height: 34px; padding: 0 12px; font-size: 12px; }
.strip-board.crosscut-board { cursor: grab; user-select: none; touch-action: none; overscroll-behavior: contain; overflow: auto; }
.strip-board.crosscut-board.panning { cursor: grabbing; }
.crosscut-stage { position: relative; transform-origin: top left; }
.crosscut-card { overflow: visible; }
.piece-edge {
  position: absolute;
  display: block;
  z-index: 5;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  pointer-events: none;
  transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.piece-edge.top, .piece-edge.bottom { left: 0; right: 0; height: 4px; }
.piece-edge.left, .piece-edge.right { top: 0; bottom: 0; width: 4px; }
.piece-edge.top { top: -2px; }
.piece-edge.right { right: -2px; }
.piece-edge.bottom { bottom: -2px; }
.piece-edge.left { left: -2px; }
.piece-edge.open { background: #d14949; }
.crosscut-card .strip-card-controls, .crosscut-card .strip-card-footer { z-index: 12; }
@media (max-width: 800px) {
  .edge-tools { align-items: start; flex-direction: column; }
  .zoom-indicator { display: none; }
}


/* ジグソーの変則形状パス：未接続の凹凸辺だけを表示 */
.jigsaw-edge-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.jigsaw-edge-path {
  fill: none;
  stroke: #d14949;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.5));
}


/* 統合された復元ステージ */
.studio-panel { padding: 26px; }
.studio-head { margin-bottom: 18px; }
.main-viewport {
  position: relative;
  min-height: min(76vh, 850px);
  height: min(76vh, 850px);
  border-radius: 16px;
  overflow: hidden;
  background: #e7ece9;
  border: 1px solid var(--line);
}
.source-stage, .workspace-viewport {
  position: absolute;
  inset: 0;
}
.source-stage {
  z-index: 1;
  display: grid;
  place-items: center;
  background: #e7ece9;
  opacity: 1;
  transition: opacity .68s ease;
}
.source-stage.dissolve { opacity: 0; pointer-events: none; }
.source-preview-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #14231f;
}
.source-empty-prompt {
  position: absolute;
  inset: 22px;
  min-height: auto;
  margin: 0;
}
.source-restore-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(20,35,31,.18);
}
.restore-action {
  min-height: 60px;
  padding: 0 34px;
  border-radius: 999px;
  font-size: 18px;
  box-shadow: 0 14px 34px rgba(14,45,38,.24);
}
.analysis-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  color: white;
  background: rgba(16,28,25,.45);
  backdrop-filter: blur(2px);
}
.analysis-overlay strong { font-size: 19px; }
.analysis-overlay span:last-child { font-size: 13px; opacity: .88; }
.analysis-spinner {
  display: block;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: white;
  border-radius: 50%;
  animation: repaperSpin .8s linear infinite;
}
@keyframes repaperSpin { to { transform: rotate(360deg); } }
.workspace-viewport { z-index: 2; background: transparent; }
.workspace-viewport .preview-status {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 30;
  margin: 0;
}
.workspace-viewport .strip-board,
.workspace-viewport .strip-board.crosscut-board {
  height: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.main-viewport[data-phase="editing"] .workspace-viewport .strip-board,
.main-viewport[data-phase="editing"] .workspace-viewport .strip-board.crosscut-board {
  background: #cfddd6;
}
.main-viewport[data-phase="animating"] .crosscut-page-shadow { opacity: 0; }
.main-viewport[data-phase="editing"] .crosscut-page-shadow {
  opacity: 1;
  background: transparent;
  box-shadow: none;
  transition: opacity .35s ease;
}
.main-viewport[data-phase="animating"] .strip-card-controls,
.main-viewport[data-phase="animating"] .strip-card-footer,
.main-viewport[data-phase="animating"] .piece-edge,
.main-viewport[data-phase="animating"] .jigsaw-edge-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}
.crosscut-card.assembly-piece, .strip-card.assembly-piece {
  will-change: transform, opacity;
  z-index: 15;
}
.studio-file-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.studio-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.studio-edit-actions.hidden { display: none; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.editing-panel { margin-top: 16px; }
.editing-stats { margin: 0 0 10px; }
.editing-panel .edge-legend { margin-bottom: 10px; }

@media (max-width: 800px) {
  .studio-panel { padding: 15px; }
  .main-viewport { min-height: 60vh; height: 60vh; }
  .source-empty-prompt { inset: 10px; }
  .restore-action { font-size: 16px; min-height: 53px; padding-inline: 26px; }
  .studio-file-actions { flex-wrap: wrap; }
}


/* H1: 裁断された文字がタイトルへ戻る導入アニメーション */
.restore-title {
  position: relative;
  min-height: calc(2em * 1.18);
  overflow: visible;
}
.restore-title-line {
  display: block;
  white-space: nowrap;
}
.restore-title-char {
  position: relative;
  display: inline-block;
  transform-origin: 50% 52%;
  will-change: transform, opacity, filter;
}
.restore-title.is-scattered .restore-title-char {
  transform:
    translate(var(--scatter-x), var(--scatter-y))
    rotate(var(--scatter-angle))
    scale(var(--scatter-scale));
  opacity: .17;
  filter: blur(.3px);
}
.restore-title.is-scattered.is-assembled .restore-title-char {
  transform: translate(0, 0) rotate(0deg) scale(1);
  opacity: 1;
  filter: blur(0);
  transition:
    transform 780ms cubic-bezier(.16, .9, .18, 1) var(--settle-delay),
    opacity 300ms ease var(--settle-delay),
    filter 340ms ease var(--settle-delay);
}


/* モバイル復元ビュー：全体表示とピンチ操作 */
.workspace-viewport, .workspace-viewport .strip-board.crosscut-board {
  touch-action: none;
  overscroll-behavior: contain;
}
@media (max-width: 800px) {
  .workspace-viewport .preview-status {
    top: 8px;
    left: 8px;
    right: 8px;
    font-size: 12px;
  }
  .crosscut-card .strip-card-controls,
  .crosscut-card .strip-card-footer {
    transform: scale(.92);
    transform-origin: top right;
  }
  .crosscut-card .strip-card-footer { transform-origin: bottom right; }
}


/* Flat premium material theme: no gradients */
:root {
  --bg: #f4f3ee;
  --panel: #fffefa;
  --ink: #101a17;
  --sub: #59645f;
  --line: #d9d8d1;
  --line-strong: #c8c8c0;
  --accent: #137861;
  --accent-deep: #0e604d;
  --accent-2: #e7f0ed;
  --paper: #fffefb;
  --stone: #e9e8e2;
  --shadow: 0 1px 1px rgba(16,26,23,.04), 0 12px 30px rgba(16,26,23,.06);
  --shadow-raised: 0 1px 0 rgba(255,255,255,.92) inset, 0 1px 2px rgba(16,26,23,.05), 0 18px 38px rgba(16,26,23,.075);
  --radius: 20px;
}
html {
  background: var(--world-page-background, var(--bg));
}
body {
  background: var(--world-page-background, var(--bg));
  color: var(--ink);
}
.topbar {
  height: 78px;
  background: rgba(255,254,250,.98);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.88) inset, 0 2px 12px rgba(16,26,23,.035);
  z-index: 40;
}
.brand {
  gap: 15px;
}
.brand-mark {
  width: 39px;
  height: 45px;
  border-width: 2px;
  border-radius: 9px;
  background: var(--panel);
  box-shadow:
    inset 8px 0 0 #eef3f1,
    inset 17px 0 0 var(--panel),
    inset 22px 0 0 #eef3f1,
    inset 31px 0 0 var(--panel),
    0 1px 2px rgba(16,26,23,.05);
}
.brand-mark::after {
  right: -5px;
  bottom: -5px;
  width: 15px;
  height: 15px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--panel);
}
.brand strong {
  font-size: 22px;
  letter-spacing: -.045em;
}
.brand div span {
  font-size: 12px;
  letter-spacing: .035em;
}
.badge.free-plan {
  padding: 10px 16px;
  background: #faf0da;
  color: #815718;
  border: 1px solid #ead5aa;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
.shell {
  margin: 0 auto 60px;
  padding: 0 24px;
  gap: 22px;
}
.panel {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-raised);
}
.hero {
  display: grid;
  grid-template-columns: minmax(390px, 1.22fr) minmax(286px, .78fr);
  align-items: center;
  gap: clamp(32px, 5vw, 70px);
  padding: clamp(48px, 8vw, 88px) 12px clamp(38px, 6vw, 62px);
  border: 0;
  background: transparent;
  box-shadow: none;
}
.hero-copy {
  min-width: 0;
}
.hero .eyebrow {
  margin-bottom: 15px;
  color: var(--accent-deep);
}
.restore-title {
  margin-bottom: 20px;
  min-height: calc(2em * 1.16);
}
.restore-title-line:first-child,
.restore-title-line:first-child .restore-title-char {
  color: #101a17;
}
.restore-title-line:nth-child(2),
.restore-title-line:nth-child(2) .restore-title-char {
  color: var(--accent);
}
h1 {
  font-size: clamp(41px, 5.2vw, 62px);
  line-height: 1.12;
  letter-spacing: -.065em;
  font-weight: 760;
}
.lead {
  max-width: 560px;
  color: var(--sub);
  font-size: 16px;
  line-height: 1.9;
}
.hero-privacy {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 3vw, 29px);
  box-shadow: 0 1px 0 rgba(255,255,255,.95) inset, 0 2px 4px rgba(16,26,23,.035), 0 18px 42px rgba(16,26,23,.05);
}
.hero-privacy::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  margin-bottom: 20px;
}
.privacy-card h2 {
  font-size: 18px;
  letter-spacing: -.035em;
}
.privacy-card p {
  color: #26332f;
}
.privacy-card .minor {
  color: var(--sub);
}
.studio-panel {
  border-radius: 23px;
  border-color: var(--line-strong);
  padding: clamp(18px, 3vw, 30px);
}
.main-viewport {
  border-color: var(--line-strong);
  background: #e5e7e2;
  box-shadow: inset 0 1px 2px rgba(16,26,23,.05);
}
.source-stage {
  background: #e5e7e2;
}
.source-restore-overlay {
  background: rgba(16,26,23,.16);
}
.dropzone {
  border-color: #a9c2bb;
  background: rgba(255,254,250,.78);
}
.dropzone.drag,
.dropzone:hover {
  border-color: var(--accent);
  background: #edf4f1;
}
.button {
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
.button:hover:not(:disabled) {
  opacity: 1;
  transform: translateY(-1px);
}
.button.primary {
  background: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 5px 14px rgba(19,120,97,.22);
}
.button.primary:hover:not(:disabled) {
  background: var(--accent-deep);
}
.button.secondary {
  background: #edf4f1;
  border-color: #c2d7d1;
}
.button.ghost {
  background: var(--paper);
  border-color: var(--line);
}
.demo-actions .button {
  border-radius: 999px;
}
.preview-status {
  background: #edf4f1;
  border-color: #bed6cf;
}
.progress div {
  position: relative;
  overflow: hidden;
  background: #e2e5e1;
}
.progress div::before {
  content: "";
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .16s ease;
}
.guide-grid div,
.ocr-run {
  background: #f5f4f0;
  border: 1px solid #e6e4dd;
}
.free-output-note {
  background: #fbf3df;
  border-color: #ead4a4;
}
.footer {
  border-top-color: var(--line);
  background: #f0eee8;
}
@media (max-width: 800px) {
  .topbar {
    height: 72px;
  }
  .shell {
    padding: 0 14px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 35px 5px 28px;
  }
  h1 {
    font-size: clamp(35px, 10.8vw, 46px);
  }
  .hero-privacy {
    padding: 20px;
  }
}


@media (max-width: 800px) {
  .studio-edit-actions {
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }
  .studio-edit-actions .button {
    min-height: 41px;
    padding-inline: 12px;
    font-size: 13px;
  }
}


/* WORLD flow layout: hero -> image import -> restoration result */
.studio-head .stage-description { margin-top: 7px; color: var(--sub); font-size: 13px; }
.result-stage-banner {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 31;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #c6ded8;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 14px rgba(17,46,39,.08);
}
.result-stage-banner span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.result-stage-banner strong { color: var(--ink); font-size: 12px; }
.workspace-viewport .preview-status { top: 63px; }
@media (max-width: 800px) {
  .result-stage-banner { left: 10px; top: 10px; max-width: calc(100% - 20px); }
  .workspace-viewport .preview-status { top: 57px; left: 10px; }
}
