/* ==========================================================================
   British Noble Author Studio - The AI Operating System for Publishing
   Standalone Stylesheet for Independent Authors (/author-studio/)
   Three-Theme Engine: Light (Default) | British Noble | Dark
   ========================================================================== */

:root,
html[data-as-theme="light"] {
  --as-font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --as-font-book: 'Newsreader', Georgia, 'Times New Roman', serif;
  --as-font-garamond: 'EB Garamond', Georgia, serif;
  --as-font-crimson: 'Crimson Pro', Georgia, serif;
  --as-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Sidebar: Apple/Linear/Vellum Warm Architectural Paper Rail */
  --as-sb-bg-top: #F6F3ED;
  --as-sb-bg-bot: #F2EEE6;
  --as-sb-card: #FFFFFF;
  --as-sb-border: #E5DFD5;
  --as-sb-text: #181619;
  --as-sb-muted: #655F58;
  --as-sb-hover: rgba(24, 22, 25, 0.055);
  --as-sb-active-bg: #181619;
  --as-sb-active-text: #FAF8F5;
  --as-sb-accent: #3D0C20;
  --as-sb-accent-ink: #FAF8F5;

  /* Studio Canvas: Warm Editorial Paper (#FAF8F5) & Crisp White Cards (#FFFFFF) */
  --as-bg: #FAF8F5;
  --as-bg-subtle: #F3EFE8;
  --as-card: #FFFFFF;
  --as-card-alt: #FCFBF9;
  --as-border: #E5DFD5;
  --as-border-strong: #CFC7B8;
  --as-ink: #181619;
  --as-ink-soft: #38343A;
  --as-muted: #66605A;

  /* Brand Actions & Status */
  --as-primary: #181619;
  --as-primary-hover: #3D0C20;
  --as-primary-ink: #FFFFFF;
  --as-lime: #EEFF6D;
  --as-lime-ink: #181619;
  --as-accent-soft: rgba(61, 12, 32, 0.075);
  --as-accent-text: #3D0C20;

  --as-ok: #157347;
  --as-ok-bg: rgba(21, 115, 71, 0.11);
  --as-warn: #B45309;
  --as-warn-bg: rgba(180, 83, 9, 0.12);
  --as-danger: #B91C1C;
  --as-danger-bg: rgba(185, 28, 28, 0.11);
  --as-info: #1D4ED8;
  --as-info-bg: rgba(29, 78, 216, 0.10);

  --as-shadow-sm: 0 1px 2px rgba(24, 22, 25, 0.04), 0 1px 4px rgba(24, 22, 25, 0.03);
  --as-shadow-md: 0 8px 24px rgba(24, 22, 25, 0.065);
  --as-shadow-lg: 0 20px 48px rgba(24, 22, 25, 0.13);
  --as-paper-sheet: #FFFFFF;
  --as-paper-ink: #181619;
}

html[data-as-theme="noble"] {
  /* Sidebar: Deep Sovereign Mulberry */
  --as-sb-bg-top: #2C0817;
  --as-sb-bg-bot: #3D0C20;
  --as-sb-card: rgba(255, 255, 255, 0.065);
  --as-sb-border: rgba(250, 248, 245, 0.14);
  --as-sb-text: #FAF8F5;
  --as-sb-muted: rgba(250, 248, 245, 0.68);
  --as-sb-hover: rgba(250, 248, 245, 0.09);
  --as-sb-active-bg: rgba(238, 255, 109, 0.14);
  --as-sb-active-text: #EEFF6D;
  --as-sb-accent: #EEFF6D;
  --as-sb-accent-ink: #2C0817;

  /* Studio Canvas: Warm Editorial Paper / Ivory */
  --as-bg: #FAF8F5;
  --as-bg-subtle: #F3EFE8;
  --as-card: #FFFFFF;
  --as-card-alt: #FCFBF8;
  --as-border: #E5DFD5;
  --as-border-strong: #CFC7B8;
  --as-ink: #181619;
  --as-ink-soft: #3A3D45;
  --as-muted: #64605A;

  /* Brand Actions & Status */
  --as-primary: #3D0C20;
  --as-primary-hover: #54122D;
  --as-primary-ink: #FAF8F5;
  --as-lime: #EEFF6D;
  --as-lime-ink: #2C0817;
  --as-accent-soft: rgba(61, 12, 32, 0.08);
  --as-accent-text: #3D0C20;

  --as-paper-sheet: #FFFDF9;
  --as-paper-ink: #181619;
}

html[data-as-theme="dark"] {
  --as-sb-bg-top: #090C12;
  --as-sb-bg-bot: #0B0E14;
  --as-sb-card: #121722;
  --as-sb-border: #232A38;
  --as-sb-text: #F3F4F6;
  --as-sb-muted: #9CA3AF;
  --as-sb-hover: rgba(255, 255, 255, 0.06);
  --as-sb-active-bg: rgba(238, 255, 109, 0.14);
  --as-sb-active-text: #EEFF6D;
  --as-sb-accent: #EEFF6D;
  --as-sb-accent-ink: #0B0E14;

  --as-bg: #0B0E14;
  --as-bg-subtle: #10151F;
  --as-card: #121722;
  --as-card-alt: #161C29;
  --as-border: #232A38;
  --as-border-strong: #323C50;
  --as-ink: #F3F4F6;
  --as-ink-soft: #D1D5DB;
  --as-muted: #9CA3AF;

  --as-primary: #EEFF6D;
  --as-primary-hover: #F5FF9E;
  --as-primary-ink: #0B0E14;
  --as-lime: #EEFF6D;
  --as-lime-ink: #0B0E14;
  --as-accent-soft: rgba(238, 255, 109, 0.12);
  --as-accent-text: #EEFF6D;

  --as-ok: #34D399;
  --as-ok-bg: rgba(52, 211, 153, 0.14);
  --as-warn: #FBBF24;
  --as-warn-bg: rgba(251, 191, 36, 0.14);
  --as-danger: #F87171;
  --as-danger-bg: rgba(248, 113, 113, 0.14);
  --as-info: #60A5FA;
  --as-info-bg: rgba(96, 165, 250, 0.14);

  --as-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --as-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --as-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.65);
  --as-paper-sheet: #141A26;
  --as-paper-ink: #F3F4F6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--as-bg);
  color: var(--as-ink);
  font-family: var(--as-font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.as-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  background: var(--as-primary);
  color: var(--as-primary-ink);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.as-skip-link:focus {
  left: 12px;
}

.as-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   UNDISTORTED BRAND LOGOS (820x296 = 2.77:1)
   ========================================================================== */
.as-brand-logo {
  width: auto;
  max-height: 40px;
  height: auto;
  aspect-ratio: 820 / 296;
  object-fit: contain;
  display: block;
}

.as-logo-on-light {
  display: block;
}
.as-logo-on-dark {
  display: none;
}

html[data-as-theme="noble"] .as-logo-on-light,
html[data-as-theme="dark"] .as-logo-on-light {
  display: none;
}
html[data-as-theme="noble"] .as-logo-on-dark,
html[data-as-theme="dark"] .as-logo-on-dark {
  display: block;
}

/* ==========================================================================
   STUDIO SHELL: SIDEBAR + MAIN WORKSPACE
   ========================================================================== */
.as-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.as-sidebar {
  background: linear-gradient(180deg, var(--as-sb-bg-top) 0%, var(--as-sb-bg-bot) 100%);
  color: var(--as-sb-text);
  border-right: 1px solid var(--as-sb-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 14px;
  z-index: 40;
}

.as-sidebar-backdrop {
  display: none;
}

.as-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 8px;
}

.as-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.as-version-pill {
  font-family: var(--as-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--as-sb-accent);
  color: var(--as-sb-accent-ink);
  letter-spacing: 0.03em;
}

.as-studio-subline {
  display: flex;
  flex-direction: column;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--as-sb-border);
  margin-bottom: 12px;
}
.as-studio-subline strong {
  font-family: var(--as-font-book);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.as-studio-subline span {
  font-size: 11px;
  color: var(--as-sb-muted);
  letter-spacing: 0.02em;
}

/* Author Profile & Project Card */
.as-profile-card {
  background: var(--as-sb-card);
  border: 1px solid var(--as-sb-border);
  border-radius: 12px;
  padding: 11px;
  margin-bottom: 14px;
}

.as-author-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.as-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--as-sb-accent);
  color: var(--as-sb-accent-ink);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.as-author-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.as-author-meta strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-author-meta span {
  font-size: 11px;
  color: var(--as-sb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.as-ip-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--as-sb-border);
  color: var(--as-sb-text);
  flex-shrink: 0;
}

.as-micro-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--as-sb-muted);
  margin-bottom: 4px;
}

.as-sidebar-select {
  width: 100%;
  background: #FAF8F5;
  color: #181619;
  border: 1px solid var(--as-sb-border);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: var(--as-font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
html[data-as-theme="noble"] .as-sidebar-select,
html[data-as-theme="dark"] .as-sidebar-select {
  background: rgba(0, 0, 0, 0.24);
  color: var(--as-sb-text);
}
.as-sidebar-select option {
  background: #FFFFFF;
  color: #181619;
}
html[data-as-theme="noble"] .as-sidebar-select option,
html[data-as-theme="dark"] .as-sidebar-select option {
  background: #1B1E26;
  color: #FAF8F5;
}

.as-book-quick-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 6px;
  margin-top: 8px;
}

.as-sidebar-mini-btn {
  border: 1px solid var(--as-sb-border);
  background: transparent;
  color: var(--as-sb-text);
  font-family: var(--as-font-ui);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 7px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-sidebar-mini-btn:hover {
  background: var(--as-sb-hover);
}
.as-sidebar-mini-lime {
  background: var(--as-sb-accent);
  color: var(--as-sb-accent-ink);
  border-color: transparent;
}
.as-sidebar-mini-lime:hover {
  opacity: 0.92;
  background: var(--as-sb-accent);
}

/* Suite Navigation */
.as-nav-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--as-sb-muted);
  padding: 0 6px 6px;
}

.as-nav-heading-pro {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--as-sb-border);
}

.as-suite-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.as-suite-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--as-sb-text);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.14s ease, color 0.14s ease;
  border-left: 3px solid transparent;
}
.as-suite-link:hover {
  background: var(--as-sb-hover);
}
.as-suite-link.is-active {
  background: var(--as-sb-active-bg);
  color: var(--as-sb-active-text);
  font-weight: 600;
  border-left-color: var(--as-sb-accent);
}

.as-suite-num {
  font-family: var(--as-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.82;
  width: 24px;
  flex-shrink: 0;
}
.as-suite-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-suite-count {
  font-family: var(--as-font-mono);
  font-size: 10px;
  opacity: 0.65;
}

/* Sidebar Footer */
.as-sidebar-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--as-sb-border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.as-crosslink-enterprise {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--as-sb-card);
  border: 1px solid var(--as-sb-border);
  color: var(--as-sb-text);
  text-decoration: none;
  font-size: 11px;
  transition: background 0.15s ease;
}
.as-crosslink-enterprise:hover {
  background: var(--as-sb-hover);
}
.as-crosslink-enterprise span {
  color: var(--as-sb-muted);
  font-size: 10.5px;
}
.as-crosslink-enterprise strong {
  font-weight: 600;
  font-size: 11.5px;
}

.as-sidebar-foot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--as-sb-muted);
}
.as-foot-link {
  color: var(--as-sb-muted);
  text-decoration: none;
}
.as-foot-link:hover {
  color: var(--as-sb-text);
  text-decoration: underline;
}

/* ==========================================================================
   TOP COMMAND BAR & 3-THEME SEGMENTED SWITCHER
   ========================================================================== */
.as-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--as-bg);
}

.as-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--as-card);
  border-bottom: 1px solid var(--as-border);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.as-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.as-mobile-btn {
  display: none;
  border: 1px solid var(--as-border);
  background: var(--as-card);
  color: var(--as-ink);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.as-crumb-block {
  display: flex;
  flex-direction: column;
}
.as-crumb-kicker {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--as-muted);
}
.as-crumb-title {
  margin: 0;
  font-family: var(--as-font-book);
  font-size: 19px;
  font-weight: 600;
  color: var(--as-ink);
  line-height: 1.15;
}

.as-save-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--as-muted);
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  padding: 4px 10px;
  border-radius: 999px;
}
.as-save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--as-ok);
}

.as-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Free AI Selector */
.as-ai-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 9px;
  padding: 3px 6px 3px 9px;
}
.as-ai-spark {
  color: var(--as-accent-text);
  font-size: 13px;
}
.as-topbar-select {
  border: none;
  background: transparent;
  color: var(--as-ink);
  font-family: var(--as-font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
  outline: none;
}
.as-topbar-select option {
  background: var(--as-card);
  color: var(--as-ink);
}

.as-icon-btn {
  border: 1px solid var(--as-border);
  background: var(--as-card);
  color: var(--as-ink);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}
.as-icon-btn:hover {
  background: var(--as-bg-subtle);
}

/* Explore All Tools Button */
.as-matrix-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--as-border-strong);
  background: var(--as-lime);
  color: var(--as-lime-ink);
  font-family: var(--as-font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.as-matrix-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--as-shadow-sm);
}
.as-star-glyph {
  font-size: 13px;
}

/* Segmented Theme Switcher */
.as-theme-seg {
  display: inline-flex;
  align-items: center;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.as-theme-btn {
  border: none;
  background: transparent;
  color: var(--as-muted);
  font-family: var(--as-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.as-theme-btn:hover {
  color: var(--as-ink);
}
.as-theme-btn.is-active {
  background: var(--as-primary);
  color: var(--as-primary-ink);
  box-shadow: var(--as-shadow-sm);
}

/* ==========================================================================
   BOOK TELEMETRY RIBBON
   ========================================================================== */
.as-book-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 22px;
  background: var(--as-bg-subtle);
  border-bottom: 1px solid var(--as-border);
}

.as-ribbon-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.as-ribbon-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--as-muted);
}
.as-ribbon-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--as-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-ribbon-money {
  color: var(--as-ok);
  font-family: var(--as-font-mono);
}

/* ==========================================================================
   DISTRACTION-FREE FOCUS WRITING MODE
   ========================================================================== */
body.is-zen-mode .as-sidebar,
body.is-zen-mode .as-topbar,
body.is-zen-mode .as-book-ribbon,
body.is-zen-mode .as-suite-header,
body.is-zen-mode .as-subtabs,
body.is-zen-mode .as-zen-hide {
  display: none !important;
}

body.is-zen-mode .as-shell {
  grid-template-columns: 1fr;
}

body.is-zen-mode .as-zen-bar {
  display: flex !important;
  position: sticky;
  top: 0;
  z-index: 50;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--as-card);
  border-bottom: 1px solid var(--as-border);
}

.as-zen-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.as-zen-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.is-zen-mode .as-writer-layout {
  grid-template-columns: 1fr !important;
  max-width: 820px;
  margin: 0 auto;
}
body.is-zen-mode .as-chapter-rail {
  display: none !important;
}
body.is-zen-mode .as-prose-textarea {
  min-height: 76vh;
  font-size: 20px;
  line-height: 1.85;
  padding: 40px 52px;
}

/* ==========================================================================
   MAIN STUDIO CANVAS, SUB-TABS & FEATURE CARDS
   ========================================================================== */
.as-main {
  padding: 20px 24px 56px;
  max-width: 1520px;
  width: 100%;
}

.as-suite-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.as-suite-header h2 {
  margin: 2px 0 4px;
  font-family: var(--as-font-book);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.as-suite-header p {
  margin: 0;
  color: var(--as-muted);
  font-size: 13.5px;
  max-width: 780px;
}

.as-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--as-accent-text);
}

/* Sub-tab Pills */
.as-subtabs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--as-border);
}

.as-subtab-btn {
  border: 1px solid var(--as-border);
  background: var(--as-card);
  color: var(--as-ink-soft);
  font-family: var(--as-font-ui);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.14s ease;
}
.as-subtab-btn:hover {
  border-color: var(--as-border-strong);
  color: var(--as-ink);
}
.as-subtab-btn.is-active {
  background: var(--as-primary);
  color: var(--as-primary-ink);
  border-color: var(--as-primary);
}
.as-subtab-range {
  font-family: var(--as-font-mono);
  font-size: 10.5px;
  opacity: 0.78;
}

/* Grids & Feature Cards */
.as-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.as-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.as-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.as-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.as-feat-card {
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--as-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.as-feat-card.is-highlighted {
  border-color: var(--as-primary);
  box-shadow: 0 0 0 3px var(--as-accent-soft), var(--as-shadow-md);
}

.as-feat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.as-feat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.as-feat-num {
  font-family: var(--as-font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  color: var(--as-ink);
}
.as-feat-num.is-star {
  background: var(--as-lime);
  color: var(--as-lime-ink);
  border-color: rgba(44, 8, 23, 0.2);
}
.as-feat-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--as-ink);
}
.as-feat-desc {
  margin: -6px 0 14px;
  font-size: 12.8px;
  color: var(--as-muted);
}

/* ==========================================================================
   BUTTONS, INPUTS, BADGES & TABLES
   ========================================================================== */
.as-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--as-font-ui);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--as-border-strong);
  background: var(--as-card);
  color: var(--as-ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.as-btn:hover {
  background: var(--as-bg-subtle);
}
.as-btn:active {
  transform: translateY(1px);
}
.as-btn-primary {
  background: var(--as-primary);
  color: var(--as-primary-ink);
  border-color: var(--as-primary);
}
.as-btn-primary:hover {
  background: var(--as-primary-hover);
  border-color: var(--as-primary-hover);
}
.as-btn-lime {
  background: var(--as-lime);
  color: var(--as-lime-ink);
  border-color: rgba(44, 8, 23, 0.2);
}
.as-btn-lime:hover {
  opacity: 0.92;
  background: var(--as-lime);
}
.as-btn-sm {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 7px;
}
.as-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.as-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.as-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--as-ink-soft);
}

.as-input,
.as-textarea,
.as-select {
  width: 100%;
  font-family: var(--as-font-ui);
  font-size: 13px;
  color: var(--as-ink);
  background: var(--as-card-alt);
  border: 1px solid var(--as-border);
  border-radius: 9px;
  padding: 8px 11px;
  transition: border-color 0.15s ease;
}
.as-input:focus,
.as-textarea:focus,
.as-select:focus {
  outline: none;
  border-color: var(--as-primary);
}

.as-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--as-bg-subtle);
  color: var(--as-ink-soft);
  border: 1px solid var(--as-border);
}
.as-badge-ok {
  background: var(--as-ok-bg);
  color: var(--as-ok);
  border-color: transparent;
}
.as-badge-warn {
  background: var(--as-warn-bg);
  color: var(--as-warn);
  border-color: transparent;
}
.as-badge-danger {
  background: var(--as-danger-bg);
  color: var(--as-danger);
  border-color: transparent;
}
.as-badge-info {
  background: var(--as-info-bg);
  color: var(--as-info);
  border-color: transparent;
}

.as-stat-box {
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.as-stat-box span {
  font-size: 11px;
  color: var(--as-muted);
  font-weight: 600;
}
.as-stat-box strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--as-ink);
  font-family: var(--as-font-book);
}
.as-stat-box small {
  font-size: 11px;
  color: var(--as-muted);
}

.as-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--as-border);
  border-radius: 10px;
}
.as-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.as-table th,
.as-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--as-border);
}
.as-table th {
  background: var(--as-bg-subtle);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--as-muted);
}
.as-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   MANUSCRIPT STUDIO, CORKBOARD CARDS & EDITORIAL SUGGESTION BOX
   ========================================================================== */
.as-writer-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.as-chapter-rail {
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.as-chap-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--as-ink);
  text-align: left;
  cursor: pointer;
  font-family: var(--as-font-ui);
}
.as-chap-item:hover {
  background: var(--as-card);
}
.as-chap-item.is-active {
  background: var(--as-card);
  border-color: var(--as-primary);
  box-shadow: var(--as-shadow-sm);
}
.as-chap-item strong {
  font-size: 12.5px;
  font-weight: 600;
}
.as-chap-item span {
  font-size: 11px;
  color: var(--as-muted);
}

.as-editor-sheet {
  background: var(--as-paper-sheet);
  color: var(--as-paper-ink);
  border: 1px solid var(--as-border);
  border-radius: 14px;
  padding: 22px 28px;
  box-shadow: var(--as-shadow-sm);
}

.as-chap-title-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--as-border);
  background: transparent;
  color: var(--as-paper-ink);
  font-family: var(--as-font-book);
  font-size: 24px;
  font-weight: 600;
  padding: 4px 0 10px;
  margin-bottom: 14px;
}
.as-chap-title-input:focus {
  outline: none;
  border-bottom-color: var(--as-primary);
}

.as-prose-textarea {
  width: 100%;
  min-height: 410px;
  border: none;
  background: transparent;
  color: var(--as-paper-ink);
  font-family: var(--as-font-book);
  font-size: 17.5px;
  line-height: 1.78;
  resize: vertical;
  padding: 4px 0;
}
.as-prose-textarea:focus {
  outline: none;
}

.as-ai-suggestion-box {
  margin-top: 14px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-primary);
  border-radius: 12px;
  padding: 14px 16px;
}
.as-ai-suggestion-prose {
  font-family: var(--as-font-book);
  font-size: 16px;
  line-height: 1.7;
  padding: 10px 12px;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: 8px;
  margin: 10px 0;
  white-space: pre-wrap;
}

/* Draggable Beat Cards */
.as-beat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.as-beat-card {
  background: var(--as-card-alt);
  border: 1px solid var(--as-border);
  border-radius: 11px;
  padding: 12px;
  cursor: grab;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.as-beat-card:hover {
  border-color: var(--as-primary);
}
.as-beat-card.is-dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

/* Version Comparison & Line-Edit Diffs */
.as-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.as-diff-pane {
  background: var(--as-card-alt);
  border: 1px solid var(--as-border);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--as-font-book);
  font-size: 14.5px;
  line-height: 1.65;
  max-height: 260px;
  overflow-y: auto;
}
del.as-del {
  background: var(--as-danger-bg);
  color: var(--as-danger);
  text-decoration: line-through;
  padding: 1px 4px;
  border-radius: 4px;
}
ins.as-ins {
  background: var(--as-ok-bg);
  color: var(--as-ok);
  text-decoration: none;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
}

/* ==========================================================================
   COVER DESIGNER, 100PX RETAIL SHELF & CSS 3D HARDCOVER
   ========================================================================== */
.as-cover-concepts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.as-cover-art-card {
  border: 2px solid var(--as-border);
  border-radius: 12px;
  padding: 12px;
  background: var(--as-card-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.as-cover-art-card.is-selected {
  border-color: var(--as-primary);
  box-shadow: 0 0 0 3px var(--as-accent-soft);
}

.as-cover-canvas {
  width: 190px;
  height: 304px;
  border-radius: 5px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

/* 100px Retail Store Shelf Thumbnail Test */
.as-store-grid-stage {
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--as-border);
  transition: background 0.2s ease, color 0.2s ease;
}
.as-store-grid-stage.is-store-light {
  background: #FFFFFF;
  color: #111827;
}
.as-store-grid-stage.is-store-dark {
  background: #0F141C;
  color: #F3F4F6;
}

.as-retail-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.as-retail-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
}
.as-retail-slot.is-author-book {
  outline: 2px solid #F59E0B;
  background: rgba(245, 158, 11, 0.08);
}

/* Exact 100px Height Thumbnail Enforcement */
.as-thumb-100px {
  height: 100px !important;
  width: 63px !important;
  border-radius: 3px;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  font-size: 6.5px;
  line-height: 1.1;
  margin-bottom: 6px;
}

/* CSS 3D Hardcover Mockup */
.as-3d-stage {
  perspective: 900px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.as-3d-book {
  width: 164px;
  height: 252px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-24deg) rotateX(6deg);
  transition: transform 0.35s ease;
}
.as-3d-book:hover {
  transform: rotateY(-12deg) rotateX(3deg);
}
.as-3d-front {
  position: absolute;
  inset: 0;
  border-radius: 2px 5px 5px 2px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  box-shadow: 10px 14px 28px rgba(0, 0, 0, 0.34);
  transform: translateZ(16px);
}
.as-3d-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -16px;
  width: 32px;
  transform: rotateY(-90deg);
  border-radius: 2px 0 0 2px;
  filter: brightness(0.78);
}
.as-3d-pages {
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: -13px;
  width: 28px;
  background: repeating-linear-gradient(90deg, #FAF6EE 0px, #FAF6EE 2px, #E3DCCF 2px, #E3DCCF 3px);
  transform: rotateY(90deg);
}

/* ==========================================================================
   BOOK FORMATTING: FACING-SPREAD PRINT PREVIEW
   ========================================================================== */
.as-spread-wrapper {
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.as-open-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 370px));
  background: #FDFBF6;
  color: #191816;
  border-radius: 6px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18), 0 0 0 1px #DDD5C7;
  position: relative;
}
.as-open-book.is-stock-white {
  background: #FFFFFF;
}
.as-open-book.is-theme-noir {
  background: #F9F8F6;
}

.as-book-page {
  padding: 32px 34px 28px;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 13.5px;
  line-height: 1.68;
  text-align: justify;
  hyphens: auto;
}
.as-book-page.is-verso {
  border-right: 1px solid #E5DEC9;
  background: linear-gradient(90deg, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0) 88%, rgba(0,0,0,0.055) 100%);
}
.as-book-page.is-recto {
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 12%, rgba(0,0,0,0.01) 100%);
}

.as-running-head {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6E6A63;
  text-align: center;
  margin-bottom: 18px;
}

.as-chap-ornament {
  text-align: center;
  margin: 8px 0 16px;
}
.as-chap-ornament .as-chap-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #6E6A63;
}
.as-chap-ornament h4 {
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 500;
}

.as-dropcap::first-letter {
  float: left;
  font-size: 3.3em;
  line-height: 0.82;
  padding-right: 8px;
  padding-top: 3px;
  font-weight: 600;
}
.as-smallcaps-lead {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.as-dingbat {
  text-align: center;
  margin: 12px 0;
  letter-spacing: 0.3em;
  color: #5E5951;
}
.as-folio-num {
  text-align: center;
  font-size: 10.5px;
  color: #6E6A63;
  margin-top: 16px;
}

/* ==========================================================================
   E-READER & TABLET DEVICE PREVIEWERS
   ========================================================================== */
.as-device-stage {
  display: flex;
  justify-content: center;
  padding: 18px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 14px;
}

.as-device-frame {
  border-radius: 24px;
  padding: 18px;
  background: #1F242D;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  transition: width 0.25s ease;
}
.as-device-frame.is-kindle {
  width: 360px;
  border-radius: 20px;
  background: #26292E;
  padding: 20px 20px 30px;
}
.as-device-frame.is-ipad {
  width: 520px;
  border-radius: 26px;
  background: #181B20;
}
.as-device-frame.is-iphone {
  width: 300px;
  border-radius: 34px;
  background: #121519;
  padding: 14px;
}

.as-device-screen {
  border-radius: 8px;
  height: 420px;
  overflow-y: auto;
  padding: 22px 24px;
  font-family: var(--as-font-book);
}
.as-device-screen.is-eink {
  background: #EFECE2;
  color: #1D1E1C;
}
.as-device-screen.is-sepia {
  background: #F6ECD9;
  color: #2E2418;
}
.as-device-screen.is-night {
  background: #12151B;
  color: #E2E6EE;
}

/* ==========================================================================
   AUDIOBOOK STUDIO WAVEFORM & RECORDING BOOTH
   ========================================================================== */
.as-waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 54px;
  padding: 8px 12px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 10px;
  overflow: hidden;
}
.as-wave-bar {
  flex: 1;
  background: var(--as-primary);
  border-radius: 3px;
  min-height: 6px;
  transition: height 0.14s ease;
}
.as-waveform-bars.is-live .as-wave-bar {
  animation: asWavePulse 0.8s infinite ease-in-out alternate;
}
@keyframes asWavePulse {
  0% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(0.55); }
}

/* Pacing & Royalty Bar Charts */
.as-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 14px 10px 6px;
  background: var(--as-card-alt);
  border: 1px solid var(--as-border);
  border-radius: 10px;
}
.as-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 5px;
}
.as-bar-fill {
  width: 100%;
  max-width: 36px;
  background: var(--as-primary);
  border-radius: 6px 6px 2px 2px;
  min-height: 6px;
  transition: height 0.25s ease;
}
.as-bar-col span {
  font-size: 10px;
  color: var(--as-muted);
  font-family: var(--as-font-mono);
}

/* ==========================================================================
   AUTHOR STUDIO DIRECTORY DRAWER & MODALS
   ========================================================================== */
.as-drawer-backdrop,
.as-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.56);
  backdrop-filter: blur(3px);
  z-index: 80;
}

.as-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(620px, 94vw);
  background: var(--as-card);
  border-left: 1px solid var(--as-border);
  box-shadow: var(--as-shadow-lg);
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.as-drawer[hidden],
.as-drawer-backdrop[hidden],
.as-modal-backdrop[hidden] {
  display: none !important;
}

.as-drawer-head,
.as-modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--as-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.as-drawer-head h2,
.as-modal-head h2 {
  margin: 2px 0 0;
  font-family: var(--as-font-book);
  font-size: 20px;
}

.as-drawer-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--as-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.as-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.as-pill {
  border: 1px solid var(--as-border);
  background: var(--as-bg-subtle);
  color: var(--as-ink-soft);
  font-family: var(--as-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.as-pill.is-active {
  background: var(--as-primary);
  color: var(--as-primary-ink);
  border-color: var(--as-primary);
}

.as-drawer-body {
  padding: 14px 20px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.as-matrix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--as-border);
  border-radius: 10px;
  background: var(--as-card-alt);
}
.as-matrix-row:hover {
  border-color: var(--as-primary);
}

/* Modal */
.as-modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.as-modal {
  width: min(680px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: 16px;
  box-shadow: var(--as-shadow-lg);
}
.as-modal-sm {
  width: min(480px, 96vw);
}
.as-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.as-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--as-border);
}
.as-muted-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--as-muted);
}

/* Toasts */
.as-toast-stack {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.as-toast {
  background: var(--as-primary);
  color: var(--as-primary-ink);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--as-shadow-md);
  font-size: 12.5px;
  font-weight: 600;
}

.as-boot-card {
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: 14px;
  padding: 28px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1120px) {
  .as-book-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .as-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .as-cover-concepts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .as-shell {
    grid-template-columns: 1fr;
  }
  .as-sidebar {
    position: fixed;
    left: -290px;
    width: 276px;
    transition: left 0.22s ease;
  }
  .as-sidebar.is-open {
    left: 0;
  }
  .as-sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
  }
  .as-mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .as-writer-layout,
  .as-grid-2,
  .as-grid-3,
  .as-diff-grid,
  .as-open-book {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CRAFT, ACCESSIBILITY & READER GROWTH VISUALISERS
   ========================================================================== */
.as-progress-track {
  height: 9px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 999px;
  overflow: hidden;
}
.as-progress-fill {
  height: 100%;
  background: var(--as-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.as-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.as-heat-cell {
  border-radius: 10px;
  padding: 10px 11px;
  border: 1px solid var(--as-border);
  background: var(--as-card-alt);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.as-heat-cell.is-hot {
  background: var(--as-ok-bg);
  border-color: rgba(21, 115, 71, 0.28);
}
.as-heat-cell.is-warm {
  background: var(--as-info-bg);
  border-color: rgba(29, 78, 216, 0.24);
}
.as-heat-cell.is-cool {
  background: var(--as-warn-bg);
  border-color: rgba(180, 83, 9, 0.26);
}

.as-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.as-agent-card {
  background: var(--as-card-alt);
  border: 1px solid var(--as-border);
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.as-agent-card strong {
  font-size: 13px;
  color: var(--as-ink);
}
.as-agent-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--as-ink-soft);
  line-height: 1.55;
}

.as-chat-log {
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 11px;
  padding: 12px;
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.as-chat-bubble {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.8px;
  line-height: 1.55;
  max-width: 90%;
}
.as-chat-bubble.is-user {
  align-self: flex-end;
  background: var(--as-primary);
  color: var(--as-primary-ink);
}
.as-chat-bubble.is-char {
  align-self: flex-start;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  color: var(--as-ink);
  font-family: var(--as-font-book);
  font-size: 14px;
}

.as-dyslexia-preview {
  background: #FDF9EE;
  color: #1C1B18;
  border: 1px solid #DFD6BE;
  border-radius: 12px;
  padding: 20px 24px;
  font-family: 'DM Sans', Verdana, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.9;
  letter-spacing: 0.12em;
  word-spacing: 0.18em;
  text-align: left;
  max-width: 62ch;
}

.as-code-box {
  margin: 0;
  padding: 11px 13px;
  background: var(--as-bg-subtle);
  border: 1px solid var(--as-border);
  border-radius: 9px;
  font-family: var(--as-font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--as-ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

.as-funnel-step {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.as-comic-stage {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 8px;
  background: #14161B;
  padding: 12px;
  border-radius: 10px;
  color: #FAF8F5;
}
.as-comic-panel {
  border: 2px solid #EEFF6D;
  border-radius: 6px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  position: relative;
}

@media (max-width: 920px) {
  .as-agent-grid,
  .as-comic-stage,
  .as-funnel-step {
    grid-template-columns: 1fr;
  }
}
