/* ── 墨笺 · Design System ── */

:root {
  --cream: #FDF6F0;
  --cream-dark: #F5EBE0;
  --rose: #D4A5A5;
  --rose-deep: #B87B7B;
  --plum: #5C3D4E;
  --plum-light: #7A5568;
  --sage: #9DB4A0;
  --sage-deep: #7A9A7E;
  --gold: #C9A962;
  --gold-light: #E8D5A8;
  --ink: #3D2C35;
  --ink-soft: #6B5A62;
  --white: #FFFCFA;
  --shadow: 0 4px 24px rgba(92, 61, 78, 0.08);
  --shadow-lg: 0 12px 48px rgba(92, 61, 78, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: 'Nunito', 'PingFang SC', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background ── */

.bg-bloom {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 20s ease-in-out infinite;
}

.b1 {
  width: 500px; height: 500px;
  background: linear-gradient(135deg, var(--rose), var(--gold-light));
  top: -10%; right: -5%;
}

.b2 {
  width: 400px; height: 400px;
  background: linear-gradient(135deg, var(--sage), var(--cream-dark));
  bottom: -5%; left: -8%;
  animation-delay: -7s;
}

.b3 {
  width: 300px; height: 300px;
  background: linear-gradient(135deg, var(--gold-light), var(--rose));
  top: 40%; left: 30%;
  animation-delay: -14s;
  opacity: 0.25;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ── Views ── */

.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view.active { display: flex; flex-direction: column; }

.hidden { display: none !important; }

/* ── Auth ── */

#view-auth {
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 252, 250, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 165, 165, 0.25);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand { text-align: center; margin-bottom: 2rem; }

.brand-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--plum), var(--rose-deep));
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(92, 61, 78, 0.2);
}

.auth-brand h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--plum);
  letter-spacing: 0.15em;
}

.brand-tagline {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-weight: 300;
}

/* ── Form Elements ── */

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--plum-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.field input,
.field textarea,
.novel-title-input,
.chapter-title-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(212, 165, 165, 0.3);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field textarea:focus,
.novel-title-input:focus,
.chapter-title-input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.2);
}

.field textarea { resize: vertical; min-height: 60px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  color: var(--rose-deep);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--plum), var(--plum-light));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(92, 61, 78, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(92, 61, 78, 0.3);
}

.btn-secondary {
  background: var(--cream-dark);
  color: var(--plum);
  border: 1.5px solid rgba(212, 165, 165, 0.4);
}

.btn-secondary:hover:not(:disabled) { background: var(--rose); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover { color: var(--plum); background: rgba(212, 165, 165, 0.1); }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem 0.75rem; font-size: 1.1rem; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Topbar ── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255, 252, 250, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 165, 165, 0.15);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--plum);
}

.brand-mini {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--plum), var(--rose-deep));
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-chip {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.3rem 0.8rem;
  background: rgba(212, 165, 165, 0.12);
  border-radius: 20px;
}

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ── Home ── */

.home-main {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.home-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.home-hero h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--plum);
  margin-bottom: 0.5rem;
}

.home-hero p { color: var(--ink-soft); font-weight: 300; }

.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.novel-card {
  background: rgba(255, 252, 250, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 165, 165, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.novel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--sage));
  opacity: 0;
  transition: opacity var(--transition);
}

.novel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--rose);
}

.novel-card:hover::before { opacity: 1; }

.novel-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--plum);
  margin-bottom: 0.5rem;
}

.novel-card .synopsis {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.novel-card .meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--rose-deep);
}

.btn-new-novel {
  display: flex;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  font-size: 1rem;
}

.btn-new-novel .plus {
  font-size: 1.3rem;
  font-weight: 300;
}

/* ── Workspace ── */

.workspace-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 252, 250, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 165, 165, 0.15);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ai-provider-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.ai-provider-label {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ai-provider-select {
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(212, 165, 165, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  color: var(--plum);
  cursor: pointer;
  max-width: 150px;
}

.ai-provider-select:focus {
  outline: none;
  border-color: var(--rose);
}

.workspace-title-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.novel-title-input {
  border: none;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--plum);
  padding: 0.25rem 0;
}

.novel-title-input:focus {
  outline: none;
  border-bottom: 2px solid var(--rose);
}

.genre-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  background: rgba(157, 180, 160, 0.2);
  color: var(--sage-deep);
  border-radius: 12px;
  font-weight: 600;
}

.workspace-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 252, 250, 0.5);
  border-bottom: 1px solid rgba(212, 165, 165, 0.1);
}

.tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.tab:hover { background: rgba(212, 165, 165, 0.1); color: var(--plum); }

.tab.active {
  background: var(--white);
  color: var(--plum);
  box-shadow: var(--shadow);
}

.panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.panel.active { display: flex; flex-direction: column; }

#view-workspace.active {
  height: 100vh;
  overflow: hidden;
}

/* ── Inspiration ── */

.inspiration-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.chat-panel, .cards-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 1.25rem;
}

.chat-panel {
  border-right: 1px solid rgba(212, 165, 165, 0.15);
}

.panel-head {
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.cards-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
}

.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chat-panel-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.bootstrap-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.pitch-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(212, 165, 165, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  color: var(--ink);
}

.pitch-input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 2px rgba(212, 165, 165, 0.2);
}

.bootstrap-hint {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.cards-panel-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.panel-head h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--plum);
}

.panel-head p {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg {
  max-width: 88%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.65;
  animation: fadeUp 0.3s ease;
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--plum), var(--plum-light));
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.msg-ai {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.2);
  border-bottom-left-radius: 4px;
}

.msg-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.option-btn {
  padding: 0.4rem 0.8rem;
  border: 1.5px solid rgba(212, 165, 165, 0.4);
  border-radius: 20px;
  background: var(--cream);
  font-size: 0.8rem;
  color: var(--plum);
  cursor: pointer;
  transition: all var(--transition);
}

.option-btn:hover {
  background: var(--rose);
  color: var(--white);
  border-color: var(--rose);
}

.chat-input-wrap {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(212, 165, 165, 0.15);
  flex-shrink: 0;
}

.chat-input-wrap textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(212, 165, 165, 0.3);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  resize: none;
}

.chat-input-wrap textarea:focus {
  outline: none;
  border-color: var(--rose);
}

/* ── Setting Cards ── */

.setting-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-card {
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
  animation: fadeUp 0.3s ease;
}

.setting-card .card-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rose-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.setting-card .card-value {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.card-value-pre {
  white-space: pre-line;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.82rem;
  background: rgba(255, 252, 250, 0.8);
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(212, 165, 165, 0.12);
}

.setting-card .card-actions {
  display: flex;
  gap: 0.5rem;
}

.world-preview {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 165, 165, 0.15);
  flex-shrink: 0;
}

.world-preview h4 {
  font-size: 0.8rem;
  color: var(--plum-light);
  margin-bottom: 0.5rem;
}

.world-summary {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.empty-hint {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 1rem;
  opacity: 0.7;
}

.empty-hint.center { padding: 4rem 2rem; }

/* ── Outline Panel ── */

.outline-layout {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.outline-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.outline-section-card.outline-main-col,
.outline-section-card.outline-sub-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 420px;
  overflow: hidden;
}

.outline-main-col .section-head,
.outline-sub-col .section-head {
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.outline-main-col .section-head h3,
.outline-sub-col .section-head h3 {
  margin: 0;
}

.outline-main-col .section-desc,
.outline-sub-col .section-desc {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.outline-main-col #master-outline {
  flex: 1;
  min-height: 0;
  resize: none;
  margin-bottom: 0.5rem;
}

.outline-main-col .status-badge {
  flex-shrink: 0;
  align-self: flex-start;
}

.outline-sub-col .subplot-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.outline-volumes-col {
  flex-shrink: 0;
}

.section-desc-inline {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.outline-rel-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.outline-rel-group-title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: var(--plum-light);
  font-family: var(--font-serif);
}

.outline-rel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.outline-rel-card {
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  border-left: 3px solid rgba(212, 165, 165, 0.35);
}

.outline-rel-card.friendly { border-left-color: var(--sage-deep); }
.outline-rel-card.hostile { border-left-color: var(--rose-deep); }

.outline-rel-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.outline-rel-names {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--plum);
}

.outline-rel-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.outline-rel-stats {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

.outline-rel-editable .outline-rel-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.outline-rel-editable .outline-rel-card-head {
  margin-bottom: 0;
}

.outline-rel-editable .field {
  margin-bottom: 0;
}

.outline-rel-editable .field label {
  font-size: 0.72rem;
}

.outline-rel-editable textarea,
.outline-rel-editable input[type="number"] {
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
}

.rel-modal-edit {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(212, 165, 165, 0.2);
}

.rel-modal-edit .field-row {
  grid-template-columns: 1fr 1fr;
}

.rel-modal-desc {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
  padding: 0.75rem 1rem;
  background: rgba(212, 165, 165, 0.08);
  border-radius: var(--radius-sm);
}

.rel-pair-main {
  flex: 1;
  min-width: 0;
}

.rel-pair-desc {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.outline-section-card {
  background: rgba(255, 252, 250, 0.7);
  border: 1px solid rgba(212, 165, 165, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.section-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rose-dark);
}

.section-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#master-outline {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem;
  border: 1.5px solid rgba(212, 165, 165, 0.25);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink);
  min-height: 200px;
}

#master-outline:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.15);
}

.volume-list,
.subplot-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subplot-card {
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  flex-shrink: 0;
}

.subplot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
}

.subplot-card-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--plum);
  font-family: var(--font-serif);
}

.subplot-fields {
  display: grid;
  gap: 0.6rem;
}

.subplot-fields .field-row {
  grid-template-columns: 1fr 1fr;
}

.subplot-fields .sp-content {
  min-height: 100px;
  max-height: 180px;
  resize: vertical;
  font-size: 0.85rem;
  line-height: 1.6;
}

.subplot-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  justify-content: flex-end;
}

.subplot-focus {
  font-size: 0.7rem;
  color: var(--rose-dark);
  background: rgba(212, 165, 165, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.volume-card {
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.volume-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.volume-card-header h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--plum);
}

.volume-chapters {
  font-size: 0.75rem;
  color: var(--rose-deep);
  padding: 0.15rem 0.5rem;
  background: rgba(212, 165, 165, 0.12);
  border-radius: 8px;
}

.volume-fields {
  display: grid;
  gap: 0.75rem;
}

.volume-card .volume-fields .field-row {
  grid-template-columns: 1fr 1fr 1fr;
}

.volume-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.volume-status {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-weight: 600;
}

.volume-status.planned { background: rgba(212, 165, 165, 0.15); color: var(--rose-deep); }
.volume-status.writing { background: rgba(201, 169, 98, 0.2); color: #9A7B3C; }
.volume-status.completed { background: rgba(157, 180, 160, 0.2); color: var(--sage-deep); }

.char-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.char-actions select {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(212, 165, 165, 0.3);
  background: var(--white);
  color: var(--plum);
}

/* ── Settings Panel ── */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  align-items: start;
}

.settings-main {
  min-width: 0;
}

.settings-sidebar {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.settings-section {
  background: rgba(255, 252, 250, 0.7);
  border: 1px solid rgba(212, 165, 165, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-head h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--plum);
}

/* ── Characters ── */

.character-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.char-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 165, 165, 0.15);
}

.char-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--white);
  flex-shrink: 0;
}

.char-info { flex: 1; }

.char-info h4 {
  font-size: 0.95rem;
  color: var(--plum);
  margin-bottom: 0.2rem;
}

.char-role {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  background: rgba(157, 180, 160, 0.15);
  color: var(--sage-deep);
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.char-info p {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.char-summary {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.char-dead-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  background: rgba(120, 120, 120, 0.15);
  color: #888;
  border-radius: 6px;
  font-weight: normal;
  vertical-align: middle;
}

.char-profile-fields {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.65rem 0;
}

.char-field-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--rose-deep);
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.char-field p {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

.char-card-expanded {
  align-items: flex-start;
}

.char-faction-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.faction-tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  background: rgba(139, 90, 120, 0.1);
  color: var(--plum);
  border-radius: 6px;
}

/* ── Factions ── */

.faction-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faction-card {
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.faction-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.faction-card-head input.faction-name {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--plum);
  border: none;
  background: transparent;
  padding: 0.15rem 0;
  border-bottom: 1px dashed rgba(212, 165, 165, 0.4);
}

.faction-card-head input.faction-name:focus {
  outline: none;
  border-bottom-color: var(--rose);
}

.faction-align {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(212, 165, 165, 0.3);
  background: var(--cream);
  color: var(--ink-soft);
}

.faction-desc {
  width: 100%;
  font-size: 0.78rem;
  color: var(--ink-soft);
  border: 1px solid rgba(212, 165, 165, 0.15);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  resize: vertical;
  min-height: 2.5rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 252, 250, 0.8);
}

.faction-members-label {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.6rem;
  margin-bottom: 0.45rem;
}

.member-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(157, 180, 160, 0.2);
  border: 1px solid var(--sage);
  color: var(--sage-deep);
}

.member-remove {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0.1rem;
}

.member-remove:hover {
  color: var(--plum);
}

.member-empty {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.member-add-select {
  width: 100%;
  font-size: 0.72rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px dashed rgba(212, 165, 165, 0.4);
  background: rgba(255, 252, 250, 0.8);
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 165, 0.25);
  background: var(--cream);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.member-chip.active {
  background: rgba(157, 180, 160, 0.2);
  border-color: var(--sage);
  color: var(--sage-deep);
}

.member-chip input {
  display: none;
}

.faction-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(212, 165, 165, 0.12);
}

.faction-panel .section-desc {
  margin-bottom: 0.75rem;
}

/* ── Hooks ── */

.hook-list { display: flex; flex-direction: column; gap: 0.5rem; }

.hook-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.hook-content-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(212, 165, 165, 0.25);
  border-radius: 6px;
  font-size: 0.85rem;
  resize: vertical;
}

.hook-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.hook-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.55rem;
}

.hook-status.unused { background: var(--gold); }
.hook-status.used { background: var(--sage); }

.char-edit-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(212, 165, 165, 0.25);
  display: grid;
  gap: 0.5rem;
}

.char-edit-panel .field label {
  font-size: 0.72rem;
}

.char-edit-panel textarea {
  font-size: 0.82rem;
  padding: 0.45rem 0.6rem;
}

/* ── Writing ── */

.writing-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}

.chapter-sidebar {
  border-right: 1px solid rgba(212, 165, 165, 0.15);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sidebar-head h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--plum);
}

.chapter-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chapter-item {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--ink-soft);
  border: 1px solid transparent;
}

.chapter-item:hover { background: rgba(212, 165, 165, 0.08); }

.chapter-item.active {
  background: var(--white);
  color: var(--plum);
  border-color: rgba(212, 165, 165, 0.3);
  font-weight: 600;
}

.chapter-editor {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.chapter-workspace { animation: fadeUp 0.3s ease; }

.chapter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.chapter-title-input {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--plum);
  flex: 1;
  min-width: 200px;
}

.chapter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.outline-section, .body-section {
  margin-bottom: 1.25rem;
}

.outline-section label,
.body-section label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--plum-light);
  margin-bottom: 0.5rem;
}

.status-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  background: rgba(212, 165, 165, 0.2);
  color: var(--rose-deep);
}

.status-badge.confirmed {
  background: rgba(157, 180, 160, 0.2);
  color: var(--sage-deep);
}

#chapter-outline, #chapter-body {
  width: 100%;
  padding: 1rem;
  border: 1.5px solid rgba(212, 165, 165, 0.25);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink);
  resize: vertical;
}

#chapter-body { min-height: 400px; }

#chapter-outline:focus, #chapter-body:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.15);
}

.warning-text {
  color: var(--gold);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.body-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.chapter-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  background: rgba(212, 165, 165, 0.06);
  border-radius: var(--radius-sm);
}

.meta-item label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rose-deep);
  display: block;
  margin-bottom: 0.3rem;
}

.meta-item p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ── Focus Mode ── */

#view-focus { background: var(--cream); }

.focus-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 252, 250, 0.6);
  border-bottom: 1px solid rgba(212, 165, 165, 0.1);
}

.focus-bar span {
  font-family: var(--font-serif);
  color: var(--plum);
  font-size: 0.95rem;
}

.focus-editor {
  flex: 1;
  width: 100%;
  padding: 2rem 3rem;
  border: none;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 2;
  color: var(--ink);
  resize: none;
  max-width: 800px;
  margin: 0 auto;
  display: block;
}

.focus-editor:focus { outline: none; }

.focus-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 44, 53, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease;
}

.modal h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--plum);
  margin-bottom: 1.25rem;
}

.modal-wide {
  max-width: 680px;
}

/* ── Relationships ── */

.relationships-layout {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rel-section-card {
  background: rgba(255, 252, 250, 0.7);
  border: 1px solid rgba(212, 165, 165, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.rel-graph-container {
  height: 420px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 165, 165, 0.15);
  position: relative;
  overflow: hidden;
}

.rel-graph-inner {
  width: 100%;
  height: 100%;
}

.rel-graph-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.rel-graph-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rel-graph-filter-label {
  font-size: 0.75rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}

.rel-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.rel-graph-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-friendly::before { background: #7A9A7E; }
.legend-hostile::before { background: #C97070; }
.legend-neutral::before { background: #B8B0A8; }
.legend-node-size::before {
  width: 14px;
  height: 14px;
  background: #FFFCFA;
  border: 2px solid #8B5A78;
}

.rel-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rel-chart-wrap {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid rgba(212, 165, 165, 0.15);
  overflow-x: auto;
}

.rel-chart-wrap label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--plum-light);
  margin-bottom: 0.5rem;
}

.rel-chart-wrap canvas {
  max-width: 100%;
  height: auto;
}

.rel-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rel-filter-row input {
  width: 80px;
  padding: 0.4rem 0.6rem;
  border: 1.5px solid rgba(212, 165, 165, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
}

.rel-matrix-wrap {
  overflow-x: auto;
}

.rel-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rel-matrix th,
.rel-matrix td {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(212, 165, 165, 0.15);
  text-align: center;
}

.rel-matrix th {
  background: rgba(212, 165, 165, 0.08);
  font-weight: 600;
  color: var(--plum);
  font-family: var(--font-serif);
}

.rel-matrix td.self { background: rgba(212, 165, 165, 0.05); color: var(--ink-soft); }

.rel-cell {
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.15s;
  min-width: 72px;
}

.rel-cell:hover { transform: scale(1.05); }

.rel-cell.friendly { background: rgba(157, 180, 160, 0.25); color: var(--sage-deep); }
.rel-cell.hostile { background: rgba(212, 100, 100, 0.2); color: #9A4040; }
.rel-cell.neutral { background: rgba(212, 165, 165, 0.1); color: var(--ink-soft); }

.rel-cell-value { font-weight: 700; font-size: 0.95rem; }
.rel-cell-sub { font-size: 0.65rem; opacity: 0.8; }

.rel-pairs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rel-pair-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid rgba(212, 165, 165, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.rel-pair-row:hover {
  border-color: var(--rose);
  box-shadow: var(--shadow);
}

.rel-pair-names {
  font-family: var(--font-serif);
  color: var(--plum);
  font-weight: 600;
}

.rel-pair-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.rel-stat-favor { color: var(--sage-deep); }
.rel-stat-hostile { color: #B85C5C; }

.rel-history-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rel-history-item {
  padding: 0.6rem 0.8rem;
  background: var(--cream);
  border-radius: 8px;
  font-size: 0.85rem;
  border-left: 3px solid transparent;
}

.rel-history-item.spike {
  border-left-color: #E85D5D;
  background: rgba(232, 93, 93, 0.06);
}

.rel-history-item .rel-chapter {
  font-size: 0.7rem;
  color: var(--rose-deep);
  font-weight: 600;
}

.rel-modal-charts {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow-x: auto;
}

.rel-type-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-weight: 600;
}

.rel-type-badge.friendly { background: rgba(157, 180, 160, 0.25); color: var(--sage-deep); }
.rel-type-badge.hostile { background: rgba(212, 100, 100, 0.2); color: #9A4040; }
.rel-type-badge.neutral { background: rgba(212, 165, 165, 0.15); color: var(--ink-soft); }

.chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

.chart-legend span::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-favor::before { background: var(--sage-deep); }
.legend-hostile::before { background: #C97070; }
.legend-emotion::before { background: var(--plum-light); border-top: 1px dashed var(--plum-light); height: 0; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Toast & Loading ── */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--plum);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 24px;
  font-size: 0.85rem;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease;
}

.loading {
  position: fixed;
  inset: 0;
  background: rgba(253, 246, 240, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 150;
}

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(212, 165, 165, 0.3);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading span {
  font-size: 0.9rem;
  color: var(--plum);
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .inspiration-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .chat-panel {
    border-right: none;
    border-bottom: 1px solid rgba(212, 165, 165, 0.15);
    max-height: none;
  }
  .cards-panel { max-height: none; }
  .writing-layout { grid-template-columns: 1fr; }
  .chapter-sidebar { border-right: none; border-bottom: 1px solid rgba(212, 165, 165, 0.15); max-height: 200px; }
  .chapter-meta { grid-template-columns: 1fr; }
  .volume-fields .field-row { grid-template-columns: 1fr; }
  .focus-editor { padding: 1.5rem; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { position: static; max-height: none; }
  .outline-split { grid-template-columns: 1fr; }
  .outline-section-card.outline-main-col,
  .outline-section-card.outline-sub-col { min-height: 280px; }
  .outline-main-col #master-outline { min-height: 200px; }
  .subplot-fields .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .workspace-tabs { overflow-x: auto; }
  .tab { white-space: nowrap; font-size: 0.8rem; padding: 0.5rem 0.8rem; }
  .topbar, .home-main { padding: 1rem; }
}
