@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
    --ink: #173a36;
    --ink-2: #31534f;
    --paper: #f6efe4;
    --paper-2: #fffaf3;
    --coral: #e75b3e;
    --coral-dark: #c9432b;
    --yellow: #f0c85a;
    --line: #d8cfc2;
    --muted: #766f66;
    --white: #fff;
    --shadow: 0 18px 55px rgba(39, 58, 51, .1);
    --display: "Fraunces", Georgia, serif;
    --body: "DM Sans", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper-2); font-family: var(--body); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display); line-height: 1.04; letter-spacing: -.035em; }
h1 { font-size: clamp(2.25rem, 5vw, 4.6rem); margin-bottom: 14px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
em { color: var(--coral); font-style: italic; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--coral); font-size: .72rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.03rem; }
.brand > span:last-child { line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: .62rem; font-weight: 500; letter-spacing: .04em; margin-top: 4px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50% 50% 50% 12%; color: white; background: var(--coral); font: 700 1.3rem var(--display); transform: rotate(-5deg); }
.brand.light { color: white; }
.brand.light .brand-mark { color: var(--ink); background: var(--yellow); }
.btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 5px; font-weight: 700; transition: .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; background: var(--coral); box-shadow: 0 8px 22px rgba(231, 91, 62, .18); }
.btn-primary:hover { background: var(--coral-dark); }
.btn-secondary { border-color: var(--line); color: var(--ink); background: white; }
.btn-quiet { color: var(--ink); }
.btn-large { min-height: 54px; padding-inline: 25px; }
.btn-small { min-height: 35px; padding: 7px 11px; font-size: .78rem; }
.btn-block { width: 100%; }
.link-button { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: .8rem; }
.text-center { text-align: center; }

/* Landing and authentication */
.guest-body { min-height: 100vh; background: var(--paper); }
.guest-noise { position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .16; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E"); }
.landing { min-height: 100vh; overflow: hidden; }
.landing-nav { display: flex; max-width: 1260px; margin: auto; padding: 26px 34px; align-items: center; justify-content: space-between; }
.landing-nav > div { display: flex; gap: 8px; }
.hero { display: grid; max-width: 1260px; min-height: calc(100vh - 185px); margin: auto; padding: 45px 34px 80px; grid-template-columns: .96fr 1.04fr; align-items: center; gap: 70px; }
.hero-copy h1 { font-size: clamp(3.4rem, 6.3vw, 6.6rem); }
.hero-copy > p { max-width: 590px; color: var(--ink-2); font-size: 1.15rem; }
.hero-actions { display: flex; margin-top: 34px; align-items: center; gap: 18px; }
.hero-actions span { color: var(--muted); font-size: .75rem; }
.hero-studio { position: relative; min-height: 640px; border-radius: 45% 45% 7px 7px; background: var(--ink); box-shadow: var(--shadow); }
.sample-card { position: absolute; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 30px 60px rgba(0, 0, 0, .25); }
.sample-main { width: 55%; aspect-ratio: 4/5; right: 12%; top: 9%; padding: 8%; color: var(--ink); background: var(--paper); transform: rotate(3deg); }
.sample-main blockquote { margin: 18px 0; font: 600 clamp(1.7rem, 3.1vw, 3.6rem)/1.06 var(--display); }
.sample-main em { color: var(--coral); }
.sample-label, .sample-main small { font-size: .6rem; font-weight: 700; letter-spacing: .16em; }
.sample-line { width: 42px; height: 4px; margin: 5px 0 20px; background: var(--coral); }
.sample-back { width: 39%; aspect-ratio: 1; left: 8%; bottom: 8%; padding: 6%; color: var(--paper); background: var(--coral); font: 700 clamp(1.5rem, 3vw, 3.3rem)/.94 var(--display); transform: rotate(-8deg); }
.sun-shape { position: absolute; width: 170px; aspect-ratio: 1; right: -30px; bottom: -25px; border-radius: 50%; background: var(--yellow); }
.tape { position: absolute; width: 120px; height: 35px; right: 29%; top: 5%; opacity: .8; background: #ead9b8; transform: rotate(-7deg); }
.landing-strip { display: flex; min-height: 90px; align-items: center; justify-content: center; gap: clamp(35px, 8vw, 120px); color: var(--paper); background: var(--ink); font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.auth-page { display: grid; min-height: 100vh; grid-template-columns: .9fr 1.1fr; }
.auth-art { display: flex; min-height: 100vh; padding: 54px clamp(35px, 7vw, 100px); flex-direction: column; justify-content: space-between; color: white; background: var(--ink); }
.auth-art.register-art { background: var(--coral); }
.auth-art > div { max-width: 570px; padding-bottom: 9vh; }
.auth-art h1 { font-size: clamp(3rem, 5.2vw, 5.8rem); }
.auth-art em { color: var(--yellow); }
.auth-art p { color: rgba(255,255,255,.7); font-size: 1.1rem; }
.auth-form-wrap { display: grid; padding: 45px; place-items: center; background: var(--paper); }
.auth-form { width: min(100%, 470px); }
.auth-form h2 { margin-bottom: 32px; font-size: 2.6rem; }
.auth-form label, .form-card > label, .details-card label { display: block; margin-bottom: 19px; color: var(--ink); font-size: .77rem; font-weight: 700; letter-spacing: .03em; }
.auth-form label small, label > small { display: block; color: var(--muted); font-size: .7rem; font-weight: 400; margin-top: 6px; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 4px; outline: none; color: var(--ink); background: white; transition: .2s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(231,91,62,.1); }
.form-between { display: flex; margin: 2px 0 22px; justify-content: space-between; font-size: .77rem; }
.form-between a, .auth-switch a { color: var(--coral); font-weight: 700; }
.check { display: flex !important; width: auto; margin: 0 !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--coral); }
.auth-switch { margin-top: 20px; text-align: center; font-size: .84rem; }
.centered-auth { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.centered-auth .card { padding: 40px; border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--shadow); }
.centered-auth .brand { margin-bottom: 40px; }

/* Application shell */
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; padding: 27px 22px; z-index: 10; flex-direction: column; color: var(--paper); background: var(--ink); }
.sidebar .brand { margin: 0 7px 45px; }
.sidebar .brand small { color: rgba(255,255,255,.5); }
.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; padding: 11px 12px; align-items: center; gap: 12px; border-radius: 4px; color: rgba(255,255,255,.7); font-size: .85rem; font-weight: 600; transition: .2s; }
.main-nav a span { width: 21px; color: var(--yellow); font-size: 1.1rem; text-align: center; }
.main-nav a:hover, .main-nav a.active { color: white; background: rgba(255,255,255,.1); }
.main-nav a.active { box-shadow: inset 3px 0 var(--coral); }
.sidebar-foot { margin-top: auto; padding: 17px 8px 0; border-top: 1px solid rgba(255,255,255,.14); }
.user-chip { display: flex; margin-bottom: 13px; align-items: center; gap: 10px; }
.user-chip > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--yellow); font-weight: 800; }
.user-chip strong, .user-chip small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: .78rem; }
.user-chip small { color: rgba(255,255,255,.5); font-size: .64rem; }
.content { min-width: 0; background: var(--paper-2); }
.page-wrap { width: min(100%, 1440px); margin: auto; padding: 55px clamp(24px, 5vw, 76px) 80px; }
.mobile-head { display: none; }
.page-head { display: flex; margin-bottom: 35px; align-items: flex-end; justify-content: space-between; gap: 25px; }
.page-head h1 { margin: 0; font-size: clamp(2.3rem, 4.5vw, 4.3rem); }
.page-head p { margin: 10px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 9px; }
.dashboard-head h1 { font-size: clamp(2.8rem, 5vw, 5.2rem); }
.alert { margin-bottom: 24px; padding: 13px 16px; border-radius: 4px; font-size: .83rem; }
.alert ul { margin: 5px 0 0; padding-left: 18px; }
.alert.success { border: 1px solid #a9c8b5; color: #28593d; background: #edf7f0; }
.alert.error { border: 1px solid #e6aaa0; color: #8c2f20; background: #fff0ed; }

/* Dashboard and collections */
.stats-grid { display: grid; margin-bottom: 30px; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.stat-card { position: relative; min-height: 180px; padding: 23px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.stat-card > span, .stat-card small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { display: block; margin: 11px 0 6px; font: 700 4rem/1 var(--display); }
.stat-card small { color: var(--muted); font-size: .6rem; }
.stat-card.accent { color: white; border-color: var(--coral); background: var(--coral); }
.stat-card.accent small { color: rgba(255,255,255,.68); }
.stat-card.dark { color: white; border-color: var(--ink); background: var(--ink); }
.stat-card.dark small { color: rgba(255,255,255,.55); }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -35px; bottom: -35px; border: 13px solid var(--yellow); border-radius: 50%; opacity: .65; }
.quick-grid { display: grid; margin-bottom: 55px; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: white; }
.quick-grid > a { display: flex; min-height: 105px; padding: 18px; align-items: center; gap: 14px; border-right: 1px solid var(--line); transition: .2s; }
.quick-grid > a:last-child { border-right: 0; }
.quick-grid > a:hover { background: var(--paper); }
.quick-grid > a > b { margin-left: auto; color: var(--coral); }
.quick-grid strong, .quick-grid small { display: block; }
.quick-grid strong { font-size: .85rem; }
.quick-grid small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.quick-icon { display: grid; min-width: 48px; height: 48px; place-items: center; border-radius: 50%; font: 700 1.45rem var(--display); }
.quick-icon.coral { color: white; background: var(--coral); }
.quick-icon.green { color: white; background: var(--ink); }
.quick-icon.yellow { color: var(--ink); background: var(--yellow); }
.section-title { display: flex; margin-bottom: 22px; align-items: end; justify-content: space-between; }
.section-title h2 { margin: 0; }
.section-title a { color: var(--coral); font-size: .78rem; font-weight: 700; }
.empty-state { padding: clamp(45px, 8vw, 95px) 20px; border: 1px dashed #cbbfb0; text-align: center; background: var(--paper); }
.empty-state > span { display: block; color: var(--coral); font: 700 3.2rem var(--display); }
.empty-state h3 { margin: 5px 0 7px; font: 600 1.6rem var(--display); }
.empty-state p { color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.post-mini { aspect-ratio: 1; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; color: var(--card-color); background: var(--card-bg); border: 1px solid rgba(0,0,0,.08); transition: .2s; }
.post-mini:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--shadow); }
.post-mini p { font: 600 clamp(1rem, 1.65vw, 1.55rem)/1.1 var(--display); }
.post-mini span, .post-mini small { font-size: .63rem; font-weight: 700; }
.filter-bar { display: flex; margin-bottom: 28px; padding: 13px; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--paper); }
.filter-bar select, .filter-bar input { width: auto; min-width: 160px; margin: 0; }
.filter-bar > label:not(.check) { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; }
.filter-bar a { color: var(--coral); font-size: .75rem; font-weight: 700; }
.phrase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.phrase-card { display: flex; min-height: 280px; padding: 23px; flex-direction: column; border: 1px solid var(--line); background: var(--paper); }
.phrase-meta { display: flex; justify-content: space-between; color: var(--coral); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.phrase-meta b { color: #d2a517; font-size: 1rem; }
.phrase-card blockquote { margin: 28px 0 12px; font: 600 1.45rem/1.2 var(--display); }
.phrase-card cite, .phrase-card > small { color: var(--muted); font-size: .73rem; }
.phrase-card > small { margin-top: 7px; }
.card-actions { display: flex; margin-top: auto; padding-top: 18px; align-items: center; gap: 7px; flex-wrap: wrap; }
.card-actions form { display: inline-flex; }
.icon-btn { display: grid; width: 35px; height: 35px; padding: 0; place-items: center; border: 1px solid var(--line); color: var(--ink); background: white; font-size: 1.1rem; }
.icon-btn.danger { color: var(--coral); }
.pagination { display: flex; margin-top: 24px; justify-content: center; gap: 8px; }

/* Forms and templates */
.form-card, .details-card { padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); background: var(--paper); }
.narrow-form { width: min(100%, 830px); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-actions { display: flex; margin-top: 26px; justify-content: flex-end; gap: 9px; }
.form-section-title { display: flex; margin: 8px 0 24px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.form-section-title:not(:first-child) { margin-top: 35px; }
.form-section-title > span, .step-label span { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--coral); font: 700 .7rem var(--body); }
.form-section-title h2, .form-section-title p { margin: 0; }
.form-section-title h2 { font-size: 1.35rem; }
.form-section-title p { color: var(--muted); font-size: .72rem; }
.check-card { min-height: 58px; padding: 11px 13px; border: 1px solid var(--line); background: white; }
.check-card span strong, .check-card span small { display: block; }
.check-card span small { color: var(--muted); font-size: .67rem; }
.color-field { display: flex; margin-top: 7px; align-items: center; border: 1px solid var(--line); background: white; }
.color-field input { width: 52px; height: 43px; margin: 0; padding: 4px; border: 0; }
.color-field output { padding: 0 9px; font-size: .75rem; }
.logo-preview { max-width: 120px; max-height: 70px; margin-bottom: 20px; object-fit: contain; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: start; gap: 25px; }
.sticky-preview { position: sticky; top: 30px; padding: 28px; border: 1px solid var(--line); background: white; box-shadow: var(--shadow); }
.sticky-preview > p { margin: 18px 0 0; color: var(--muted); font-size: .75rem; }
.identity-sample { display: flex; aspect-ratio: 1; padding: 12%; flex-direction: column; justify-content: space-between; color: var(--paper); background: var(--secondary); box-shadow: inset 0 -18px 0 var(--primary); }
.identity-sample > span { font: 700 clamp(2rem, 4vw, 4rem)/.92 var(--display); }
.identity-sample em { color: var(--primary); }
.identity-sample small { font-weight: 700; letter-spacing: .1em; }
.format-diagram { display: grid; width: min(100%, 250px); margin: 25px auto; place-items: center; color: var(--paper); background: var(--ink); box-shadow: 12px 12px 0 var(--coral); font: 700 .8rem var(--body); }
.format-diagram.format-square { aspect-ratio: 1; }
.format-diagram.format-story { aspect-ratio: 9/16; max-height: 380px; }
.format-diagram.format-portrait { aspect-ratio: 4/5; }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.template-card { border: 1px solid var(--line); background: white; }
.template-thumb { position: relative; display: flex; margin: 13px; padding: 10%; flex-direction: column; justify-content: center; background-position: center; background-size: cover; overflow: hidden; }
.template-thumb.format-square { aspect-ratio: 1; }
.template-thumb.format-story { aspect-ratio: 9/12; }
.template-thumb.format-portrait { aspect-ratio: 4/5; }
.template-thumb > span { position: relative; z-index: 1; font: 700 clamp(1.25rem, 2.5vw, 2.6rem)/.98 var(--display); }
.template-thumb > small { position: absolute; left: 10%; bottom: 8%; z-index: 1; font-size: .6rem; font-weight: 700; }
.template-info { padding: 7px 17px 17px; }
.template-info h3 { margin: 0; font-size: .95rem; }
.template-info span { color: var(--muted); font-size: .65rem; }

/* Post composer and generated art */
.copyright-note { margin: -10px 0 24px; padding: 12px 16px; border-left: 4px solid var(--yellow); color: var(--ink-2); background: #fff7db; font-size: .75rem; }
.post-editor { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(430px, 1.2fr); align-items: start; gap: 25px; }
.editor-controls { max-height: calc(100vh - 80px); overflow-y: auto; }
.step-label { display: flex; margin: 8px 0 22px; align-items: center; gap: 10px; color: var(--ink); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.step-label:not(:first-child) { margin-top: 32px; padding-top: 25px; border-top: 1px solid var(--line); }
.preview-panel { position: sticky; top: 25px; padding: 21px; border: 1px solid var(--line); background: #ede5d9; }
.preview-head { display: flex; margin-bottom: 17px; align-items: center; justify-content: space-between; }
.preview-head .eyebrow { margin: 0; }
.preview-head strong { display: block; margin-top: 3px; font-size: .75rem; }
.preview-help { margin: 14px 0 0; color: var(--muted); font-size: .68rem; text-align: center; }
.art-stage { display: grid; min-height: 530px; padding: 25px; place-items: center; overflow: hidden; background-color: #d9d0c4; background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.25) 25%, transparent 25%); background-size: 20px 20px; }
.post-art { position: relative; display: flex; width: auto; max-width: 100%; max-height: 570px; overflow: hidden; flex-direction: column; color: var(--art-color); background-color: var(--art-bg); background-image: var(--art-image, none); background-position: center; background-size: cover; box-shadow: 0 22px 45px rgba(25,37,33,.2); }
.post-art.format-square { width: min(100%, 520px); aspect-ratio: 1; }
.post-art.format-portrait { width: min(86%, 460px); aspect-ratio: 4/5; }
.post-art.format-story { width: min(57%, 340px); aspect-ratio: 9/16; }
.post-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.07), transparent 55%, rgba(0,0,0,.04)); }
.art-copy { position: relative; display: flex; height: 100%; padding: 13%; z-index: 1; flex-direction: column; justify-content: center; text-align: var(--art-align); }
.position-top .art-copy { justify-content: flex-start; padding-top: 16%; }
.position-bottom .art-copy { justify-content: flex-end; padding-bottom: 18%; }
.art-copy p { margin: 0; white-space: pre-line; font: 600 clamp(1.2rem, calc(var(--art-size) * .035), 3rem)/1.12 var(--art-font); }
.art-author { display: block; margin-top: 7%; font: 600 clamp(.55rem, 1vw, .82rem) var(--body); letter-spacing: .07em; }
.art-signature { position: absolute; display: flex; left: 9%; right: 9%; bottom: 6%; z-index: 2; align-items: center; gap: 8px; font: 700 clamp(.45rem, .8vw, .7rem) var(--body); letter-spacing: .08em; }
.art-signature img { width: 28px; height: 28px; object-fit: contain; }
.art-accent { position: absolute; width: 27%; aspect-ratio: 1; right: -10%; top: -9%; z-index: 1; border: max(5px, 1vw) solid currentColor; border-radius: 50%; opacity: .22; }
.show-grid { display: grid; grid-template-columns: 1.2fr .8fr; align-items: start; gap: 25px; }
.show-stage { min-height: 650px; }
.show-stage .post-art { max-height: 610px; }
.details-card { position: sticky; top: 25px; }
.details-card h2 { font-size: 1.8rem; }
.details-card hr { margin: 25px 0; border: 0; border-top: 1px solid var(--line); }
.detail-quote { font: 600 1.4rem/1.28 var(--display); white-space: pre-line; }
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.library-card { border: 1px solid var(--line); background: white; }
.library-art { display: flex; aspect-ratio: 1; margin: 12px; padding: 11%; flex-direction: column; justify-content: center; color: var(--card-color); background: var(--card-bg); }
.library-art p { font: 600 clamp(1.1rem, 2vw, 2rem)/1.12 var(--display); }
.library-art small { font-size: .65rem; font-weight: 700; }
.library-info { padding: 6px 16px 16px; }
.library-info h3 { margin: 0; font-size: .9rem; }
.library-info span { color: var(--muted); font-size: .65rem; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 210px 1fr; }
    .sidebar { padding-inline: 15px; }
    .post-editor { grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr); }
    .quick-grid, .phrase-grid, .template-grid, .library-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-grid > a:nth-child(2) { border-right: 0; }
    .quick-grid > a:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
    .post-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 800px) {
    .landing-nav { padding: 20px; }
    .landing-nav .btn-quiet { display: none; }
    .hero { min-height: auto; padding: 55px 20px; grid-template-columns: 1fr; gap: 40px; }
    .hero-copy h1 { font-size: clamp(3rem, 14vw, 5.2rem); }
    .hero-studio { min-height: 520px; }
    .landing-strip { padding: 25px 20px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-art { min-height: 340px; padding: 28px; }
    .auth-art > div { padding: 50px 0 0; }
    .auth-art h1 { font-size: 2.7rem; }
    .auth-form-wrap { padding: 45px 22px; }
    .app-shell { display: block; }
    .sidebar { position: fixed; width: min(82vw, 300px); left: -310px; z-index: 30; transition: .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .sidebar.open { left: 0; }
    .mobile-head { position: sticky; top: 0; display: flex; height: 66px; padding: 11px 18px; z-index: 20; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,250,243,.94); backdrop-filter: blur(12px); }
    .mobile-head .brand-mark { width: 34px; height: 34px; }
    .menu-toggle { width: 40px; height: 40px; border: 1px solid var(--line); color: var(--ink); background: white; }
    .page-wrap { padding: 34px 18px 70px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-head .btn, .head-actions { width: 100%; }
    .head-actions .btn { flex: 1; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 145px; }
    .quick-grid, .phrase-grid, .template-grid, .library-grid, .post-grid { grid-template-columns: 1fr; }
    .quick-grid > a { border-right: 0; border-bottom: 1px solid var(--line); }
    .quick-grid > a:last-child { grid-column: auto; border-top: 0; border-bottom: 0; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar select, .filter-bar input { width: 100%; }
    .editor-grid, .post-editor, .show-grid { grid-template-columns: 1fr; }
    .sticky-preview, .preview-panel, .details-card { position: static; }
    .editor-controls { max-height: none; overflow: visible; }
    .art-stage { min-height: 460px; padding: 17px; }
    .post-art.format-story { width: min(68%, 300px); }
}

@media (max-width: 520px) {
    .landing-nav .brand > span:last-child { display: none; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions span { text-align: center; }
    .hero-studio { min-height: 420px; border-radius: 120px 120px 6px 6px; }
    .sample-main { width: 62%; right: 8%; }
    .sample-back { width: 44%; }
    .field-grid { grid-template-columns: 1fr; gap: 0; }
    .form-card { padding: 19px; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .preview-head { align-items: stretch; flex-direction: column; gap: 12px; }
    .post-art.format-story { width: min(78%, 270px); }
    .art-stage { min-height: 410px; }
}
