:root {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent: #d4af37; /* Metallic Gold */
  --border: #333333;
  --font-serif: 'Merriweather', serif;
  --font-sans: 'Inter', sans-serif;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-serif);
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
  z-index: 10;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.phase-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  margin-left: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Main Layout */
main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
aside {
  width: 320px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tree-node {
  margin-bottom: 1.5rem;
}

.vol-node {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.ch-node {
  margin-left: 1rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  transition: color 0.2s;
  cursor: default;
}

.ch-node:hover {
  color: var(--text-primary);
  border-left-color: var(--accent);
}

/* Workbench Area */
.workbench {
  flex: 1;
  padding: 3rem;
  overflow-y: auto;
  max-width: 1000px; /* Increased width */
  margin: 0 auto;
}

.stage-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 300; /* Lighter serif weight */
}

.instruction {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  font-size: 1rem;
  max-width: 600px;
}

/* Forms */
textarea {
  width: 100%;
  height: 200px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.6;
  border-radius: 6px;
  resize: vertical;
  margin-bottom: 2rem;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #333;
}

button {
  background: var(--accent);
  color: #121212;
  border: none;
  padding: 0.8rem 2rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
}

button:hover {
  background: #e5c146;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

/* Dredge Results Grid */
.dredge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  animation: fadeIn 0.4s ease-out;
}

.result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin-left: 1rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* Chapter List specific styles (overriding dynamic ones for consistency) */
.chapter-item { 
  padding: 1rem; 
  border: 1px solid var(--border); 
  margin-bottom: 0.75rem; 
  cursor: pointer; 
  transition: all 0.2s; 
  background: var(--bg-tertiary); 
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-item:hover { 
  background: #333; 
  border-color: var(--accent); 
  transform: translateX(4px);
}

.status-dot { 
  display: inline-block; 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: #444; 
}
.status-dot.done { 
  background: var(--accent); 
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Scholarly List Expansion */
.scholarly-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scholarly-list li {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: flex-start;
  animation: fadeIn 0.3s ease forwards;
}

.scholarly-list li .index {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--accent);
  margin-right: 1.5rem;
  margin-top: 0.2rem;
  min-width: 20px;
}

.scholarly-list li .heading-title {
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--text-primary);
}

.headings-proposal {
  margin-top: 1rem;
}
