﻿    :root {
      --content-width: 760px;
      --font-scale: 1;
      --line-height: 1.72;
      --shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
      --ease: 150ms ease;
      --header-height: 64px;
      --toolbar-control-height: 40px;
    }

    body[data-width-mode="wide"] {
      --content-width: 980px;
    }

    body[data-theme="dark"] {
      --bg-grad-1: #0f1624;
      --bg-grad-2: #0b0f17;
      --text: #e5ecf5;
      --muted: #9db0c8;
      --surface: #111826;
      --surface-2: #151f31;
      --border: #253750;
      --accent: #7db4ff;
      --warn-bg: #453913;
      --warn-border: #b89437;
      --warn-text: #ffe8a6;
      --author-bg: #1f203f;
      --author-border: #7874ff;
      --author-text: #d8d6ff;
      --log-bg: #2a1114;
      --log-border: #8f2f3a;
      --log-text: #ffb5bf;
      --night-bg: #090c12;
      --night-border: #3d4a64;
      --name-bg: rgba(125, 180, 255, 0.2);
      --name-border: rgba(125, 180, 255, 0.48);
      --dramatic: #ffd7d7;
      --lock-bg: rgba(69, 57, 19, 0.4);
      --lock-border: #b89437;
      --lock-text: #ffe8a6;
    }

    body[data-theme="light"] {
      --bg-grad-1: #f9fbff;
      --bg-grad-2: #eef2fa;
      --text: #1e2a3a;
      --muted: #5d6d82;
      --surface: #ffffff;
      --surface-2: #f3f6fc;
      --border: #d5dfef;
      --accent: #1d63cc;
      --warn-bg: #fff4cc;
      --warn-border: #d3ad45;
      --warn-text: #5e4706;
      --author-bg: #eef0ff;
      --author-border: #8e94ff;
      --author-text: #31308f;
      --log-bg: #ffe9ec;
      --log-border: #d97885;
      --log-text: #6e1320;
      --night-bg: #e4ecf9;
      --night-border: #a6b7d6;
      --name-bg: rgba(29, 99, 204, 0.14);
      --name-border: rgba(29, 99, 204, 0.35);
      --dramatic: #5b0915;
      --lock-bg: #fff4cc;
      --lock-border: #d3ad45;
      --lock-text: #5e4706;
    }

    * {
      box-sizing: border-box;
    }

    .hidden {
      display: none !important;
    }

    html,
    body {
      margin: 0;
      padding: 0;
      min-height: 100%;
      overflow-x: hidden;
      scroll-behavior: smooth;
      font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
      background: linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
      color: var(--text);
      -webkit-text-size-adjust: 100%;
    }

    body {
      font-size: calc(16px * var(--font-scale));
    }

    .app-header {
      position: sticky;
      top: 0;
      z-index: 40;
      border-bottom: 1px solid var(--border);
      background: rgba(17, 24, 38, 0.92);
      backdrop-filter: blur(8px);
      transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
    }

    body[data-theme="light"] .app-header {
      background: rgba(255, 255, 255, 0.95);
    }

    .header-inner,
    .toolbar-inner,
    .reader-wrap {
      width: min(var(--content-width), calc(100% - 24px));
      margin: 0 auto;
    }

    .header-inner {
      min-height: var(--header-height);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 0;
      transition: min-height var(--ease), padding var(--ease);
    }

    .header-btns {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .header-btns .icon-btn {
      white-space: nowrap;
    }

    .brand-title {
      margin: 0;
      font-size: clamp(1.1rem, 2.5vw, 1.4rem);
      line-height: 1.2;
      letter-spacing: 0.01em;
      transition: font-size var(--ease), letter-spacing var(--ease);
    }

    .brand-subtitle {
      margin: 3px 0 0;
      color: var(--muted);
      font-size: 0.9rem;
      transition: opacity var(--ease), max-height var(--ease), margin var(--ease);
      max-height: 1.8em;
      overflow: hidden;
    }

    .icon-btn,
    .text-btn,
    .mode-btn {
      border: 1px solid var(--border);
      color: var(--text);
      background: var(--surface);
      border-radius: 10px;
      padding: 8px 10px;
      cursor: pointer;
      font-weight: 600;
      transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), background var(--ease);
    }

    .toolbar .text-btn,
    .toolbar .mode-btn,
    .toolbar .search-toggle,
    .toolbar .settings summary,
    .toolbar .character-picker,
    .toolbar .toolbar-chip,
    .toolbar .search {
      height: var(--toolbar-control-height);
      min-height: var(--toolbar-control-height);
    }

    .icon-btn:hover,
    .text-btn:hover,
    .mode-btn:hover {
      border-color: var(--accent);
    }

    .icon-btn:active,
    .text-btn:active,
    .mode-btn:active {
      transform: translateY(1px);
    }

    .icon-btn:disabled,
    .text-btn:disabled,
    .mode-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      filter: grayscale(0.55);
    }

    .toolbar {
      position: sticky;
      top: var(--header-height);
      z-index: 35;
      border-bottom: 1px solid var(--border);
      background: rgba(21, 31, 49, 0.9);
      backdrop-filter: blur(8px);
      transition: top var(--ease), background var(--ease), border-color var(--ease);
    }

    body[data-theme="light"] .toolbar {
      background: rgba(243, 246, 252, 0.95);
    }

    .toolbar-inner {
      min-height: 64px;
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 10px;
      align-items: start;
      padding: 10px 0;
      transition: min-height var(--ease), padding var(--ease);
    }

    body.is-scrolled {
      --header-height: 50px;
    }

    body.is-scrolled .app-header {
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    body.is-scrolled .header-inner {
      padding: 4px 0;
    }

    body.is-scrolled .brand-title {
      font-size: clamp(1rem, 2.2vw, 1.2rem);
      letter-spacing: 0;
    }

    body.is-scrolled .brand-subtitle {
      opacity: 0;
      max-height: 0;
      margin-top: 0;
    }

    body.is-scrolled .toolbar-inner {
      min-height: 56px;
      padding: 8px 0;
    }

    .toolbar-left,
    .toolbar-center,
    .toolbar-right,
    .toolbar-right-main,
    .toolbar-right-actions-primary,
    .toolbar-right-actions-secondary {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .toolbar-left {
      justify-content: flex-start;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      width: 44px;
      flex-wrap: nowrap;
      position: relative;
    }

    .toolbar-center {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      align-items: start;
    }

    .toolbar-right-main {
      justify-content: flex-start;
    }

    .toolbar-right {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      align-items: start;
      justify-items: end;
    }

    .toolbar-right-actions-primary,
    .toolbar-right-actions-secondary {
      justify-content: flex-start;
      flex-wrap: nowrap;
    }

    .search-toggle {
      width: 44px;
      padding: 0;
      font-size: 1.06rem;
      font-weight: 800;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .toolbar-left #fontDown,
    .toolbar-left #fontUp {
      width: 44px;
      padding-left: 0;
      padding-right: 0;
    }

    .search {
      width: min(320px, 36vw);
      min-width: 220px;
      position: absolute;
      left: calc(100% + 10px);
      top: 84px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      padding: 0 10px;
      outline: none;
      display: none;
    }

    .toolbar-left.search-open .search {
      display: block;
    }

    @media (min-width: 861px) {
      .toolbar-left .search {
        display: none !important;
      }

      .toolbar-left.search-open .search {
        display: block !important;
        z-index: 5;
      }

      #focusLabel {
        display: none;
      }

      .nav-wrap {
        flex-wrap: nowrap;
      }

      .toolbar-right-main {
        min-height: 40px;
      }
    }

    .character-picker {
      min-width: 230px;
      max-width: 280px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      padding: 0 9px;
      outline: none;
      font-weight: 600;
      cursor: pointer;
    }

    .search:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(125, 180, 255, 0.3);
    }

    .character-picker:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(125, 180, 255, 0.3);
    }

    body[data-theme="light"] .search:focus {
      box-shadow: 0 0 0 3px rgba(29, 99, 204, 0.2);
    }

    body[data-theme="light"] .character-picker:focus {
      box-shadow: 0 0 0 3px rgba(29, 99, 204, 0.2);
    }

    .toolbar-chip {
      display: inline-flex;
      align-items: center;
      padding: 0 9px;
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--muted);
      background: var(--surface);
      font-weight: 600;
      white-space: nowrap;
    }

    .settings {
      position: relative;
    }

    .settings summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      border: 1px solid var(--border);
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      padding: 0 10px;
      background: var(--surface);
      font-weight: 600;
    }

    .settings summary::-webkit-details-marker {
      display: none;
    }

    .settings-panel {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      width: min(300px, 88vw);
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: 12px;
      box-shadow: var(--shadow);
      padding: 12px;
      display: grid;
      gap: 8px;
    }

    .settings-row {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.92rem;
      color: var(--text);
    }

    .settings-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .settings-row input {
      margin: 0;
    }

    .settings-row-beta {
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .settings-inline-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
    }

    .settings-mini-btn {
      min-height: 30px;
      padding: 4px 9px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface-2);
      color: var(--text);
      font-size: 0.8rem;
      font-weight: 700;
      cursor: pointer;
      transition: border-color var(--ease), opacity var(--ease), background var(--ease);
    }

    .settings-mini-btn:hover {
      border-color: var(--accent);
    }

    .settings-mini-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .beta-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 18px;
      padding: 0 7px;
      border-radius: 999px;
      border: 1px solid var(--warn-border);
      background: var(--warn-bg);
      color: var(--warn-text);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      line-height: 1;
    }

    .not-working-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 18px;
      padding: 0 7px;
      border-radius: 999px;
      border: 1px solid #b4232c;
      background: #5b0f14;
      color: #ffd5d8;
      font-size: 0.68rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      line-height: 1;
      white-space: nowrap;
    }

    body[data-theme="light"] .not-working-badge {
      border-color: #c9353d;
      background: #ffe3e5;
      color: #7f0f16;
    }

    main {
      padding: 12px 0 28px;
    }

    .reader-wrap {
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--surface);
      box-shadow: var(--shadow);
      padding: clamp(10px, 2vw, 18px);
    }

    .status {
      margin: 0 0 10px;
      color: var(--muted);
      font-size: 0.92rem;
    }

    .help-modal {
      position: fixed;
      inset: 0;
      z-index: 90;
      display: grid;
      place-items: center;
      padding: 16px;
      background: rgba(5, 10, 20, 0.66);
      backdrop-filter: blur(2px);
    }

    .help-modal.hidden {
      display: none;
    }

    .help-dialog {
      width: min(680px, 100%);
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .help-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      background: var(--surface-2);
    }

    .help-header h2 {
      margin: 0;
      font-size: 1rem;
      line-height: 1.2;
    }

    .help-close {
      min-height: 34px;
      padding: 6px 10px;
    }

    .help-body {
      padding: 12px;
      color: var(--text);
      font-size: 0.92rem;
      line-height: 1.55;
    }

    .help-body p {
      margin: 0;
    }

    .help-body p + p {
      margin-top: 8px;
    }

    .feedback-dialog {
      width: min(720px, 100%);
    }

    .feedback-dialog .help-body {
      position: relative;
      min-height: 280px;
    }

    .feedback-form {
      display: grid;
      gap: 8px;
    }

    .feedback-label {
      font-weight: 700;
      font-size: 0.9rem;
    }

    .feedback-input,
    .feedback-textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface-2);
      color: var(--text);
      padding: 10px 11px;
      font: inherit;
      transition: border-color var(--ease), box-shadow var(--ease);
    }

    .feedback-input:focus,
    .feedback-textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(125, 180, 255, 0.3);
    }

    body[data-theme="light"] .feedback-input:focus,
    body[data-theme="light"] .feedback-textarea:focus {
      box-shadow: 0 0 0 3px rgba(29, 99, 204, 0.2);
    }

    .feedback-textarea {
      min-height: 130px;
      resize: vertical;
      line-height: 1.5;
    }

    .feedback-status {
      min-height: 1.2em;
      margin: 2px 0 0;
      color: var(--muted);
      font-size: 0.86rem;
    }

    .feedback-status.error {
      color: #ff8e9c;
    }

    body[data-theme="light"] .feedback-status.error {
      color: #a2172d;
    }

    .feedback-submit {
      justify-self: start;
      margin-top: 2px;
    }

    .feedback-thanks {
      position: absolute;
      inset: 0;
      display: grid;
      place-content: center;
      gap: 10px;
      padding: 16px;
      text-align: center;
      background: rgba(35, 41, 55, 0.78);
      backdrop-filter: blur(1px);
      pointer-events: auto;
    }

    body[data-theme="light"] .feedback-thanks {
      background: rgba(185, 193, 208, 0.72);
    }

    .feedback-thanks p {
      margin: 0;
    }

    .reader {
      display: grid;
      gap: 18px;
    }

    .day-separator {
      margin: 22px 0 4px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface-2);
      text-align: center;
      padding: 12px 10px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 700;
      letter-spacing: 0.07em;
      white-space: pre-line;
    }

    .day-section {
      display: grid;
      gap: 10px;
      padding-top: 4px;
    }

    .day-content {
      display: grid;
      gap: 10px;
      padding-top: 4px;
    }

    .reader.daytime-collapsed .day-content > .story-block.phase-day {
      display: none;
    }

    .day-section.day-important {
      border: 1px solid var(--warn-border);
      border-radius: 12px;
      padding: 10px;
      background: linear-gradient(180deg, var(--warn-bg) 0%, transparent 100%);
    }

    .day-section.day-final {
      border: 2px solid #c9a227;
      border-top: 4px solid #ffd23f;
      border-radius: 12px;
      padding: 10px;
      background: linear-gradient(180deg, rgba(72, 52, 0, 0.45) 0%, transparent 40%);
    }

    body[data-theme="light"] .day-section.day-final {
      border-color: #b8870b;
      border-top-color: #d4a017;
      background: linear-gradient(180deg, rgba(255, 230, 130, 0.4) 0%, transparent 40%);
    }

    .finale-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 6px;
      min-height: 20px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid #c9a227;
      background: linear-gradient(135deg, #453913 0%, #5e4a0a 100%);
      color: #ffd23f;
      font-size: 0.72em;
      font-weight: 900;
      letter-spacing: 0.08em;
      line-height: 1;
      vertical-align: middle;
      text-shadow: 0 0 6px rgba(255, 210, 63, 0.5);
    }

    body[data-theme="light"] .finale-badge {
      background: linear-gradient(135deg, #fff3bb 0%, #ffe570 100%);
      border-color: #b8870b;
      color: #6b4a00;
      text-shadow: none;
    }

    .day-final-banner {
      margin: 8px 0 4px;
      padding: 14px 18px;
      border: 1px solid #c9a227;
      border-radius: 10px;
      background: linear-gradient(135deg, rgba(72, 52, 0, 0.38) 0%, rgba(44, 32, 0, 0.18) 100%);
      text-align: center;
    }

    body[data-theme="light"] .day-final-banner {
      background: linear-gradient(135deg, rgba(255, 230, 130, 0.38) 0%, rgba(255, 248, 200, 0.2) 100%);
      border-color: #b8870b;
    }

    .day-final-banner-title {
      margin: 0;
      font-size: clamp(1rem, 2vw, 1.3rem);
      font-weight: 900;
      letter-spacing: 0.12em;
      color: #ffd23f;
      text-transform: uppercase;
      text-shadow: 0 0 12px rgba(255, 210, 63, 0.4);
    }

    body[data-theme="light"] .day-final-banner-title {
      color: #7a4a00;
      text-shadow: none;
    }

    .day-final-banner-sub {
      margin: 6px 0 0;
      font-size: 0.88rem;
      color: #ffe8a6;
      letter-spacing: 0.04em;
      opacity: 0.88;
    }

    body[data-theme="light"] .day-final-banner-sub {
      color: #5e3c00;
    }

    .day-section.day-locked {
      border: 1px dashed var(--lock-border);
      border-radius: 12px;
      padding: 10px;
      background: linear-gradient(180deg, var(--lock-bg) 0%, transparent 100%);
    }

    .day-heading {
      margin: 0;
      padding: 8px 10px;
      border-bottom: 1px solid var(--border);
      font-size: clamp(1.18rem, 2.3vw, 1.46rem);
      line-height: 1.3;
      font-weight: 800;
      letter-spacing: 0.03em;
    }

    .important-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 6px;
      min-height: 20px;
      padding: 0 8px;
      border-radius: 999px;
      border: 1px solid var(--warn-border);
      background: var(--warn-bg);
      color: var(--warn-text);
      font-size: 0.72em;
      font-weight: 900;
      letter-spacing: 0.06em;
      line-height: 1;
      vertical-align: middle;
    }

    .day-thanks-banner {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin: 2px 0 8px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      color: var(--text);
      line-height: 1.35;
      font-weight: 650;
    }

    .day-thanks-text {
      color: var(--muted);
    }

    .day-thanks-profile {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 5px 14px 5px 6px;
      border-radius: 999px;
      border: 1px solid var(--name-border);
      background: var(--name-bg);
    }

    .day-thanks-avatar {
      width: clamp(34px, 4.2vw, 44px);
      height: clamp(34px, 4.2vw, 44px);
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid rgba(255, 255, 255, 0.25);
      background: var(--surface-2);
      flex: 0 0 auto;
    }

    body[data-theme="light"] .day-thanks-avatar {
      border-color: rgba(30, 42, 58, 0.18);
    }

    .day-thanks-name {
      font-weight: 800;
      font-size: clamp(1rem, 1.8vw, 1.2rem);
      letter-spacing: 0.02em;
      color: var(--text);
    }

    .credits-message {
      margin: 0;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      font-size: clamp(1.02rem, 1.5vw, 1.14rem);
      font-weight: 700;
      line-height: 1.45;
    }

    .credits-note {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .credits-people {
      margin-top: 10px;
      display: grid;
      gap: 10px;
    }

    .credits-person-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .story-block {
      display: grid;
      gap: 2px;
      border-radius: 10px;
      padding: 4px 6px;
    }

    .lock-panel {
      border: 1px solid var(--lock-border);
      border-radius: 10px;
      background: var(--lock-bg);
      color: var(--lock-text);
      padding: 12px;
      display: grid;
      gap: 8px;
    }

    .lock-title,
    .lock-meta,
    .lock-countdown {
      margin: 0;
    }

    .lock-title {
      font-weight: 800;
      letter-spacing: 0.02em;
    }

    .lock-countdown {
      font-size: 1.04rem;
      font-weight: 700;
    }

    .story-block.rules {
      background: transparent;
      border: 0;
      color: var(--warn-text);
    }

    .story-block.log {
      background: transparent;
      border: 0;
      color: var(--log-text);
      font-family: Consolas, "Courier New", monospace;
      font-size: 0.96em;
    }

    .story-block.night {
      background: var(--night-bg);
      border: 1px solid var(--night-border);
    }

    .night-section {
      padding: 0;
      overflow: hidden;
    }

    .night-heading {
      margin: 0;
      padding: 7px 10px;
      border-bottom: 1px solid var(--night-border);
      font-size: 0.9rem;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--muted);
      background: rgba(61, 74, 100, 0.12);
    }

    .night-content {
      display: grid;
      gap: 2px;
      padding: 4px 6px;
    }

    .story-block.author-note {
      background: transparent;
      border: 0;
    }

    .story-block.title {
      margin: 10px 0 4px;
      border-radius: 12px;
      border: 1px solid var(--accent);
      background: linear-gradient(180deg, rgba(125, 180, 255, 0.18) 0%, rgba(125, 180, 255, 0.08) 100%);
      padding: 8px 10px;
    }

    body[data-theme="light"] .story-block.title {
      background: linear-gradient(180deg, rgba(29, 99, 204, 0.15) 0%, rgba(29, 99, 204, 0.06) 100%);
    }

    .story-block.subheading {
      background: transparent;
      border: 0;
      padding: 6px 2px 2px;
      margin-top: 8px;
    }

    .story-line {
      margin: 0;
      border-radius: 8px;
      padding: 6px 8px;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      line-height: var(--line-height);
      transition: opacity var(--ease), background-color var(--ease), filter var(--ease);
    }

    .line-number {
      display: inline-block;
      min-width: 3.2ch;
      margin-right: 10px;
      color: var(--muted);
      opacity: 0.78;
      text-align: right;
      user-select: none;
      font-family: Consolas, "Courier New", monospace;
      font-size: 0.92em;
      line-height: 1;
    }

    .story-block.rules .story-line,
    .story-block.log .story-line {
      display: inline-block;
      width: fit-content;
      max-width: 100%;
    }

    .story-block.rules .story-line {
      background: var(--warn-bg);
      border: 1px solid var(--warn-border);
      color: var(--warn-text);
    }

    .story-block.log .story-line {
      background: var(--log-bg);
      border: 1px solid var(--log-border);
      color: var(--log-text);
    }

    .story-block.author-note .story-line {
      display: inline-block;
      width: fit-content;
      max-width: 100%;
      background: var(--author-bg);
      border: 1px solid var(--author-border);
      color: var(--author-text);
      font-style: italic;
    }

    .story-block.title .story-line {
      padding: 6px 4px;
      text-align: center;
      font-size: clamp(1.22rem, 2.8vw, 1.72rem);
      line-height: 1.25;
      letter-spacing: 0.05em;
      font-weight: 900;
      color: var(--text);
      text-shadow: 0 0 10px rgba(125, 180, 255, 0.28);
    }

    .fmt-bold {
      font-weight: 800;
    }

    .fmt-italic {
      font-style: italic;
    }

    .story-block.rules .story-line.blank,
    .story-block.log .story-line.blank,
    .story-block.author-note .story-line.blank {
      display: none;
    }

    .story-line.blank {
      min-height: 10px;
      padding: 0;
    }

    .story-line.line-divider {
      min-height: 16px;
      padding: 7px 0;
    }

    .story-line.line-divider::before {
      content: "";
      display: block;
      width: 100%;
      height: 2px;
      border-radius: 999px;
      background: linear-gradient(90deg, transparent 0%, #4a95ff 18%, #71b8ff 50%, #4a95ff 82%, transparent 100%);
    }

    .story-line.dramatic {
      text-align: center;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      font-weight: 800;
      color: var(--dramatic);
      text-shadow: 0 0 10px rgba(255, 215, 215, 0.25);
    }

    .story-block.subheading .story-line,
    .story-line.subheading {
      border-radius: 0;
      padding: 6px 2px 5px;
      border-bottom: 1px solid var(--border);
      font-size: clamp(1.02rem, 2.1vw, 1.18rem);
      font-weight: 800;
      letter-spacing: 0.04em;
      color: var(--accent);
      line-height: 1.35;
      background: transparent;
      text-transform: none;
    }

    .story-line.subheading.midday {
      color: #f2b84b;
      border-bottom-color: rgba(242, 184, 75, 0.65);
      text-shadow: 0 0 10px rgba(242, 184, 75, 0.2);
    }

    body[data-theme="light"] .story-line.subheading.midday {
      color: #9a6200;
      border-bottom-color: rgba(154, 98, 0, 0.55);
      text-shadow: none;
    }

    body[data-theme="light"] .story-line.dramatic {
      text-shadow: 0 0 8px rgba(91, 9, 21, 0.18);
    }

    .story-line.is-hidden {
      display: none;
    }

    .story-line.dimmed {
      opacity: 0.35;
      filter: saturate(0.75);
    }

    .story-line.name-hit {
      background: rgba(125, 180, 255, 0.22);
    }

    body[data-theme="light"] .story-line.name-hit {
      background: rgba(29, 99, 204, 0.12);
    }

    .name {
      display: inline-block;
      padding: 0.03em 0.46em;
      border-radius: 999px;
      background: var(--name-bg);
      border: 1px solid var(--name-border);
      font-weight: 650;
      cursor: pointer;
      transition: box-shadow var(--ease), transform var(--ease);
    }

    .name:hover,
    .name:focus-visible {
      box-shadow: 0 0 0 2px rgba(125, 180, 255, 0.45);
      transform: translateY(-1px);
      outline: none;
    }

    body[data-theme="light"] .name:hover,
    body[data-theme="light"] .name:focus-visible {
      box-shadow: 0 0 0 2px rgba(29, 99, 204, 0.4);
    }

    .name.selected {
      box-shadow: 0 0 0 2px rgba(125, 180, 255, 0.62);
    }

    body[data-theme="light"] .name.selected {
      box-shadow: 0 0 0 2px rgba(29, 99, 204, 0.52);
    }

    .nav-wrap {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-left: 0;
    }

    .nav-wrap.hidden {
      display: none;
    }

    .bottom-next-wrap {
      margin-top: 16px;
      display: flex;
      justify-content: flex-end;
    }

    .bottom-next-wrap.hidden {
      display: none;
    }

    @media (max-width: 860px) {
      :root {
        --header-height: 62px;
      }

      .header-inner,
      .toolbar-inner,
      .reader-wrap {
        width: min(var(--content-width), calc(100% - 14px));
      }

      body.is-scrolled {
        --header-height: 46px;
      }

      .toolbar-inner {
        grid-template-columns: 1fr;
      }

      .toolbar-left {
        width: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
      }

      .toolbar-center,
      .toolbar-right {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .toolbar-right-main,
      .toolbar-right-actions-primary,
      .toolbar-right-actions-secondary {
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      #focusLabel {
        display: inline-flex;
      }

      .search-toggle {
        display: none;
      }

      .search {
        display: block;
        position: static;
        min-width: 100%;
        width: 100%;
        flex: 1 1 100%;
      }

      .character-picker {
        min-width: 190px;
        max-width: 100%;
      }

      .nav-wrap {
        margin-left: 0;
      }
    }

    @media (max-width: 500px) {
      .header-btns .icon-btn {
        padding: 6px 8px;
        font-size: 0.82rem;
      }

      .brand-title {
        font-size: 1rem;
      }
    }

    @media (max-width: 360px) {
      .header-btns .icon-btn {
        padding: 5px 7px;
        font-size: 0.78rem;
      }
    }
  

