/* ==========================================================================
   QASHIMARU — TSUKUBA UNIVERSITY LOCAL INTELLECT
   Apple-Grade Minimalist Design System · Pure Mincho Serif
   ========================================================================== */

/* 1. Global Reset & Strict Visibility Overrides */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden], .hidden {
  display: none !important;
}

:root {
  /* Apple Crystal Light Theme */
  --bg: #ffffff;
  --bg-shade: rgba(255, 255, 255, 0.2);
  --chat-bg: rgba(255, 255, 255, 0.3);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-card: rgba(247, 247, 249, 0.85);
  --surface-trans: rgba(0, 0, 0, 0.04);
  --surface-hover: rgba(0, 0, 0, 0.07);
  --ink: #1d1d1f;
  --ink-secondary: rgba(29, 29, 31, 0.75);
  --muted: rgba(29, 29, 31, 0.45);
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --accent: #1d1d1f;
  --accent-contrast: #ffffff;
  --sidebar: rgba(246, 246, 248, 0.75);
  --danger: #e11d48;
  --success: #16a34a;

  /* Header & Composer Light Surface (Apple Frosted Pearl White) */
  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: rgba(0, 0, 0, 0.08);
  --composer-bg: rgba(255, 255, 255, 0.94);
  --composer-border: rgba(0, 0, 0, 0.12);
  --composer-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  --slider-box-bg: rgba(0, 0, 0, 0.035);
  --slider-box-border: rgba(0, 0, 0, 0.07);
  --depth-badge-bg: rgba(0, 0, 0, 0.05);
  --depth-badge-border: rgba(0, 0, 0, 0.09);
  --slider-track-bg: rgba(0, 0, 0, 0.12);
  --slider-thumb-bg: #1d1d1f;
  --slider-thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  --thinking-bg: rgba(255, 255, 255, 0.92);
  --thinking-border: rgba(0, 0, 0, 0.1);
  --thinking-dot: #1d1d1f;

  /* User Message Bubble Colors (Refined Soft Tone) */
  --user-bubble-bg: rgba(240, 241, 246, 0.94);
  --user-bubble-border: rgba(0, 0, 0, 0.09);
  --user-bubble-ink: #1d1d1f;

  /* Typography: Pure Japanese Mincho & Cormorant Garamond */
  --font-serif: 'Cormorant Garamond', 'Noto Serif JP', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', serif;
  --font-mono: 'SF Mono', Menlo, Monaco, Consolas, monospace;

  font-family: var(--font-serif);
  color: var(--ink);
  background-color: var(--bg);
  font-size: 14.5px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.dark {
  /* Apple Pro Deep Pitch Black Theme with Crisp Galaxy View */
  --bg: #000000;
  --bg-shade: rgba(0, 0, 0, 0.15);
  --chat-bg: rgba(0, 0, 0, 0.3);    /* Transparency 30% as requested */
  --surface: rgba(18, 18, 22, 0.72);
  --surface-card: rgba(24, 24, 30, 0.55);
  --surface-trans: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --ink: #f5f5f7;
  --ink-secondary: rgba(245, 245, 247, 0.75);
  --muted: rgba(245, 245, 247, 0.44);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #ffffff;
  --accent-contrast: #000000;
  --sidebar: rgba(10, 10, 14, 0.65);
  --danger: #fb7185;
  --success: #4ade80;

  /* Header & Composer Dark Surface (Deep Translucent Glass) */
  --header-bg: rgba(0, 0, 0, 0.35);
  --header-border: rgba(255, 255, 255, 0.1);
  --composer-bg: rgba(18, 18, 24, 0.65);
  --composer-border: rgba(255, 255, 255, 0.14);
  --composer-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --slider-box-bg: rgba(255, 255, 255, 0.035);
  --slider-box-border: rgba(255, 255, 255, 0.08);
  --depth-badge-bg: rgba(255, 255, 255, 0.08);
  --depth-badge-border: rgba(255, 255, 255, 0.12);
  --slider-track-bg: rgba(255, 255, 255, 0.15);
  --slider-thumb-bg: #ffffff;
  --slider-thumb-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  --thinking-bg: rgba(18, 18, 24, 0.75);
  --thinking-border: rgba(255, 255, 255, 0.16);
  --thinking-dot: #ffffff;

  /* User Message Bubble Colors (Translucent Glass Pill) */
  --user-bubble-bg: rgba(255, 255, 255, 0.12);
  --user-bubble-border: rgba(255, 255, 255, 0.16);
  --user-bubble-ink: #f5f5f7;
}

body {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--ink);
}

/* 2. Background Media & Crystal Clear Visibility */
#galaxy-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  opacity: 1; filter: none;
  transition: opacity 1.2s ease;
}

.galaxy-shade {
  position: fixed;
  inset: 0;
  background: var(--bg-shade);
  z-index: 1;
  pointer-events: none;
  backdrop-filter: none;     /* No heavy blur so video is pristine */
  -webkit-backdrop-filter: none;
}

/* 3. Global Typography & Elements */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--ink);
}

p {
  color: var(--ink-secondary);
  line-height: 1.85;
}

small {
  font-size: 0.8rem;
  color: var(--muted);
}

a, button {
  font-family: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-serif);
  letter-spacing: 0.03em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  outline: none;
}

.eyebrow {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 400;
  display: block;
  margin-bottom: 10px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
}

/* ==========================================================================
   4. LOGIN VIEW (Full-Screen Modal / Center Stage)
   ========================================================================== */
.login-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: transparent;
}

.login-container {
  width: 100%;
  max-width: 440px;
  margin: auto;
  text-align: center;
}

.login-header {
  margin-bottom: 28px;
}

.login-header .brand {
  font-size: 1.9rem;
  letter-spacing: 0.16em;
}

.brand-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 4px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 44px 36px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  text-align: left;
}

.login-intro {
  text-align: center;
  margin-bottom: 32px;
}

.login-intro h1 {
  font-size: 1.75rem;
  line-height: 1.35;
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}

.login-intro p {
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--ink-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--ink);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.submit-btn {
  margin-top: 8px;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 400;
}

.submit-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.error-text {
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 20px;
  text-align: center;
  margin-top: 4px;
}

.login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.78rem;
}

.login-access-action {
  margin-top: 14px;
  text-align: center;
}

.access-link-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  border-radius: 9999px;
  padding: 8px 18px;
  font-family: var(--font-serif);
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.access-link-btn:hover {
  background: var(--surface-trans);
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.text-link {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
  letter-spacing: 0.04em;
}

.text-link:hover {
  color: var(--ink);
}

.dot-sep {
  color: var(--muted);
}

/* ==========================================================================
   5. WORKSPACE VIEW (Transparent Chat Stage)
   ========================================================================== */
.workspace {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: transparent;
}

/* Sidebar */
#sidebar {
  width: 270px;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 22px 16px;
  z-index: 25;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-top .brand {
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding-left: 6px;
  padding-top: 4px;
  padding-bottom: 2px;
  line-height: 1.15;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

.sidebar-top .brand:hover {
  opacity: 0.85;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-chat-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.search-wrap {
  margin: 12px 0 6px 0;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 14px 6px 6px 6px;
  font-weight: 400;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding-right: 4px;
}

.chat-item-row {
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  position: relative;
  padding: 2px 6px 2px 2px;
}

.chat-item-row:hover {
  background: var(--surface-trans);
}

.chat-item-row.active {
  background: var(--surface-trans);
  border-color: var(--line);
}

.chat-title-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 6px 8px 6px 8px;
  background: transparent;
  border: none;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.chat-item-row:hover .chat-title-btn,
.chat-item-row.active .chat-title-btn {
  color: var(--ink);
}

.chat-del-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s ease;
}

.chat-item-row:hover .chat-del-btn,
.chat-item-row.active .chat-del-btn {
  opacity: 0.65;
}

.chat-del-btn:hover {
  opacity: 1 !important;
  color: var(--danger);
  background: rgba(225, 29, 72, 0.12);
}

.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cluster-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Sidebar Quota Badge */
.sidebar-quota-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin: 4px 0;
  border-radius: 8px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quota-label-tag {
  font-size: 0.71rem;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  font-weight: 500;
  padding-right: 6px;
}

.sidebar-quota-text {
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.sidebar-quota-badge:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.sidebar-quota-badge.warning {
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.sidebar-quota-badge.danger {
  border-color: rgba(225, 29, 72, 0.4);
  color: var(--danger);
  background: rgba(225, 29, 72, 0.05);
}

/* Sidebar App Language Switcher */
.sidebar-lang-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  margin: 4px 0;
  font-size: 0.73rem;
  color: var(--muted);
}

.sidebar-lang-pills {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
}

.sidebar-lang-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.71rem;
  font-family: inherit;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-lang-btn:hover {
  color: var(--ink);
}

.sidebar-lang-btn.active {
  background: var(--surface-hover);
  color: var(--ink);
  font-weight: 500;
}

.nav-item {
  text-align: left;
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--surface-trans);
}

.logout-btn {
  color: var(--muted);
}

/* Collapsible Account Section (V / 逆V) */
.account-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.account-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.account-toggle-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.account-toggle-btn.open {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.account-toggle-title {
  font-weight: 500;
}

.account-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

.account-toggle-btn.open .account-chevron {
  transform: rotate(180deg);
  color: var(--ink);
}

.account-drawer {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px;
  transform: translateY(-5px);
  transition: max-height 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.26s ease,
              padding 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              margin-top 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease,
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.account-drawer.open {
  max-height: 320px;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  border-color: var(--line);
  padding: 8px;
  margin-top: 6px;
  transform: translateY(0);
}

.account-details-box {
  padding: 6px 8px;
  background: var(--surface-trans);
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-detail-label {
  color: var(--muted);
}

.account-detail-val {
  color: var(--ink);
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.account-role-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 500;
}

.account-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-sub-item {
  font-size: 0.75rem !important;
  padding: 6px 8px !important;
  border-radius: 6px !important;
  margin: 0 !important;
}

/* Main Content Area (Pristine Unblurred HD Galaxy Video Background) */
.main-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: transparent;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Header */
.app-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 15;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-indicator {
  font-size: 0.84rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-trans);
}

#mobile-menu {
  display: none;
}

/* Chat View */
.chat-view {
  flex: 1;
  height: calc(100% - 52px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 40px 28px 250px 52px;
  scroll-behavior: smooth;
}

/* Welcome Stage */
.welcome-container {
  max-width: 1060px;
  margin: 30px auto 20px auto;
  text-align: center;
}

.welcome-title {
  font-size: clamp(2.4rem, 4.4vw, 3.8rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.welcome-subtitle {
  font-size: 0.94rem;
  line-height: 1.95;
  color: var(--ink-secondary);
  max-width: 560px;
  margin: 0 auto 36px auto;
}

.prompt-suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  text-align: left;
}

.prompt-suggestions button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.prompt-suggestions button:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.sug-num {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 12px;
}

.prompt-suggestions b {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 4px;
}

.prompt-suggestions small {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Messages Stream */
.messages-container {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.message {
  display: flex;
  flex-direction: column;
}

.message.user {
  align-self: flex-end;
  max-width: 82%;
  background: var(--user-bubble-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--user-bubble-border);
  border-radius: 18px 18px 4px 18px;
  padding: 13px 20px;
  color: var(--user-bubble-ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.message.user .message-body {
  color: var(--user-bubble-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.message.assistant {
  align-self: flex-start;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body:not(.dark) .message.assistant {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.message-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.brand-label {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.model-tag {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.message-body {
  font-size: 0.98rem;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.message-body pre {
  margin: 14px 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
}

.message-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-trans);
  padding: 2px 6px;
  border-radius: 4px;
}

/* KaTeX Math Formatting */
.math-block,
.katex-block-wrapper {
  display: block;
  margin: 16px 0;
  padding: 12px 18px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}

.math-inline,
.katex-inline-wrapper {
  display: inline-block;
  padding: 0 3px;
  vertical-align: middle;
}

.katex {
  font-size: 1.06em;
  color: var(--ink);
}

.katex-display {
  margin: 0.25em 0 !important;
}

.math-fallback {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink-secondary);
}

.message-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.message-footer .copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.message-footer .copy-btn svg {
  display: block;
}

.message-footer .copy-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-trans);
}

.message-footer .copy-btn.copied {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
}

/* Monochrome Good / Bad Feedback Buttons (No Yellow Emojis) */
.feedback-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-btn svg {
  display: block;
}

.feedback-btn:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-trans);
}

.feedback-btn.active.good {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
}

.feedback-btn.active.bad {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.12);
}

.feedback-btn:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.feedback-btn.active:disabled {
  opacity: 1;
}

/* Admin Table Feedback Chips */
.feedback-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.feedback-chip.good {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.feedback-chip.bad {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.28);
}

.feedback-chip.none {
  color: var(--muted);
}

/* ==========================================================================
   6. COMPOSER, SLIDER & QUIET MINIMAL PROGRESS
   ========================================================================== */
.composer-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 24px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 55%, transparent 100%);
  pointer-events: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body:not(.dark) .composer-container {
  background: linear-gradient(to top, rgba(255,255,255,0.65) 55%, transparent 100%);
}

/* Quiet Minimal Progress Capsule (No Gaudy Spinners!) */
.thinking-panel {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border-radius: 9999px;
  background: var(--thinking-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--thinking-border);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 8px;
  box-shadow: var(--composer-shadow);
}

.thinking-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thinking-dot);
  box-shadow: 0 0 6px var(--thinking-dot);
  animation: breathe 1.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.thinking-detail {
  font-size: 0.74rem;
  color: var(--muted);
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  width: 64px;
  height: 2px;
  background: var(--slider-track-bg);
  border-radius: 1px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ink);
  box-shadow: 0 0 6px var(--line);
  transition: width 0.3s ease;
}

/* Composer 2 : 3 Split Deck */
.composer-split-deck {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 14px;
  max-width: 980px;
  width: 100%;
  align-items: stretch;
}

@media (max-width: 860px) {
  .composer-split-deck {
    grid-template-columns: 1fr;
  }
}

/* Left Attachment Dock Panel (2 / 5 ratio) */
.attachment-dock-panel {
  background: var(--composer-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--composer-border);
  border-radius: 20px;
  padding: 12px 16px;
  box-shadow: var(--composer-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
  max-height: 160px;
  box-sizing: border-box;
}

.dock-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.dock-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-panel-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.dock-selected-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.28);
}

body:not(.dark) .dock-selected-badge {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.dock-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
}

.dock-add-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.dock-attachment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  flex: 1;
  padding-right: 2px;
}

.dock-empty-hint {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  padding: 14px 8px;
  margin: auto 0;
}

.dock-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  transition: all 0.2s ease;
  user-select: none;
}

.dock-file-card.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}

body:not(.dark) .dock-file-card.active {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.3);
}

.dock-file-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}

.dock-file-checkbox {
  cursor: pointer;
  accent-color: #6366f1;
  width: 14px;
  height: 14px;
}

.dock-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
}

.dock-file-size {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono, monospace);
  flex-shrink: 0;
}

.dock-file-del-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.82rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.dock-file-del-btn:hover {
  color: #ef4444;
}

/* Composer Main Box (Right 3 / 5 ratio) */
.composer-box {
  pointer-events: auto;
  width: 100%;
  background: var(--composer-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--composer-border);
  border-radius: 20px;
  padding: 14px 18px 12px 18px;
  box-shadow: var(--composer-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.composer-box:focus-within {
  border-color: var(--line-strong);
}

/* Prompt Textarea (Clean & Spacious) */
#prompt {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--ink);
  width: 100%;
  min-height: 48px;
  max-height: 200px;
  resize: none;
  padding: 2px 2px 4px 2px;
}

#prompt::placeholder {
  color: var(--muted);
}

/* Actions Row */
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.actions-left, .actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: all 0.18s ease;
}

.tool-btn:hover {
  color: var(--ink);
  background: var(--surface-trans);
}

/* ChatGPT Style Model Picker & Floating Popover (Image 1 Style) */
.model-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.model-capsule-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9999px;
  padding: 4px 12px;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

body.dark .model-capsule-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.model-capsule-btn:hover,
.model-capsule-btn.active {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(0, 0, 0, 0.2);
}

body.dark .model-capsule-btn:hover,
body.dark .model-capsule-btn.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.model-capsule-btn .capsule-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--muted);
}

.model-capsule-btn.active .capsule-chevron {
  transform: rotate(180deg);
  color: var(--ink);
}

/* Floating Popover (Image 1 Replica - Light/Dark Adaptive) */
.model-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 268px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 18px;
  padding: 12px 16px 10px 16px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 150;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transform-origin: bottom left;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--ink);
}

body.dark .model-popover {
  background: rgba(22, 22, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.24);
}

.model-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.popover-model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.popover-model-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.popover-flash-icon {
  color: #22c55e;
  flex-shrink: 0;
}

.popover-model-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.popover-model-tag {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  color: var(--muted);
}

.popover-arrow-right {
  color: var(--muted);
  transition: transform 0.18s ease;
}

/* Popover Track & Slider (Image 1 Style) */
.popover-slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-track-wrap {
  position: relative;
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
}

.slider-track-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  pointer-events: none;
}

body.dark .slider-track-bar {
  background: rgba(255, 255, 255, 0.14);
}

.slider-fill-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: #22c55e;
  border-radius: 12px;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.reasoning-range-compact {
  position: relative;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  outline: none;
  cursor: pointer;
  border: none;
  margin: 0;
  z-index: 2;
}

.reasoning-range-compact::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.reasoning-range-compact::-webkit-slider-thumb:hover {
  transform: scale(1.08);
}

.reasoning-range-compact::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: none;
  cursor: pointer;
}

/* Dots inside the track */
.slider-dots-row {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1;
}

.step-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

body.dark .step-dot {
  background: rgba(255, 255, 255, 0.45);
}

.step-dot.active {
  background: rgba(0, 0, 0, 0.85);
}

body.dark .step-dot.active {
  background: rgba(255, 255, 255, 0.95);
}

/* Discrete Step Buttons */
.slider-step-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.step-label-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all 0.18s ease;
}

.step-label-btn:hover {
  background: var(--surface-trans);
}

.step-label-btn .step-main {
  font-size: 0.74rem;
  color: var(--ink-secondary);
  font-weight: 500;
  transition: color 0.18s ease;
}

.step-label-btn .step-desc {
  font-size: 0.64rem;
  color: var(--muted);
  opacity: 0.85;
}

.step-label-btn.active .step-main {
  color: var(--ink);
  font-weight: 600;
}

.step-label-btn.active .step-desc {
  color: var(--ink);
  opacity: 0.95;
}

.send-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.send-action-btn:hover:not(:disabled) {
  transform: scale(1.05);
  opacity: 0.95;
}

.send-action-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.stop-action-btn {
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stop-action-btn:hover {
  background: rgba(225, 29, 72, 0.25);
}

.job-status-text {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  min-height: 16px;
  margin-top: 4px;
}

/* Attachments */
.attachments-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.76rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   7. ADMIN CONSOLE & CLEAN UPDATE FORM
   ========================================================================== */
.admin-view {
  padding: 36px 32px 100px 32px;
  overflow-y: auto;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}

.stat-box small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-box strong {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--ink);
}

.admin-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: start;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-panel:hover {
  border-color: var(--line-strong);
}

.admin-invite-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-header-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-badge-row h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.panel-chip {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  letter-spacing: 0.04em;
}

.panel-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.6;
}

.panel-guidance-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 6px;
}

.panel-guidance-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--muted);
}

.update-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-two {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

.flex-1 { flex: 1; }
.flex-checkbox {
  padding-bottom: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  cursor: pointer;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* Admin Multilingual Tabs */
.admin-lang-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 12px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-tab-btn:hover {
  color: var(--ink);
}

.admin-tab-btn.active {
  background: var(--surface-hover);
  color: var(--ink);
  font-weight: 500;
  border: 1px solid var(--line-strong);
}

.admin-lang-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-lang-pane[hidden] {
  display: none !important;
}

.admin-updates-header {
  margin-top: 24px;
  margin-bottom: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-updates-header h4 {
  font-size: 0.88rem;
  font-weight: 400;
}

.admin-updates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-update-card {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
}

.admin-update-card:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.admin-update-card.active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
}

.admin-update-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-update-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.admin-update-title {
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.danger-text {
  color: var(--danger);
}

.danger-text:hover {
  border-color: var(--danger);
  background: rgba(225, 29, 72, 0.1);
}

.table-panel {
  padding: 20px;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--ink-secondary);
}

.primary-btn {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn.full {
  width: 100%;
}

.primary-btn:hover {
  opacity: 0.9;
}

.subtle-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtle-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.subtle-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.subtle-back-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.refresh-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.refresh-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ==========================================================================
   8. MODAL DIALOG (Official Statement / Manifesto)
   ========================================================================== */
.manifesto-dialog {
  background: var(--surface);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  max-width: 680px;
  width: 90%;
  max-height: 86vh;
  padding: 32px 36px;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
  margin: auto;
  outline: none;
}

.manifesto-dialog.subpage-modal-dialog {
  max-width: 880px;
  width: 92%;
  max-height: 88vh;
  padding: 24px 32px 32px;
  background: rgba(18, 22, 28, 0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

body:not(.dark) .manifesto-dialog.subpage-modal-dialog {
  background: rgba(255, 255, 255, 0.92);
}

.manifesto-dialog[open] {
  animation: dialogGracefulIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogGracefulIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.manifesto-dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: backdropFadeIn 0.28s ease-out forwards;
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Custom Modal Dialog (No Browser Native Confirm/Prompt) */
.confirm-modal {
  max-width: 420px;
  width: 90%;
  padding: 30px 28px 24px;
  border-radius: 22px;
  text-align: center;
  border: 1px solid var(--line-strong);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(0, 0, 0, 0.2);
  margin: auto;
}

body:not(.dark) .confirm-modal {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.06);
}

.confirm-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.confirm-modal-icon.danger {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.28);
}

.confirm-modal-icon.info {
  background: var(--surface-trans);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.confirm-modal-icon.edit {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.confirm-modal-title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 10px 0;
  color: var(--ink);
}

.confirm-modal-message {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin: 0 0 20px 0;
  white-space: pre-line;
  max-width: 360px;
}

.confirm-modal-prompt-wrap {
  width: 100%;
  margin-bottom: 20px;
}

.confirm-modal-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-trans);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: all 0.2s ease;
}

.confirm-modal-input:focus {
  border-color: var(--ink);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

body:not(.dark) .confirm-modal-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.confirm-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirm-btn.cancel {
  background: var(--surface-trans);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
}

.confirm-btn.cancel:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--line-strong);
}

.confirm-btn.ok.primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid transparent;
  font-weight: 500;
}

.confirm-btn.ok.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.confirm-btn.ok.danger {
  background: #f43f5e;
  color: #ffffff;
  border: 1px solid rgba(244, 63, 94, 0.5);
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.32);
}

.confirm-btn.ok.danger:hover {
  background: #e11d48;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.42);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.lang-nav {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 2px;
}

.lang-nav button {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
}

.lang-nav button.active {
  background: var(--surface-hover);
  color: var(--ink);
}

.close-icon-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
}

.dialog-body h1 {
  font-size: 1.7rem;
  line-height: 1.35;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.original-statement {
  font-size: 0.98rem;
  line-height: 2.15;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin: 20px 0;
  padding: 24px 28px;
  border-left: none;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark) .original-statement {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.original-statement p {
  margin: 0 0 18px 0;
}

.original-statement p:last-child {
  margin-bottom: 0;
}

.provider-signature {
  text-align: right;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 18px;
}

.manifesto-author {
  text-align: right;
  margin-top: 32px;
}

.manifesto-author p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}

/* Statement Navigation Controls & Back Button */
.statement-nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.statement-back-btn {
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-family: var(--font-serif);
}

.statement-back-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--line-strong);
}

/* Statement Table of Contents (目次) */
.statement-toc-header {
  margin-bottom: 22px;
}

.statement-toc-header h2 {
  font-size: 1.55rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  margin-top: 4px;
  margin-bottom: 8px;
  color: var(--ink);
}

.statement-toc-sub {
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--ink-secondary);
}

.statement-toc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.statement-toc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.statement-toc-item:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.statement-toc-item.manifesto-lead {
  border-left: 3px solid var(--ink);
  background: rgba(0, 0, 0, 0.02);
}

body.dark .statement-toc-item.manifesto-lead {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--ink);
}

.statement-item-main {
  flex: 1;
  min-width: 0;
}

.statement-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.statement-badge {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  background: var(--surface-trans);
  color: var(--muted);
  border: 1px solid var(--line);
}

.statement-badge.manifesto-badge {
  background: rgba(225, 29, 72, 0.08);
  color: var(--danger);
  border-color: rgba(225, 29, 72, 0.2);
}

.statement-badge.update-badge {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.2);
}

.statement-date {
  font-size: 0.74rem;
  color: var(--muted);
}

.statement-item-title {
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.45;
}

.statement-item-excerpt {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statement-lang-pill {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 6px;
}

.toc-arrow {
  font-size: 1.1rem;
  color: var(--muted);
  margin-left: 16px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.statement-toc-item:hover .toc-arrow {
  color: var(--ink);
  transform: translateX(3px);
}

/* Multilingual Placeholder / In-Preparation Card */
.lang-pending-card {
  text-align: center;
  padding: 42px 24px;
  background: var(--surface-trans);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  margin: 20px 0;
}

.pending-globe-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  opacity: 0.75;
}

.lang-pending-card h3 {
  font-size: 1.18rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 10px;
}

.lang-pending-card p {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.8;
}

.lang-pending-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 12px;
}

.view-ja-btn {
  margin-top: 18px;
}

/* Access Request Application Modal */
.access-dialog {
  max-width: 620px;
}

.dialog-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dialog-title-wrap h3 {
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.access-notice-box {
  background: var(--surface-trans);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 22px;
}

.notice-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.notice-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
}

.access-notice-box p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.access-notice-box .notice-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.req-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(225, 29, 72, 0.12);
  color: var(--danger);
  font-weight: 500;
  margin-left: 6px;
}

.opt-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-trans);
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.dialog-footer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.form-feedback-text {
  font-size: 0.85rem;
  min-height: 22px;
  text-align: center;
  margin-top: 8px;
}

.form-feedback-text.success {
  color: var(--success);
}

.form-feedback-text.error {
  color: var(--danger);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.status-badge.pending {
  background: rgba(234, 179, 8, 0.14);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-badge.registered {
  background: rgba(34, 197, 94, 0.16);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-weight: 500;
}

.status-badge.invited {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.status-badge.approved {
  background: rgba(34, 197, 94, 0.14);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.rejected {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-family: var(--font-serif);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.action-btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.copy-inline-btn {
  background: var(--surface-trans);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-family: var(--font-serif);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.copy-inline-btn:hover {
  background: var(--surface-hover);
  border-color: var(--ink);
}

/* ==========================================================================
   9. TOAST POPUP
   ========================================================================== */
.toast-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   10. ADMIN LINE CHART & INTERACTIVE HOVER
   ========================================================================== */
.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 220px;
  margin-top: 14px;
  background: var(--surface-trans);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 14px 10px 14px;
}

#jobs-line-chart {
  width: 100%;
  height: 220px;
  display: block;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  transition: opacity 0.1s ease;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.panel-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.csv-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  border-radius: 6px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: all 0.18s ease;
  cursor: pointer;
}

.csv-download-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.csv-download-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   11. QUOTA DIALOG & X (TWITTER) VIRAL RESET
   ========================================================================== */
.quota-dialog {
  max-width: 520px;
}

.quota-notice-box {
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.7;
}

.quota-notice-box strong {
  color: var(--danger);
}

.notice-sub {
  color: var(--ink-secondary);
  font-size: 0.82rem;
}

.x-post-preview {
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

body.dark .x-post-preview {
  background: rgba(255, 255, 255, 0.04);
}

.x-badge {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.x-preview-text {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.x-share-btn {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body:not(.dark) .x-share-btn {
  background: #0f1419;
  color: #ffffff;
}

.x-share-btn:hover {
  background: #1d2129;
  transform: translateY(-1px);
}

/* ==========================================================================
   12. RESPONSIVE OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 860px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #mobile-menu {
    display: block;
  }

  .prompt-suggestions {
    grid-template-columns: 1fr;
  }

  .admin-grid-two {
    grid-template-columns: 1fr;
  }

  .chat-scroll {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer-container {
    padding: 0 16px 16px 16px;
  }
}

/* Apex public intermediate outputs; inherit both existing themes. */
.apex-thinking { margin: .8rem 0; padding: .75rem 1rem; border: 1px solid currentColor; border-radius: 12px; opacity: .85; }
.apex-thinking summary { cursor: pointer; font-size: .85rem; }
.apex-thinking pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 22rem; overflow-y: auto; font: inherit; font-size: .85rem; }
body:not(.dark) .message-body pre { background: #f1f3f5; color: #17212b; border-color: #d5dbe1; }
body:not(.dark) .message-body pre code { background: transparent; color: inherit; }

/* Apex v2: scoped additions preserve the current site's layout and themes. */
.apex-thinking { border: 1px solid var(--line); background: var(--surface-trans); padding: .9rem 1.1rem; opacity: 1; }
.apex-thinking summary { color: var(--ink-secondary); font-size: .82rem; letter-spacing: .035em; }
.apex-timeline { padding: .8rem 0 .1rem; }
.apex-stage { border-left: 1px solid var(--line-strong); padding: .15rem 0 .75rem 1rem; margin-left: .25rem; }
.apex-stage-label { font-size: .75rem; color: var(--ink-secondary); }
.apex-stage-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .83rem; line-height: 1.8; color: var(--ink-secondary); margin-top: .45rem; }
.apex-disclaimer, .apex-stage small { color: var(--ink-secondary); font-size: .7rem; }
.apex-stage.is-current { border-left-color: var(--ink); }
.apex-thinking.is-thinking summary::after { content: ' ·'; animation: apex-breathe 1.6s ease-in-out infinite; }
@keyframes apex-breathe { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .apex-thinking.is-thinking summary::after { animation: none; } }
.apex-timeline { max-height: min(46vh, 26rem); overflow-y: auto; scrollbar-width: thin; }

/* ==========================================================================
   8. 査読 powered by Kimi-K3 (Deep Peer Review Integration)
   ========================================================================== */
.review-view {
  padding: 36px 32px 100px 32px;
  overflow-y: auto;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.review-page-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.review-title-section {
  margin-bottom: 8px;
}

.review-brand-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
}

.review-brand-heading h1 {
  font-size: 2.1rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.badge-kimi {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--surface-trans);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  vertical-align: middle;
}

.review-title-section .lead-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink-secondary);
  margin: 10px 0 4px 0;
}

.review-title-section .sub-text {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* 順番待ち状況表示カード */
.review-queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.25s ease;
}

.queue-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.queue-status-indicator {
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-status-indicator .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
}

.queue-status-indicator .pulse-ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(34, 197, 94, 0.35);
  animation: queuePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes queuePulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

.queue-card-info {
  display: flex;
  flex-direction: column;
}

.queue-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.queue-card-value {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.queue-card-sub {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

/* 査読申込フォーム */
.review-card-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.review-form-label {
  display: block;
  margin-bottom: 18px;
}

.review-form-label .label-title {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: var(--ink-secondary);
}

#review-document {
  width: 100%;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 14px 16px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.8;
  resize: vertical;
  min-height: 140px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#review-document:focus {
  outline: none;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

/* 添付コントロール */
.review-attach-controls {
  margin-bottom: 16px;
}

.attach-buttons-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.attach-custom-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--surface-trans);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.attach-custom-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.attach-custom-btn svg {
  stroke: var(--ink-secondary);
}

.review-attachments-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeInChip 0.2s ease;
}

@keyframes fadeInChip {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.attachment-chip.chat-chip {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
}

.attachment-chip-name {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-chip-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.attachment-chip-del:hover {
  color: var(--ink);
}

.review-submit-wrapper {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overnight-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.22);
  color: var(--ink-secondary);
  font-size: 0.82rem;
  line-height: 1.7;
}

.overnight-notice-box svg {
  flex-shrink: 0;
  margin-top: 3px;
  stroke: #eab308;
}

.submit-action-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-family: var(--font-serif);
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-error-box {
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.88rem;
  margin: 12px 0 0 0;
}

/* 査読詳細カード */
.review-detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-header-row h2 {
  font-size: 1.25rem;
  margin: 0;
}

.timing-info, .progress-info {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.evidence-box {
  background: var(--surface-trans);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}

.evidence-box summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.evidence-box pre {
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.82rem;
  color: var(--muted);
  max-height: 200px;
  overflow-y: auto;
}

.confirm-form-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 22px 24px;
}

.confirm-form-box .label-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: #ffffff;
}

.confirm-form-box textarea {
  width: 100%;
  background: rgba(8, 12, 22, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 10px;
  color: #ffffff !important;
  padding: 12px 14px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.8;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.confirm-form-box textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Apple-Style 3D Rotary Drum Wheel Picker (ドラムロール式・ホイールセレクター)
   ========================================================================== */
.rotary-picker-wrapper {
  margin: 4px 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wheel-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wheel-preset-btn {
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wheel-preset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.wheel-preset-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 500;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.wheel-picker-container {
  position: relative;
  display: flex;
  height: 180px;
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  overflow: hidden;
  padding: 0 8px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
  user-select: none;
}

.wheel-lens-highlight {
  position: absolute;
  top: 50%;
  left: 8px;
  right: 8px;
  transform: translateY(-50%);
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}

.wheel-column {
  position: relative;
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: y mandatory;
  padding: 69px 0; /* (180 - 42) / 2 */
  box-sizing: border-box;
}

.wheel-column::-webkit-scrollbar {
  display: none;
}

#wheel-col-date {
  flex: 1.8;
}

.wheel-item {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: color 0.15s ease, font-size 0.15s ease, transform 0.15s ease;
}

.wheel-item.selected {
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 600;
  transform: scale(1.06);
}

.wheel-col-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  z-index: 3;
}

.wheel-selected-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #93c5fd;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(147, 197, 253, 0.1);
  border: 1px solid rgba(147, 197, 253, 0.2);
}

/* ==========================================================================
   Apex風 Review CoT (Chain of Thought) リアルタイム推論ストリーム
   ========================================================================== */
.review-thinking-box {
  margin: 8px 0 16px 0;
}

.review-thinking-box .apex-thinking {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 16, 28, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 14px 18px;
}

.review-thinking-box .apex-thinking summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-thinking-box .apex-stage-label {
  color: #ffffff !important;
  font-weight: 500;
  font-size: 0.88rem;
}

.review-thinking-box .apex-stage-note {
  color: #e2e8f0 !important;
  font-size: 0.84rem;
  line-height: 1.6;
}

.review-thinking-box .apex-disclaimer {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.78rem;
}

.review-stream-live-container {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.review-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review-stream-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(147, 197, 253, 0.95);
  font-weight: 500;
}

.review-live-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
  animation: liveBlink 1.2s ease infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.review-stream-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
}

/* 査読ビュー テーマ別スタイル調整 */
body.dark #review-document {
  color: #ffffff !important;
  background: rgba(8, 12, 22, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
}

body.dark #review-document:focus {
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

body.dark .review-form-label .label-title {
  color: #ffffff !important;
  font-weight: 500;
}

body.dark #review-link {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
}

body.dark .timing-info {
  color: rgba(255, 255, 255, 0.85) !important;
}

body.dark .progress-info {
  color: rgba(147, 197, 253, 0.95) !important;
}

body.dark .evidence-box summary {
  color: rgba(255, 255, 255, 0.92) !important;
}

body.dark .evidence-box pre {
  color: rgba(255, 255, 255, 0.85) !important;
}

body.dark #review-result {
  background: rgba(8, 12, 22, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 12px;
  padding: 18px 22px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #ffffff !important;
  max-height: 420px;
  overflow-y: auto;
}

body.dark .hint-text {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 6px 0 12px 0;
}

/* ホワイトモード（ライトモード）時の査読スタイル調整（黒の印象を和らげ、上品で自然なトーンに） */
body:not(.dark) #review-document {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

body:not(.dark) #review-document:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

body:not(.dark) .review-form-label .label-title {
  color: #334155 !important;
  font-weight: 500;
}

body:not(.dark) #review-link {
  color: #1e293b !important;
  font-weight: 500;
}

body:not(.dark) .timing-info {
  color: #64748b !important;
}

body:not(.dark) .progress-info {
  color: #2563eb !important;
}

body:not(.dark) .evidence-box summary {
  color: #1e293b !important;
}

body:not(.dark) .evidence-box pre {
  color: #334155 !important;
  background: #f8fafc;
}

body:not(.dark) #review-result {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px;
  padding: 18px 22px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #1e293b !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  max-height: 420px;
  overflow-y: auto;
}

body:not(.dark) .hint-text {
  color: #64748b !important;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 6px 0 12px 0;
}

body:not(.dark) .review-view .submit-action-btn.primary-btn {
  background: linear-gradient(135deg, #2a3447 0%, #1e293b 100%);
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 3px 12px rgba(30, 41, 59, 0.12);
}

body:not(.dark) .review-view .submit-action-btn.primary-btn:hover {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 5px 16px rgba(30, 41, 59, 0.2);
}

body:not(.dark) .review-view .review-card-form {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

body:not(.dark) .review-view .review-queue-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.confirm-action-btn {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: var(--font-serif);
  cursor: pointer;
}

#review-result:empty {
  display: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff !important;
  font-size: 0.88rem;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.job-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.job-actions-row .danger-btn {
  background: rgba(239, 68, 68, 0.18) !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
  color: #fca5a5 !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-actions-row .danger-btn:hover {
  background: rgba(239, 68, 68, 0.32) !important;
  border-color: rgba(239, 68, 68, 0.8) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.job-actions-row .subtle-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-actions-row .subtle-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
}

/* 履歴リスト */
.history-section h2 {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  color: #ffffff !important;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-list button {
  text-align: left;
  background: rgba(12, 16, 28, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.history-list button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}

/* 会話履歴参照選択モーダル */
.review-chat-modal .dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-modal-desc {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin: 0;
}

.chat-modal-counter-bar {
  display: flex;
  justify-content: flex-end;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.review-chat-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-select-item:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.chat-select-item.selected {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.1);
}

.chat-select-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

.chat-select-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.chat-select-title {
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-select-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ==========================================================================
   3-Tier Subpage System & Academic Architecture (About, Tech Report, Feedback)
   ========================================================================== */

/* Top Header Subpage Navigation */
.header-subpage-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.header-nav-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

body:not(.dark) .header-nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

.header-nav-btn.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

body:not(.dark) .header-nav-btn.active {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

.header-nav-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 4px;
}

/* Sidebar Subpage Navigation */
.sidebar-subpage-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.nav-subpage-btn {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 7px 10px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  color: var(--ink-dim) !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.16s ease !important;
}

.nav-subpage-btn:hover {
  color: var(--ink) !important;
  background: var(--surface-trans) !important;
  border-color: var(--line) !important;
}

.subpage-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-subpage-btn:hover .subpage-icon {
  opacity: 1;
}

/* Assistant Grounding Disclaimer Block */
.grounding-disclaimer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.5;
}

body:not(.dark) .grounding-disclaimer {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

.disclaimer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  opacity: 0.75;
}

.disclaimer-text {
  flex: 1;
}

.inline-tech-link {
  display: inline;
  background: transparent;
  border: none;
  padding: 0 2px;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.inline-tech-link:hover {
  opacity: 0.8;
}

/* ==========================================================================
   Apple Developer Grade: Main Workspace Subpage View (#subpage-view)
   ========================================================================== */

/* 1. View Shell & Layout */
.subpage-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  position: relative;
  z-index: 15;
}

.subpage-view.hidden {
  display: none !important;
}

/* 2. Apple-style Sticky Sub-Navigation Bar (Deprecated per user instruction) */
.subpage-sticky-bar {
  display: none !important;
}
  z-index: 35;
  background: rgba(9, 13, 22, 0.76);
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

body:not(.dark) .subpage-sticky-bar {
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.sticky-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.subpage-back-link {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-dim);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

body:not(.dark) .subpage-back-link {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ink-dim);
}

.subpage-back-link svg {
  transition: transform 0.18s ease;
}

.subpage-back-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

body:not(.dark) .subpage-back-link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.subpage-pill-selector {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 4px;
  gap: 4px;
}

body:not(.dark) .subpage-pill-selector {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.subpage-pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.subpage-pill-btn:hover {
  color: var(--ink);
}

.subpage-pill-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

body:not(.dark) .subpage-pill-btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.1);
}

.subpage-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subpage-lang-capsule {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 3px;
  gap: 2px;
}

body:not(.dark) .subpage-lang-capsule {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.subpage-lang-btn {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 4px 11px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.subpage-lang-btn:hover {
  color: var(--ink);
}

.subpage-lang-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  font-weight: 600;
}

body:not(.dark) .subpage-lang-btn.active {
  background: rgba(0, 0, 0, 0.08);
}

/* 3. Main Scroll Container */
.subpage-content-scroll {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.subpage-render-area {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px 140px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* 4. Progressive Scroll Reveal Animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 5. Apple Keynote Hero (Unboxed, Pure Typography Breathing on Glass Canvas) */
.apple-hero {
  padding: 20px 8px 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
}

body:not(.dark) .apple-hero {
  background: transparent;
  border: none;
  box-shadow: none;
}

.apple-hero-eyebrow {
  display: none;
}

.apple-hero-tagline {
  font-family: 'Shippori Mincho', 'Apple Mincho', serif;
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: initial;
}

body.dark .apple-hero-tagline {
  color: #ffffff;
}

body:not(.dark) .apple-hero-tagline {
  color: #111827;
}

.apple-hero-lead {
  font-size: 1.02rem;
  line-height: 2.1;
  color: var(--ink-secondary);
  max-width: 820px;
  margin: 0;
}

.apple-hero.tech-hero .apple-hero-tagline {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 400;
  line-height: 1.36;
}

/* 6. Apple Bento Grid (3 Pillars) */
.apple-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bento-pillar-card {
  padding: 34px 28px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

body:not(.dark) .bento-pillar-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.bento-pillar-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
}

body:not(.dark) .bento-pillar-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.035);
}

.pillar-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
  margin-bottom: 4px;
}

body:not(.dark) .pillar-icon-wrap {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4f46e5;
}

.pillar-linear-icon {
  width: 22px;
  height: 22px;
}

.pillar-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  letter-spacing: 0.02em;
  margin: 0;
}

.pillar-desc {
  font-size: 0.94rem;
  line-height: 2.05;
  color: var(--ink-secondary);
  margin: 0;
}

/* 7. Apple Keynote Spec Highlights Bento */
.spec-highlights-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.spec-highlight-card {
  padding: 30px 24px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

body:not(.dark) .spec-highlight-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.spec-highlight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.spec-big-num-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.spec-big-num {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}

.spec-unit {
  font-size: 1rem;
  color: #818cf8;
  font-weight: 600;
}

.spec-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.spec-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
}

/* 8. Objective Benchmark & Challenges Dashboard */
.benchmark-dashboard-card {
  padding: 36px 40px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.22);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.benchmark-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.benchmark-dash-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #f59e0b;
  margin: 0;
}

.benchmark-meters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.benchmark-meter-box {
  padding: 22px 24px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body:not(.dark) .benchmark-meter-box {
  background: rgba(0, 0, 0, 0.03);
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.meter-val {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

.meter-val.miss {
  color: #f59e0b;
}

.meter-bar-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  width: 0%;
  position: relative;
  transition: width 1.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 14px rgba(129, 140, 248, 0.45);
}

.meter-bar-fill.miss {
  background: linear-gradient(90deg, #d97706, #f59e0b);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

.meter-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95));
  box-shadow: 0 0 10px #ffffff;
}

.meter-val.animated {
  animation: meterValPop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes meterValPop {
  0% { transform: scale(0.92); opacity: 0.4; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.meter-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

.challenges-deep-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.challenge-deep-item {
  padding: 22px 26px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 4px solid #f59e0b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body:not(.dark) .challenge-deep-item {
  background: rgba(0, 0, 0, 0.02);
}

.challenge-deep-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.challenge-deep-desc {
  font-size: 0.92rem;
  line-height: 1.95;
  color: var(--ink-dim);
  margin: 0;
}

/* 9. Technical Architecture Table & Implementations */
.tech-table-card {
  padding: 34px 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

body:not(.dark) .tech-table-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.apple-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.apple-tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.apple-tech-table th, .apple-tech-table td {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.85;
}

body:not(.dark) .apple-tech-table th, body:not(.dark) .apple-tech-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.apple-tech-table th {
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.apple-tech-table tr:last-child td {
  border-bottom: none;
}

.apple-tech-table td.stat-val {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}

.apple-tech-table .status-target-miss {
  color: #f59e0b;
}

.implementations-deck {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.implementation-item-card {
  padding: 28px 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  gap: 22px;
  align-items: flex-start;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

body:not(.dark) .implementation-item-card {
  background: rgba(0, 0, 0, 0.018);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.implementation-item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.impl-num-badge {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.impl-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.impl-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.45;
}

.impl-body {
  font-size: 0.94rem;
  line-height: 2.1;
  color: var(--ink-dim);
  margin: 0;
}

/* 10. Vision & Editorial Statement Section */
.vision-editorial-box {
  padding: 36px 42px;
  border-radius: 14px;
  border-left: 4px solid var(--ink);
  background: rgba(15, 23, 42, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 1.08rem;
  line-height: 2.2;
  color: var(--ink-dim);
}

body:not(.dark) .vision-editorial-box {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--ink);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* Statement Toc List */
.statement-archive-deck {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.statement-toc-item {
  padding: 24px 30px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.dark) .statement-toc-item {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.statement-toc-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.55);
}

body:not(.dark) .statement-toc-item:hover {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.95);
}

.statement-item-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.statement-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.statement-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.05em;
}

.manifesto-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.update-badge {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.statement-date {
  font-size: 0.82rem;
  color: var(--muted);
}

.statement-item-title {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.statement-item-excerpt {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.8;
}

.toc-arrow {
  font-size: 1.3rem;
  color: var(--muted);
  transition: transform 0.22s ease, color 0.22s ease;
}

.statement-toc-item:hover .toc-arrow {
  color: var(--ink);
  transform: translateX(3px);
}

/* 11. Article Reader Mode */
.statement-article-view {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 900px;
  margin: 0 auto;
}

.statement-article-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.statement-article-body {
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--ink);
}

.statement-article-body p {
  margin-bottom: 24px;
}

.statement-article-body blockquote {
  margin: 32px 0;
  padding: 28px 36px;
  border-left: none;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-style: normal;
}

body:not(.dark) .statement-article-body blockquote {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* 12. Feedback & Bug Report Studio */
.feedback-studio {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.feedback-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.feedback-cat-pill {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.18s ease;
}

.feedback-cat-pill:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.feedback-cat-pill.active {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.feedback-input, .feedback-textarea {
  font-family: inherit;
  font-size: 0.94rem;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-input:focus, .feedback-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.feedback-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.85;
}

.feedback-env-card {
  padding: 18px 22px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-all;
}

body:not(.dark) .feedback-env-card {
  background: rgba(0, 0, 0, 0.03);
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 10px;
}

.copy-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-template-btn:hover {
  background: var(--surface-hover);
}

.team-card {
  padding: 28px 34px;
  border-radius: 12px;
  background: var(--surface-trans);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.95;
}

.team-card-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}

/* 13. Login Manifesto Dialog (Pre-login Modal) */
.manifesto-dialog {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(9, 13, 22, 0.86);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7);
  width: min(760px, 90vw);
  max-height: 85vh;
  overflow: hidden;
}

body:not(.dark) .manifesto-dialog {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.manifesto-dialog[open] {
  animation: modalScaleUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.manifesto-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.manifesto-dialog .dialog-header {
  padding: 22px 30px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.dialog-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
}

.dialog-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: scale(1.04);
}

body:not(.dark) .dialog-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ink-dim);
}

body:not(.dark) .dialog-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}

.manifesto-dialog .dialog-body {
  padding: 34px 38px;
  overflow-y: auto;
  max-height: calc(85vh - 84px);
}

.manifesto-dialog .original-statement {
  margin: 0 0 24px;
  font-size: 1.02rem;
  line-height: 2.15;
  color: var(--ink);
}

.manifesto-dialog .original-statement p {
  margin: 0 0 20px 0;
}

.manifesto-dialog .original-statement p:last-child {
  margin-bottom: 0;
}

.manifesto-dialog .provider-signature {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: right;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .apple-bento-grid {
    grid-template-columns: 1fr;
  }
  .spec-highlights-bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .benchmark-meters-grid {
    grid-template-columns: 1fr;
  }
  .sticky-bar-inner {
    padding: 12px 20px;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .subpage-render-area {
    padding: 36px 20px 120px;
    gap: 50px;
  }
  .apple-hero {
    padding: 24px 8px 12px;
    border-radius: 0;
  }
  .spec-highlights-bento {
    grid-template-columns: 1fr;
  }
  .subpage-pill-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}





/* ==========================================================================
   Dynamic Motion & Timeline Rails (Codex-style Scrubbing & Fullscreen Hero)
   ========================================================================== */

/* 1. Fullscreen First-View Hero */
.apple-hero.fullscreen-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px 50px;
  box-sizing: border-box;
  position: relative;
}

.apple-hero-tagline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.3em;
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 0.88em;
  background: #ffffff;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  animation: cursorBlink 0.8s ease-in-out infinite alternate;
  transition: opacity 0.5s ease;
}

.typewriter-cursor.faded {
  opacity: 0;
  animation: none;
}

@keyframes cursorBlink {
  from { opacity: 1; }
  to { opacity: 0; }
}

.apple-hero-lead {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-hero-lead.revealed {
  opacity: 1;
  transform: translateY(0);
}

.hero-scroll-cue {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.8s ease, color 0.2s ease;
  animation: heroCueFloat 2.6s ease-in-out infinite;
  user-select: none;
  z-index: 10;
}

.hero-scroll-cue.revealed {
  opacity: 0.8;
}

.hero-scroll-cue:hover {
  opacity: 1;
  color: #ffffff;
}

@keyframes heroCueFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(7px); }
}

/* 2. Chat View: 25-Tile Relative Wave Timeline Rail (Vertically Centered) */
.chat-timeline-rail {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  z-index: 25;
  pointer-events: auto;
  opacity: 0.8;
  transition: opacity 0.25s ease;
  touch-action: none;
  padding: 8px 4px;
}

.chat-timeline-rail:hover,
.chat-timeline-rail.scrubbing {
  opacity: 1;
}

.chat-timeline-rail.scrubbing {
  cursor: ns-resize;
  user-select: none;
}

.rail-tick {
  width: 10px;
  height: 2px;
  border-radius: 1px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.12s cubic-bezier(0.16, 1, 0.3, 1), background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  transform-origin: left center;
}

body.dark .rail-tick {
  background: rgba(255, 255, 255, 0.28);
}

body.dark .rail-tick.active-tick {
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.95);
}

/* Light theme adjustments */
body:not(.dark) .chat-timeline-rail {
  opacity: 0.82;
}

body:not(.dark) .rail-tick {
  background: rgba(0, 0, 0, 0.24);
}

body:not(.dark) .rail-tick.active-tick {
  background: #000000;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.timeline-preview-tile {
  position: absolute;
  left: 44px;
  width: 320px;
  max-width: calc(100vw - 120px);
  background: rgba(14, 18, 28, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  z-index: 99;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%) translateX(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.timeline-preview-tile.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.timeline-preview-tile .tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-preview-tile .tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-preview-tile .tile-badge.user {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.timeline-preview-tile .tile-badge.assistant {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.timeline-preview-tile .tile-snippet {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root:not(.dark) .timeline-preview-tile {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  color: #0f172a;
}

:root:not(.dark) .timeline-preview-tile .tile-badge.user {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

:root:not(.dark) .timeline-preview-tile .tile-badge.assistant {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

:root:not(.dark) .timeline-preview-tile .tile-snippet {
  color: #1e293b;
}

.message-scrub-focus {
  animation: messageScrubGlow 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messageScrubGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(147, 197, 253, 0.8), 0 0 24px rgba(147, 197, 253, 0.5);
    border-color: rgba(147, 197, 253, 0.8);
  }
  60% {
    box-shadow: 0 0 0 6px rgba(147, 197, 253, 0.2), 0 0 32px rgba(147, 197, 253, 0.3);
    border-color: rgba(147, 197, 253, 0.5);
  }
  100% {
    box-shadow: none;
    border-color: inherit;
  }
}

/* 3. Subpage / Tech Report Section Rail */
.subpage-section-rail {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: auto;
}

.section-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  color: var(--muted);
  transition: all 0.2s ease;
}

.section-rail-item:hover, .section-rail-item.active {
  color: var(--ink);
}

body.dark .section-rail-item:hover, body.dark .section-rail-item.active {
  color: #ffffff;
}

body:not(.dark) .section-rail-item:hover, body:not(.dark) .section-rail-item.active {
  color: #111827;
}

.section-rail-tick {
  width: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.dark) .section-rail-tick {
  background: rgba(0, 0, 0, 0.22);
}

.section-rail-item:hover .section-rail-tick, .section-rail-item.active .section-rail-tick {
  width: 26px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
}

body:not(.dark) .section-rail-item:hover .section-rail-tick, body:not(.dark) .section-rail-item.active .section-rail-tick {
  background: #111827;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
}

.section-rail-num {
  font-size: 0.72rem;
  font-family: monospace;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.section-rail-item.active .section-rail-num {
  opacity: 1;
  font-weight: 600;
  color: #93c5fd;
}

body:not(.dark) .section-rail-item.active .section-rail-num {
  color: #2563eb;
}

.subpage-preview-tile {
  position: absolute;
  left: 60px;
  width: 250px;
  background: rgba(16, 20, 32, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  z-index: 99;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.subpage-preview-tile.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.subpage-preview-tile .sub-tile-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.subpage-preview-tile .sub-tile-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

/* 4. Single-Action Dialog Footer */
.dialog-footer-actions.single-action {
  display: flex;
  justify-content: flex-end;
}

/* Light theme overrides for dynamic motion elements */
body:not(.dark) .typewriter-cursor {
  background: #111827;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

body:not(.dark) .hero-scroll-cue {
  color: rgba(0, 0, 0, 0.55);
}

body:not(.dark) .hero-scroll-cue:hover {
  color: #111827;
}

body:not(.dark) .subpage-preview-tile {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
}

body:not(.dark) .subpage-preview-tile .sub-tile-title {
  color: #111827;
}



body:not(.dark) .timeline-preview-tile {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.15);
}

body:not(.dark) .timeline-preview-tile .tile-badge.user {
  background: rgba(0, 0, 0, 0.08);
  color: #111827;
}

body:not(.dark) .timeline-preview-tile .tile-snippet {
  color: #1f2937;
}
