/* ── Outliner (Feature 5) ──────────────────────────────────────────────── */

.outliner-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.outliner-toolbar {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.outliner-filter {
  flex: 1;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-ui, system-ui, sans-serif);
  outline: none;
  transition: border-color 0.15s;
}

.outliner-filter:focus {
  border-color: var(--accent);
}

.outliner-count {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.outliner-scroll {
  flex: 1;
  overflow: auto;
}

.outliner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.outliner-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.outliner-table th:hover {
  color: var(--text);
}

.outliner-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
  vertical-align: middle;
}

.outliner-row:hover td {
  background: var(--surface);
}

/* Column widths */
.outliner-col-num {
  width: 36px;
  color: var(--muted);
  text-align: center;
}

.outliner-col-title {
  min-width: 160px;
  max-width: 260px;
}

.outliner-title-text {
  cursor: pointer;
  display: block;
}

.outliner-title-text:hover {
  text-decoration: underline;
}

.outliner-title-input {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  font-family: inherit;
  outline: none;
}

/* Synopsis column */
.outliner-col-synopsis {
  width: 40%;
}

textarea.outliner-synopsis {
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.82rem;
  color: var(--text);
  font-family: inherit;
  line-height: 1.4;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}

textarea.outliner-synopsis:focus {
  border-color: var(--accent);
  background: var(--surface);
}

/* Status column */
.outliner-col-status {
  width: 80px;
}

select.outliner-status {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

/* Label column */
.outliner-col-label {
  width: 44px;
  text-align: center;
}

input[type="color"].outliner-label-color {
  width: 28px;
  height: 24px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
  display: block;
  margin: 0 auto;
}

/* Word count column */
.outliner-col-wc {
  width: 64px;
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}

/* POV column */
.outliner-col-pov {
  width: 100px;
}

input.outliner-pov {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.82rem;
  color: var(--text);
  font-family: inherit;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  outline: none;
}

input.outliner-pov:focus {
  border-color: var(--accent);
}

/* Folder header rows */
.outliner-folder-row td {
  background: var(--surface);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
}

/* Total row */
.outliner-total-row td {
  border-top: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
}

.outliner-total-wc {
  text-align: right;
}

/* ── Custom Metadata Fields (Feature 16) ──────────────────────────────── */

.custom-meta-field-row {
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.custom-meta-field-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.custom-meta-field-input,
.custom-meta-field-select {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.custom-meta-field-input:focus,
.custom-meta-field-select:focus {
  border-color: var(--accent);
}

.custom-meta-field-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.custom-meta-empty {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.custom-meta-manage-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

.custom-meta-manager {
  padding: 0.5rem;
}

.custom-meta-def-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}

.custom-meta-def-name {
  color: var(--text);
}

.custom-meta-def-delete {
  background: none;
  border: none;
  color: var(--error, #ef4444);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0 0.25rem;
}

.custom-meta-def-delete:hover {
  text-decoration: underline;
}

.custom-meta-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  align-items: center;
}

.custom-meta-add-name {
  flex: 1;
  min-width: 120px;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.custom-meta-add-name:focus {
  border-color: var(--accent);
}

.custom-meta-add-type,
.custom-meta-add-options {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  font-family: inherit;
  outline: none;
}

.custom-meta-add-options {
  flex: 1;
  min-width: 120px;
}

.custom-meta-add-submit {
  padding: 0.3rem 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.83rem;
  font-family: inherit;
  transition: opacity 0.15s;
}

.custom-meta-add-submit:hover {
  opacity: 0.88;
}

/* ── Project Notes (Feature 7) ────────────────────────────────────────── */

.project-notes-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-notes-editor .ProseMirror {
  min-height: 200px;
  padding: 0.75rem;
  outline: none;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  font-family: var(--font-body, Georgia, serif);
}

.project-notes-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--muted);
  float: left;
  pointer-events: none;
  height: 0;
}

textarea.project-notes-textarea {
  flex: 1;
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  font-family: var(--font-body, Georgia, serif);
  box-sizing: border-box;
}
