/* ─── stories module styles (v10.23) ──────────────────────────────
   Panel chrome (overlay, header, close) comes from module-lib.css.
   This file styles only what's INSIDE the panel body and the dialogs.

   Note: the embedded "stories tab" inside the tree person view shares
   most of its CSS with this module. Those shared selectors (.stories-row,
   .stories-list, .stories-stage-chip, .stories-prompts-section etc.)
   stay in styles.css since they are used by both surfaces. This file
   adds only what's specific to the standalone panel. */

/* Stories panel uses a wide layout */
.stories-panel .ml-panel-inner { max-width: 800px; }
.stories-panel .ml-panel-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* tab bar */
.stories-panel-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--accent2);
  flex-wrap: wrap;
}
.stories-panel-tab {
  cursor: pointer;
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--accent2);
  color: var(--dim);
  font-size: 0.88em;
  border-radius: 2px;
}
.stories-panel-tab:hover { color: var(--fg); }
.stories-panel-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(176,230,176,0.08);
}
/* the focus tab gets a distinct treatment so it visually anchors the
   per-person workflow on the right side of the tab bar */
.stories-panel-tab[data-tab="focus"] {
  margin-left: auto;
  color: #ffd070;
  border-color: rgba(255,208,112,0.4);
}
.stories-panel-tab[data-tab="focus"]:hover { background: rgba(255,208,112,0.12); }
.stories-panel-tab[data-tab="focus"].active {
  color: #ffd070;
  border-color: #ffd070;
  background: rgba(255,208,112,0.14);
}

.stories-tab-pane {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: var(--mono, monospace);
}
.stories-note {
  padding: 8px 12px;
  background: rgba(255,208,112,0.06);
  border-left: 3px solid #ffd070;
  margin-bottom: 12px;
  font-size: 0.88em;
}
.stories-hint {
  font-size: 0.78em;
  margin-top: 4px;
}
.stories-section-label {
  font-size: 0.82em;
  color: var(--dim);
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── focus tab: member picker ───────────────────────────────────── */
.stories-focus-intro {
  color: var(--dim);
  font-size: 0.92em;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(176,230,176,0.04);
  border-left: 2px solid var(--accent2);
}
.stories-focus-intro p { margin: 0; line-height: 1.5; }

.stories-focus-search {
  margin-bottom: 10px;
}
#story-member-search {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--fg);
  padding: 8px 12px;
  font-family: var(--mono, monospace);
  font-size: 1em;
  border-radius: 2px;
}
#story-member-search:focus { outline: none; border-color: var(--accent); }

.stories-member-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.stories-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(176,230,176,0.06);
  cursor: pointer;
}
.stories-member-row:hover {
  background: rgba(176,230,176,0.06);
}
.stories-member-name {
  flex: 1;
  font-size: 0.94em;
  color: var(--fg);
}
.stories-member-dates {
  font-size: 0.78em;
  margin-left: 4px;
}
.stories-member-count {
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
  font-size: 0.78em;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(176,230,176,0.12);
  color: var(--accent);
}
.stories-member-count.empty {
  background: rgba(176,230,176,0.04);
  color: var(--dim);
  font-weight: normal;
}

/* ─── focused member view ────────────────────────────────────────── */
.stories-focus-head {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--accent2);
}
.stories-back-link {
  display: inline-block;
  color: var(--dim);
  font-size: 0.84em;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 6px;
}
.stories-back-link:hover { color: var(--accent); }
.stories-focus-name {
  font-size: 1.1em;
  color: var(--fg);
  margin-bottom: 8px;
}
.stories-focus-name strong { color: var(--accent); }
.stories-focus-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stories-focus-actions .btn {
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--fg);
  padding: 6px 14px;
  font-family: var(--mono, monospace);
  font-size: 0.88em;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
}
.stories-focus-actions .btn:hover {
  background: rgba(176,230,176,0.08);
  border-color: var(--accent);
}
.stories-focus-actions .btn.primary {
  color: #ffd070;
  border-color: rgba(255,208,112,0.4);
}
.stories-focus-actions .btn.primary:hover {
  background: rgba(255,208,112,0.14);
  border-color: #ffd070;
}
.stories-focus-actions .btn.small {
  padding: 4px 10px;
  font-size: 0.82em;
}

/* ─── dialog (uses ml-submodal chrome) ───────────────────────────── */
.stories-dialog .ml-submodal-inner {
  max-width: 600px;
}
.stories-dialog-prompt {
  padding: 12px 14px;
  background: rgba(255,208,112,0.08);
  border-left: 3px solid #ffd070;
  margin-bottom: 14px;
  font-size: 0.95em;
  font-style: italic;
  color: var(--fg);
}
.stories-dialog .ml-submodal-body .field { margin-bottom: 12px; }
.stories-dialog .ml-submodal-body label {
  display: block;
  color: var(--dim);
  font-size: 0.82em;
  margin-bottom: 3px;
}
.stories-dialog .ml-submodal-body input[type="text"],
.stories-dialog .ml-submodal-body textarea {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--fg);
  padding: 6px 8px;
  font-family: var(--mono, monospace);
  font-size: 0.92em;
}
.stories-dialog .ml-submodal-body textarea {
  resize: vertical;
  min-height: 200px;
}
.stories-dialog-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.stories-dialog-actions .btn {
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--fg);
  padding: 6px 14px;
  font-family: var(--mono, monospace);
  font-size: 0.88em;
  cursor: pointer;
  border-radius: 2px;
}
.stories-dialog-actions .btn:hover {
  background: rgba(176,230,176,0.08);
  border-color: var(--accent);
}
.stories-dialog-actions .btn.primary {
  color: var(--accent);
  border-color: var(--accent);
}
.stories-dialog-actions .btn.primary:hover {
  background: rgba(176,230,176,0.15);
}

@media (max-width: 700px) {
  .stories-panel-tabs { gap: 3px; padding: 6px 8px; }
  .stories-panel-tab { padding: 4px 8px; font-size: 0.82em; }
  .stories-panel-tab[data-tab="focus"] { margin-left: 0; }
  .stories-focus-actions { flex-direction: column; align-items: stretch; }
}
