:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #121620;
  --panel-2: #181e29;
  --border: #293140;
  --text: #f5f7fb;
  --muted: #9aa6b6;
  --accent: #ff4d58;
  --accent-2: #ff7b62;
  --link: #8bc1ff;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 20% 0%, #171c28 0, var(--bg) 42%); color: var(--text); font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.mark { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 10px 35px rgba(255,77,88,.25); }
.mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 22px; background: rgba(18,22,32,.94); box-shadow: 0 25px 80px rgba(0,0,0,.45); }
.login-card .mark { margin-bottom: 28px; }
.login-card h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.login-card label { display: block; margin: 26px 0 8px; font-weight: 700; }
.login-card input, .search { width: 100%; border: 1px solid var(--border); border-radius: 12px; outline: none; background: #0d1017; color: var(--text); }
.login-card input { padding: 13px 14px; }
.login-card input:focus, .search:focus { border-color: #68758a; box-shadow: 0 0 0 3px rgba(139,193,255,.12); }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 15px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.login-card button { width: 100%; margin-top: 14px; }
button:disabled { cursor: wait; opacity: .65; }
.secondary { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.error { min-height: 24px; margin: 12px 0 0; color: #ff9ba1; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid rgba(41,49,64,.75); background: rgba(9,11,16,.88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 900; text-decoration: none; }
.top-actions { display: flex; gap: 9px; }
main { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 90px; }
.hero { max-width: 760px; margin-bottom: 45px; }
.hero h1 { margin: 0 0 10px; font-size: clamp(34px, 6vw, 60px); line-height: 1.03; letter-spacing: -.055em; }
.search { max-width: 540px; margin-top: 24px; padding: 14px 16px; }
.channel-group { margin-top: 42px; }
.group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.group-title h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.group-title span { color: var(--muted); font-size: 13px; }
.cards { display: grid; gap: 10px; }
.script-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 15px; align-items: center; min-height: 96px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(135deg, rgba(24,30,41,.95), rgba(18,22,32,.95)); text-decoration: none; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.script-card:hover { transform: translateY(-2px); border-color: #4a5669; background: #1b2230; }
.number { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: #0c0f15; color: var(--accent-2); font-size: 12px; font-weight: 900; }
.card-copy { display: grid; gap: 5px; }
.card-copy strong { line-height: 1.35; }
.card-copy small { color: var(--muted); }
.arrow { color: var(--link); font-size: 22px; }
.empty { padding: 30px; border: 1px dashed var(--border); border-radius: 15px; color: var(--muted); }

.reader { width: min(820px, 100%); margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--link); text-decoration: none; }
.reader-head { padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.reader-head h1 { margin: 0 0 14px; font-size: clamp(32px, 6vw, 52px); line-height: 1.08; letter-spacing: -.045em; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.script-content { padding-top: 34px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.8; }
.script-content p { margin: 0 0 1.15em; }
.script-content h2 { margin: 2.2em 0 .8em; padding-top: 1.2em; border-top: 1px solid var(--border); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 22px; }
.script-content h3 { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.script-content a { color: var(--link); overflow-wrap: anywhere; }
.script-content li { margin-bottom: .5em; }

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .brand span:last-child { display: none; }
  .top-actions button { padding: 8px 10px; font-size: 13px; }
  main { width: min(100% - 26px, 1120px); padding-top: 36px; }
  .script-card { grid-template-columns: 38px 1fr; }
  .script-card .arrow { display: none; }
  .number { width: 36px; height: 36px; }
  .script-content { font-size: 18px; }
}

