@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=Special+Elite&display=swap');

:root {
  --ink: #0b0d12;
  --ink-2: #151924;
  --paper: #f2ead7;
  --paper-2: #dcd1b8;
  --cream: #fff9e9;
  --blue: #2c63d8;
  --coral: #f04e30;
  --gold: #f5b842;
  --mint: #4bc0a0;
  --muted: #847e73;
  --line: rgba(11, 13, 18, .17);
  --shadow: 0 22px 60px rgba(0, 0, 0, .22);
  --lift: 0 8px 22px rgba(5, 7, 10, .18);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.eyebrow, .mini-label { margin: 0 0 8px; font: 700 12px/1 "Barlow Condensed", sans-serif; letter-spacing: .16em; color: var(--coral); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-weight: 700; }
.button--ink { background: var(--ink); color: var(--cream); box-shadow: var(--lift); }
.button--accent { border-color: var(--coral); background: var(--coral); color: white; box-shadow: var(--lift); }
.button--full { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(370px, .65fr); background: var(--paper); }
.login-art { min-height: 100vh; position: relative; background: #080b10 url('/og.png') center/cover no-repeat; border-right: 9px solid var(--ink); }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 65%, rgba(7, 9, 13, .5)); pointer-events: none; }
.login-art__label { position: absolute; z-index: 1; left: 24px; bottom: 20px; right: 24px; display: flex; justify-content: space-between; color: var(--paper); font: 700 11px "Barlow Condensed"; letter-spacing: .18em; }
.login-panel { min-height: 100vh; padding: 38px clamp(34px, 5vw, 78px); display: flex; flex-direction: column; justify-content: center; position: relative; background-color: var(--paper); background-image: radial-gradient(rgba(11, 13, 18, .11) .55px, transparent .7px); background-size: 5px 5px; }
.wordmark { position: absolute; top: 36px; left: clamp(34px, 5vw, 78px); display: flex; align-items: baseline; gap: 7px; font: 700 20px "Barlow Condensed"; letter-spacing: .08em; }
.wordmark em { color: var(--coral); font: 17px "Special Elite"; transform: rotate(-4deg); }
.crop-mark { position: absolute; left: -19px; top: -14px; font: 22px serif; color: var(--gold); }
.login-copy { max-width: 460px; }
.login-copy h1 { margin: 0 0 22px; max-width: 500px; font: 800 clamp(48px, 5vw, 78px)/.87 "Barlow Condensed"; text-transform: uppercase; letter-spacing: -.03em; }
.login-copy p:not(.eyebrow) { max-width: 420px; color: #494942; line-height: 1.65; }
.login-form { display: grid; gap: 16px; margin-top: 32px; max-width: 420px; }
.login-form label, .paper-form label, .dialog label { display: grid; gap: 7px; color: #4a4943; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid rgba(11,13,18,.28); border-radius: 0; background: rgba(255, 249, 233, .72); color: var(--ink); padding: 12px 13px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(44,99,216,.13); }
.login-form .button { margin-top: 4px; justify-content: space-between; }
.login-note { margin: 24px 0 0; color: #777166; font-size: 11px; line-height: 1.6; }
.login-note code { color: var(--ink); }
.form-error { min-height: 18px; margin: 0; color: #a92514; font-size: 12px; }

.studio { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); background: var(--paper); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 17px 18px; display: flex; flex-direction: column; color: var(--paper); background-color: var(--ink); background-image: radial-gradient(rgba(242,234,215,.05) .6px, transparent .7px); background-size: 5px 5px; border-right: 1px solid #343640; }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 23px; border-bottom: 1px solid #343640; font: 700 16px/1 "Barlow Condensed"; letter-spacing: .08em; }
.brand-box { display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink); background: var(--gold); border: 1px solid #fff1c3; box-shadow: 0 5px 14px rgba(0,0,0,.34); font-weight: 800; transform: rotate(-2deg); }
.primary-nav { display: grid; gap: 4px; margin-top: 19px; }
.nav-item { width: 100%; padding: 11px 10px; display: flex; align-items: center; gap: 12px; border: 0; color: #a9a7a0; background: transparent; text-align: left; font: 600 14px "DM Sans"; }
.nav-item span { color: #565a63; font: 600 10px "Barlow Condensed"; }
.nav-item:hover { color: var(--paper); background: #171b24; }
.nav-item.active { color: var(--paper); background: #202633; box-shadow: inset 3px 0 var(--coral); }
.nav-item.active span { color: var(--coral); }
.project-stack { margin-top: 32px; padding: 0 6px; }
.mini-label { color: #676b75; }
.project-pill { width: 100%; padding: 8px 3px; display: flex; align-items: center; gap: 9px; border: 0; color: #8d8e90; background: transparent; text-align: left; font-size: 12px; }
.project-pill i { width: 7px; height: 7px; background: var(--project); transform: rotate(45deg); }
.project-pill.active { color: var(--paper); }
.user-card { margin-top: auto; padding: 13px 10px 2px; border-top: 1px solid #343640; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; font-size: 11px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink); background: var(--mint); font: 800 14px "Barlow Condensed"; border-radius: 50% 44% 52% 47%; }
.user-card strong { display: block; color: var(--paper); font-size: 12px; }
.user-card small { color: #747780; text-transform: uppercase; }
.logout { border: 0; color: #777a82; background: transparent; font-size: 17px; }

.workspace { min-width: 0; min-height: 100vh; background-color: #dad2c0; background-image: linear-gradient(rgba(11,13,18,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(11,13,18,.045) 1px, transparent 1px); background-size: 24px 24px; }
.topbar { height: 94px; padding: 18px 27px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink); background: var(--paper); border-bottom: 1px solid rgba(11,13,18,.2); }
.topbar h2 { margin: 0; font: 800 28px "Barlow Condensed"; text-transform: uppercase; letter-spacing: .01em; }
.topbar__actions { display: flex; align-items: center; gap: 14px; }
.session-select { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.session-select select { width: 230px; padding: 9px 30px 9px 10px; background: transparent; }

.view { min-height: calc(100vh - 94px); }
.canvas-view { display: grid; grid-template-columns: minmax(460px, 1fr) 292px; grid-template-rows: 44px minmax(0, 1fr); }
.canvas-toolbar { grid-column: 1 / -1; padding: 0 16px 0 23px; display: flex; align-items: center; justify-content: space-between; background: #c9c1b1; border-bottom: 1px solid rgba(11,13,18,.18); font-size: 11px; }
.canvas-toolbar > div { display: flex; align-items: center; gap: 8px; }
.canvas-toolbar small { color: #6f6c64; }
.status-dot { width: 7px; height: 7px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 3px rgba(75,192,160,.2); }
.zoom-tools { border: 1px solid rgba(11,13,18,.18); background: rgba(242,234,215,.6); }
.zoom-tools button { width: 28px; height: 27px; border: 0; background: transparent; }
.zoom-tools span { min-width: 38px; text-align: center; }
.page-stage { min-width: 0; padding: 28px; overflow: auto; display: grid; place-items: start center; background: rgba(92,87,77,.15); }
.comic-page { --zoom: 1; width: min(760px, 100%); aspect-ratio: .76; padding: 17px; display: grid; grid-template-columns: 1.12fr .88fr; grid-template-rows: 1fr .84fr 1.06fr; gap: 10px; background: var(--cream); box-shadow: 1px 2px 0 #8b806b, 4px 7px 0 #f4ecd9, 5px 9px 0 #756c5b, var(--shadow); transform: scale(var(--zoom)); transform-origin: top center; transition: transform .18s ease; }
.empty-page { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--muted); text-align: center; }
.panel { position: relative; min-height: 150px; overflow: hidden; border: 4px solid var(--ink); background-color: #1f3b76; isolation: isolate; cursor: crosshair; }
.panel:nth-child(3n + 2) { background-color: #b76d27; }
.panel:nth-child(3n) { background-color: #75664e; }
.panel:first-child { grid-column: 1 / -1; }
.panel:nth-child(4) { grid-column: 1 / -1; }
.panel::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: .8; background-image: radial-gradient(circle at 70% 38%, rgba(245,184,66,.9) 0 2%, transparent 2.5%), linear-gradient(130deg, transparent 45%, rgba(7,9,15,.86) 45.5% 58%, transparent 58.5%), linear-gradient(12deg, rgba(7,9,15,.65) 0 18%, transparent 18.5%), repeating-linear-gradient(100deg, transparent 0 14px, rgba(255,255,255,.07) 15px, transparent 17px); }
.panel::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .22; mix-blend-mode: multiply; background-image: radial-gradient(#000 0.6px, transparent .8px); background-size: 4px 4px; }
.panel.selected { outline: 4px solid var(--coral); outline-offset: 3px; }
.panel__meta { position: absolute; z-index: 6; left: 10px; bottom: 8px; max-width: 68%; padding: 5px 7px; color: var(--paper); background: rgba(8,10,15,.82); border-left: 3px solid var(--gold); pointer-events: none; }
.panel__meta strong { display: block; font: 700 11px "Barlow Condensed"; letter-spacing: .08em; }
.panel__meta span { display: block; max-height: 31px; overflow: hidden; color: #bfc2c6; font-size: 8px; line-height: 1.45; }
.character-anchor { position: absolute; z-index: -1; right: 6%; bottom: -3%; width: 33%; aspect-ratio: .68; display: grid; place-items: center; border: 4px solid rgba(6,8,11,.7); border-radius: 50% 50% 8% 8%; background: #111722; color: rgba(255,255,255,.2); font: 800 48px "Barlow Condensed"; transform: rotate(2deg); overflow: hidden; box-shadow: -18px 0 0 rgba(7,9,14,.34); }
.character-anchor img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.15) saturate(.8); }

.bubble { position: absolute; z-index: 3; width: max-content; max-width: 42%; min-width: 66px; padding: 8px 11px; color: var(--ink); background: var(--cream); border: 2px solid var(--ink); border-bottom-color: var(--character-color, var(--coral)); border-radius: 50%; box-shadow: 0 3px 8px rgba(5,7,10,.22); font: 600 clamp(8px, .75vw, 11px)/1.2 "DM Sans"; text-align: center; cursor: grab; touch-action: none; }
.bubble::after { content: ""; position: absolute; left: 35%; bottom: -10px; width: 13px; height: 14px; background: var(--cream); border-right: 2px solid var(--ink); transform: skew(-27deg) rotate(25deg); }
.bubble.thought { border-radius: 48% 55% 44% 59% / 55% 46% 57% 43%; border-style: dashed; background: #e4e9ee; }
.bubble.thought::after { width: 7px; height: 7px; bottom: -12px; border: 2px solid var(--ink); border-radius: 50%; transform: none; background: #e4e9ee; }
.bubble:active { cursor: grabbing; }
.bubble__speaker { display: block; margin-bottom: 2px; color: var(--character-color, var(--coral)); font: 800 8px "Barlow Condensed"; letter-spacing: .07em; }
.bubble.locked .bubble__speaker::after { content: " · SOURCE"; color: #777; }

.audio-dock { position: absolute; z-index: 8; right: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; opacity: .25; transform: translateX(calc(100% - 28px)); transition: .2s ease; }
.panel:hover .audio-dock, .audio-dock:focus-within, .audio-dock.playing { opacity: 1; transform: translateX(0); }
.audio-chip { height: 27px; max-width: 180px; padding: 0 8px 0 6px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--cream); border-radius: 20px; color: var(--cream); background: rgba(8,10,15,.88); font: 700 8px "Barlow Condensed"; letter-spacing: .04em; }
.audio-chip__avatar { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--character-color); }
.waveform { height: 12px; display: flex; align-items: center; gap: 1.5px; }
.waveform i { width: 2px; height: var(--h); background: currentColor; animation: none; }
.audio-chip.playing .waveform i { animation: wave .5s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes wave { to { height: 3px; } }

.inspector { grid-column: 2; grid-row: 2; min-height: 0; overflow-y: auto; color: var(--ink); background: var(--paper); border-left: 1px solid rgba(11,13,18,.26); }
.inspector__head { padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.inspector__head span { font: 700 14px "Barlow Condensed"; }
.inspector-section { padding: 18px; border-bottom: 1px solid var(--line); }
.inspector h3 { margin: 0 0 12px; font: 800 18px "Barlow Condensed"; text-transform: uppercase; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; border: 1px solid var(--ink); }
.segmented button { padding: 8px; border: 0; background: transparent; font: 700 11px "Barlow Condensed"; text-transform: uppercase; }
.segmented button.active { color: var(--cream); background: var(--ink); }
.field-label { display: grid; gap: 5px; margin-top: 11px; color: #676258; font-size: 10px; font-weight: 700; }
.field-label textarea, .field-label select { padding: 9px; background: var(--cream); font-size: 11px; resize: vertical; }
.permission-note { margin: 12px 0 0; color: #817b70; font-size: 9px; line-height: 1.5; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.storage-badge { padding: 3px 6px; color: #23735e; background: rgba(75,192,160,.16); border: 1px solid rgba(75,192,160,.5); font: 700 8px "Barlow Condensed"; text-transform: uppercase; }
.storage-badge.offline { color: #8b5713; background: rgba(245,184,66,.16); border-color: rgba(245,184,66,.6); }
.audio-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.record-button, .upload-button { min-height: 39px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ink); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.record-button i { width: 9px; height: 9px; background: var(--coral); border-radius: 50%; }
.record-button.recording { color: white; background: var(--coral); }
.record-button.recording i { background: white; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.recording-status { margin-top: 10px; min-height: 32px; color: #7d776c; font-size: 9px; line-height: 1.5; }

.content-view { padding: 38px clamp(24px, 4vw, 58px) 70px; }
.content-intro { max-width: 670px; margin-bottom: 31px; }
.content-intro h3, .qc-hero h3 { margin: 0; font: 800 clamp(38px, 4vw, 58px)/.95 "Barlow Condensed"; text-transform: uppercase; }
.content-intro > p:not(.eyebrow), .qc-hero p:not(.eyebrow) { color: #646057; line-height: 1.6; }
.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 17px; }
.session-card { min-height: 230px; padding: 19px; position: relative; overflow: hidden; display: flex; flex-direction: column; color: var(--paper); background: var(--ink-2); border: 1px solid #3a3c42; border-left: 4px solid #596170; box-shadow: var(--lift); }
.session-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -90px; top: -80px; border: 28px solid var(--blue); border-radius: 50%; opacity: .28; }
.session-card.active { border-left-color: var(--gold); box-shadow: 0 12px 28px rgba(5,7,10,.24); }
.session-card small { color: #747985; font: 700 10px "Barlow Condensed"; letter-spacing: .12em; }
.session-card h4 { margin: 20px 0 8px; font: 800 25px/1 "Barlow Condensed"; text-transform: uppercase; }
.session-card p { color: #989ca3; font-size: 11px; line-height: 1.5; }
.session-card button { margin-top: auto; align-self: flex-start; padding: 0; border: 0; color: var(--gold); background: transparent; font-weight: 700; }

.style-form { max-width: 990px; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.guide-card, .paper-form { padding: 21px; background: var(--paper); border: 1px solid rgba(11,13,18,.24); box-shadow: 6px 6px 0 rgba(11,13,18,.18); }
.guide-card--wide { grid-column: 1 / -1; }
.guide-card h4, .paper-form h3 { margin: 0 0 17px; font: 800 22px "Barlow Condensed"; text-transform: uppercase; }
.guide-card label { display: grid; gap: 6px; margin-top: 11px; color: #706b62; font-size: 10px; font-weight: 700; }
.guide-card textarea { min-height: 85px; resize: vertical; }
.guide-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.readonly-banner { grid-column: 1 / -1; padding: 10px 13px; color: #5e584e; background: rgba(245,184,66,.25); border-left: 4px solid var(--gold); font-size: 11px; }

.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 15px; margin-bottom: 28px; }
.cast-card { min-height: 285px; position: relative; overflow: hidden; color: var(--paper); background: var(--ink); border: 5px solid var(--paper); outline: 1px solid var(--ink); }
.cast-card__portrait { height: 188px; display: grid; place-items: center; background: linear-gradient(145deg, color-mix(in srgb, var(--character-color) 75%, #111), #111); font: 800 72px "Barlow Condensed"; color: rgba(255,255,255,.62); }
.cast-card__portrait img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78) contrast(1.1); }
.cast-card__copy { padding: 12px; }
.cast-card h4 { margin: 0 0 3px; font: 800 22px "Barlow Condensed"; text-transform: uppercase; }
.cast-card p { margin: 0; color: #8f9298; font-size: 10px; line-height: 1.5; }
.cast-card__owner { position: absolute; top: 8px; left: 8px; padding: 4px 6px; background: var(--cream); color: var(--ink); font: 700 8px "Barlow Condensed"; text-transform: uppercase; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.paper-form { display: grid; gap: 12px; }
.paper-form label { gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.file-drop { padding: 15px; border: 1px dashed #878173; background: rgba(255,255,255,.25); }
.person-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.person-row:last-child { border: 0; }
.person-row .initial { width: 30px; height: 30px; display: grid; place-items: center; color: var(--paper); background: var(--blue); border-radius: 50%; font: 800 12px "Barlow Condensed"; }
.person-row small { display: block; color: var(--muted); }
.role-tag { color: var(--coral); font: 700 9px "Barlow Condensed"; text-transform: uppercase; }
.invite-form { margin-top: 20px; padding-top: 16px; border-top: 2px solid var(--ink); }
.invite-form .form-row { grid-template-columns: 1fr 1fr; }
.bridge-panel { margin: 24px -21px -21px; padding: 21px; color: var(--paper); background: var(--ink-2); border-top: 5px solid var(--blue); }
.bridge-panel h3 { color: var(--paper); }
.bridge-copy { margin: -9px 0 14px; color: #91949b; font-size: 10px; line-height: 1.5; }
.bridge-list { display: grid; gap: 5px; }
.bridge-row { min-height: 42px; padding: 6px; display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 8px; background: #222936; }
.bridge-platform { width: 31px; height: 27px; display: grid; place-items: center; color: var(--ink); background: var(--gold); font: 800 8px "Barlow Condensed"; transform: rotate(-2deg); }
.bridge-platform.roll20 { color: white; background: var(--coral); }
.bridge-row strong { display: block; color: var(--paper); font-size: 10px; }
.bridge-row small { color: #747984; font-size: 8px; }
.bridge-row button { border: 0; color: #777d88; background: transparent; font-size: 16px; }
.empty-bridges { color: #777b84; font-size: 9px; }
.bridge-form { display: grid; gap: 9px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #363c48; }
.bridge-form label { color: #9498a0; }
.bridge-form input, .bridge-form select { color: var(--paper); background: #232a37; border-color: #434955; }
.bridge-form .button { border-color: var(--paper); box-shadow: var(--lift); }
.bridge-secret { margin-top: 13px; padding: 11px; color: var(--ink); background: var(--gold); }
.bridge-secret strong { font: 800 15px "Barlow Condensed"; text-transform: uppercase; }
.bridge-secret p { margin: 3px 0 8px; font-size: 8px; line-height: 1.45; }
.bridge-secret textarea { min-height: 58px; font: 9px monospace; word-break: break-all; resize: none; }
.bridge-secret button { margin-top: 6px; padding: 6px 9px; border: 1px solid var(--ink); background: transparent; font-size: 9px; font-weight: 700; }

.qc-hero { display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 30px; padding: 32px; color: var(--paper); background: var(--ink); border-top: 3px solid var(--blue); box-shadow: var(--lift); }
.qc-hero p:not(.eyebrow) { max-width: 630px; color: #a6a6a2; }
.qc-hero .button { margin-top: 13px; }
.score-seal { width: 178px; height: 178px; display: grid; place-content: center; text-align: center; border: 2px solid var(--gold); border-radius: 50%; outline: 1px dashed var(--gold); outline-offset: -9px; transform: rotate(2deg); }
.score-seal strong { color: var(--gold); font: 800 66px/.8 "Barlow Condensed"; }
.score-seal span { margin-top: 10px; font: 700 10px "Barlow Condensed"; letter-spacing: .14em; }
.qc-results { margin-top: 30px; display: grid; gap: 9px; }
.qc-item { padding: 17px; display: grid; grid-template-columns: 31px 180px 1fr; gap: 13px; align-items: center; background: var(--paper); border: 1px solid var(--line); }
.qc-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); font-weight: 800; }
.qc-item.warn .qc-icon { background: var(--gold); }
.qc-item.fail .qc-icon { color: white; background: var(--coral); }
.qc-item strong { font: 800 16px "Barlow Condensed"; text-transform: uppercase; }
.qc-item p { margin: 0; color: #6e695f; font-size: 11px; }

.dialog { width: min(680px, calc(100vw - 28px)); padding: 0; color: var(--ink); background: var(--paper); border: 4px solid var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(5,7,10,.74); backdrop-filter: blur(3px); }
.dialog form { padding: 29px; display: grid; gap: 15px; }
.dialog h2 { margin: 0; font: 800 39px "Barlow Condensed"; text-transform: uppercase; }
.dialog p:not(.eyebrow) { margin: 0 0 4px; color: #676158; font-size: 12px; line-height: 1.5; }
.dialog textarea { resize: vertical; font-family: "Special Elite", monospace; line-height: 1.55; }
.dialog__close { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 28px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px; padding: 13px 16px; color: var(--paper); background: var(--ink); border-left: 5px solid var(--mint); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--coral); }

@media (max-width: 1050px) {
  .studio { grid-template-columns: 74px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  .sidebar__brand { justify-content: center; }
  .sidebar__brand > span:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; gap: 0; font-size: 0; }
  .nav-item.active { font-size: 10px; flex-direction: column; gap: 3px; }
  .project-stack { display: none; }
  .user-card { grid-template-columns: 1fr; justify-items: center; }
  .user-card > div:not(.user-avatar) { display: none; }
  .login-screen { grid-template-columns: 1.2fr minmax(350px, .8fr); }
}

@media (max-width: 820px) {
  .login-screen { display: block; background: var(--paper); }
  .login-art { min-height: 35vh; border-right: 0; border-bottom: 7px solid var(--ink); }
  .login-panel { min-height: 65vh; padding-top: 90px; }
  .studio { display: block; }
  .sidebar { position: fixed; z-index: 30; inset: auto 0 0; width: auto; height: 64px; padding: 5px 8px; flex-direction: row; border: 0; border-top: 1px solid #343640; }
  .sidebar__brand, .project-stack, .user-card { display: none; }
  .primary-nav { width: 100%; margin: 0; grid-template-columns: repeat(5, 1fr); }
  .nav-item, .nav-item.active { height: 53px; flex-direction: column; justify-content: center; gap: 3px; font-size: 8px; text-align: center; box-shadow: none; }
  .topbar { height: auto; min-height: 88px; padding: 15px; align-items: flex-end; }
  .topbar__actions { flex-wrap: wrap; justify-content: flex-end; }
  .session-select span { display: none; }
  .session-select select { width: 155px; }
  .topbar .button { min-height: 38px; padding-inline: 11px; font-size: 11px; }
  .view { min-height: calc(100vh - 88px); padding-bottom: 70px; }
  .canvas-view { grid-template-columns: 1fr; grid-template-rows: 42px minmax(430px, 1fr) auto; }
  .canvas-toolbar { grid-column: 1; }
  .page-stage { padding: 18px 12px 42px; }
  .inspector { grid-column: 1; grid-row: 3; border-left: 0; border-top: 5px solid var(--ink); }
  .inspector-section { display: inline-block; width: 49%; vertical-align: top; }
  .comic-page { min-width: 540px; }
  .style-form, .two-column { grid-template-columns: 1fr; }
  .guide-card--wide, .guide-actions, .readonly-banner { grid-column: 1; }
  .qc-hero { grid-template-columns: 1fr; }
  .score-seal { display: none; }
}

@media (max-width: 520px) {
  .topbar { align-items: flex-start; }
  .topbar h2 { font-size: 22px; }
  .topbar__actions { display: grid; justify-items: end; }
  .inspector-section { display: block; width: 100%; }
  .content-view { padding-inline: 17px; }
  .qc-item { grid-template-columns: 30px 1fr; }
  .qc-item p { grid-column: 2; }
}

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