:root {
  --ink: #292722;
  --muted: #756f65;
  --paper: #f3eee5;
  --sheet: #fffdf8;
  --soft: #e9e1d5;
  --line: #d8cfc1;
  --accent: #875445;
  --green: #71806b;
  --serif: "Source Serif 4", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { background: var(--paper); color: var(--ink); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
body.modal-open { overflow: hidden; }
button, input, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }

/* Public sample diary */
.sample-public { min-height: 100vh; background: #eee7dc; }
.sample-masthead { position: sticky; z-index: 20; top: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, .93); backdrop-filter: blur(12px); }
.sample-masthead > div { display: flex; align-items: center; gap: 20px; }
.sample-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.sample-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.sample-create { padding: 10px 15px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 600; text-decoration: none; }
.sample-main { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 62px 0 80px; }
.sample-intro { display: grid; grid-template-columns: 1fr 360px; align-items: center; gap: clamp(36px, 8vw, 90px); padding: 0 34px 58px; }
.sample-intro-copy h1 { margin: 9px 0 17px; font: 500 clamp(36px, 5vw, 48px)/1.06 var(--serif); letter-spacing: -.025em; }
.sample-lede { max-width: 520px; color: #625d56; font: 400 16px/1.7 var(--serif); }
.sample-details { display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 23px; color: #82796f; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.sample-details span + span::before { content: "·"; margin-right: 17px; }
.sample-cover { position: relative; padding: 9px 9px 24px; border-radius: 3px; background: #fffdf8; box-shadow: 0 15px 35px rgba(57, 44, 35, .12); transform: rotate(1.2deg); }
.sample-cover-art { position: relative; overflow: hidden; border-radius: 2px; background: #eee7dc; }
.sample-cover-art img { display: block; width: 100%; height: 245px; object-fit: cover; }
.sample-cover-sketch { position: absolute; inset: 0; clip-path: polygon(45% 0, 100% 0, 100% 55%); filter: contrast(.93) sepia(.08); }
.sample-cover-art::after { content: ""; position: absolute; z-index: 2; top: -8%; right: 24.5%; width: 1px; height: 78%; background: rgba(69, 62, 54, .45); box-shadow: 1px 0 rgba(255, 253, 248, .72); transform: rotate(-45deg); transform-origin: top; }
.sample-cover::after { content: ""; position: absolute; z-index: -1; right: -9px; bottom: -8px; width: 64px; height: 55px; border-right: 1px solid rgba(90, 80, 69, .32); border-bottom: 1px solid rgba(90, 80, 69, .32); transform: rotate(-3deg); }
.sample-cover figcaption, .sample-entry figure figcaption { margin-top: 8px; color: #837a70; font: italic 400 10px var(--serif); }
.sample-rule { display: flex; align-items: center; gap: 15px; margin: 0 34px 14px; color: #847b71; font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.sample-rule::before, .sample-rule::after { content: ""; height: 1px; flex: 1; background: #d4c9bb; }
.sample-pages { position: relative; padding: 12px 68px 20px 92px; border: 1px solid #d8cfc2; border-radius: 5px; background: repeating-linear-gradient(to bottom, #fffdf8 0, #fffdf8 31px, rgba(110, 132, 123, .08) 32px); box-shadow: 0 16px 45px rgba(55, 43, 34, .08); }
.sample-pages::before { content: ""; position: absolute; top: 0; bottom: 0; left: 54px; width: 1px; background: rgba(194, 117, 101, .36); }
.sample-entry { padding: 34px 0 37px; border-bottom: 1px solid rgba(205, 194, 181, .72); }
.sample-entry:last-child { border-bottom: 0; }
.sample-entry header { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 7px; }
.sample-entry time { color: var(--accent); font-size: 9px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.sample-entry header span { color: #91887e; font-size: 8px; }
.sample-entry h2 { margin-bottom: 13px; font: 500 25px/1.18 var(--serif); }
.sample-prose { max-width: 720px; color: #4f4b46; font: 400 15px/1.75 var(--serif); }
.sample-prose p + p { margin-top: 12px; }
.sample-entry--with-photo { display: grid; grid-template-columns: 1fr 290px; align-items: center; gap: 38px; }
.sample-entry--with-photo .sample-prose { max-width: 560px; }
.sample-entry--with-photo figure { padding: 7px 7px 19px; border-radius: 3px; background: #f7f1e8; box-shadow: 0 8px 22px rgba(56, 43, 34, .11); transform: rotate(1deg); }
.sample-entry--with-photo figure img { display: block; width: 100%; height: 215px; border-radius: 2px; object-fit: cover; }
.sample-entry--photo-left { grid-template-columns: 290px 1fr; }
.sample-entry--photo-left figure { transform: rotate(-1deg); }
.sample-signature { color: var(--accent); font-style: italic; }
.sample-invitation { max-width: 680px; margin: 72px auto 20px; text-align: center; }
.sample-invitation h2 { margin: 9px 0 12px; font: 500 34px/1.12 var(--serif); }
.sample-invitation > p:not(.eyebrow) { color: var(--muted); font: 400 14px/1.6 var(--serif); }
.sample-invitation > a { display: inline-flex; align-items: center; gap: 24px; margin-top: 23px; padding: 13px 17px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 600; text-decoration: none; }
.sample-footer { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 25px clamp(22px, 5vw, 72px); border-top: 1px solid var(--line); background: #e6ddd0; }
.sample-footer p { max-width: 520px; color: #7e756b; font-size: 9px; line-height: 1.5; text-align: right; }

/* First visit */
.setup { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.18fr); background: var(--paper); }
.setup-intro-panel { position: relative; display: grid; place-items: center; min-height: 100vh; overflow: hidden; padding: 64px; background: #cec0ad; }
.setup-intro-panel::before { content: ""; position: absolute; inset: 0; opacity: .46; background: radial-gradient(circle at 18% 15%, #eee7db 0 2px, transparent 3px), radial-gradient(circle at 78% 70%, #a99378 0 1px, transparent 2px); background-size: 31px 31px, 23px 23px; }
.notebook { position: relative; width: min(390px, 92%); min-height: 480px; padding: 64px 52px 48px 68px; border-radius: 3px 12px 12px 3px; background: repeating-linear-gradient(to bottom, #fffdf6 0, #fffdf6 35px, #dfe4de 36px); box-shadow: -13px 13px 0 #765a49, 0 30px 70px rgba(60, 42, 30, .2); transform: rotate(-2deg); }
.notebook::before { content: ""; position: absolute; top: 0; bottom: 0; left: 42px; width: 1px; background: #ddb9ab; }
.notebook-date { margin-bottom: 42px; color: #8b8175; font-size: 9px; font-weight: 600; letter-spacing: .13em; }
.notebook p { font: italic 400 20px/1.8 var(--serif); }
.notebook span { position: absolute; right: 42px; bottom: 35px; color: #8a8175; font: italic 400 12px var(--serif); }
.setup-promise { position: absolute; bottom: 34px; color: #5c5148; font-size: 10px; letter-spacing: .08em; }
.setup-form-wrap { position: relative; display: flex; align-items: center; padding: 100px clamp(42px, 7vw, 110px) 55px; overflow: auto; }
.setup-brand, .wordmark { color: var(--ink); text-decoration: none; font: italic 500 20px var(--serif); }
.setup-brand { position: absolute; top: 34px; left: clamp(42px, 7vw, 110px); }
.setup-brand span, .wordmark span { color: var(--accent); }
.setup-form, .restore-form { width: min(100%, 520px); margin: auto; }
.setup-form h1 { max-width: 470px; margin: 12px 0 17px; font: 500 clamp(38px, 4vw, 52px)/1.05 var(--serif); letter-spacing: -.025em; }
.setup-intro { max-width: 490px; margin-bottom: 29px; color: var(--muted); font: 400 15px/1.65 var(--serif); }
.setup-form label, .restore-form label, .settings-dialog label { display: block; margin-top: 17px; }
.setup-form label > span:first-child, .restore-form label > span:first-child, .settings-dialog label > span:first-child, .entry-editor label > span:first-child { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 600; }
.setup-form input, .restore-form input, .settings-dialog input, .settings-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 253, 248, .72); padding: 12px 13px; outline: 0; font-size: 13px; }
.setup-form input:focus, .restore-form input:focus, .settings-dialog input:focus, .settings-dialog textarea:focus { border-color: #a07b6f; box-shadow: 0 0 0 3px rgba(135, 84, 69, .08); }
.slug-field { height: 44px; display: flex !important; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 253, 248, .72); }
.slug-field small { padding-left: 13px; color: #8d857a; font-size: 11px; white-space: nowrap; }
.slug-field input { height: 100%; border: 0 !important; border-radius: 0 !important; padding-left: 2px !important; background: transparent; box-shadow: none !important; }
.setup-submit { width: 100%; height: 46px; margin-top: 23px; border: 0; border-radius: 7px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.setup-submit span { float: right; margin-right: 5px; }
.setup-submit:disabled, .save-entry:disabled { opacity: .58; cursor: wait; }
.setup-note { margin-top: 12px; color: #8a8278; text-align: center; font-size: 10px; }
.restore-toggle { display: block; margin: 18px auto 0; border: 0; background: transparent; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.restore-form h2 { margin: 10px 0 28px; font: 500 40px var(--serif); }
.back-to-setup { margin-bottom: 40px; padding: 0; border: 0; background: transparent; font-size: 11px; cursor: pointer; }

/* Diary workspace */
.topbar { position: fixed; z-index: 40; inset: 0 0 auto; height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, .92); backdrop-filter: blur(13px); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 13px; }
.save-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.save-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.save-state.saving i { background: #b6804f; animation: pulse 1s infinite; }
.save-state.error i { background: #b25353; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; line-height: 1; cursor: pointer; }
.mobile-menu { display: none; }
.story-app { min-height: 100vh; padding-top: 62px; }
.story-sidebar { position: fixed; z-index: 20; top: 62px; bottom: 0; left: 0; width: 264px; display: flex; flex-direction: column; padding: 27px 18px 20px; border-right: 1px solid #d3c9bb; background: #e9e1d5; }
.sidebar-owner { display: flex; align-items: center; gap: 12px; padding: 0 5px 22px; }
.owner-cover { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 5px; background: #846555; color: #fff; font: 500 19px var(--serif); cursor: pointer; }
.owner-cover img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-owner p { margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-owner h1 { max-width: 170px; font: 500 14px/1.3 var(--serif); }
.new-entry { height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 7px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; box-shadow: 0 7px 18px rgba(45, 37, 31, .11); cursor: pointer; }
.new-entry span { font-size: 16px; font-weight: 400; }
.chapter-nav { min-height: 0; margin-top: 29px; overflow-y: auto; }
.sidebar-label { padding: 0 9px 10px; color: #8b8277; font-size: 8px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.chapter-link { width: 100%; height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; font-size: 11px; text-align: left; cursor: pointer; }
.chapter-link b { color: #91887d; font-size: 9px; font-weight: 500; }
.chapter-link.active { background: rgba(255, 253, 248, .76); font-weight: 600; box-shadow: 0 1px 0 rgba(48, 40, 34, .04); }
.sidebar-foot { margin-top: auto; padding: 15px 7px 0; border-top: 1px solid #d2c7b8; }
.sidebar-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sidebar-tools button { padding: 0; border: 0; background: transparent; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sidebar-tools button + button { color: var(--accent); font-weight: 600; }
.sidebar-foot > p { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #82796f; font-size: 8px; }
.privacy-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.privacy-dot.public { background: #b07848; }

.workspace { min-height: calc(100vh - 62px); margin-left: 264px; padding: 0 42px 80px; }
.workspace-head { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border-bottom: 1px solid var(--line); }
.workspace-kicker { max-width: 500px; margin-bottom: 5px; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.workspace-head h2 { font: 500 24px/1.15 var(--serif); }
.workspace-actions { display: flex; align-items: center; gap: 8px; }
.entry-search { width: 200px; height: 37px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255, 253, 248, .6); color: #847c72; }
.entry-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 10px; }
.quiet-button, .publish-button, .publish-confirm { height: 37px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border-radius: 99px; font-size: 10px; font-weight: 600; text-decoration: none; cursor: pointer; }
.quiet-button { border: 1px solid var(--line); background: transparent; }
.publish-button, .publish-confirm { border: 0; background: var(--accent); color: #fff; }

.story-welcome { max-width: 650px; margin: 64px auto 0; text-align: center; }
.welcome-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 22px; border: 1px solid #d3c8ba; border-radius: 50%; background: rgba(255, 253, 248, .55); color: var(--accent); font-size: 17px; }
.story-welcome h2 { margin: 9px 0 16px; font: 500 clamp(32px, 4vw, 42px)/1.1 var(--serif); letter-spacing: -.015em; }
.story-welcome > p:not(.eyebrow) { max-width: 560px; margin: 0 auto; color: var(--muted); font: 400 15px/1.7 var(--serif); }
.primary-button { margin-top: 27px; padding: 12px 18px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.primary-button span { margin-left: 9px; }
.prompt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 35px; }
.prompt-row button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: #6f685f; font: italic 400 11px var(--serif); cursor: pointer; }

.timeline { max-width: 790px; margin: 34px auto 0; }
.timeline-year { display: flex; align-items: center; gap: 12px; margin: 31px 0 14px; color: #8a8177; font-size: 9px; font-weight: 600; letter-spacing: .12em; }
.timeline-year::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.entry-card { position: relative; margin-bottom: 13px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 253, 248, .84); box-shadow: 0 4px 14px rgba(56, 45, 37, .025); transition: box-shadow .18s, transform .18s; }
.entry-card:hover { transform: translateY(-1px); box-shadow: 0 9px 25px rgba(56, 45, 37, .06); }
.entry-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.entry-date { margin-bottom: 5px; color: var(--accent); font-size: 8px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.entry-card h3 { font: 500 22px/1.2 var(--serif); }
.entry-edit { border: 0; background: transparent; color: #7f776d; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.entry-body-copy { max-width: 680px; margin-top: 12px; color: #57524c; font: 400 15px/1.72 var(--serif); white-space: pre-wrap; }
.entry-chapter { display: inline-block; margin-top: 16px; padding: 5px 8px; border-radius: 99px; background: #ece4d9; color: #756d64; font-size: 8px; }
.entry-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 17px; }
.entry-photos.one { grid-template-columns: minmax(0, 420px); }
.entry-photos.two { grid-template-columns: repeat(2, minmax(0, 310px)); }
.entry-photos img { display: block; width: 100%; height: 150px; border-radius: 6px; object-fit: cover; }
.entry-photos.one img { height: min(280px, 40vw); }
.empty-search { padding: 75px 20px; color: var(--muted); text-align: center; font: 400 16px var(--serif); }

/* Writing page */
.dialog-backdrop { position: fixed; z-index: 80; inset: 0; border: 0; background: rgba(42, 37, 32, .4); backdrop-filter: blur(2px); }
.workspace.is-writing .workspace-head,
.workspace.is-writing .story-welcome,
.workspace.is-writing .timeline { display: none !important; }
.entry-editor { width: min(1120px, 100%); min-height: calc(100vh - 94px); margin: 18px auto 0; overflow: hidden; border: 1px solid rgba(115, 96, 80, .2); border-radius: 9px 9px 4px 4px; background: var(--sheet); box-shadow: 0 12px 38px rgba(52, 42, 34, .08); }
.entry-editor.open { display: block; }
.editor-head { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 27px; border-bottom: 1px solid var(--line); }
.editor-head p { font-size: 11px; font-weight: 600; }
.editor-head span { display: block; margin-top: 3px; color: #898176; font-size: 8px; }
.editor-head button, .dialog-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 19px; line-height: 1; cursor: pointer; }
.entry-editor form { width: min(100%, 960px); margin: 0 auto; padding: 36px 42px 48px; }
.editor-title input { width: 100%; padding: 4px 0 12px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; font: 500 28px var(--serif); }
.editor-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 21px; }
.editor-meta input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: #fff; font-size: 11px; }
.editor-body { display: block; margin-top: 23px; }
.editor-body textarea { width: 100%; min-height: clamp(420px, 48vh, 620px); resize: vertical; border: 0; outline: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 28px, rgba(109, 129, 120, .13) 29px); font: 400 16px/29px var(--serif); }
.photo-drop { min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #cabfb1; border-radius: 7px; background: #faf6ef; cursor: pointer; }
.photo-drop.is-dragging { border-color: var(--accent); background: #f2e7dc; box-shadow: inset 0 0 0 2px rgba(135, 84, 69, .1); }
.photo-drop input { display: none; }
.photo-drop strong { margin: 2px 0; font-size: 10px; }
.photo-drop small { color: #8b8278; font-size: 8px; }
.photo-icon { margin: 0 !important; font-size: 19px !important; }
.photo-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 7px; }
.photo-preview img { width: 100%; height: 86px; border-radius: 5px; object-fit: cover; }
.editor-footer { display: flex; align-items: center; justify-content: flex-end; gap: 11px; margin-top: 25px; }
.delete-entry { margin-right: auto; border: 0; background: transparent; color: #9c4f49; font-size: 9px; text-decoration: underline; cursor: pointer; }
.save-entry { height: 42px; padding: 0 17px; border: 0; border-radius: 7px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.save-entry span { margin-left: 15px; }

/* Settings and sharing */
.settings-dialog { position: fixed; z-index: 91; top: 50%; left: 50%; width: min(500px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 32px; border-radius: 11px; background: var(--sheet); box-shadow: 0 25px 70px rgba(37, 29, 24, .2); transform: translate(-50%, -50%); }
.settings-dialog .dialog-close { position: absolute; top: 18px; right: 18px; }
.settings-dialog h2 { margin: 7px 0 22px; font: 500 31px var(--serif); }
.settings-dialog textarea { resize: vertical; }
.cover-upload small { display: block; margin-top: 5px; color: #898176; font-size: 8px; }
.publish-dialog { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 14px; background: rgba(42, 37, 32, .45); backdrop-filter: blur(3px); }
.publish-card { position: relative; width: min(470px, 100%); padding: 36px; border-radius: 12px; background: var(--sheet); text-align: center; box-shadow: 0 25px 70px rgba(0, 0, 0, .18); }
.publish-card .dialog-close { position: absolute; top: 15px; right: 15px; }
.publish-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: #ece2d8; color: var(--accent); font-size: 18px; }
.publish-card h2 { font: 500 30px var(--serif); }
.publish-card > p { max-width: 350px; margin: 10px auto 19px; color: var(--muted); font: 400 13px/1.55 var(--serif); }
.publish-actions { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.public-link { height: 40px; display: flex; align-items: center; overflow: hidden; padding-left: 11px; border: 1px solid var(--line); border-radius: 7px; text-align: left; }
.public-link span { min-width: 0; flex: 1; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.public-link button { height: 100%; padding: 0 12px; border: 0; border-left: 1px solid var(--line); background: var(--soft); font-size: 9px; font-weight: 600; cursor: pointer; }
.toast { position: fixed; z-index: 120; bottom: 24px; left: 50%; padding: 10px 15px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 9px; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 900px) {
  .sample-main { padding-top: 42px; }
  .sample-intro { grid-template-columns: 1fr 300px; gap: 35px; padding-inline: 15px; }
  .sample-entry--with-photo, .sample-entry--photo-left { grid-template-columns: 1fr; }
  .sample-entry--with-photo figure { width: min(390px, 100%); }
  .sample-entry--photo-left figure { order: 2; }
  .setup { grid-template-columns: 1fr; }
  .setup-intro-panel { display: none; }
  .setup-form-wrap { min-height: 100vh; padding: 88px 24px 38px; }
  .setup-brand { top: 27px; left: 24px; }
  .story-sidebar { transform: translateX(-103%); transition: transform .25s; box-shadow: 14px 0 40px rgba(39, 31, 25, .13); }
  .story-sidebar.open { transform: none; }
  .workspace { margin-left: 0; padding: 0 24px 65px; }
  .mobile-menu { display: block; }
}

@media (max-width: 580px) {
  .sample-masthead { height: 58px; padding-inline: 15px; }
  .sample-masthead .sample-status { display: none; }
  .sample-create { padding: 9px 12px; }
  .sample-main { width: min(100% - 24px, 1040px); padding: 36px 0 58px; }
  .sample-intro { grid-template-columns: 1fr; padding: 0 8px 43px; }
  .sample-intro-copy h1 { font-size: 37px; }
  .sample-cover { width: 100%; max-width: 390px; justify-self: center; }
  .sample-cover-art img { height: 230px; }
  .sample-details span + span::before { margin-right: 8px; }
  .sample-details { gap: 8px; }
  .sample-rule { margin-inline: 8px; }
  .sample-pages { padding: 5px 19px 12px 37px; }
  .sample-pages::before { left: 22px; }
  .sample-entry { padding-block: 27px 31px; }
  .sample-entry header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .sample-entry h2 { font-size: 23px; }
  .sample-prose { font-size: 15px; }
  .sample-entry--with-photo { gap: 23px; }
  .sample-entry--with-photo figure img { height: 205px; }
  .sample-invitation { margin-top: 55px; padding-inline: 14px; }
  .sample-invitation h2 { font-size: 29px; }
  .sample-footer { align-items: flex-start; flex-direction: column; }
  .sample-footer p { text-align: left; }
  .topbar { height: 58px; padding: 0 14px; }
  .story-app { padding-top: 58px; }
  .story-sidebar { top: 58px; width: min(290px, 86vw); }
  .workspace { padding: 0 15px 55px; }
  .workspace-head { min-height: 118px; align-items: flex-start; flex-direction: column; padding: 20px 0 16px; gap: 14px; }
  .workspace-actions { width: 100%; }
  .entry-search { flex: 1; width: auto; }
  .story-welcome { margin-top: 46px; }
  .story-welcome h2 { font-size: 33px; }
  .prompt-row { flex-direction: column; align-items: center; }
  .entry-card { padding: 20px 18px; }
  .entry-card h3 { font-size: 20px; }
  .entry-photos { grid-template-columns: repeat(2, 1fr); }
  .entry-photos img { height: 125px; }
  .entry-photos.one img { height: 230px; }
  .entry-editor { min-height: calc(100vh - 88px); margin-top: 15px; border-radius: 7px; }
  .entry-editor form { padding: 24px 19px 35px; }
  .editor-head { padding: 0 19px; }
  .editor-meta { grid-template-columns: 1fr; }
  .editor-title input { font-size: 25px; }
  .editor-body textarea { min-height: 330px; }
  .settings-dialog { padding: 28px 19px; }
  .publish-card { padding: 34px 20px 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
