/* Sahne Metin — "programme booklet" design system
   paper + ink + curtain red, Bodoni display, Newsreader reading face, Plex UI. */

:root {
  --paper: #f3ede2;
  --paper-2: #e9e0cf;
  --card: #fbf8f2;
  --ink: #1c1814;
  --ink-2: #3b342d;
  --muted: #6f655b;
  --line: #d9cdb9;
  --line-2: #c4b49b;
  --red: #8e1b1b;
  --red-2: #a8261f;
  --red-deep: #5e0f10;
  --gold: #a9823f;
  --gold-soft: #e7d3a8;
  --green: #2f5d50;
  --danger: #a4161a;
  --focus: #c2410c;
  --f-display: 'Bodoni Moda', 'Bodoni 72', Didot, 'Playfair Display', Georgia, serif;
  --f-read: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --f-ui: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --r: 3px;
  --shadow: 0 1px 0 rgba(28, 24, 20, 0.04), 0 8px 24px -12px rgba(28, 24, 20, 0.22);
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(169, 130, 63, 0.10), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(142, 27, 27, 0.06), transparent 60%),
    var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--f-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-deep); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.9em; }
code, kbd { font-family: var(--f-mono); font-size: 0.86em; background: var(--paper-2); padding: 0.08em 0.35em; border-radius: 2px; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; }
hr { border: 0; border-top: 1px solid var(--line); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 760px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.muted { color: var(--muted); }
.lead { font-family: var(--f-read); font-size: 1.22rem; line-height: 1.5; color: var(--ink-2); }
.kicker { font: 600 0.72rem/1.2 var(--f-ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); margin: 0 0 0.7rem; }
.h-label { font: 600 0.74rem/1.2 var(--f-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.grow { flex: 1; min-width: 0; }
.inline { display: inline; }
.section { padding-block: 2.2rem; }
.i { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  font: 600 0.92rem/1 var(--f-ui); letter-spacing: 0.01em;
  padding: 0.72em 1.15em; border-radius: var(--r);
  background: var(--b); color: #fbf8f2; border: 1px solid var(--b);
  text-decoration: none; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); color: var(--red); border-color: var(--red); }
.btn-light { background: #fbf8f2; color: var(--ink); border-color: #fbf8f2; }
.btn-danger { --b: var(--danger); }
.btn-danger:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn-small { font-size: 0.82rem; padding: 0.55em 0.85em; }
.btn-large { font-size: 1rem; padding: 0.9em 1.4em; }
.btn-block { width: 100%; }
.btn-toggle { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-toggle:hover { color: var(--red); border-color: var(--red); background: var(--card); }
.btn-toggle.is-active { background: #f6e4df; color: var(--red); border-color: #e0b3aa; }
.btn-toggle.is-active .i { fill: currentColor; }
.t-count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.link-muted { background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; color: var(--muted); cursor: pointer; display: inline-flex; gap: 0.3em; align-items: center; text-decoration: none; }
.link-muted:hover { color: var(--red); }
.link-more { font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
form.toggle { display: inline; margin: 0; }

/* ---- masthead ----------------------------------------------------------- */
.masthead { background: var(--ink); color: #efe6d6; position: sticky; top: 0; z-index: 40; border-bottom: 3px double var(--red); }
.masthead-row { display: flex; align-items: center; gap: 1.4rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fbf8f2; text-decoration: none; }
.brand:hover { color: var(--gold-soft); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); color: #fbf8f2; font: italic 700 1.15rem/1 var(--f-display);
  box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 1px var(--gold);
}
.brand-name { font: 600 1.32rem/1 var(--f-display); letter-spacing: 0.01em; }
.mainnav { display: flex; gap: 0.2rem; }
.mainnav a { color: #d9cfbf; text-decoration: none; font-weight: 500; font-size: 0.94rem; padding: 0.5rem 0.75rem; border-radius: var(--r); display: inline-flex; align-items: center; gap: 0.35em; }
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.mainnav a[aria-current='page'] { color: #fff; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.mainnav .nav-write { color: var(--gold-soft); }
.search { flex: 1; max-width: 360px; margin-left: auto; position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 0.7rem; color: #9d9282; pointer-events: none; }
.masthead .search input { width: 100%; background: #2a241f; border: 1px solid #3b342d; color: #fbf8f2; padding: 0.55rem 0.8rem 0.55rem 2.2rem; border-radius: 99px; font: inherit; font-size: 0.9rem; }
.masthead .search input::placeholder { color: #8f8474; }
.masthead .search input:focus { outline: none; box-shadow: none; border-color: var(--gold); background: #322b25; }
.masthead-actions { display: flex; align-items: center; gap: 0.6rem; }
.masthead .btn-ghost { color: #efe6d6; border-color: #4a423a; }
.masthead .btn-ghost:hover { background: transparent; color: #fff; border-color: var(--gold); }
.bell { position: relative; color: #d9cfbf; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; }
.bell:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.bell .i { width: 22px; height: 22px; }
.bell-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--red-2); color: #fff; font: 700 0.68rem/18px var(--f-ui); text-align: center; box-shadow: 0 0 0 2px var(--ink); }

/* menus & popovers built on <details> */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.menu { position: relative; }
.menu > summary { border-radius: 50%; display: block; }
.menu-panel, .pop-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 0.4rem;
}
.menu-panel a, .menu-panel button { display: flex; width: 100%; gap: 0.6rem; align-items: center; padding: 0.55rem 0.7rem; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 0.92rem; cursor: pointer; border-radius: 2px; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--paper); color: var(--red); }
.menu-panel form { margin: 0; border-top: 1px solid var(--line); margin-top: 0.3rem; padding-top: 0.3rem; }
.menu-head { padding: 0.5rem 0.7rem 0.6rem; margin: 0 0 0.3rem; border-bottom: 1px solid var(--line); display: grid; }
.menu-head span { color: var(--muted); font-size: 0.85rem; }
.pop { position: relative; display: inline-block; }
.pop-panel { left: 0; right: auto; width: min(360px, 86vw); padding: 0.9rem; }
.pop-right .pop-panel, .pop-panel.pop-right { left: auto; right: 0; }
.pop-left .pop-panel { left: auto; right: 0; }

/* ---- banners & flash ------------------------------------------------------ */
.banner { font-size: 0.92rem; }
.banner .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding-block: 0.6rem; }
.banner form { margin: 0; }
.banner-setup { background: var(--red); color: #fbf0ea; }
.banner-info { background: var(--gold-soft); color: var(--ink); }
.flash .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; font-weight: 500; }
.flash-ok { background: #dfe9e2; color: #1e4436; border-bottom: 1px solid #b9cfc1; }
.flash-error { background: #f6dcd8; color: var(--red-deep); border-bottom: 1px solid #e3b1a9; }
.flash-info { background: #ece4d3; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0.2rem; opacity: 0.7; }
.alert { padding: 0.8rem 1rem; border-radius: var(--r); margin: 0 0 1rem; border: 1px solid; font-size: 0.95rem; }
.alert p:last-child { margin: 0; }
.alert-error { background: #f8e3df; border-color: #e7b6ad; color: var(--red-deep); }
.alert-info { background: #f1ead9; border-color: var(--line-2); color: var(--ink-2); }
.alert-ok { background: #e3ede6; border-color: #b9cfc1; color: #1e4436; }
.notice { margin-top: 1rem; padding: 0.7rem 1rem; border-radius: var(--r); display: flex; gap: 0.5rem; align-items: center; font-size: 0.93rem; }
.notice-draft { background: #efe6d3; border: 1px dashed var(--line-2); }
.notice-hidden { background: #f6dcd8; border: 1px solid #e3b1a9; color: var(--red-deep); }

/* ---- badges, tags, chips ------------------------------------------------- */
.badge { display: inline-block; font: 600 0.68rem/1 var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; padding: 0.35em 0.55em; border-radius: 2px; background: #e3ede6; color: var(--green); vertical-align: middle; }
.badge-muted { background: var(--paper-2); color: var(--muted); }
.badge-danger { background: #f6dcd8; color: var(--danger); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.tags a, .tag-cloud a { display: inline-flex; gap: 0.35em; align-items: baseline; padding: 0.3em 0.65em; border: 1px solid var(--line-2); border-radius: 99px; color: var(--ink-2); text-decoration: none; font-size: 0.85rem; background: var(--card); }
.tags a:hover, .tag-cloud a:hover { border-color: var(--red); color: var(--red); }
.tag-cloud { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0; }
.tag-cloud span { font-size: 0.75em; color: var(--muted); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; margin-left: 0.6rem; vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 0.3em; padding: 0.25em 0.6em; background: var(--ink); color: #fbf8f2; border-radius: 99px; font-size: 0.8rem; text-decoration: none; }
.chip:hover { background: var(--red); color: #fff; }
.chip .i { width: 0.9em; height: 0.9em; }

/* ---- avatars ------------------------------------------------------------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; font: 600 0.8rem/1 var(--f-ui); color: #fbf8f2; background: var(--ink-2); letter-spacing: 0.02em; }
.av-xs { width: 22px; height: 22px; font-size: 0.6rem; }
.av-sm { width: 32px; height: 32px; font-size: 0.72rem; }
.av-md { width: 42px; height: 42px; font-size: 0.85rem; }
.av-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.av-xl { width: 112px; height: 112px; font: 600 2.1rem/1 var(--f-display); box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--line-2); }
.av-c0 { background: #8e1b1b; } .av-c1 { background: #2f5d50; } .av-c2 { background: #7a5a1e; }
.av-c3 { background: #3d3a63; } .av-c4 { background: #5b3b4b; } .av-c5 { background: #3b342d; }
.av-sys { background: var(--paper-2); color: var(--red); }
.masthead .av { box-shadow: 0 0 0 2px #4a423a; }

/* ---- posters / cards ----------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.6rem 1.3rem; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform 0.18s, box-shadow 0.18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.poster {
  --bg: #8e1b1b; --fg: #fbf3e8; --ac: #e7d3a8;
  position: relative; display: flex; flex-direction: column; aspect-ratio: 4 / 4.6; padding: 1.1rem 1.1rem 1rem;
  background: var(--bg); color: var(--fg); text-decoration: none; overflow: hidden; isolation: isolate;
}
.poster::before { content: ''; position: absolute; inset: 9px; border: 1px solid color-mix(in srgb, var(--ac) 55%, transparent); pointer-events: none; z-index: -1; }
.poster::after { content: ''; position: absolute; width: 140%; aspect-ratio: 1; left: -20%; top: 38%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--ac) 22%, transparent), transparent); z-index: -1; }
.poster:hover { color: var(--fg); }
.poster-top { display: flex; justify-content: space-between; align-items: center; font: 600 0.66rem/1 var(--f-ui); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ac); padding: 0.2rem 0.3rem; }
.poster-title { margin-top: auto; font: 700 clamp(1.45rem, 2.2vw, 1.85rem)/1.02 var(--f-display); letter-spacing: -0.015em; padding: 0 0.3rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.poster-sub { font: italic 400 0.98rem/1.3 var(--f-read); opacity: 0.86; padding: 0.35rem 0.3rem 0; }
.poster-author { margin-top: 0.8rem; padding: 0.6rem 0.3rem 0.1rem; border-top: 1px solid color-mix(in srgb, var(--ac) 45%, transparent); font: 600 0.74rem/1.2 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; }
.pv0 { --bg: #8e1b1b; --fg: #fbf3e8; --ac: #e7c98f; }
.pv1 { --bg: #1c1814; --fg: #f3ede2; --ac: #c79a52; }
.pv2 { --bg: #2f5d50; --fg: #f3efe4; --ac: #d8c48d; }
.pv3 { --bg: #e3c77f; --fg: #2a1e12; --ac: #8e1b1b; }
.pv4 { --bg: #3d3a63; --fg: #f0ebf3; --ac: #e4bc7c; }
.pv5 { --bg: #f7f1e5; --fg: #1c1814; --ac: #8e1b1b; }
.pv6 { --bg: #5b3b4b; --fg: #f8ede9; --ac: #e8b9a0; }
.pv7 { --bg: #7a5a1e; --fg: #fbf3e2; --ac: #f0dba6; }
.pv5::before { border-color: rgba(142, 27, 27, 0.45); }
.card-body { padding: 0.85rem 1rem 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card-facts { font-size: 0.8rem; color: var(--muted); margin: 0; letter-spacing: 0.01em; }
.card-syn { font: 400 0.98rem/1.45 var(--f-read); color: var(--ink-2); margin: 0; }
.card-stats { margin: auto 0 0; display: flex; gap: 0.9rem; font-size: 0.82rem; color: var(--muted); align-items: center; padding-top: 0.4rem; }
.card-stats span { display: inline-flex; align-items: center; gap: 0.25em; }
.card-time { margin-left: auto; }
.card-compact .poster { aspect-ratio: 4 / 3; }

/* ---- section heads / empty / pager --------------------------------------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.3rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.section-head .kicker { margin-bottom: 0.4rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 3px double var(--line-2); }
.page-head h1 { margin: 0; }
.empty { text-align: center; padding: 3.2rem 1.5rem; border: 1px dashed var(--line-2); border-radius: var(--r); background: color-mix(in srgb, var(--card) 70%, transparent); }
.empty h3 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.empty p { color: var(--muted); max-width: 46ch; margin-inline: auto; font-family: var(--f-read); font-size: 1.08rem; }
.empty .actions { justify-content: center; }
.empty-mark { color: var(--red); margin-bottom: 0.5rem; }
.empty-mark .i { width: 44px; height: 44px; stroke-width: 1.2; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.pager a { font-weight: 600; text-decoration: none; }

/* ---- forms --------------------------------------------------------------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label, .form legend, fieldset > legend { font-weight: 600; font-size: 0.88rem; color: var(--ink-2); }
.req { color: var(--red); margin-left: 0.15em; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 0.98rem; color: var(--ink); background: #fffdf9;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 0.62rem 0.75rem; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(142, 27, 27, 0.12); }
input[type='file'] { font: inherit; font-size: 0.9rem; }
.hint { font-size: 0.83rem; color: var(--muted); margin: 0; }
.error { font-size: 0.85rem; color: var(--danger); margin: 0; font-weight: 500; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.field-check label { display: flex; gap: 0.55rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.field-check input { margin-top: 0.25rem; accent-color: var(--red); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.9rem; min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem; }
.panel > h2 { font-size: 1.2rem; }
fieldset.panel > legend { font: 600 1.15rem/1.2 var(--f-display); color: var(--ink); padding: 0 0.4rem; margin-left: -0.4rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0; }
.form-inline select, .form-inline input { width: auto; flex: 1; min-width: 120px; }
.form-row-end { text-align: right; margin: -0.4rem 0 0; font-size: 0.88rem; }
label.check, label.radio { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; font-size: 0.92rem; cursor: pointer; padding: 0.15rem 0; }
label.check input, label.radio input, .radio-list input { accent-color: var(--red); }
.copy-field { font-family: var(--f-mono); font-size: 0.85rem !important; }

/* ---- hero ---------------------------------------------------------------- */
.hero { position: relative; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ''; position: absolute; inset: -40% 30% auto -10%; height: 140%;
  background: radial-gradient(closest-side, rgba(255, 236, 190, 0.55), transparent 70%); pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 3rem; align-items: center; }
.hero-title { font: 600 clamp(2.4rem, 5.6vw, 4.6rem)/0.98 var(--f-display); letter-spacing: -0.025em; margin-bottom: 1.2rem; }
.hero-title em { font-style: italic; color: var(--red); font-weight: 500; }
.hero .lead { max-width: 40ch; }
.hero-stats { display: flex; gap: 1.6rem; margin-top: 1.6rem; font-size: 0.92rem; color: var(--muted); }
.hero-stats strong { font: 600 1.5rem/1 var(--f-display); color: var(--ink); margin-right: 0.3rem; }
.hero-bill { display: flex; justify-content: center; }
.bill {
  width: min(320px, 100%); aspect-ratio: 3 / 4.2; background: var(--ink); color: #f3ede2; padding: 2rem 1.6rem;
  display: flex; flex-direction: column; text-align: center; position: relative; transform: rotate(2.2deg);
  box-shadow: 0 30px 60px -30px rgba(28, 24, 20, 0.6), 0 0 0 1px #000;
}
.bill::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(201, 154, 82, 0.55); }
.bill::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(201, 154, 82, 0.25); }
.bill-top { font: 600 0.7rem/1 var(--f-ui); letter-spacing: 0.3em; text-transform: uppercase; color: #c79a52; margin-top: 0.6rem; }
.bill-title { font: italic 600 2.7rem/0.95 var(--f-display); margin: auto 0 0.4rem; color: #fbf3e8; }
.bill-rule { width: 60px; height: 1px; background: #c79a52; margin: 0.8rem auto; }
.bill-cast { font: 600 0.72rem/1 var(--f-ui); letter-spacing: 0.22em; color: #e7c98f; }
.bill-dir { font: italic 400 0.98rem/1.4 var(--f-read); color: #cfc4b2; margin: 1rem 0 auto; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: s; }
.how-steps li { border-top: 2px solid var(--ink); padding-top: 1rem; }
.how-steps p { color: var(--ink-2); font-family: var(--f-read); font-size: 1.05rem; }
.how-n { font: italic 600 2rem/1 var(--f-display); color: var(--red); display: block; margin-bottom: 0.4rem; }

/* ---- feed ---------------------------------------------------------------- */
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.4rem; padding-block: 2rem 3rem; }
.feed-head { margin-bottom: 1.5rem; }
.tabs { display: flex; gap: 0.2rem; border-bottom: 1px solid var(--line-2); margin: 1rem 0 1.5rem; overflow-x: auto; }
.tabs a { padding: 0.65rem 0.95rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a span { font-weight: 500; color: var(--muted); margin-left: 0.2em; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current='page'] { color: var(--red); border-color: var(--red); }
.feed-side { display: grid; gap: 1.2rem; align-content: start; }
.feed-side .panel h2 { font-size: 1.1rem; display: flex; justify-content: space-between; align-items: baseline; }
.checklist h2 span { font: 600 0.8rem var(--f-ui); color: var(--muted); }
.checklist ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; column-gap: 0.5rem; align-items: center; }
.checklist li .i { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; padding: 3px; border: 1px solid var(--line-2); color: transparent; }
.checklist li.done .i { background: var(--green); border-color: var(--green); color: #fff; }
.checklist li.done a { text-decoration: line-through; color: var(--muted); }
.checklist small { color: var(--muted); font-size: 0.8rem; }
.write-cta { display: flex; gap: 0.9rem; align-items: center; text-decoration: none; color: var(--ink); background: var(--ink); color: #f3ede2; border-color: var(--ink); }
.write-cta:hover { background: var(--red); color: #fff; }
.write-cta .i { width: 28px; height: 28px; color: var(--gold-soft); }
.write-cta span { display: grid; }
.write-cta small { opacity: 0.75; }
.author-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.author-list li { display: flex; align-items: center; gap: 0.6rem; justify-content: space-between; }
.author-link { display: flex; gap: 0.65rem; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.author-link span { display: grid; min-width: 0; }
.author-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-link small { color: var(--muted); font-size: 0.8rem; }

/* ---- explore ------------------------------------------------------------- */
.explore { padding-block: 2rem 3rem; }
.explore-head { margin-bottom: 1.8rem; }
.explore-search { display: flex; gap: 0.6rem; max-width: 720px; margin-top: 1rem; }
.explore-search input { font-size: 1.05rem; padding: 0.8rem 1rem; }
.explore-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 2rem; align-items: start; }
.filters { display: grid; gap: 1rem; position: sticky; top: 90px; }
.filters-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; }
.filters-box > summary, .filters-box > h2 { font: 600 0.74rem/1.2 var(--f-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.8rem; }
.filter-form { display: grid; gap: 1.1rem; }
.filter-form legend { font-size: 0.84rem; margin-bottom: 0.4rem; }
.radio-list { display: grid; gap: 0.25rem; }
.radio-list label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; cursor: pointer; }
.results-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.1rem; }
.results-meta strong { color: var(--ink); }

/* ---- play page ------------------------------------------------------------ */
.playbill { background: var(--bg); color: var(--fg); position: relative; overflow: hidden; isolation: isolate; }
.playbill::before { content: ''; position: absolute; inset: 14px; border: 1px solid color-mix(in srgb, var(--ac) 45%, transparent); z-index: -1; pointer-events: none; }
.playbill::after { content: ''; position: absolute; width: 900px; aspect-ratio: 1; right: -250px; top: -420px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--ac) 20%, transparent), transparent); z-index: -1; }
.playbill-inner { padding: clamp(2.2rem, 5vw, 4rem) 0 2.2rem; }
.playbill .kicker { color: var(--ac); }
.play-title { font: 700 clamp(2.4rem, 6vw, 4.8rem)/0.96 var(--f-display); letter-spacing: -0.03em; max-width: 18ch; margin-bottom: 0.4rem; overflow-wrap: anywhere; }
.play-sub { font: italic 400 clamp(1.15rem, 2vw, 1.45rem)/1.35 var(--f-read); opacity: 0.9; max-width: 50ch; }
.byline { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0 1.8rem; }
.byline-author { display: inline-flex; gap: 0.7rem; align-items: center; color: inherit; text-decoration: none; }
.byline-author span { display: grid; font: 600 1.05rem/1.2 var(--f-ui); }
.byline-author small { font: 600 0.64rem/1 var(--f-ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ac); margin-bottom: 0.2rem; }
.byline-author:hover { color: inherit; text-decoration: underline; }
.playbill .btn-toggle { background: transparent; color: var(--fg); border-color: color-mix(in srgb, var(--fg) 35%, transparent); }
.playbill .btn-toggle.is-active { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin: 0; border-top: 1px solid color-mix(in srgb, var(--ac) 45%, transparent); }
.facts div { padding: 0.9rem 1rem 0.2rem 0; }
.facts dt { font: 600 0.64rem/1 var(--f-ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ac); margin-bottom: 0.4rem; }
.facts dd { margin: 0; font: 500 1rem/1.3 var(--f-ui); }
.play-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; padding-block: 1.2rem; border-bottom: 1px solid var(--line); }
.play-stats { color: var(--muted); font-size: 0.85rem; display: inline-flex; gap: 0.35rem; align-items: center; margin-left: 0.4rem; }
.owner-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lists-pop .pop-panel { width: 300px; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 2.6rem; padding-block: 2rem 3rem; }
.play-main > section { margin-bottom: 2.6rem; }
.play-side { display: grid; gap: 1.1rem; align-content: start; position: sticky; top: 90px; }
.synopsis p { font: 400 1.18rem/1.6 var(--f-read); color: var(--ink-2); max-width: 64ch; }
.dramatis ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.dramatis li { break-inside: avoid; padding: 0.45rem 0; border-bottom: 1px dotted var(--line-2); display: grid; }
.dp-name { font: 600 0.9rem/1.3 var(--f-ui); letter-spacing: 0.1em; text-transform: uppercase; }
.dp-desc { font: italic 400 1rem/1.35 var(--f-read); color: var(--ink-2); }
.dp-lines { font-size: 0.76rem; color: var(--muted); }
.excerpt { position: relative; }
.script-excerpt { max-height: 560px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); background: var(--card); border: 1px solid var(--line); padding: 2rem clamp(1rem, 4vw, 3rem); }
.excerpt-more { text-align: center; margin-top: -1.2rem; position: relative; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; font-size: 0.92rem; }
.toc a { text-decoration: none; color: var(--ink-2); display: block; padding: 0.2rem 0; }
.toc a:hover { color: var(--red); }
.toc-act a { font-weight: 600; letter-spacing: 0.04em; margin-top: 0.4rem; }
.toc-scene a { padding-left: 0.9rem; font-family: var(--f-read); font-size: 1rem; }
.license-name { font: 600 1.15rem/1.2 var(--f-display); margin-bottom: 0.4rem; }
.license-note { font-family: var(--f-read); font-size: 1rem; border-left: 2px solid var(--gold); padding-left: 0.7rem; margin: 0.6rem 0 0; white-space: pre-line; }
.side-meta p { display: flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; margin-bottom: 0.4rem; }
.file-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.file-row small { color: var(--muted); }
.pdf-frame { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r); }
.docx-preview { max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line-2); padding: 2rem clamp(1rem, 4vw, 3rem); font: 400 1.05rem/1.6 var(--f-read); border-radius: var(--r); }
.docx-preview h2, .docx-preview h3 { text-align: center; }
.docx-preview .center { text-align: center; }

/* comments */
.comments-section h2 { display: flex; align-items: baseline; gap: 0.5rem; padding-bottom: 0.6rem; border-bottom: 3px double var(--line-2); }
.comments-section .count { font: 500 1rem var(--f-ui); color: var(--muted); }
.comment-new { margin: 1.2rem 0 1.6rem; }
.comment-new-row { display: flex; gap: 0.8rem; align-items: flex-start; }
.comment-new .btn { margin-top: 0.6rem; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.comment > article { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment.is-hidden > article { opacity: 0.65; }
.replies { margin-left: clamp(1rem, 4vw, 2.6rem); padding-left: 1rem; border-left: 2px solid var(--line); }
.comment-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.comment-author { display: inline-flex; gap: 0.5rem; align-items: center; color: var(--ink); text-decoration: none; }
.comment-time { color: var(--muted); font-size: 0.82rem; text-decoration: none; }
.comment-body { font: 400 1.07rem/1.55 var(--f-read); color: var(--ink-2); padding-left: 2.6rem; }
.comment-body p { margin-bottom: 0.5rem; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; padding-left: 2.6rem; }
.comment-removed { color: var(--muted); font-style: italic; margin: 0; }
.comment-form textarea { min-height: 84px; }
.login-nudge { margin: 1rem 0 1.5rem; text-align: center; }
.empty-comments { padding: 1.2rem 0; font-family: var(--f-read); font-size: 1.05rem; }

/* ---- the script (shared by reader, excerpt and editor preview) ----------- */
.script { --fs: 1.14rem; font-family: var(--f-read); font-size: var(--fs); line-height: 1.62; color: var(--ink); max-width: 40em; margin-inline: auto; }
.s-act { text-align: center; font: 600 calc(var(--fs) * 1.05)/1.2 var(--f-ui); letter-spacing: 0.32em; text-transform: uppercase; margin: 3.2em 0 1.6em; display: flex; align-items: center; gap: 1em; color: var(--red); }
.s-act::before, .s-act::after { content: ''; flex: 1; border-top: 1px solid currentColor; opacity: 0.5; }
.s-act:first-child { margin-top: 0.5em; }
.s-scene { text-align: center; font: italic 600 calc(var(--fs) * 1.18)/1.25 var(--f-display); margin: 2.4em 0 1.2em; letter-spacing: 0; }
.s-direction { font-style: italic; color: var(--ink-2); margin: 1em 0 1em 12%; opacity: 0.92; }
.s-direction p { margin: 0 0 0.4em; }
.s-speech { margin: 1.05em 0; transition: background 0.2s; border-radius: 2px; }
.s-cue { margin: 0 0 0.12em; text-align: center; }
.s-name { font: 600 calc(var(--fs) * 0.8)/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; }
.s-paren { font-style: italic; color: var(--muted); font-size: 0.92em; }
.s-line { margin: 0 8%; }
.s-line p { margin: 0 0 0.45em; }
.s-line .aside { font-style: italic; color: var(--muted); }
.s-text { margin: 1.2em 0; }
.s-text p { margin: 0 0 0.7em; text-indent: 0; }
.script.is-highlighting .s-speech { opacity: 0.55; }
.script.is-highlighting .s-speech.is-hl { opacity: 1; background: color-mix(in srgb, var(--gold-soft) 55%, transparent); box-shadow: -10px 0 0 color-mix(in srgb, var(--gold-soft) 55%, transparent), 10px 0 0 color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.script.is-highlighting .s-speech.is-hl .s-name { color: var(--red); }

/* ---- reader --------------------------------------------------------------- */
body.is-focus .masthead { position: static; }
body.page-reader { --reader-bg: #fbf8f1; --reader-ink: #1c1814; --reader-muted: #6f655b; background: var(--reader-bg); }
body.page-reader.theme-sepia { --reader-bg: #f1e4c8; --reader-ink: #2b2014; }
body.page-reader.theme-night { --reader-bg: #15120f; --reader-ink: #e9e0d0; --reader-muted: #a39885; --ink: #e9e0d0; --ink-2: #d6ccbb; --muted: #a39885; --red: #e58b7c; --line: #2f2923; --line-2: #3d362e; --card: #1d1915; --gold-soft: #5a4521; }
body.page-reader .colophon { display: none; }
.reader { color: var(--reader-ink); }
.reader-bar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--reader-bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.reader-bar-in { width: min(100% - 2rem, 1100px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; }
.reader-back { text-decoration: none; color: var(--reader-ink); font-weight: 600; font-size: 0.92rem; display: flex; gap: 0.4rem; min-width: 0; }
.reader-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-tools { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tool { background: transparent; border: 1px solid var(--line-2); color: var(--reader-ink); font: 600 0.82rem/1 var(--f-ui); padding: 0.48rem 0.7rem; border-radius: var(--r); cursor: pointer; display: inline-flex; align-items: center; gap: 0.35em; }
.tool:hover { border-color: var(--red); color: var(--red); }
.tool-select { padding: 0; border: 0; }
.tool-select select { padding: 0.4rem 0.6rem; font: 600 0.82rem var(--f-ui); background: transparent; color: var(--reader-ink); border-color: var(--line-2); width: auto; max-width: 180px; }
.reader-progress { height: 2px; background: transparent; }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.1s linear; }
.reader-toc { position: fixed; z-index: 35; top: 56px; right: max(1rem, calc((100vw - 1100px) / 2)); width: 300px; max-height: calc(100vh - 80px); overflow: auto; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: 1rem 1.2rem; border-radius: var(--r); }
.reader-toc ol { list-style: none; margin: 0; padding: 0; }
.reader-toc a { color: var(--reader-ink); text-decoration: none; display: block; padding: 0.25rem 0; }
.reader-toc .toc-scene a { padding-left: 1rem; font-family: var(--f-read); }
.reader-toc .toc-act a { font-weight: 600; margin-top: 0.4rem; }
.reader-page { width: min(100% - 2rem, 46em); margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) 0 4rem; }
.title-page { text-align: center; padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--line); }
.title-page h1 { font: 700 clamp(2.4rem, 7vw, 4.2rem)/1 var(--f-display); letter-spacing: -0.02em; margin: 0.4em 0 0.3em; }
.tp-genre { font: 600 0.72rem/1 var(--f-ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--red); }
.tp-sub { font: italic 400 1.3rem/1.4 var(--f-read); color: var(--reader-muted); }
.tp-author { font: 600 0.95rem/1 var(--f-ui); letter-spacing: 0.24em; text-transform: uppercase; margin-top: 2.2rem; }
.tp-facts { color: var(--reader-muted); font-size: 0.9rem; }
.tp-dramatis { margin: 0 auto 3.5rem; max-width: 32em; }
.tp-dramatis h2 { text-align: center; font: 600 0.8rem/1 var(--f-ui); letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 1.4rem; }
.tp-dramatis dl { margin: 0; display: grid; gap: 0.55rem; }
.tp-dramatis div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1rem; font-family: var(--f-read); font-size: 1.05rem; align-items: baseline; }
.tp-dramatis dt { text-align: right; font: 600 0.82rem/1.4 var(--f-ui); letter-spacing: 0.14em; text-transform: uppercase; }
.tp-dramatis dd { margin: 0; font-style: italic; color: var(--reader-muted); }
.reader-end { text-align: center; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.reader-end .actions { justify-content: center; }
.curtain { font: italic 700 2rem/1 var(--f-display); letter-spacing: 0.3em; color: var(--red); margin-bottom: 1rem; }
body.page-reader.theme-night .btn { --b: #e9e0d0; color: #15120f; }
body.page-reader.theme-night .btn-toggle { background: transparent; color: var(--ink); }

/* ---- editor --------------------------------------------------------------- */
.editor-wrap { padding-block: 1.6rem 7rem; }
.editor-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.editor-head h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.editor-head-actions { display: flex; align-items: center; gap: 0.8rem; }
.save-state { font-size: 0.85rem; color: var(--muted); }
.save-state.is-error { color: var(--danger); }
.editor-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.editor-meta { display: grid; gap: 1.2rem; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 4px; }
.license-hints { list-style: none; padding: 0; margin: -0.4rem 0 0; font-size: 0.83rem; color: var(--muted); }
.script-editor { padding: 0; overflow: visible; }
.se-toolbar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; padding: 0.7rem; background: var(--card); border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.eb-add, .eb-tool { font: 600 0.8rem/1 var(--f-ui); padding: 0.5rem 0.7rem; border: 1px solid var(--line-2); background: #fffdf9; color: var(--ink); border-radius: var(--r); cursor: pointer; display: inline-flex; gap: 0.3em; align-items: center; }
.eb-add:hover, .eb-tool:hover { border-color: var(--red); color: var(--red); }
.se-sep { flex: 1; }
.se-help, .se-import { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--paper); font-size: 0.9rem; }
.se-help ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.se-import { display: grid; gap: 0.6rem; }
.se-import[hidden], .se-help[hidden] { display: none; }
.se-chars { padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--line); }
.se-chars > summary { font: 600 0.74rem/1.2 var(--f-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.se-chars-list { display: grid; gap: 0.4rem; margin: 0.8rem 0; }
.se-char { display: grid; grid-template-columns: 180px 1fr auto; gap: 0.4rem; }
.se-char input { font-size: 0.9rem; padding: 0.45rem 0.6rem; }
.se-char input:first-child { font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.se-blocks { padding: 1.2rem clamp(0.6rem, 3vw, 2.4rem) 1.5rem; display: grid; gap: 0.35rem; background: #fffdf9; min-height: 200px; }
.se-empty { padding: 0 2rem 2rem; color: var(--muted); font-family: var(--f-read); font-size: 1.05rem; text-align: center; background: #fffdf9; margin: 0; }
.se-empty[hidden] { display: none; }
.se-stats { margin: 0; padding: 0.6rem 1.2rem; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--line); }
.blk { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 0.6rem; align-items: start; padding: 0.3rem 0.4rem; border-radius: var(--r); border: 1px solid transparent; }
.blk:focus-within { border-color: var(--line); background: #fff; }
.blk-type { font: 600 0.62rem/1 var(--f-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 0.75rem; text-align: right; cursor: pointer; background: none; border: 0; }
.blk-type:hover { color: var(--red); }
.blk-tools { display: flex; gap: 0.1rem; opacity: 0; transition: opacity 0.15s; padding-top: 0.35rem; }
.blk:hover .blk-tools, .blk:focus-within .blk-tools { opacity: 1; }
.blk-tools button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0.25rem; border-radius: 2px; font-size: 0.85rem; line-height: 1; }
.blk-tools button:hover { color: var(--red); background: var(--paper); }
.blk textarea, .blk input { border: 0; background: transparent; padding: 0.45rem 0.3rem; box-shadow: none !important; font-family: var(--f-read); font-size: 1.08rem; line-height: 1.5; resize: none; overflow: hidden; }
.blk textarea:focus, .blk input:focus { background: transparent; }
.blk-act textarea { text-align: center; font: 600 0.98rem/1.4 var(--f-ui); letter-spacing: 0.28em; text-transform: uppercase; color: var(--red); }
.blk-scene textarea { text-align: center; font: italic 600 1.2rem/1.3 var(--f-display); }
.blk-direction textarea { font-style: italic; color: var(--ink-2); padding-left: 10%; }
.blk-speech .sp-fields { display: grid; gap: 0; }
.blk-speech .sp-head { display: flex; gap: 0.4rem; justify-content: center; align-items: center; }
.blk-speech .sp-char { text-align: center; font: 600 0.86rem/1.2 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; max-width: 240px; }
.blk-speech .sp-paren { font-style: italic; font-size: 0.95rem; color: var(--muted); max-width: 220px; }
.blk-speech textarea { padding-inline: 8%; }
.blk-act { margin-top: 1rem; }
.blk-scene { margin-top: 0.6rem; }
.type-menu { position: absolute; z-index: 10; left: 0.4rem; top: 2rem; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); border-radius: var(--r); padding: 0.3rem; display: grid; min-width: 150px; }
.type-menu button { background: none; border: 0; text-align: left; padding: 0.45rem 0.6rem; font: 500 0.88rem var(--f-ui); cursor: pointer; border-radius: 2px; color: var(--ink); }
.type-menu button:hover { background: var(--paper); color: var(--red); }
.type-menu kbd { float: right; font-size: 0.7rem; }
.editor-footer { position: fixed; inset: auto 0 0 0; z-index: 30; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line-2); }
.editor-footer-in { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.7rem; flex-wrap: wrap; }
.danger-zone { margin-top: 2rem; border-color: #e7b6ad; }
.danger-zone h2 { color: var(--danger); font-size: 1.15rem; }

/* ---- auth / onboarding / setup -------------------------------------------- */
.auth { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 3rem; padding-block: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.auth-card { background: var(--card); border: 1px solid var(--line); padding: clamp(1.4rem, 4vw, 2.4rem); border-radius: var(--r); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); }
.auth-alt { text-align: center; margin: 1.2rem 0 0; font-size: 0.92rem; color: var(--muted); }
.auth-aside { display: grid; place-items: center; min-height: 420px; position: relative; }
.auth-aside::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #7a1616 0 22px, #8e1b1b 22px 44px, #6a1212 44px 60px); clip-path: polygon(0 0, 100% 0, 100% 78%, 88% 100%, 60% 86%, 40% 100%, 12% 86%, 0 100%); opacity: 0.95; border-radius: var(--r); box-shadow: inset 0 -60px 80px -40px rgba(0, 0, 0, 0.5); }
.auth-quote { position: relative; margin: 0; max-width: 22ch; text-align: center; color: #fbf3e8; }
.auth-quote p { font: italic 500 clamp(1.8rem, 3.2vw, 2.6rem)/1.15 var(--f-display); }
.auth-quote footer { font: 600 0.72rem/1.4 var(--f-ui); letter-spacing: 0.2em; text-transform: uppercase; color: #e7c98f; }
.welcome, .setup { padding-block: 2.4rem 4rem; }
.welcome-head, .setup-head { max-width: 760px; margin-bottom: 1.6rem; }
.steps { list-style: none; display: flex; gap: 0.5rem; padding: 0; margin: 0 0 1.6rem; flex-wrap: wrap; }
.steps li { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; font-size: 0.88rem; color: var(--muted); padding: 0.45rem 0.9rem 0.45rem 0.45rem; border: 1px solid var(--line-2); border-radius: 99px; }
.steps li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--paper-2); font-size: 0.78rem; }
.steps li.is-current { color: var(--ink); border-color: var(--ink); }
.steps li.is-current span { background: var(--red); color: #fff; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 2rem; align-items: start; }
.avatar-pick { display: flex; gap: 1.3rem; align-items: center; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.feature-list li { display: flex; gap: 0.9rem; font-family: var(--f-read); font-size: 1.05rem; color: var(--ink-2); }
.feature-list .i { width: 26px; height: 26px; color: var(--red); margin-top: 0.15rem; }
.feature-list strong { font-family: var(--f-ui); font-size: 0.95rem; color: var(--ink); }
.setup-form { max-width: 760px; }
.step-n { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--ink); color: var(--gold-soft); font: italic 600 0.9rem/1 var(--f-display); margin-right: 0.4rem; }
.error-page { text-align: center; padding-block: clamp(3rem, 10vw, 7rem); }
.error-code { font: italic 700 clamp(5rem, 14vw, 9rem)/0.9 var(--f-display); color: var(--red); margin: 0; letter-spacing: -0.04em; }
.error-page .actions { justify-content: center; margin-top: 1.5rem; }
.prose-page { padding-block: 3rem 4rem; font-family: var(--f-read); font-size: 1.15rem; line-height: 1.65; }
.prose-page h2 { margin-top: 2rem; }

/* ---- profile, lists, personal pages --------------------------------------- */
.profile-head { background: linear-gradient(180deg, var(--paper-2), transparent); border-bottom: 1px solid var(--line); padding-top: 2.4rem; }
.profile-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2rem; align-items: start; }
.profile-id h1 { margin: 0; }
.handle { color: var(--muted); margin: 0.2rem 0 0.8rem; }
.profile-bio { font-family: var(--f-read); font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.profile-counts { display: flex; gap: 1.5rem; font-size: 0.92rem; color: var(--muted); }
.profile-counts strong { color: var(--ink); font: 600 1.2rem var(--f-display); margin-right: 0.2em; }
.profile-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.profile-tabs { margin: 1.6rem auto 0; border-bottom: 0; }
.list-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.list-card { display: flex; gap: 1rem; align-items: center; background: var(--card); border: 1px solid var(--line); padding: 1rem; border-radius: var(--r); text-decoration: none; color: var(--ink); }
.list-card:hover { border-color: var(--red); }
.lc-count { font: italic 700 2rem/1 var(--f-display); color: var(--red); min-width: 2.2ch; text-align: center; }
.lc-body { display: grid; gap: 0.15rem; }
.lc-body small { color: var(--muted); font-size: 0.82rem; }
.lists-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }
.grid-item { display: grid; gap: 0.4rem; }
.remove-from-list { text-align: right; }
.my-list { list-style: none; margin: 0 0 2rem; padding: 0; border-top: 1px solid var(--line); }
.my-play { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.my-title { font: 600 1.2rem/1.2 var(--f-display); text-decoration: none; color: var(--ink); }
.my-play small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }
.my-stats { display: flex; gap: 0.3rem; align-items: center; color: var(--muted); font-size: 0.85rem; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { display: flex; gap: 0.9rem; padding: 1rem 0.9rem; border-bottom: 1px solid var(--line); border-radius: var(--r); }
.note.is-unread { background: color-mix(in srgb, var(--gold-soft) 35%, transparent); }
.note-body p { margin: 0 0 0.3rem; }
.note-body blockquote { margin: 0.3rem 0; padding-left: 0.8rem; border-left: 2px solid var(--line-2); font-family: var(--f-read); color: var(--ink-2); }
.note-body time { font-size: 0.8rem; color: var(--muted); }
.settings-form { max-width: 720px; }
.settings-stack { display: grid; gap: 1.2rem; max-width: 720px; }

/* ---- admin ---------------------------------------------------------------- */
.admin { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; padding-block: 2rem 4rem; }
.admin-nav { position: sticky; top: 90px; align-self: start; }
.admin-nav nav { display: grid; gap: 0.15rem; }
.admin-nav a { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; text-decoration: none; color: var(--ink-2); border-radius: var(--r); font-weight: 500; font-size: 0.93rem; }
.admin-nav a:hover { background: var(--card); color: var(--red); }
.admin-nav a[aria-current='page'] { background: var(--ink); color: #fbf8f2; }
.nav-badge { margin-left: auto; background: var(--red-2); color: #fff; border-radius: 99px; font-size: 0.7rem; padding: 0.15em 0.55em; }
.admin-role { font-size: 0.8rem; color: var(--muted); margin-top: 1rem; }
.admin-main > h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); padding-bottom: 0.8rem; border-bottom: 3px double var(--line-2); margin-bottom: 1.4rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 1rem 1.1rem; border-radius: var(--r); }
.stat-k { font: 600 0.7rem/1 var(--f-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.stat-v { font: 700 2.3rem/1 var(--f-display); margin: 0; }
.stat-sub { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 0; }
.admin-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; margin-top: 1.2rem; }
.admin-two > div { display: grid; gap: 1.2rem; }
.admin-checklist ul, .mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.admin-checklist li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--ink-2); }
.admin-checklist li.done .i { color: var(--green); }
.admin-checklist li:not(.done) .i { color: var(--red); }
.mini-list li { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-size: 0.92rem; }
.mini-list small { color: var(--muted); }
.admin-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.admin-filter input, .admin-filter select { width: auto; flex: 1; min-width: 160px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font: 600 0.7rem/1 var(--f-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0.8rem; border-bottom: 1px solid var(--line-2); background: var(--paper); }
.table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.user-cell { display: flex; gap: 0.6rem; align-items: center; }
.user-cell small { display: block; color: var(--muted); font-size: 0.78rem; }
.table .pop-panel { display: grid; gap: 0.5rem; width: 280px; }
.table .pop-panel form { margin: 0; }
.reports { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.report-item header { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.6rem; }
.report-item header small { color: var(--muted); }
.report-target blockquote { margin: 0.5rem 0; padding: 0.6rem 0.9rem; background: var(--paper); border-left: 3px solid var(--line-2); font-family: var(--f-read); }
.report-details { font-family: var(--f-read); font-style: italic; color: var(--ink-2); }
.report-actions { display: grid; gap: 0.6rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }

/* ---- footer --------------------------------------------------------------- */
.colophon { background: var(--ink); color: #c9bfae; margin-top: 3rem; border-top: 3px double var(--red); }
.colophon-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; padding-block: 2rem; }
.colophon-name { font: 600 1.3rem/1 var(--f-display); color: #fbf8f2; margin-bottom: 0.4rem; }
.colophon-tag { font-family: var(--f-read); font-style: italic; margin: 0; }
.colophon nav { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: start; }
.colophon nav a { color: #e7d9c2; text-decoration: none; font-size: 0.9rem; }
.colophon nav a:hover { color: #fff; text-decoration: underline; }
.colophon-note { grid-column: 1 / -1; font-size: 0.8rem; color: #8f8474; border-top: 1px solid #332c26; padding-top: 1rem; margin: 0; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 1020px) {
  .feed-layout, .play-grid, .explore-grid, .editor-grid, .lists-layout, .welcome-grid { grid-template-columns: minmax(0, 1fr); }
  .play-side, .filters, .editor-meta { position: static; max-height: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-bill { display: none; }
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; }
  .admin-nav nav { display: flex; flex-wrap: wrap; }
  .admin-two { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .masthead-row { flex-wrap: wrap; gap: 0.6rem 0.9rem; padding-block: 0.5rem; }
  .brand-name { font-size: 1.15rem; }
  .mainnav { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid #332c26; padding-top: 0.3rem; }
  .search { order: 4; max-width: none; width: 100%; flex-basis: 100%; }
  .masthead-actions { margin-left: auto; }
  .masthead { position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem 0.8rem; }
  .poster-title { font-size: 1.25rem; }
  .card-syn { display: none; }
  .how-steps { grid-template-columns: 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr 1fr; }
  .dramatis ul { columns: 1; }
  .profile-grid { grid-template-columns: 1fr; text-align: left; }
  .my-play { grid-template-columns: 1fr; }
  .blk { grid-template-columns: minmax(0, 1fr) auto; }
  .blk-type { grid-column: 1 / -1; text-align: left; padding: 0.3rem 0 0; }
  .se-toolbar { top: 0; }
  .se-char { grid-template-columns: 1fr; }
  .s-direction { margin-left: 4%; }
  .s-line { margin: 0 2%; }
  .owner-actions { margin-left: 0; }
  .reader-tools .tool span { display: none; }
  .tp-dramatis div { grid-template-columns: 1fr; gap: 0; text-align: center; }
  .tp-dramatis dt { text-align: center; }
  .comment-body, .comment-actions { padding-left: 0; }
  .explore-search { flex-direction: column; }
  .colophon-row { grid-template-columns: 1fr; }
  .reader-toc { left: 1rem; right: 1rem; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .masthead, .colophon, .reader-bar, .play-actions, .comments-section, .banner, .flash { display: none !important; }
  body, body.page-reader { background: #fff; color: #000; }
  .reader-page { width: auto; padding: 0; }
  .script { --fs: 11.5pt; }
  .s-speech { break-inside: avoid; }
}

/* toast */
.sm-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); background: var(--ink); color: #fbf8f2; padding: 0.7rem 1.1rem; border-radius: var(--r); font-size: 0.92rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; }
.sm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.page-editor .sm-toast { bottom: 5rem; }
.restore-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
