:root {
  color-scheme: light;
  --topbar-height: 62px;
  --ui-bg: #e8e9e6;
  --ui-panel: #f5f5f2;
  --ui-card: #fbfbf8;
  --ui-text: #242826;
  --ui-muted: #69706c;
  --ui-line: #cdd1cc;
  --ui-line-strong: #aeb5af;
  --ui-accent: #4f6862;
  --ui-accent-soft: #dce5e1;
  --ui-danger: #985b57;
  --radius: 10px;
  font-family: "OC Noto Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; min-width: 320px; height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: var(--topbar-height) minmax(0, 1fr); color: var(--ui-text); background: var(--ui-bg); }
body.is-export-busy { cursor: progress; }
body.is-export-busy button { cursor: progress; }
button, input, textarea, select { font: inherit; color: inherit; }
button, label.file-button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #86a69e; outline-offset: 2px; }
button:disabled { opacity: .42; cursor: not-allowed; }

.topbar { min-width: 0; height: var(--topbar-height); display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--ui-line); background: rgba(250,250,247,.96); }
.brand { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ui-accent); color: #f8faf7; border-radius: 8px; font-weight: 900; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy b { font-size: 14px; }
.brand-copy small { margin-top: 3px; color: var(--ui-muted); font-size: 9px; letter-spacing: .13em; }
.project-field { min-width: 120px; max-width: 260px; flex: 0 1 260px; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.project-field span { color: var(--ui-muted); font-size: 11px; white-space: nowrap; }
.project-field input { min-width: 0; width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--ui-line); border-radius: 8px; background: #fdfdfa; }
.top-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.button { min-height: 34px; padding: 7px 12px; border: 1px solid var(--ui-line-strong); border-radius: 8px; background: #fdfdfa; color: var(--ui-text); font-size: 12px; font-weight: 750; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .12s ease; }
.button:hover { border-color: #7c8983; background: #f3f5f2; }
.button:active { transform: translateY(1px); }
.button.primary { border-color: var(--ui-accent); background: var(--ui-accent); color: #f8faf7; }
.button.primary:hover { background: #405852; }
.button.quiet { background: transparent; }
.button.compact { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.file-button { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--ui-muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: var(--ui-danger); }

.workspace { min-width: 0; min-height: 0; display: grid; grid-template-columns: 292px minmax(380px, 1fr) 292px; grid-template-areas: "content preview style"; overflow: hidden; }
.editor-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--ui-panel); }
.content-panel { grid-area: content; border-right: 1px solid var(--ui-line); }
.style-panel { grid-area: style; border-left: 1px solid var(--ui-line); }
.panel-heading { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 14px 15px 12px; border-bottom: 1px solid var(--ui-line); }
.panel-heading > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: #e1e4df; color: var(--ui-muted); font-size: 10px; font-weight: 900; }
.panel-heading h1 { margin: 0; font-size: 15px; line-height: 1.2; }
.panel-heading p { margin: 3px 0 0; color: var(--ui-muted); font-size: 10px; line-height: 1.45; }
.panel-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px; scrollbar-width: thin; scrollbar-color: #b7bcb7 transparent; }
.editor-card { padding: 13px; border: 1px solid var(--ui-line); border-radius: var(--radius); background: var(--ui-card); }
.editor-card + .editor-card { margin-top: 9px; }
.card-title { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.card-title h2 { margin: 0; font-size: 13px; line-height: 1.3; }
.card-title p { margin: 3px 0 0; color: var(--ui-muted); font-size: 10px; line-height: 1.45; }
.card-title > span { flex: 0 0 auto; color: #7d8580; font: 700 9px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.field { display: grid; gap: 5px; margin-top: 9px; }
.field:first-of-type { margin-top: 0; }
.field > span, .range-field > span, .orientation-control > span { color: #59615d; font-size: 10px; font-weight: 750; }
.field input, .field textarea, .field select { min-width: 0; width: 100%; border: 1px solid var(--ui-line); border-radius: 7px; background: #fdfdfa; font-size: 12px; }
.field input, .field select { height: 34px; padding: 0 9px; }
.field textarea { min-height: 70px; padding: 8px 9px; line-height: 1.55; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #a2aaa4; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-grid.three { grid-template-columns: .7fr .8fr 1.1fr; }
.image-control { display: grid; grid-template-columns: 72px 1fr; gap: 11px; align-items: center; }
.poster-thumb { width: 72px; aspect-ratio: 2 / 3; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--ui-line); border-radius: 7px; background: #e3e5e1; color: #7b817d; font: 700 9px/1 ui-monospace, monospace; }
.poster-thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-copy b { font-size: 12px; }
.image-copy p { margin: 3px 0 8px; color: var(--ui-muted); font-size: 10px; line-height: 1.45; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-grid button { min-height: 50px; padding: 7px 8px; border: 1px solid var(--ui-line); border-radius: 8px; background: #f5f6f3; text-align: left; cursor: pointer; }
.preset-grid button:hover { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.preset-grid b { display: block; font-size: 11px; }
.preset-grid span { display: block; margin-top: 2px; color: var(--ui-muted); font-size: 9px; }

.preview-panel { grid-area: preview; min-width: 0; min-height: 0; display: grid; grid-template-rows: 46px minmax(0,1fr) 28px; background: #d8dad6; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border-bottom: 1px solid #c4c8c2; background: #eceeeb; }
.preview-toolbar > div:first-child { display: grid; line-height: 1.1; }
.preview-toolbar strong { font-size: 12px; }
.preview-toolbar span { margin-top: 3px; color: var(--ui-muted); font-size: 9px; }
.preview-actions { display: flex; align-items: center; gap: 5px; }
.preview-actions button, .orientation-switch button { min-height: 28px; padding: 4px 9px; border: 1px solid #b5bbb5; border-radius: 7px; background: #f8f9f6; font-size: 10px; font-weight: 800; cursor: pointer; }
.preview-actions button.active, .orientation-switch button.active { border-color: var(--ui-accent); background: var(--ui-accent); color: #fdfdfa; }
.preview-viewport { min-width: 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 54px; background-image: linear-gradient(45deg,rgba(255,255,255,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.25) 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }
.preview-stage { position: relative; transform-origin: center center; transition: transform .18s ease; }
.preview-status { display: flex; align-items: center; justify-content: center; padding: 0 12px; border-top: 1px solid #c4c8c2; background: #eceeeb; color: var(--ui-muted); font-size: 9px; }

.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.template-option { min-height: 62px; padding: 8px; border: 1px solid var(--ui-line); border-radius: 8px; background: #f6f7f4; text-align: left; cursor: pointer; }
.template-option:hover { border-color: #8c9891; }
.template-option.active { border-color: var(--ui-accent); box-shadow: inset 0 0 0 1px var(--ui-accent); background: var(--ui-accent-soft); }
.template-option b { display: block; font-size: 11px; line-height: 1.3; }
.template-option small { display: block; margin-top: 3px; color: var(--ui-muted); font-size: 8px; letter-spacing: .05em; }
.template-swatches { display: flex; gap: 3px; margin-top: 6px; }
.template-swatches i { width: 15px; height: 5px; border-radius: 2px; }
.orientation-control { display: grid; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--ui-line); }
.orientation-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.orientation-switch button { height: 32px; }
.color-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.color-field { display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 6px; min-height: 34px; padding: 5px 6px 5px 9px; border: 1px solid var(--ui-line); border-radius: 7px; background: #fdfdfa; }
.color-field span { font-size: 10px; font-weight: 700; }
.color-field input { width: 30px; height: 22px; padding: 0; border: 0; background: transparent; }
.range-field { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 8px; margin-top: 10px; }
.range-field input { width: 100%; accent-color: var(--ui-accent); }
.range-field output { display:block; margin-top:3px; color:var(--ui-accent); font:700 9px/1 ui-monospace,monospace; }
.poster-crop-open { width:100%; margin-top:10px; }
.check-field { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: #505854; font-size: 11px; }
.check-field input { width: 15px; height: 15px; accent-color: var(--ui-accent); }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.export-grid .primary { grid-column: 1 / -1; }
.export-note { margin: 9px 0 0; color: var(--ui-muted); font-size: 9px; line-height: 1.5; }

.mobile-resizer, .mobile-main-tabs { display: none; }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 80; max-width: min(420px, calc(100vw - 24px)); padding: 10px 14px; border-radius: 8px; background: #29312e; color: #fdfdfa; font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tour-overlay[hidden] { display: none; }
.tour-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.tour-blocker { position: absolute; inset: 0; border: 0; background: rgba(31,35,33,.54); }
.tour-card { position: relative; width: min(440px,100%); padding: 20px; border-radius: 12px; background: #fbfbf8; box-shadow: 0 24px 80px rgba(36,40,38,.28); }
.tour-card header, .tour-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-card header button { border: 0; background: transparent; color: var(--ui-muted); font-size: 11px; cursor: pointer; }
.tour-card h2 { margin: 20px 0 7px; font-size: 22px; }
.tour-card p { margin: 0 0 22px; color: var(--ui-muted); font-size: 13px; line-height: 1.7; }
.poster-crop-modal[hidden] { display:none; }
.poster-crop-modal { position:fixed; inset:0; z-index:90; display:grid; place-items:center; padding:16px; }
.poster-crop-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(25,30,28,.72); backdrop-filter:blur(4px); }
.poster-crop-dialog { position:relative; width:min(720px,100%); max-height:calc(100dvh - 32px); overflow:auto; padding:18px; border-radius:14px; background:#fbfbf8; box-shadow:0 24px 90px rgba(0,0,0,.4); }
.poster-crop-dialog header,.poster-crop-dialog footer { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.poster-crop-dialog header small { color:var(--ui-accent); font:800 9px/1 ui-monospace,monospace; letter-spacing:.12em; }
.poster-crop-dialog h2 { margin:4px 0 0; font-size:18px; }
.poster-crop-dialog > p { margin:10px 0 14px; color:var(--ui-muted); font-size:12px; line-height:1.6; }
.poster-crop-stage { position:relative; display:grid; place-items:center; min-height:180px; overflow:hidden; border:1px solid #9ca29f; border-radius:10px; background:#202623; }
.poster-crop-stage canvas { display:block; width:100%; max-height:min(56dvh,560px); object-fit:contain; cursor:grab; touch-action:none; }
.poster-crop-stage canvas:active { cursor:grabbing; }
.poster-crop-stage > span { position:absolute; left:50%; bottom:8px; transform:translateX(-50%); padding:5px 8px; border-radius:999px; background:rgba(20,24,22,.72); color:#fff; font-size:10px; pointer-events:none; }
.poster-crop-zoom { display:grid; grid-template-columns:100px 1fr; align-items:center; gap:12px; margin:14px 0; font-size:11px; font-weight:750; }
.poster-crop-zoom output { display:block; margin-top:4px; color:var(--ui-accent); font:800 10px/1 ui-monospace,monospace; }
.poster-crop-zoom input { width:100%; accent-color:var(--ui-accent); }
.poster-crop-dialog footer { justify-content:flex-end; }
body.crop-modal-open { overflow:hidden; }
@media (max-width:600px) {
  .poster-crop-dialog { padding:14px; }
  .poster-crop-stage canvas { max-height:50dvh; }
}

/* Ticket canvas contract: fixed width, content-driven height. */
.ticket-canvas { --surface:#e4dcc9; --surface-alt:#ddd2bb; --ink:#342f29; --muted:#756d61; --accent:#7a4d49; --line:#9d9280; --stamp:#8e4f49; position: relative; isolation: isolate; border-radius:0!important; color: var(--ink); background: var(--surface); box-shadow: 0 24px 65px rgba(47,53,49,.22); transition: none; }
.ticket-canvas[data-mode="landscape"] { width: 672px; display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.ticket-canvas[data-mode="portrait"] { width: 448px; display: grid; grid-template-rows: auto auto; }
.ticket-main, .ticket-stub { position: relative; min-width: 0; }
.ticket-main { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.ticket-stub { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; background: var(--surface-alt); }
.ticket-canvas[data-mode="landscape"] .ticket-stub { border-left: 2px dashed var(--line); }
.ticket-canvas[data-mode="portrait"] .ticket-stub { border-top: 2px dashed var(--line); }
.ticket-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.ticket-brand { min-width: 0; font-size: 14px; font-weight: 900; letter-spacing: .1em; overflow-wrap: anywhere; }
.ticket-brand small { display: block; margin-top: 3px; color: var(--muted); font: 650 9px/1.35 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.format-tag { flex: 0 0 auto; max-width: 42%; padding: 5px 7px; border: 1px solid var(--accent); color: var(--accent); font: 800 9px/1.25 ui-monospace, Consolas, monospace; text-align: center; overflow-wrap: anywhere; }
.ticket-feature { min-width: 0; display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 16px; align-items: start; }
.poster-shell { position: relative; height: 144px; overflow: hidden; background: color-mix(in srgb, var(--surface-alt) 80%, var(--ink)); border: 1px solid var(--line); }
.poster-shell img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.poster-shell.is-empty { display: grid; place-items: center; color: var(--muted); font: 700 11px/1.5 ui-monospace, monospace; letter-spacing: .12em; }
.movie-copy { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.movie-kicker { color: var(--accent); font: 750 9px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .1em; overflow-wrap: anywhere; }
.movie-title { margin: 3px 0 0; font-size: 24px; line-height: 1.14; letter-spacing: -.03em; overflow-wrap: anywhere; }
.movie-original { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.movie-byline { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.movie-quote { margin: 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--surface-alt) 78%, transparent); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.info-grid { min-width: 0; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 7px; }
.info-cell { min-width: 0; padding: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-alt) 72%, transparent); }
.info-cell small { display: block; margin-bottom: 3px; color: var(--muted); font: 700 8px/1.35 ui-monospace, Consolas, monospace; letter-spacing: .09em; }
.info-cell b, .info-cell span { display: block; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.info-cell span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.ticket-foot { min-width: 0; display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.seat-block small, .stub-label { display: block; margin-bottom: 4px; color: var(--muted); font: 750 9px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .13em; }
.seat-block { flex: 0 0 auto; min-width: max-content; }
.seat-block b { display: block; color: var(--accent); font: 900 21px/1.1 ui-monospace, Consolas, monospace; white-space: nowrap; overflow-wrap: normal; }
.ticket-canvas .seat-value { display: inline-block; flex: 0 0 auto; white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
.barcode-wrap { min-width: 120px; max-width: 176px; flex: 1 1 176px; }
.barcode { height: 28px; display: flex; align-items: stretch; gap: 2px; overflow: hidden; }
.barcode i { display: block; flex: 0 0 auto; background: currentColor; }
.barcode-text { margin-top: 4px; color: var(--muted); font: 650 8px/1.25 ui-monospace, Consolas, monospace; letter-spacing: .07em; overflow-wrap: anywhere; }
.stub-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.stub-head h3 { margin: 3px 0; font-size: 17px; line-height: 1.22; overflow-wrap: anywhere; }
.stub-code { color: var(--muted); font: 650 8px/1.35 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.stub-facts { display: grid; gap: 6px; }
.stub-row { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 6px; padding-bottom: 5px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); font-size: 11px; line-height: 1.35; }
.stub-row span { color: var(--muted); }
.stub-row b { text-align: right; overflow-wrap: anywhere; }
.stub-seat { padding: 7px; border: 1px solid var(--accent); color: var(--accent); text-align: center; }
.stub-seat > span { display: block; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.stub-seat b { display: block; min-width: max-content; margin-top: 2px; font: 900 16px/1.15 ui-monospace, Consolas, monospace; white-space: nowrap; overflow-wrap: normal; }
.stub-codebox { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.qr-code { --qr-size: 52px; width: var(--qr-size); height: var(--qr-size); flex: 0 0 var(--qr-size); display: grid; grid-template-columns: repeat(11,1fr); grid-template-rows: repeat(11,1fr); padding: 3px; background: color-mix(in srgb, var(--surface-alt) 92%, white); }
.qr-code i { background: currentColor; }
.qr-code i:not(.fill) { background: transparent; }
.stub-status { min-width: 0; color: var(--muted); font: 650 8px/1.4 ui-monospace, Consolas, monospace; text-align: right; overflow-wrap: anywhere; }
.ticket-stub.is-torn { transform: translate(24px,8px) rotate(1.5deg); opacity: .68; }
.ticket-canvas[data-mode="portrait"] .ticket-stub.is-torn { transform: translate(8px,24px) rotate(1deg); }
.ticket-canvas.is-exporting { box-shadow: none !important; }
.ticket-canvas.is-exporting .export-hidden { display: none !important; }
.ticket-canvas.export-main .ticket-stub, .ticket-canvas.export-stub .ticket-main { display: none !important; }
.ticket-canvas.export-main[data-mode="landscape"] { width: 448px; grid-template-columns: minmax(0,1fr); }
.ticket-canvas.export-stub[data-mode="landscape"] { width: 224px; grid-template-columns: minmax(0,1fr); }
.ticket-canvas.export-main[data-mode="portrait"], .ticket-canvas.export-stub[data-mode="portrait"] { width: 448px; display: block; min-height: 0; }
.ticket-canvas.export-stub[data-mode="portrait"] .ticket-stub { border-top: 0; }

.ticket-canvas[data-mode="portrait"] .ticket-main { padding: 24px; gap: 12px; }
.ticket-canvas[data-mode="portrait"] .ticket-stub { padding: 18px 20px; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) auto; align-items: stretch; gap: 12px; }
.ticket-canvas[data-mode="portrait"] .ticket-feature { grid-template-columns: 112px minmax(0,1fr); }
.ticket-canvas[data-mode="portrait"] .poster-shell { width: auto; height: 144px; min-height: 0; aspect-ratio: auto; }
.ticket-canvas[data-mode="portrait"] .movie-copy { gap: 8px; }
.ticket-canvas[data-mode="portrait"] .movie-title { font-size: 24px; }
.ticket-canvas[data-mode="portrait"] .info-grid { grid-template-columns: 1fr 1fr; }
.ticket-canvas[data-mode="portrait"] .ticket-foot { align-items: center; }
.ticket-canvas[data-mode="portrait"] .stub-head { border-bottom: 0; border-right: 1px solid var(--line); padding: 0 12px 0 0; }
.ticket-canvas[data-mode="portrait"] .stub-facts { align-content: center; }
.ticket-canvas[data-mode="portrait"] .stub-row { grid-template-columns: 40px 1fr; }
.ticket-canvas[data-mode="portrait"] .stub-codebox { margin-top: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); align-items: center; }
.ticket-canvas[data-mode="portrait"] .stub-status { display: none; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 265px minmax(330px,1fr) 265px; }
  .top-actions { gap: 4px; }
  .button { padding-inline: 9px; }
}

@media (max-width: 900px) {
  :root { --topbar-height: 56px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .brand-copy small, .project-field, .desktop-action { display: none; }
  .brand-copy b { font-size: 13px; }
  .top-actions { margin-left: auto; }
  .workspace { --mobile-preview-height: 42%; height: auto; min-height: 0; grid-template-columns: 1fr; grid-template-rows: var(--mobile-preview-height) 20px 46px minmax(0,1fr); grid-template-areas: "preview" "resizer" "tabs" "panel"; }
  .preview-panel { grid-area: preview; grid-template-rows: 42px minmax(0,1fr) 24px; }
  .preview-toolbar { padding: 0 8px; }
  .preview-actions button { padding: 3px 7px; font-size: 9px; }
  .preview-viewport { padding: 0; place-items: center; }
  .mobile-resizer { grid-area: resizer; display: grid; place-items: center; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); background: #f1f1ee; cursor: row-resize; touch-action: none; user-select: none; z-index: 12; }
  .mobile-resizer span { width: 110px; height: 5px; border-radius: 4px; background: var(--ui-line-strong); pointer-events: none; }
  .mobile-main-tabs { grid-area: tabs; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ui-line); background: #f7f7f4; z-index: 14; }
  .mobile-main-tabs button { border: 0; border-right: 1px solid var(--ui-line); background: transparent; font-size: 12px; font-weight: 850; }
  .mobile-main-tabs button:last-child { border-right: 0; }
  .mobile-main-tabs button.active { background: var(--ui-accent-soft); box-shadow: inset 0 -3px var(--ui-accent); }
  .editor-panel { grid-area: panel; border: 0; min-height: 0; }
  .panel-heading { display: none; }
  .panel-scroll { padding: 8px 10px calc(14px + env(safe-area-inset-bottom)); }
  body[data-active-mobile-panel="content"] .style-panel, body[data-active-mobile-panel="style"] .content-panel { display: none; }
}

@media (max-width: 520px) {
  .brand-copy { display: none; }
  .preview-actions #tear-ticket { display: none; }
  .editor-card { padding: 12px; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 1. Clean white paper ticket */
.ticket-paper { font-family:"OC Noto Sans SC",sans-serif; border:2px solid var(--ink); background:var(--surface); }
.ticket-paper::before { content:""; position:absolute; inset:8px; z-index:-1; border:1px solid color-mix(in srgb,var(--line) 62%,transparent); pointer-events:none; }
.ticket-paper .ticket-main { padding:24px; gap:14px; background:var(--surface); }
.ticket-paper .ticket-stub { background:var(--surface-alt); }
.ticket-paper .ticket-head { padding-bottom:11px; border-bottom:2px solid var(--ink); }
.ticket-paper .ticket-brand { font-size:15px; letter-spacing:.04em; }
.ticket-paper .ticket-brand small { margin-top:2px; letter-spacing:.14em; }
.ticket-paper .format-tag { padding:4px 8px; border-color:var(--ink); background:var(--ink); color:var(--surface); }
.ticket-paper .poster-shell { border:2px solid var(--ink); }
.ticket-paper .movie-title { color:var(--ink); font-size:25px; }
.ticket-paper .movie-kicker { color:var(--accent); }
.ticket-paper .movie-quote { padding:8px 0 8px 11px; border-left:2px solid var(--accent); background:transparent; }
.ticket-paper .info-grid { gap:0; border-top:1px solid var(--ink); border-bottom:1px solid var(--ink); }
.ticket-paper .info-cell { border:0; border-right:1px solid var(--line); background:transparent; }
.ticket-paper .info-cell:last-child { border-right:0; }
.ticket-paper .ticket-foot { border-top:0; padding-top:0; }
.ticket-paper .seat-block { padding:7px 9px; background:var(--ink); color:var(--surface); }
.ticket-paper .seat-block small,.ticket-paper .seat-block b { color:var(--surface); }
.ticket-paper .seat-block b { font-size:18px; }
.ticket-paper .stub-label { color:var(--accent); }
.ticket-paper .stub-seat { border-color:var(--ink); background:var(--ink); color:var(--surface); }
.ticket-paper .qr-code { color:var(--ink); background:var(--surface); border:1px solid var(--ink); }
.ticket-paper[data-mode="portrait"] .ticket-main { padding:24px; }
.ticket-paper[data-mode="portrait"] .ticket-feature { grid-template-columns:112px minmax(0,1fr); }
.ticket-paper[data-mode="portrait"] .poster-shell { height:144px; min-height:0; }
.ticket-paper[data-mode="portrait"] .info-grid { grid-template-columns:1fr 1fr; }
.ticket-paper[data-mode="portrait"] .info-cell:first-child { grid-column:1 / -1; border-right:0; border-bottom:1px solid var(--line); }

/* 2. Vintage kraft ticket, rebuilt against the original reference composition. */
.ticket-vintage { font-family:"OC Noto Serif SC","Songti SC",serif; border:4px solid color-mix(in srgb,var(--line) 46%,transparent); border-radius:4px; background-image:radial-gradient(color-mix(in srgb,var(--ink) 16%,transparent) .6px,transparent .7px),radial-gradient(color-mix(in srgb,var(--ink) 16%,transparent) .6px,var(--surface) .7px); background-position:0 0,7.5px 7.5px; background-size:15px 15px; }
.ticket-vintage::before { content:""; position:absolute; inset:8px; z-index:-1; border:1px solid color-mix(in srgb,var(--line) 42%,transparent); pointer-events:none; }
.ticket-vintage .ticket-main { padding:24px; gap:16px; }
.ticket-vintage .ticket-head { align-items:center; padding-bottom:12px; border-bottom:2px double color-mix(in srgb,var(--line) 72%,transparent); }
.ticket-vintage .vintage-ticket-head { display:grid; grid-template-columns:minmax(0,1fr) max-content; }
.ticket-vintage .ticket-brand { font-size:14px; letter-spacing:.07em; }
.vintage-ticket-brand { min-width:0; display:grid; grid-template-columns:max-content minmax(0,1fr); align-items:center; gap:9px; }
.vintage-film-mark { color:var(--accent); font:900 21px/1 ui-monospace,Consolas,monospace; }
.vintage-ticket-title { min-width:0; display:flex; align-items:baseline; flex-wrap:nowrap; gap:0 7px; white-space:nowrap; overflow-wrap:normal; }
.vintage-ticket-label { flex:0 0 auto; }
.vintage-title-separator { color:var(--muted); font-size:10px; }
.ticket-vintage .format-tag { max-width:none; padding:4px 8px; background:color-mix(in srgb,var(--surface-alt) 32%,transparent); font-size:9px; }
.ticket-vintage .ticket-feature { grid-template-columns:96px minmax(0,1fr); gap:16px; }
.ticket-vintage .poster-shell { height:128px; border:2px solid var(--line); box-shadow:3px 3px 8px color-mix(in srgb,var(--ink) 18%,transparent); }
.ticket-vintage.poster-filtered .poster-shell img { filter:sepia(.2) saturate(.78) contrast(.96); }
.vintage-copy { min-width:0; min-height:128px; display:flex; flex-direction:column; justify-content:space-between; gap:8px; }
.ticket-vintage .movie-kicker { font-family:"OC Noto Serif SC",serif; font-size:10px; letter-spacing:.08em; }
.ticket-vintage .movie-title { font-size:24px; line-height:1.06; }
.vintage-byline { margin-top:8px; color:var(--ink); font-size:13px; font-weight:800; line-height:1.5; overflow-wrap:anywhere; }
.ticket-vintage .movie-quote { padding:7px 9px; border-left:2px solid var(--accent); background:color-mix(in srgb,var(--surface-alt) 56%,transparent); font-size:11px; line-height:1.45; font-style:italic; }
.vintage-info { padding:11px 12px 9px; border:1px solid color-mix(in srgb,var(--line) 55%,transparent); background:color-mix(in srgb,var(--surface-alt) 62%,transparent); font-family:"OC Noto Sans SC",sans-serif; }
.vintage-info-top { display:grid; grid-template-columns:1.45fr 1fr; gap:16px; }
.vintage-info small { display:block; margin-bottom:2px; color:var(--muted); font-size:9px; font-weight:800; }
.vintage-info b,.vintage-info span { display:block; font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.vintage-info b { color:var(--ink); font-size:12px; }
.vintage-info span { color:var(--ink); }
.vintage-info-bottom { display:grid; grid-template-columns:max-content minmax(0,1fr) max-content; align-items:center; gap:12px; margin-top:9px; padding-top:8px; border-top:1px solid color-mix(in srgb,var(--line) 34%,transparent); }
.vintage-info-bottom > div { display:flex; align-items:center; gap:7px; min-width:0; }
.vintage-info-bottom > div:last-child { justify-self:end; }
.vintage-info-bottom small {
  flex:0 0 auto;
  margin:0;
  white-space:nowrap;
  word-break:keep-all;
}
.vintage-info-bottom b { flex:0 0 auto; min-width:max-content; padding:2px 7px; border:1px solid color-mix(in srgb,var(--stamp) 50%,transparent); color:var(--stamp); font:900 13px/1.25 ui-monospace,Consolas,monospace; white-space:nowrap; overflow-wrap:normal; }
.vintage-info-bottom .seat-value { color:inherit; font:inherit; }
.vintage-info-bottom strong { color:var(--ink); font-size:14px; white-space:nowrap; }
.vintage-holder span { min-width:0; color:var(--ink); font-size:12px; font-weight:800; }
.vintage-footer { min-width:0; display:flex; align-items:end; justify-content:flex-start; padding-top:8px; border-top:1px solid color-mix(in srgb,var(--line) 45%,transparent); }
.ticket-vintage .barcode-wrap { max-width:192px; flex-basis:192px; }
.ticket-vintage .barcode { height:32px; }
.ticket-vintage .ticket-stub { background-image:repeating-linear-gradient(0deg,transparent 0 12px,color-mix(in srgb,var(--ink) 3%,transparent) 13px); }
.ticket-vintage .stub-head { text-align:center; }
.ticket-vintage .stub-row { grid-template-columns:46px minmax(0,1fr); padding-bottom:0; border-bottom:0; font-family:"OC Noto Sans SC",sans-serif; }
.ticket-vintage .stub-seat { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 7px; border:1px solid color-mix(in srgb,var(--line) 65%,transparent); background:color-mix(in srgb,var(--surface) 28%,transparent); text-align:left; }
.ticket-vintage .stub-seat > span,.ticket-vintage .stub-seat > b { display:block; margin:0; }
.ticket-vintage .stub-seat .seat-value { display:inline-block; }
.ticket-vintage .stub-seat > span { color:var(--muted); font:800 10px/1.3 "OC Noto Sans SC",sans-serif; letter-spacing:0; }
.ticket-vintage .stub-seat b { flex:0 0 auto; color:var(--stamp); font-size:14px; }
.ticket-vintage[data-mode="landscape"] .stub-codebox { flex-direction:column; align-items:center; justify-content:center; }
.ticket-vintage[data-mode="landscape"] .stub-status { text-align:center; }
.ticket-vintage .qr-code { --qr-size:64px; color:var(--ink); background:transparent; }
.ticket-vintage[data-mode="portrait"] .ticket-feature { grid-template-columns:96px minmax(0,1fr); align-items:start; }
.ticket-vintage[data-mode="portrait"] .poster-shell { height:128px; }
.ticket-vintage[data-mode="portrait"] .movie-title { font-size:24px; }
.ticket-vintage[data-mode="portrait"] .vintage-info-top { grid-template-columns:1.45fr 1fr; }

/* 3. Modern frost ticket */
.ticket-modern { border: 1px solid var(--line); border-radius: 18px; background-image: linear-gradient(135deg,color-mix(in srgb,var(--surface-alt) 70%,transparent),transparent 54%), linear-gradient(90deg,color-mix(in srgb,var(--line) 12%,transparent) 1px,transparent 1px), linear-gradient(color-mix(in srgb,var(--line) 10%,transparent) 1px,transparent 1px); background-size: 100% 100%,44px 44px,44px 44px; }
.ticket-modern .ticket-main { padding: 24px; }
.ticket-modern .ticket-head { border-bottom: 0; padding-bottom: 0; }
.ticket-modern .ticket-brand { font-family: "OC Noto Sans SC",sans-serif; letter-spacing: .08em; }
.ticket-modern .format-tag { border-radius: 999px; background: color-mix(in srgb,var(--accent) 12%,transparent); }
.ticket-modern .poster-shell { height: 144px; border-radius: 12px; }
.ticket-modern.poster-filtered .poster-shell img { filter: saturate(.8) contrast(.96); }
.ticket-modern .movie-title { font-size: 24px; }
.ticket-modern .movie-quote { border-left: 0; border-radius: 10px; }
.ticket-modern .info-grid { grid-template-columns: 1.7fr .9fr .8fr; }
.ticket-modern .info-cell { border: 0; border-radius: 10px; }
.ticket-modern .ticket-stub { border-radius: 0; }
.ticket-modern .stub-seat { border-radius: 9px; background: color-mix(in srgb,var(--accent) 10%,transparent); }
.ticket-modern .qr-code { border-radius: 8px; }
.ticket-modern[data-mode="portrait"] { border-radius: 18px; }
.ticket-modern[data-mode="portrait"] .ticket-main { padding: 24px; }
.ticket-modern[data-mode="portrait"] .ticket-feature { grid-template-columns:112px minmax(0,1fr); }
.ticket-modern[data-mode="portrait"] .poster-shell { width:auto; height:144px; min-height:0; aspect-ratio:auto; }
.ticket-modern[data-mode="portrait"] .movie-copy { display:flex; }
.ticket-modern[data-mode="portrait"] .movie-copy > div:first-child,
.ticket-modern[data-mode="portrait"] .movie-quote { grid-column:auto; }
.ticket-modern[data-mode="portrait"] .ticket-stub { border-radius: 0; }

/* 4. Cyber terminal ticket */
.ticket-cyber { font-family: "OC Noto Sans SC", ui-monospace, Consolas, monospace; border: 2px solid var(--accent); background-image: repeating-linear-gradient(0deg,transparent 0 5px,color-mix(in srgb,var(--accent) 4%,transparent) 6px), linear-gradient(115deg,color-mix(in srgb,var(--accent) 9%,transparent),transparent 43%); }
.ticket-cyber::before { content:"ACCESS // 2049"; position:absolute; right:20px; top:13px; color:color-mix(in srgb,var(--accent) 35%,transparent); font:700 9px/1 ui-monospace,monospace; letter-spacing:.17em; }
.ticket-cyber .ticket-main { padding: 24px; }
.ticket-cyber .ticket-head { border-bottom: 1px solid var(--accent); }
.ticket-cyber .ticket-brand, .ticket-cyber .movie-title { text-transform: uppercase; }
.ticket-cyber .format-tag { background: color-mix(in srgb,var(--accent) 15%,transparent); }
.ticket-cyber .poster-shell { border: 2px solid var(--accent); clip-path: polygon(0 0,calc(100% - 18px) 0,100% 18px,100% 100%,18px 100%,0 calc(100% - 18px)); }
.ticket-cyber.poster-filtered .poster-shell img { filter: saturate(.72) contrast(1.06); }
.ticket-cyber .movie-copy { justify-content: start; }
.ticket-cyber .movie-kicker { padding: 5px 7px; width: fit-content; background: var(--accent); color: var(--surface); }
.ticket-cyber .movie-quote { font-family: ui-monospace,Consolas,monospace; font-style: normal; }
.ticket-cyber .info-grid { grid-template-columns: 1.4fr 1fr 1fr; }
.ticket-cyber .info-cell { border-color: color-mix(in srgb,var(--accent) 55%,var(--line)); }
.ticket-cyber .ticket-foot { border-top-color: var(--accent); }
.ticket-cyber .ticket-stub { background-image: linear-gradient(135deg,color-mix(in srgb,var(--accent) 9%,transparent),transparent 48%); }
.ticket-cyber .stub-row { font-family: ui-monospace,Consolas,monospace; }
.ticket-cyber .qr-code { color: var(--accent); background: transparent; border: 1px solid var(--accent); }
.terminal-id { padding:7px 9px; border-left:3px solid var(--accent); background:color-mix(in srgb,var(--surface-alt) 78%,transparent); color:var(--muted); font:700 9px/1.45 ui-monospace,monospace; }
.ticket-cyber[data-mode="portrait"] .ticket-feature { grid-template-columns:112px minmax(0,1fr); }
.ticket-cyber[data-mode="portrait"] .poster-shell { height:144px; min-height:0; aspect-ratio:auto; }
.ticket-cyber[data-mode="portrait"] .movie-copy { display:flex; }
.ticket-cyber[data-mode="portrait"] .movie-copy > div:first-child, .ticket-cyber[data-mode="portrait"] .movie-quote { grid-column:auto; }
.ticket-cyber[data-mode="portrait"] .info-grid { grid-template-columns:1fr 1fr; }
.ticket-cyber[data-mode="portrait"] .info-cell:first-child { grid-column:1 / -1; }

/* 5. Royal charcoal and old gold */
.ticket-golden { font-family:"OC Noto Serif SC","Songti SC",serif; border:2px solid var(--accent); background-image: radial-gradient(circle at 10% 20%,color-mix(in srgb,var(--accent) 11%,transparent) 0 1px,transparent 1.5px), linear-gradient(140deg,transparent 0 55%,color-mix(in srgb,var(--accent) 7%,transparent)); background-size:22px 22px,100% 100%; }
.ticket-golden::before { content:""; position:absolute; inset:9px; z-index:-1; border:1px solid color-mix(in srgb,var(--accent) 55%,transparent); }
.ticket-golden .ticket-head { border-bottom:1px solid var(--accent); }
.ticket-golden .ticket-brand { letter-spacing:.18em; }
.ticket-golden .format-tag { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,transparent); }
.ticket-golden .poster-shell { border:2px solid var(--accent); box-shadow:8px 8px 0 color-mix(in srgb,var(--accent) 16%,transparent); }
.ticket-golden.poster-filtered .poster-shell img { filter:saturate(.72) contrast(1.02); }
.ticket-golden .ticket-feature { grid-template-columns:104px minmax(0,1fr); }
.ticket-golden .poster-shell { height:144px; }
.ticket-golden .movie-title { color:color-mix(in srgb,var(--accent) 72%,var(--ink)); font-size:24px; }
.ticket-golden .movie-quote { border-left-color:var(--accent); font-style:italic; }
.ticket-golden .info-cell { border-color:color-mix(in srgb,var(--accent) 50%,var(--line)); }
.ticket-golden .stub-seat { border:2px double var(--accent); }
.ticket-golden .qr-code { color:var(--accent); }
.ticket-golden[data-mode="portrait"] .ticket-feature { grid-template-columns:104px minmax(0,1fr); justify-items:stretch; text-align:left; }
.ticket-golden[data-mode="portrait"] .poster-shell { width:auto; height:144px; min-height:0; }
.ticket-golden[data-mode="portrait"] .movie-copy { width:100%; }
.ticket-golden[data-mode="portrait"] .movie-kicker { text-align:left; }
.ticket-golden[data-mode="portrait"] .movie-quote { text-align:left; }
.ticket-golden[data-mode="portrait"] .info-grid { grid-template-columns:1fr 1fr; }
.ticket-golden[data-mode="portrait"] .info-cell:first-child { grid-column:1 / -1; }

/* 6. Art-house 35mm ticket */
.ticket-arthouse { --arthouse-main-bg:color-mix(in srgb,var(--surface) 66%,#101216); --arthouse-stub-bg:color-mix(in srgb,var(--surface-alt) 42%,#0b0c0f); --arthouse-strip-bg:#0b0c0f; --arthouse-paper:color-mix(in srgb,var(--ink) 96%,#f1f1ee); border:2px solid var(--line); background-color:var(--arthouse-main-bg); }
.ticket-arthouse[data-mode="landscape"] { overflow:hidden; border-radius:8px; background:var(--arthouse-main-bg); }
.ticket-arthouse[data-mode="landscape"] .ticket-main { padding:38px 24px 36px; gap:16px; background:var(--arthouse-main-bg); }
.ticket-arthouse[data-mode="landscape"] .ticket-stub { padding:38px 20px 36px; background:var(--arthouse-stub-bg); border-left:0; }
.ticket-arthouse[data-mode="landscape"] .ticket-stub::before { content:""; position:absolute; top:27px; bottom:27px; left:-1px; border-left:1px dashed color-mix(in srgb,var(--line) 72%,transparent); pointer-events:none; }
.arthouse-film-strip { position:absolute; left:0; right:0; height:27px; z-index:2; display:flex; align-items:center; gap:8px; padding:0 12px; background:var(--arthouse-strip-bg); color:var(--muted); font:700 8px/1 ui-monospace,Consolas,monospace; letter-spacing:.13em; white-space:nowrap; overflow:hidden; }
.arthouse-strip-top { top:0; border-bottom:1px solid color-mix(in srgb,var(--line) 55%,transparent); }
.arthouse-strip-bottom { bottom:0; border-top:1px solid color-mix(in srgb,var(--line) 55%,transparent); }
.arthouse-film-strip i { width:12px; height:7px; flex:0 0 auto; border-radius:1px; background:color-mix(in srgb,var(--line) 64%,transparent); }
.arthouse-main .arthouse-strip-bottom { justify-content:flex-start; }
.arthouse-stub .arthouse-strip-top { justify-content:flex-end; }
.arthouse-stub .arthouse-strip-bottom { justify-content:flex-end; font-size:7px; }
.arthouse-head { min-width:0; display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:10px; border-bottom:1px solid color-mix(in srgb,var(--line) 55%,transparent); }
.arthouse-brand { min-width:0; display:flex; align-items:center; gap:8px; color:var(--accent); font:900 11px/1.3 ui-monospace,Consolas,monospace; letter-spacing:.06em; overflow-wrap:anywhere; }
.arthouse-brand span { flex:0 0 auto; font-size:18px; line-height:1; }
.arthouse-brand b,.arthouse-brand small { display:block; }
.arthouse-brand small { margin-top:2px; color:var(--muted); font-size:7px; letter-spacing:.12em; }
.ticket-arthouse[data-mode="landscape"] .format-tag { padding:4px 8px; background:color-mix(in srgb,var(--surface) 75%,var(--surface-alt)); color:var(--ink); border-color:var(--line); }
.arthouse-feature { min-width:0; display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; align-items:start; }
.ticket-arthouse[data-mode="landscape"] .poster-shell { height:128px; border:1px solid var(--muted); }
.arthouse-copy { min-width:0; min-height:128px; display:flex; flex-direction:column; justify-content:space-between; gap:8px; }
.ticket-arthouse[data-mode="landscape"] .movie-original { margin:0; color:var(--muted); font:700 9px/1.35 ui-monospace,Consolas,monospace; }
.ticket-arthouse[data-mode="landscape"] .movie-title { margin-top:4px; color:var(--ink); font:900 24px/1.08 "OC Noto Serif SC",serif; }
.arthouse-byline { margin-top:7px; color:var(--muted); font-size:12px; font-weight:700; line-height:1.45; overflow-wrap:anywhere; }
.arthouse-quote { margin:0; padding:8px 10px; border-left:2px solid var(--accent); background:color-mix(in srgb,var(--ink) 6%,transparent); color:var(--ink); font:700 italic 11px/1.5 "OC Noto Serif SC",serif; overflow-wrap:anywhere; }
.arthouse-info-panel { padding:8px 11px; border:1px solid color-mix(in srgb,var(--ink) 88%,transparent); background:var(--arthouse-paper); color:var(--arthouse-stub-bg); }
.arthouse-info-panel > div { min-width:0; display:grid; grid-template-columns:116px minmax(0,1fr); gap:10px; align-items:baseline; padding:5px 0; border-bottom:1px solid color-mix(in srgb,var(--arthouse-stub-bg) 20%,transparent); font:800 11px/1.35 ui-monospace,Consolas,monospace; }
.arthouse-info-panel > div:last-child { border-bottom:0; }
.arthouse-info-panel span { white-space:nowrap; }
.arthouse-info-panel b { font-size:12px; text-align:right; overflow-wrap:anywhere; }
.arthouse-info-panel .arthouse-seat-price b { color:var(--stamp); font-size:13px; }
.arthouse-footer { min-width:0; display:flex; align-items:end; justify-content:space-between; gap:16px; margin-top:auto; padding:0 12px; }
.arthouse-footer .barcode-wrap { max-width:160px; }
.arthouse-footer .barcode { height:36px; }
.arthouse-selection { min-width:0; text-align:right; }
.arthouse-selection small { display:block; margin-bottom:4px; color:var(--muted); font:700 8px/1.2 ui-monospace,Consolas,monospace; }
.arthouse-selection b { display:block; color:var(--ink); font-size:12px; overflow-wrap:anywhere; }
.arthouse-stub .stub-label { color:var(--accent); font-weight:900; }
.arthouse-stub .stub-head { padding-bottom:10px; border-bottom-color:color-mix(in srgb,var(--line) 55%,transparent); }
.arthouse-stub .stub-head h3 { color:var(--ink); }
.arthouse-stub-facts { display:grid; gap:7px; }
.arthouse-stub .stub-row { grid-template-columns:46px minmax(0,1fr); padding:0; border:0; font-family:ui-monospace,Consolas,monospace; }
.arthouse-stub .stub-row b { color:var(--ink); }
.arthouse-stub .stub-row:last-of-type b { color:var(--accent); }
.arthouse-stub .stub-seat { margin-top:2px; padding:8px; border-color:var(--line); color:var(--ink); }
.arthouse-stub .stub-codebox { border-top-color:color-mix(in srgb,var(--line) 55%,transparent); }
.arthouse-stub .qr-code { --qr-size:64px; color:var(--accent); background:transparent; }
.arthouse-stub .stub-status { color:var(--muted); }
.ticket-arthouse[data-mode="portrait"] { background-image:linear-gradient(90deg,color-mix(in srgb,var(--ink) 65%,transparent) 0 22px,transparent 22px calc(100% - 22px),color-mix(in srgb,var(--ink) 65%,transparent) calc(100% - 22px)); }
.ticket-arthouse[data-mode="portrait"]::before,.ticket-arthouse[data-mode="portrait"]::after { content:""; position:absolute; top:20px; bottom:20px; width:13px; z-index:2; background:repeating-linear-gradient(0deg,var(--ink) 0 16px,transparent 16px 25px); opacity:.62; pointer-events:none; }
.ticket-arthouse .ticket-head { border-bottom-color:var(--accent); }
.ticket-arthouse .format-tag { background:var(--ink); color:var(--surface); border-color:var(--ink); }
.ticket-arthouse .poster-shell { border:1px solid var(--muted); }
.ticket-arthouse.poster-filtered .poster-shell img { filter:grayscale(.72) contrast(1.03); }
.ticket-arthouse .movie-title { font-family:"OC Noto Serif SC",serif; }
.ticket-arthouse .movie-quote { font-family:"OC Noto Serif SC",serif; }
.ticket-arthouse .info-grid { display:block; padding:9px 11px; background:color-mix(in srgb,var(--ink) 88%,var(--surface)); color:var(--surface); }
.ticket-arthouse .info-cell { display:grid; grid-template-columns:92px minmax(0,1fr); padding:5px 0; border:0; border-bottom:1px solid color-mix(in srgb,var(--surface) 23%,transparent); background:transparent; }
.ticket-arthouse .info-cell:last-child { border-bottom:0; }
.ticket-arthouse .info-cell small { color:color-mix(in srgb,var(--surface) 62%,transparent); }
.ticket-arthouse .info-cell span { color:color-mix(in srgb,var(--surface) 68%,transparent); }
.ticket-arthouse .qr-code { color:var(--accent); background:transparent; }
.ticket-arthouse[data-mode="portrait"]::before { left:4px; right:auto; }
.ticket-arthouse[data-mode="portrait"]::after { right:4px; left:auto; }
.ticket-arthouse[data-mode="portrait"] .ticket-feature { grid-template-columns:1fr; }
.ticket-arthouse[data-mode="portrait"] .poster-shell { width:100%; height:auto; min-height:330px; }
.ticket-arthouse[data-mode="portrait"] .ticket-main { padding:32px 38px; background:var(--arthouse-main-bg); }
.ticket-arthouse[data-mode="portrait"] .ticket-stub { background:var(--arthouse-stub-bg); }
.ticket-arthouse[data-mode="portrait"] .arthouse-info-panel { padding:9px 11px; }
.ticket-arthouse[data-mode="portrait"] .arthouse-info-panel > div { grid-template-columns:108px minmax(0,1fr); }
.ticket-arthouse[data-mode="portrait"] .info-cell { grid-template-columns:96px minmax(0,1fr); }

/* 7. Quiet quantum ticket */
.ticket-scifi { border:2px solid var(--accent); background-image:radial-gradient(circle at 80% 12%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 30%),radial-gradient(circle at 12% 86%,color-mix(in srgb,var(--accent) 10%,transparent),transparent 27%); }
.ticket-scifi::before { content:""; position:absolute; width:190px; height:190px; right:270px; top:82px; border:1px solid color-mix(in srgb,var(--accent) 22%,transparent); border-radius:50%; box-shadow:0 0 0 22px color-mix(in srgb,var(--accent) 5%,transparent),0 0 0 48px color-mix(in srgb,var(--accent) 3%,transparent); z-index:-1; }
.ticket-scifi .ticket-brand { font-family:ui-monospace,Consolas,monospace; }
.ticket-scifi .format-tag { border-radius:999px; background:color-mix(in srgb,var(--accent) 11%,transparent); }
.ticket-scifi .poster-shell { clip-path:polygon(0 0,100% 0,100% calc(100% - 24px),calc(100% - 24px) 100%,0 100%); border:2px solid var(--accent); }
.ticket-scifi.poster-filtered .poster-shell img { filter:saturate(.7) contrast(1.04); }
.ticket-scifi .movie-title { letter-spacing:.025em; }
.ticket-scifi .movie-quote { border-left:0; border-bottom:1px solid var(--accent); }
.ticket-scifi .info-cell { border-color:color-mix(in srgb,var(--accent) 44%,var(--line)); }
.ticket-scifi .seat-block b { letter-spacing:.1em; }
.ticket-scifi .qr-code { color:var(--accent); background:transparent; border:1px solid var(--accent); }
.quantum-coord { display:flex; gap:8px; flex-wrap:wrap; color:var(--muted); font:700 9px/1.4 ui-monospace,monospace; }
.quantum-coord span { padding:4px 6px; border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line)); }
.ticket-scifi[data-mode="portrait"]::before { right:54px; top:190px; width:180px; height:180px; }
.ticket-scifi[data-mode="portrait"] .ticket-feature { grid-template-columns:112px minmax(0,1fr); }
.ticket-scifi[data-mode="portrait"] .poster-shell { height:144px; min-height:0; aspect-ratio:auto; }
.ticket-scifi[data-mode="portrait"] .movie-copy { display:flex; }
.ticket-scifi[data-mode="portrait"] .movie-copy > div:first-child,.ticket-scifi[data-mode="portrait"] .movie-quote { grid-column:auto; }
.ticket-scifi[data-mode="portrait"] .info-grid { grid-template-columns:1fr 1fr; }
.ticket-scifi[data-mode="portrait"] .info-cell:first-child { grid-column:1 / -1; }

/* 8. Thermal receipt ticket */
.ticket-thermal { --thermal-ink:#1c1d1c; font-family:ui-monospace,"SFMono-Regular",Consolas,"OC Noto Sans SC",monospace; border:2px solid var(--thermal-ink); background-image:repeating-linear-gradient(0deg,transparent 0 9px,rgba(28,29,28,.025) 10px); color:var(--thermal-ink); }
.ticket-thermal::before,.ticket-thermal::after { content:""; position:absolute; left:0; right:0; height:8px; z-index:3; background:repeating-linear-gradient(135deg,var(--thermal-ink) 0 7px,transparent 7px 14px); pointer-events:none; }
.ticket-thermal::before { top:0; }
.ticket-thermal::after { bottom:0; transform:rotate(180deg); }
.ticket-thermal[data-mode="landscape"] { grid-template-columns:minmax(0,41fr) minmax(0,15fr); }
.ticket-thermal .ticket-main { padding:20px 24px; gap:14px; }
.ticket-thermal .ticket-stub { padding:20px; }
.ticket-thermal .poster-shell { border:2px solid var(--thermal-ink); }
.ticket-thermal.poster-filtered .poster-shell img { filter:grayscale(1) contrast(1.08); }
.thermal-feature { display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; align-items:start; }
.ticket-thermal .poster-shell { height:128px; }
.thermal-feature-copy { min-width:0; }
.thermal-format { display:inline-block; max-width:100%; padding:3px 7px; background:var(--thermal-ink); color:var(--surface); font-size:10px; font-weight:900; line-height:1.25; overflow-wrap:anywhere; }
.ticket-thermal .movie-title { margin-top:6px; color:var(--thermal-ink); font-size:24px; line-height:1.05; overflow-wrap:anywhere; }
.ticket-thermal .movie-original { margin-top:3px; color:var(--thermal-ink); font-size:12px; font-weight:900; line-height:1.3; overflow-wrap:anywhere; }
.thermal-byline { margin-top:18px; padding-left:10px; border-left:2px solid var(--thermal-ink); font:700 12px/1.5 "OC Noto Sans SC",sans-serif; }
.thermal-byline > div { display:flex; align-items:baseline; gap:7px; min-width:0; }
.thermal-byline span { flex:0 0 auto; }
.thermal-byline b { font-size:13px; font-weight:900; overflow-wrap:anywhere; }
.thermal-details { padding:8px 10px 9px; border:2px solid var(--thermal-ink); }
.thermal-detail-row { display:grid; grid-template-columns:78px minmax(0,1fr); gap:8px; align-items:baseline; padding:4px 0; border-bottom:1px solid rgba(28,29,28,.34); font-size:12px; line-height:1.35; }
.thermal-detail-row span { font-weight:700; }
.thermal-detail-row b { font-weight:900; text-align:right; overflow-wrap:anywhere; }
.thermal-seat-row { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-top:7px; padding:7px 9px; background:var(--thermal-ink); color:var(--surface); font-size:14px; font-weight:900; line-height:1.25; }
.thermal-seat-row b { flex:0 0 auto; min-width:max-content; font-size:15px; text-align:right; white-space:nowrap; overflow-wrap:normal; }
.thermal-quote { margin:0; padding:3px 0 8px 10px; border-left:2px solid var(--thermal-ink); border-bottom:2px solid var(--thermal-ink); color:var(--thermal-ink); font:700 italic 11px/1.5 "OC Noto Serif SC",serif; overflow-wrap:anywhere; }
.thermal-footer { display:flex; align-items:end; justify-content:space-between; gap:16px; }
.ticket-thermal .thermal-footer .barcode-wrap { max-width:184px; flex:1 1 184px; }
.ticket-thermal .thermal-footer .barcode { height:40px; }
.thermal-price { flex:0 0 auto; text-align:right; }
.thermal-price small { display:block; margin-bottom:3px; color:var(--thermal-ink); font-size:9px; font-weight:800; }
.thermal-price b { display:block; padding:4px 9px; border:2px solid var(--thermal-ink); color:var(--thermal-ink); font-size:15px; line-height:1.15; white-space:nowrap; }
.ticket-thermal .ticket-stub { border-color:var(--thermal-ink) !important; }
.ticket-thermal .stub-head,.ticket-thermal .stub-codebox { border-color:var(--thermal-ink) !important; }
.ticket-thermal .stub-row { border-bottom:1px solid rgba(28,29,28,.4); }
.ticket-thermal .stub-seat { background:var(--thermal-ink); color:var(--surface); border-color:var(--thermal-ink); }
.ticket-thermal .qr-code { color:var(--thermal-ink); background:var(--surface); border:1px solid var(--thermal-ink); }
.ticket-thermal.export-main[data-mode="landscape"] { width:492px; grid-template-columns:minmax(0,1fr); }
.ticket-thermal.export-stub[data-mode="landscape"] { width:180px; grid-template-columns:minmax(0,1fr); }
.ticket-thermal[data-mode="portrait"] { width:448px; }
.ticket-thermal[data-mode="portrait"] .ticket-main { padding:20px 24px; }
.ticket-thermal[data-mode="portrait"] .thermal-feature { grid-template-columns:96px minmax(0,1fr); }
.ticket-thermal[data-mode="portrait"] .poster-shell { height:128px; min-height:0; }
.ticket-thermal[data-mode="portrait"] .movie-title { font-size:24px; }
.ticket-thermal[data-mode="portrait"] .thermal-detail-row { grid-template-columns:78px minmax(0,1fr); }

@supports not (background: color-mix(in srgb, white, black)) {
  .movie-quote,.info-cell { background:transparent; }
}

/* Original designer baseline: 672px ticket, 24px title, 96-112px poster, content-driven height. */
