/* ==========================================================================
   Novel Reader - Editorial Typography Design System
   ========================================================================== */

:root {
  /* Accent Color: Yamashiro Crimson (#e11d48) */
  --accent-color: #e11d48;
  --accent-subtle: rgba(225, 29, 72, 0.12);
  --accent-border: rgba(225, 29, 72, 0.3);

  /* Surface & Tone Hierarchy (No Glassmorphism, Pure Tone Depth) */
  --bg-dark-base: #0a0b0e;
  --surface-dark-1: #111318;
  --surface-dark-2: #181b22;
  --border-dark: #222630;
  --border-subtle: rgba(255, 255, 255, 0.07);

  /* Typography */
  --font-heading: 'Noto Serif JP', 'Shippori Mincho B1', serif;
  --font-body: 'Noto Serif JP', 'Shippori Mincho', serif;
  --font-family: var(--font-body);
  --font-ui: 'Noto Sans JP', sans-serif;
  --font-code: 'Cinzel', serif;

  --font-size: 18px;
  --line-height: 1.85;
  --letter-spacing: 0.04em;
  --content-width: 780px;

  --text-primary: #ededed;
  --text-secondary: #8c93a0;
  --text-dim: #545b68;

  /* Reader State Properties (Vivid & Clear Default) */
  --bg-opacity: 0.90;
  --bg-blur: 1px;
  --bg-dim: 0.25;
  --bg-mask-color: rgba(10, 11, 14, var(--bg-dim));

  /* Card Background & Shadows (Frosted Glass Supporting) */
  --card-bg: rgba(17, 19, 24, 0.78);
  --card-border: 1px solid var(--border-dark);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  --transition-speed: 0.2s ease;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-family);
  background: transparent;
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: var(--line-height);
}

/* ==========================================================================
   Background System (Restrained & Elegant)
   ========================================================================== */

#bg-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#bg-base-color {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0a0b0e;
  transition: background var(--transition-speed);
}

#bg-image-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  opacity: var(--bg-opacity);
  filter: blur(var(--bg-blur));
  transition: opacity var(--transition-speed), filter var(--transition-speed);
}

#bg-illust {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
  transition: all var(--transition-speed);
}

/* Background Position Modes */
body.bg-pos-right #bg-illust {
  right: 0;
  bottom: 0;
  height: 95vh;
  max-width: 55vw;
  object-fit: contain;
  object-position: right bottom;
}

body.bg-pos-center #bg-illust {
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: 0;
  height: 95vh;
  max-width: 85vw;
  object-fit: contain;
  object-position: center bottom;
}

body.bg-pos-cover #bg-illust {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

#bg-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--bg-mask-color);
  transition: background var(--transition-speed);
}

/* ==========================================================================
   Theme Presets (No Gimmicks, Crisp Literary Tone)
   ========================================================================== */

/* 1. Illust Mode (Default) */
body.theme-illust {
  --text-primary: #ededed;
  --text-secondary: #949ca8;
}
body.theme-illust #bg-illust {
  display: block;
}

/* 2. Dark Mode (Ink Slate / Strict Monochrome) */
body.theme-dark {
  --card-bg: #111318;
  --card-border: 1px solid #1c1f26;
  --text-primary: #e4e7eb;
  --text-secondary: #767e8c;
  --text-shadow: none;
}
body.theme-dark #bg-base-color {
  background: #090a0d;
}
body.theme-dark #bg-image-layer,
body.theme-dark #bg-illust {
  display: none !important;
}
body.theme-dark #bg-overlay-layer {
  background: transparent;
}

/* 3. White Mode (Book Paper / Off-White) */
body.theme-white {
  --card-bg: #ffffff;
  --card-border: 1px solid #e5e5e5;
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  --text-primary: #171717;
  --text-secondary: #737373;
  --text-dim: #a3a3a3;
  --text-shadow: none;
  --accent-color: #0284c7;
  --border-subtle: rgba(0, 0, 0, 0.06);
}
body.theme-white #bg-base-color {
  background: #f7f7f6;
}
body.theme-white #bg-image-layer,
body.theme-white #bg-illust {
  display: none !important;
}
body.theme-white #bg-overlay-layer {
  background: transparent;
}

/* 4. Sepia Mode (Archive Paper) */
body.theme-sepia {
  --card-bg: #fdfbf7;
  --card-border: 1px solid #eae3d2;
  --card-shadow: 0 4px 15px rgba(60, 40, 20, 0.04);
  --text-primary: #382c1e;
  --text-secondary: #78644e;
  --text-dim: #9e8972;
  --text-shadow: none;
  --accent-color: #8c5b24;
  --border-subtle: rgba(60, 40, 20, 0.08);
}
body.theme-sepia #bg-base-color {
  background: #f3edd9;
}
body.theme-sepia #bg-image-layer,
body.theme-sepia #bg-illust {
  display: none !important;
}
body.theme-sepia #bg-overlay-layer {
  background: transparent;
}

/* ==========================================================================
   Minimal Flat Toolbar (No Glassmorphism, Strict Hierarchy)
   ========================================================================== */

#progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  z-index: 1001;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-color);
  transition: width 0.1s linear;
}

#top-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface-dark-1);
  border-bottom: 1px solid var(--border-dark);
  z-index: 1000;
  transition: background var(--transition-speed);
}
body.theme-white #top-toolbar {
  background: #ffffff;
  border-bottom-color: #e5e5e5;
}
body.theme-sepia #top-toolbar {
  background: #fdfbf7;
  border-bottom-color: #eae3d2;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#novel-header-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.badge {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--surface-dark-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-dark);
}
body.theme-white .badge {
  background: #f5f5f4;
  border-color: #e5e5e5;
  color: #737373;
}
body.theme-sepia .badge {
  background: #f4edd9;
  border-color: #eae3d2;
  color: #78644e;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Version Toggle Button */
.version-switch-group {
  display: flex;
  align-items: center;
  background: var(--surface-dark-2);
  padding: 2px;
  border-radius: 2px;
  border: 1px solid var(--border-dark);
}
body.theme-white .version-switch-group {
  background: #f5f5f4;
  border-color: #e5e5e5;
}
body.theme-sepia .version-switch-group {
  background: #f4edd9;
  border-color: #eae3d2;
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-toggle.active {
  background: var(--accent-color);
  color: #ffffff;
}

/* Locked Version Button (Paid Only) */
.locked-toggle-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-toggle.locked {
  cursor: not-allowed;
  opacity: 0.72;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}
.btn-toggle.locked:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.lock-icon {
  font-size: 9px;
  opacity: 0.8;
  vertical-align: middle;
}

/* Paid Mini Tooltip on Hover */
.paid-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-3px);
  background: var(--surface-dark-1);
  color: var(--accent-color);
  border: 1px solid var(--accent-border);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  z-index: 1005;
}
.paid-tooltip::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid var(--accent-border);
}

.locked-toggle-wrapper:hover .paid-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

body.theme-white .paid-tooltip {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
body.theme-white .paid-tooltip::before {
  border-bottom-color: #cbd5e1;
}

body.theme-sepia .paid-tooltip {
  background: #fdfbf7;
  border-color: #dec8b0;
  box-shadow: 0 4px 12px rgba(60, 40, 20, 0.08);
}
body.theme-sepia .paid-tooltip::before {
  border-bottom-color: #dec8b0;
}

/* Shake animation on click attempt */
.btn-toggle.shake {
  animation: lock-shake 0.35s ease-in-out;
}
@keyframes lock-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

/* Toast Message Notification */
.toast-message {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--surface-dark-1);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 8px 18px;
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 10000;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
.toast-message.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
body.theme-white .toast-message {
  background: #ffffff;
  border-color: #e5e5e5;
  color: #171717;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
body.theme-sepia .toast-message {
  background: #fdfbf7;
  border-color: #eae3d2;
  color: #382c1e;
  box-shadow: 0 6px 16px rgba(60, 40, 20, 0.08);
}

.quick-theme-group {
  display: flex;
  gap: 3px;
}

.btn-icon {
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-speed);
}
body.theme-white .btn-icon {
  background: #f5f5f4;
  border-color: #e5e5e5;
  color: #525252;
}
body.theme-sepia .btn-icon {
  background: #f4edd9;
  border-color: #eae3d2;
  color: #634b35;
}

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

.btn-icon.active {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--accent-subtle);
}

.btn-icon.primary {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
}
.btn-icon.primary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.btn-icon.primary .btn-label {
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-ui);
}

/* ==========================================================================
   Main Novel Container & Reading Paper (Editorial Layout)
   ========================================================================== */

#novel-container {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 84px 24px 80px 24px;
  min-height: 100vh;
  width: 100%;
}

@media (min-width: 1300px) {
  body.bg-pos-right #novel-container {
    justify-content: flex-start;
    padding-left: max(48px, calc((100vw - var(--content-width) - 480px) / 2));
  }
}

#reading-card {
  width: 100%;
  max-width: var(--content-width);
  border-radius: 2px;
  padding: 64px 56px;
  position: relative;
  font-family: var(--font-family);
  transition: background var(--transition-speed), border-color var(--transition-speed), backdrop-filter var(--transition-speed);
}

/* Card Styles: Semi-transparent & Dynamic Paper Tones */
#reading-card.card-glass {
  background: rgba(17, 19, 24, 0.78);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

#reading-card.card-semi-dark {
  background: rgba(17, 19, 24, 0.88);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

#reading-card.card-semi-light {
  background: rgba(248, 248, 246, 0.88);
  border: 1px solid #d4d4d8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  color: #18181b;
}

#reading-card.card-none {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding-left: 12px;
  padding-right: 12px;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#reading-card.card-solid {
  background: var(--surface-dark-1);
  border: 1px solid var(--border-dark);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.theme-white #reading-card.card-solid {
  background: #ffffff;
  border-color: #e5e5e5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
body.theme-sepia #reading-card.card-solid {
  background: #fdfbf7;
  border-color: #eae3d2;
  box-shadow: 0 4px 16px rgba(60, 40, 20, 0.04);
}

/* ==========================================================================
   Novel Header & Metadata (Editorial Typography)
   ========================================================================== */

#novel-meta-header {
  margin-bottom: 40px;
  text-align: center;
}

.novel-title-badge {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 2px;
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  margin-bottom: 18px;
}
body.theme-white .novel-title-badge {
  background: #f5f5f4;
  border-color: #e5e5e5;
  color: #737373;
}
body.theme-sepia .novel-title-badge {
  background: #f4edd9;
  border-color: #eae3d2;
  color: #78644e;
}

#novel-main-title {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
  margin-bottom: 24px;
  color: var(--text-primary);
  text-shadow: var(--text-shadow);
}

/* Tags Accordion (Restrained Editorial Stamp) */
.tags-details {
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: 2px;
  padding: 12px 18px;
  margin: 20px auto;
  max-width: 620px;
  text-align: left;
}
body.theme-white .tags-details {
  background: #fafaf9;
  border-color: #e5e5e5;
}
body.theme-sepia .tags-details {
  background: #f7f1e1;
  border-color: #eae3d2;
}

.tags-summary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  color: var(--text-secondary);
}
.tags-summary:hover {
  color: var(--text-primary);
}

.tag-counter {
  font-family: var(--font-code);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--surface-dark-1);
  border: 1px solid var(--border-dark);
}
body.theme-white .tag-counter {
  background: #ffffff;
  border-color: #e5e5e5;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.play-tag {
  font-family: var(--font-ui);
  font-size: 11.5px;
  background: var(--surface-dark-1);
  color: var(--text-secondary);
  border: 1px solid var(--border-dark);
  padding: 2px 8px;
  border-radius: 2px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.play-tag:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
}
body.theme-white .play-tag {
  background: #ffffff;
  border-color: #e5e5e5;
  color: #525252;
}
body.theme-sepia .play-tag {
  background: #ffffff;
  border-color: #eae3d2;
  color: #634b35;
}

.play-tag.enlarged {
  border-color: var(--accent-border);
  color: var(--accent-color);
  background: var(--accent-subtle);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: 36px 0 44px 0;
}

/* ==========================================================================
   Novel Text Content Rendering
   ========================================================================== */

#novel-body {
  font-family: var(--font-family);
  font-size: var(--font-size);
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
  text-shadow: var(--text-shadow);
  word-break: break-all;
}

/* Paragraphs & Natural Rhythm */
#novel-body p {
  font-family: var(--font-family);
  margin-bottom: 0.25em;
  text-align: justify;
}

#novel-body p.paragraph-break {
  margin-top: 1.35em;
}

#novel-body p.dialogue {
  text-indent: 0;
  margin-left: 0.5em;
}

#novel-body p.thought {
  color: rgba(240, 243, 248, 0.92);
  font-style: normal;
  letter-spacing: 0.03em;
}
body.theme-dark #novel-body p.thought {
  color: #d1d5db;
}
body.theme-white #novel-body p.thought {
  color: #334155;
}
body.theme-sepia #novel-body p.thought {
  color: #4a3b2c;
}

#novel-body p.scene-break {
  text-align: center;
  margin: 2.8em 0;
  letter-spacing: 0.6em;
  color: var(--text-dim);
  font-family: var(--font-code);
}

#novel-body p.novel-section-header {
  font-family: var(--font-body);
  font-size: 1.05em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.8em 0 0.6em 0;
  letter-spacing: var(--letter-spacing);
  text-align: left;
  line-height: 1.6;
}

/* Text Shadow Options */
body.shadow-soft #novel-body {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
body.shadow-sharp #novel-body {
  text-shadow: 0 0 1px #000, 0 1px 2px #000;
}
body.shadow-none #novel-body {
  text-shadow: none !important;
}

/* End Mark */
#novel-footer {
  margin-top: 64px;
  text-align: center;
  padding-top: 36px;
  border-top: 1px solid var(--border-subtle);
}

.end-mark {
  font-family: var(--font-code);
  font-size: 13px;
  letter-spacing: 0.35em;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.btn-pill {
  font-family: var(--font-ui);
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  padding: 8px 22px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all var(--transition-speed);
}
.btn-pill:hover {
  background: var(--surface-dark-1);
  color: var(--text-primary);
  border-color: var(--accent-color);
}
body.theme-white .btn-pill {
  background: #f5f5f4;
  border-color: #e5e5e5;
  color: #525252;
}
body.theme-sepia .btn-pill {
  background: #f4edd9;
  border-color: #eae3d2;
  color: #634b35;
}

.btn-pill.secondary {
  width: 100%;
  background: var(--accent-subtle);
  color: var(--accent-color);
  border-color: var(--accent-border);
}
.btn-pill.secondary:hover {
  background: var(--accent-color);
  color: #ffffff;
}



/* ==========================================================================
   Autoscroll Control (Editorial Floating Widget)
   ========================================================================== */

#autoscroll-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 980;
}

.btn-icon.circle {
  width: 38px;
  height: 38px;
  border-radius: 2px;
  background: var(--surface-dark-1);
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 14px;
}
body.theme-white .btn-icon.circle {
  background: #ffffff;
  border-color: #e5e5e5;
  color: #525252;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
body.theme-sepia .btn-icon.circle {
  background: #fdfbf7;
  border-color: #eae3d2;
  color: #634b35;
}

.btn-icon.circle.playing {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.speed-popup {
  display: none;
  background: var(--surface-dark-1);
  border: 1px solid var(--border-dark);
  padding: 6px 12px;
  border-radius: 2px;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
body.theme-white .speed-popup {
  background: #ffffff;
  border-color: #e5e5e5;
}
body.theme-sepia .speed-popup {
  background: #fdfbf7;
  border-color: #eae3d2;
}

#autoscroll-bar:hover .speed-popup {
  display: flex;
}

.speed-label {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Settings Drawer (Editorial Bento / Strict Hierarchy)
   ========================================================================== */

#settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-speed), visibility var(--transition-speed);
}
#settings-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface-dark-1);
  border-left: 1px solid var(--border-dark);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0.28s ease;
}
body.theme-white #settings-drawer {
  background: #ffffff;
  border-left-color: #e5e5e5;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
}
body.theme-sepia #settings-drawer {
  background: #fdfbf7;
  border-left-color: #eae3d2;
  box-shadow: -8px 0 24px rgba(60, 40, 20, 0.08);
}

#settings-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-dark);
  background: var(--surface-dark-1);
  gap: 10px;
}
body.theme-white .drawer-header {
  background: #ffffff;
  border-bottom-color: #e5e5e5;
}
body.theme-sepia .drawer-header {
  background: #fdfbf7;
  border-bottom-color: #eae3d2;
}

.drawer-header h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  white-space: nowrap;
}

.btn-pill-close {
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-speed);
}
.btn-pill-close:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--accent-subtle);
}
body.theme-white .btn-pill-close {
  background: #f5f5f4;
  border-color: #e5e5e5;
  color: #525252;
}
body.theme-sepia .btn-pill-close {
  background: #f4edd9;
  border-color: #eae3d2;
  color: #634b35;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color var(--transition-speed);
}
.btn-close:hover {
  color: var(--text-primary);
}

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

.setting-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 18px;
}
.setting-section.footer-section {
  border-bottom: none;
  padding-bottom: 0;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
  font-family: var(--font-code);
}

/* Theme Bento Grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.theme-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  padding: 8px 12px;
  border-radius: 2px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-speed);
}
body.theme-white .theme-card {
  background: #f5f5f4;
  border-color: #e5e5e5;
  color: #525252;
}
body.theme-sepia .theme-card {
  background: #f4edd9;
  border-color: #eae3d2;
  color: #634b35;
}

.theme-card:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
}
.theme-card.active {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
  color: var(--accent-color);
}
.theme-icon {
  font-size: 14px;
}
.theme-name {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
}

/* Controls */
.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.control-label-group {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
}
.control-val {
  font-family: var(--font-code);
  font-weight: 600;
  color: var(--text-primary);
}

/* Range Inputs: Minimal Editorial Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: 1px;
  outline: none;
}
body.theme-white input[type="range"] {
  background: #e5e5e5;
  border-color: #d4d4d8;
}
body.theme-sepia input[type="range"] {
  background: #eae3d2;
  border-color: #dec8b0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-color);
  cursor: pointer;
  border: 1px solid #ffffff;
  transition: transform var(--transition-speed);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Option Button Groups */
.option-button-group {
  display: flex;
  gap: 4px;
  background: var(--surface-dark-2);
  padding: 2px;
  border-radius: 2px;
  border: 1px solid var(--border-dark);
}
body.theme-white .option-button-group {
  background: #f5f5f4;
  border-color: #e5e5e5;
}
body.theme-sepia .option-button-group {
  background: #f4edd9;
  border-color: #eae3d2;
}

.btn-option {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 5px 6px;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-speed);
  white-space: nowrap;
}
.btn-option:hover {
  color: var(--text-primary);
}
.btn-option.active {
  background: var(--accent-color);
  color: #ffffff;
  font-weight: 500;
}

/* Color Chips */
.color-options {
  display: flex;
  gap: 8px;
}
.color-chip {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  border: 1px solid var(--border-dark);
  cursor: pointer;
  transition: transform var(--transition-speed);
}
.color-chip:hover {
  transform: scale(1.1);
}
.color-chip.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color);
}

/* Select Box */
.select-styled {
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-family: var(--font-ui);
  outline: none;
}
body.theme-white .select-styled {
  background: #ffffff;
  border-color: #e5e5e5;
  color: #171717;
}
body.theme-sepia .select-styled {
  background: #ffffff;
  border-color: #eae3d2;
  color: #382c1e;
}
.select-styled option {
  background: var(--surface-dark-1);
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  #top-toolbar {
    height: 48px;
    padding: 0 12px;
  }
  #novel-header-title {
    max-width: 110px;
    font-size: 12px;
  }
  .badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  .quick-theme-group {
    display: none;
  }
  #btn-fullscreen {
    display: none;
  }
  .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .btn-icon.primary {
    padding: 0 8px;
  }
  .btn-icon.primary .btn-label {
    font-size: 11px;
  }
  .btn-toggle {
    padding: 3px 6px;
    font-size: 11px;
  }
  #novel-container {
    padding: 68px 12px 60px 12px;
  }
  #reading-card {
    padding: 24px 16px;
    border-radius: 2px;
  }
  #novel-main-title {
    font-size: 20px;
    line-height: 1.45;
    margin-bottom: 18px;
    word-break: break-word;
  }
  #novel-body {
    font-size: 16.5px;
  }
  #novel-body p {
    margin-bottom: 0.3em;
  }
  #novel-body p.paragraph-break {
    margin-top: 1.2em;
  }
  #settings-drawer {
    width: 100vw;
    right: 0;
  }
}

/* ==========================================================================
   Mobile Responsive Adjustments (Smartphones & Narrow Screens)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Background Illust Optimization for Mobile */
  body.bg-pos-center #bg-illust {
    top: auto;
    bottom: 0;
    left: 50%;
    right: auto;
    margin: 0;
    transform: translateX(-46%);
    height: 92vh;
    max-height: 96vh;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
  }

  body.bg-pos-right #bg-illust {
    left: auto;
    right: -15%;
    bottom: 0;
    height: 90vh;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: right bottom;
  }

  body.bg-pos-cover #bg-illust {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
  }

  /* 2. Top Toolbar Mobile Compact Layout */
  #top-toolbar {
    padding: 0 10px;
    height: 48px;
    gap: 6px;
  }

  .toolbar-left {
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
  }

  #novel-header-title {
    font-size: 13px;
    max-width: 80px;
  }

  .badge {
    font-size: 10px;
    padding: 2px 5px;
    white-space: nowrap;
  }

  .toolbar-right {
    gap: 5px;
    flex-shrink: 0;
  }

  /* Hide quick themes on mobile toolbar to avoid clutter (available in settings drawer) */
  .quick-theme-group {
    display: none !important;
  }

  /* Compact Version Toggle */
  .version-switch-group {
    padding: 1px;
    gap: 1px;
  }

  .btn-toggle {
    font-size: 11px;
    padding: 3px 6px;
  }

  .paid-tooltip {
    display: none;
  }

  /* Buttons */
  .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .btn-icon.primary {
    padding: 0 8px;
    height: 30px;
  }

  .btn-icon.primary svg {
    width: 16px;
    height: 16px;
  }

  .btn-icon.primary .btn-label {
    font-size: 11px;
  }

  #btn-fullscreen {
    display: none;
  }

  /* 3. Main Reading Card & Content Width */
  #novel-container {
    padding: 56px 8px 60px 8px;
  }

  #reading-card {
    padding: 28px 16px 40px 16px;
    border-radius: 6px;
  }

  #novel-meta-header {
    margin-bottom: 24px;
  }

  #novel-main-title {
    font-size: 1.25rem !important;
    line-height: 1.45;
  }

  .novel-body p {
    font-size: 16.5px;
    line-height: 1.85;
    margin-bottom: 0.85em;
  }

  /* Drawer width */
  #settings-drawer {
    width: 88vw;
    max-width: 340px;
  }
}

/* ==========================================================================
   Yamashiro Ren - AI Interaction & Chat Experience
   ========================================================================== */

/* 1. Header Button */
.btn-icon.ai-header-btn {
  width: auto;
  min-width: 95px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(225, 29, 72, 0.45);
  color: #fff;
  padding: 0 12px;
  gap: 6px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-icon.ai-header-btn:hover {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.4), rgba(168, 85, 247, 0.4));
  border-color: #e11d48;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

.btn-icon.ai-header-btn .btn-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  font-family: var(--font-ui);
}

.ai-btn-icon {
  font-size: 14px;
  line-height: 1;
}

/* 2. Floating AI Trigger Badge (Bottom Right) & Proactive Bubble (Bottom Left) */
.ai-floating-container {
  position: fixed;
  bottom: 82px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* 能動的つぶやきコンテナ（画面左下） */
.ai-proactive-container {
  position: fixed;
  bottom: 82px;
  left: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}

/* 能動的つぶやき吹き出し（画面左下の独立カード） */
.ai-proactive-bubble {
  pointer-events: auto;
  position: relative;
  max-width: 300px;
  min-width: 210px;
  background: rgba(18, 16, 26, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(225, 29, 72, 0.45);
  border-left: 3.5px solid #e11d48;
  border-radius: 12px;
  padding: 10px 12px 10px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 16px rgba(225, 29, 72, 0.25);
  cursor: default;
  animation: proactive-pop-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: text;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-proactive-bubble:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.75), 0 0 22px rgba(225, 29, 72, 0.4);
  border-color: #e11d48;
}

/* 自然な自動フェードアウトアニメーション */
.ai-proactive-bubble.fading-out {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

@keyframes proactive-pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.proactive-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.proactive-char-info {
  display: flex;
  align-items: center;
  gap: 5px;
}

.proactive-dot {
  width: 6px;
  height: 6px;
  background: #e11d48;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

.proactive-name {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  color: #fda4af;
  letter-spacing: 0.05em;
}

.proactive-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.proactive-mute-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s;
  opacity: 0.75;
}

.proactive-mute-btn:hover {
  opacity: 1;
  color: #fda4af;
  background: rgba(255, 255, 255, 0.15);
}

.proactive-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s;
}

.proactive-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.proactive-bubble-text {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.55;
  color: #f1f5f9;
  margin: 0;
  word-break: break-word;
}

/* 未読バッジ */
.ai-unread-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: 2px solid #111318;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.9);
  animation: badge-pulse 1.8s infinite;
  z-index: 2;
}

@keyframes badge-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(225, 29, 72, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.ai-floating-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  background: rgba(18, 20, 28, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(225, 29, 72, 0.35);
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(225, 29, 72, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ai-floating-badge:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #e11d48;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(225, 29, 72, 0.4);
}

.ai-floating-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #e11d48;
  flex-shrink: 0;
}

.ai-floating-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ai-status-dot {
  display: none;
}

.ai-floating-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  white-space: nowrap;
}

/* 3. AI Overlay & Sliding Panel */
.ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.ai-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: rgba(14, 16, 23, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid rgba(225, 29, 72, 0.3);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.65);
  z-index: 1010;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-drawer.active {
  transform: translateX(0);
}

/* 4. Panel Header */
.ai-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(22, 24, 34, 0.6);
}

.ai-char-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #e11d48;
  padding: 2px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.4), transparent);
  flex-shrink: 0;
}

.ai-header-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.ai-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-char-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
}

.ai-role-tag {
  font-size: 10px;
  font-weight: 700;
  background: #e11d48;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.ai-char-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  margin-top: 1px;
}

.ai-header-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.ai-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ai-icon-btn.close:hover {
  background: rgba(225, 29, 72, 0.25);
  border-color: #e11d48;
  color: #fff;
}

/* 4.5 AI Session Management Bar */
.ai-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(14, 16, 23, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 8px;
}

.ai-session-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ai-session-icon {
  font-size: 13px;
  opacity: 0.85;
}

.ai-session-dropdown {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11.5px;
  border-radius: 6px;
  padding: 4px 8px;
  width: 100%;
  max-width: 220px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-ui);
}

.ai-session-dropdown:focus {
  border-color: var(--accent-color, #e11d48);
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.2);
}

.ai-session-dropdown option {
  background: #181b26;
  color: #e2e8f0;
}

.ai-session-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ai-session-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-ui);
}

.ai-session-btn.primary {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.ai-session-btn.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.ai-session-btn.danger {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0 7px;
  font-size: 11.5px;
}

.ai-session-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Modal: New Session Creation */
.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ai-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
}

.ai-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #141622;
  border: 1px solid rgba(225, 29, 72, 0.4);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(225, 29, 72, 0.2);
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.ai-modal-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  font-family: var(--font-heading, serif);
  letter-spacing: 0.02em;
}

.ai-modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.ai-modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ai-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-modal-desc {
  font-size: 12px;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.5;
}

.session-mode-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.session-mode-card:hover {
  border-color: rgba(225, 29, 72, 0.5);
  background: rgba(225, 29, 72, 0.05);
}

.session-mode-card.active {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.12);
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.2);
}

.session-mode-card input[type="radio"] {
  margin-top: 3px;
  accent-color: #e11d48;
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.session-mode-details {
  flex: 1;
}

.session-mode-heading {
  font-size: 13px;
  color: #f8fafc;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-mode-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.session-mode-badge.current {
  background: #be123c;
  color: #fff;
}

.session-mode-badge.fresh {
  background: #4f46e5;
  color: #fff;
}

.session-mode-explanation {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.highlight-progress {
  color: #f43f5e;
  font-weight: 600;
}

.ai-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.btn-modal-secondary {
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-modal-primary {
  padding: 8px 16px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.3);
  transition: all 0.2s;
}

.btn-modal-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* 5. Reading Status Bar */
.ai-reading-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: rgba(10, 11, 16, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
}

.ai-status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-reading-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* AIチャット・つぶやきの月間上限バッジ（UI上は非表示） */
#ai-usage-badge,
.ai-usage-badge,
#ai-proactive-badge,
.ai-proactive-badge {
  display: none !important;
}

.ai-model-badge {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

/* 5.1 Beta Notice Banner (初回限定) */
.ai-beta-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 10px 14px 0 14px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.16), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(225, 29, 72, 0.4);
  border-radius: 10px;
  animation: notice-slide-down 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 5;
}

@keyframes notice-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-beta-notice-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-beta-notice-content {
  flex: 1;
}

.ai-beta-notice-title {
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 700;
  color: #fda4af;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.ai-beta-notice-text {
  font-family: var(--font-ui);
  font-size: 11.5px;
  line-height: 1.55;
  color: #f1f5f9;
  margin: 0;
}

.ai-beta-notice-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-beta-notice-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* 6. Chat Body & Bubbles */
.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-chat-body::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* システム通知バブル（上限到達等の通知） */
.ai-chat-notice {
  align-self: center;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-secondary, #94a3b8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  margin: 4px auto;
  border-radius: 12px;
  width: fit-content;
  max-width: 85%;
  letter-spacing: 0.03em;
  font-family: var(--font-ui);
  animation: bubble-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-bubble {
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.7;
  font-size: 14.5px;
  position: relative;
  word-break: break-word;
  animation: bubble-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bubble-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-chat-bubble.ren {
  align-self: flex-start;
  background: rgba(24, 20, 32, 0.85);
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-left: 3px solid #e11d48;
  color: #f1f1f1;
  font-family: var(--font-body);
}

.ai-chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(59, 36, 92, 0.9), rgba(35, 30, 65, 0.9));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #fff;
  font-family: var(--font-ui);
}

/* 吹き出し内の行動（ト書き）表示 */
.bubble-action-box {
  background: rgba(168, 85, 247, 0.18);
  border-left: 3px solid #c084fc;
  border-radius: 4px;
  padding: 5px 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #f3e8ff;
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.bubble-action-box .action-badge {
  display: inline-block;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
  letter-spacing: 0.04em;
}

.bubble-action-box .action-text {
  flex: 1;
  word-break: break-word;
}

.bubble-speech-box {
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  color: #ffffff;
}

.ai-chat-bubble .bubble-sender {
  font-size: 10.5px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.ai-chat-bubble.ren .bubble-sender {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fda4af;
  font-size: 12px;
  margin-bottom: 6px;
}

.bubble-ren-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #e11d48;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 0 8px rgba(225, 29, 72, 0.4);
  background: #1e1b2e;
  flex-shrink: 0;
}

.ai-chat-bubble.user .bubble-sender {
  color: #c084fc;
  text-align: right;
}

.ai-chat-bubble .bubble-time {
  font-size: 9.5px;
  color: var(--text-dim);
  margin-top: 6px;
  text-align: right;
  font-family: var(--font-code);
}

/* Typing indicator */
.ai-typing-indicator {
  align-self: flex-start;
  background: rgba(24, 20, 32, 0.8);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-left: 3px solid #e11d48;
  padding: 8px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-typing-indicator .typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-typing-indicator span {
  width: 6px;
  height: 6px;
  background: #e11d48;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.ai-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* 7. Quick Chips */
.ai-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(10, 11, 16, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-height: 125px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ai-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4.5px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-ui);
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.ai-chip:hover {
  background: rgba(225, 29, 72, 0.22);
  border-color: rgba(225, 29, 72, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

/* 8. Input Mode Toolbar */
.ai-input-mode-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(12, 14, 20, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mode-toolbar-label {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}

.ai-mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3.5px 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
}

.ai-mode-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-0.5px);
}

.ai-mode-btn.active[data-mode="speech"] {
  background: rgba(225, 29, 72, 0.18);
  border-color: rgba(225, 29, 72, 0.55);
  color: #fda4af;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(225, 29, 72, 0.2);
}

.ai-mode-btn.active[data-mode="action_speech"] {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.6);
  color: #d8b4fe;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
}

/* 9. Input Box & Fields */
.ai-input-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 12px 14px;
  background: rgba(16, 18, 25, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.ai-input-fields-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.ai-field-wrap {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.field-sub-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  padding-left: 2px;
}

.field-sub-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  font-family: var(--font-ui);
}

.field-sub-badge.action {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.field-sub-badge.speech {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.4);
}

.field-sub-desc {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-ui);
}

#ai-action-input {
  width: 100%;
  background: rgba(32, 22, 46, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f5f3ff;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  max-height: 90px;
  min-height: 36px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#ai-action-input:focus {
  outline: none;
  border-color: #c084fc;
  background: rgba(38, 25, 56, 0.95);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

#ai-chat-input {
  width: 100%;
  background: rgba(25, 28, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.5;
  resize: none;
  max-height: 110px;
  min-height: 38px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#ai-chat-input:focus {
  outline: none;
  border-color: #e11d48;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.25);
}

.ai-input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 3px 0 3px;
}

.ai-input-tip {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

.ai-input-counter {
  font-family: var(--font-code);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.ai-input-counter.warning {
  color: #fbbf24;
  font-weight: 600;
}

.ai-input-counter.danger {
  color: #f87171;
  font-weight: 700;
}

.ai-send-btn {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.ai-send-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.45);
}

.ai-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 9. Setting Drawer Additions (API Key & Model) */
.api-key-input-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.setting-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font-code);
  font-size: 13px;
  transition: border-color 0.2s ease;
}

.setting-input-field:focus {
  outline: none;
  border-color: #e11d48;
  background: rgba(255, 255, 255, 0.08);
}

.setting-select-field {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
}

.setting-select-field option {
  background: #161824;
  color: #ffffff;
  padding: 6px 8px;
}

.setting-select-field:focus {
  outline: none;
  border-color: #e11d48;
}

.setting-hint-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-top: 2px;
}

.status-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-tag.not-set {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-tag.configured {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 10. Mobile Responsiveness */
@media (max-width: 768px) {
  .ai-chat-drawer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-left: none;
    border-top: none;
    border-radius: 0;
    transform: translateY(100%);
  }

  .ai-chat-drawer.active {
    transform: translateY(0);
  }

  /* ヘッダーのスリム化（縦幅圧縮） */
  .ai-drawer-header {
    padding: 8px 12px;
  }
  .ai-char-profile {
    gap: 8px;
  }
  .ai-avatar-ring {
    width: 34px;
    height: 34px;
    border-width: 1.5px;
    padding: 1.5px;
  }
  .ai-char-title {
    font-size: 14px;
  }
  .ai-role-tag {
    font-size: 9px;
    padding: 1px 4px;
  }
  .ai-char-subtitle {
    font-size: 9.5px;
    margin-top: 0;
  }
  .ai-icon-btn {
    width: 28px;
    height: 28px;
    font-size: 13px;
    border-radius: 6px;
  }

  /* 読書ステータスバーのスリム化 */
  .ai-reading-status-bar {
    padding: 4px 12px;
    font-size: 10px;
  }
  .ai-usage-badge {
    font-size: 9.5px !important;
    padding: 1px 6px !important;
  }

  /* チャット本文エリアの最適化 */
  .ai-chat-body {
    padding: 10px 12px;
    gap: 10px;
  }
  .ai-chat-bubble {
    max-width: 92%;
    padding: 9px 12px;
    font-size: 13.5px;
    line-height: 1.6;
  }

  /* クイックチップスの1行横スクロール化（縦幅を劇的に削減） */
  .ai-quick-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 5px 10px;
    gap: 6px;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ai-quick-chips::-webkit-scrollbar {
    display: none;
  }
  .ai-chip {
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
  }

  /* 入力形式切替ツールバーのスリム化 */
  .ai-input-mode-toolbar {
    padding: 4px 12px;
    gap: 6px;
  }
  .mode-toolbar-label {
    font-size: 9.5px;
  }
  .ai-mode-btn {
    padding: 2.5px 8px;
    font-size: 10.5px;
  }

  /* 入力ボックスのスリム化 */
  .ai-input-box {
    padding: 6px 10px 8px 10px;
    gap: 6px;
  }
  .field-sub-header {
    margin-bottom: 2px;
  }
  .field-sub-badge {
    font-size: 8.5px;
    padding: 1px 4px;
  }
  .field-sub-desc {
    font-size: 9px;
  }
  #ai-chat-input, #ai-action-input {
    font-size: 13px;
    padding: 6px 10px;
    min-height: 34px;
    border-radius: 6px;
  }
  .ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .ai-input-meta {
    padding: 0 1px;
  }
  .ai-input-tip {
    font-size: 9px;
  }
  .ai-input-counter {
    font-size: 9.5px;
  }

  .ai-proactive-container {
    bottom: 74px;
    left: 14px;
    max-width: calc(100vw - 120px);
  }

  .ai-floating-badge {
    bottom: 74px;
    right: 16px;
    padding: 4px 10px 4px 4px;
  }

  .ai-floating-avatar-wrap {
    width: 28px;
    height: 28px;
  }

  .ai-floating-label {
    font-size: 12px;
  }

  .btn-icon.ai-header-btn .btn-label {
    display: none;
  }
}

