/* Speaker names are typed straight into the label; saving happens on Enter or leaving it. */
.epic-speaker { display: contents; }
.epic-speaker-input, .epic-speaker-input:focus { width: auto; min-width: 2em; max-width: 16em; field-sizing: content; margin: -2px 0; padding: 2px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; color: var(--epic-ink); font: inherit; line-height: inherit; }
.epic-workspace .epic-speaker-input { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.epic-speaker-input:hover { color: var(--epic-blue); }
.epic-speaker-input:focus { color: var(--epic-ink); text-decoration-color: transparent; }
.epic-speaker > .epic-save-status:empty { display: none; }
/* Each speaker keeps one colour mark through the transcript so turns can be told apart at a glance. */
.epic-speaker { --epic-speaker-tone: #0671e8; }
.epic-speaker[data-speaker-tone="1"] { --epic-speaker-tone: #0d9488; }
.epic-speaker[data-speaker-tone="2"] { --epic-speaker-tone: #d97706; }
.epic-speaker[data-speaker-tone="3"] { --epic-speaker-tone: #7c3aed; }
.epic-speaker[data-speaker-tone="4"] { --epic-speaker-tone: #db2777; }
.epic-speaker[data-speaker-tone="5"] { --epic-speaker-tone: #65a30d; }
.epic-source-line.has-speaker .epic-source-meta > .epic-speaker { gap: 6px 8px; }
.epic-source-line.has-speaker .epic-source-meta > .epic-speaker::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--epic-speaker-tone); }

.epic-term-add { padding: 24px; margin-bottom: 32px; border: 1px solid var(--epic-line); background: #fff; }
.epic-term-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; }
.epic-term-form textarea { resize: vertical; }
.epic-term-group + .epic-term-group { margin-top: 28px; }
.epic-term-group h2 { margin: 0 0 10px; color: var(--epic-muted); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.epic-term-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--epic-line); background: #fff; }
.epic-term-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 20px; padding: 16px 18px; border-bottom: 1px solid var(--epic-line); }
.epic-term-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.epic-term-name { font-size: 17px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.epic-term-kind { padding: 0 6px; border: 1px solid var(--epic-line); border-radius: 4px; color: var(--epic-muted); font-size: 12px; line-height: 1.7; white-space: nowrap; }
.epic-term-aliases { grid-column: 1; margin: 0; color: var(--epic-muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.epic-term-aliases span { margin-right: 8px; }
.epic-term-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 18px; }
.epic-term-actions form { display: inline-flex; }
.epic-term-publishable { padding: 0 6px; border: 1px solid #b4d1f7; border-radius: 4px; color: #0664cb; background: #f5faff; font-size: 12px; line-height: 1.7; white-space: nowrap; }
.epic-check { display: inline-flex; align-items: center; gap: 10px; width: fit-content; min-height: 44px; font-weight: 550; cursor: pointer; }
.epic-check input { flex-shrink: 0; width: 18px; height: 18px; margin: 0; accent-color: var(--epic-blue); cursor: pointer; }

.epic-term-picker { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--epic-line); }
.epic-term-picker > summary { width: fit-content; color: var(--epic-ink); font-size: 14px; line-height: 1.8; }
.epic-term-picker-count { margin-left: 10px; color: var(--epic-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.epic-term-picker-body { display: grid; gap: 12px; min-width: 0; max-height: 280px; margin: 12px 0 0; padding: 0; border: 0; overflow-y: auto; overscroll-behavior: contain; }
.epic-term-picker-heading { margin: 0 0 6px; color: var(--epic-muted); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.epic-term-picker-group ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.epic-term-option { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px; border: 1px solid var(--epic-line); border-radius: 6px; background: #fff; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.epic-term-option:has(input:checked) { border-color: #7aafed; background: #f5faff; color: #0664cb; }
.epic-term-option:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.epic-term-option input { flex-shrink: 0; accent-color: var(--epic-blue); }
.epic-term-select { min-width: 0; margin: 0; }
.epic-term-select > legend .epic-term-picker-count { font-weight: 400; }
.epic-term-select .epic-term-picker-body { margin-top: 0; }
@media (max-width: 760px) {
  .epic-term-add { padding: 18px 16px; }
  .epic-term-fields { grid-template-columns: minmax(0, 1fr); }
  .epic-term-row { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .epic-term-actions { grid-column: 1; grid-row: auto; }
}

/* Aliases are entered as tags inside one field. */
.epic-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 6px 8px; border: 1px solid #c5d2e3; border-radius: 6px; background: #fff; cursor: text; }
.epic-tag-list { display: contents; }
.epic-tag { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 10px; border-radius: 4px; background: #edf2f8; color: var(--epic-ink); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.epic-tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 4px; background: transparent; color: var(--epic-muted); font-size: 15px; line-height: 1; }
.epic-tag-remove:hover { background: #dde6f1; color: var(--epic-ink); }
.epic-tag-input, .epic-tag-input:focus { flex: 1 1 8em; min-width: 6em; padding: 4px 2px; border: 0; background: transparent; box-shadow: none; outline: none; font-size: 15px; line-height: 1.6; }
.epic-tag-input:disabled { display: none; }
.epic-tags textarea { display: none; }

/* Names to use are chosen as toggle chips; the checkbox stays for keyboard and screen readers. */
.epic-term-option { position: relative; cursor: pointer; }
.epic-term-option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.epic-term-option:hover { border-color: #b4d1f7; }
