/* ══════════════════════════════════════════════════════════════
   OnAirPlan – Themen
   ══════════════════════════════════════════════════════════════ */

/* ── Übersicht ── */
.th-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.th-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--th);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    transition: box-shadow .15s, transform .15s;
}
.th-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-1px); }
.th-card.th-inactive { opacity: .7; }
.th-card-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.th-card-head h3 { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; }
.th-chip-me {
    font-size: .68rem;
    font-weight: 700;
    color: var(--th);
    border: 1px solid var(--th);
    border-radius: 999px;
    padding: .05rem .5rem;
}
.th-card-desc {
    margin: 0;
    font-size: .85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.th-card-stats { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .8rem; }
.th-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid var(--border);
}
.th-card-lead { font-size: .72rem; color: var(--text-muted); text-align: right; }

.th-avatars { display: flex; }
.th-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--th, var(--primary));
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border: 2px solid var(--surface);
    flex-shrink: 0;
}
.th-avatars .th-avatar + .th-avatar { margin-left: -7px; }
.th-avatar.th-more { background: var(--surface-2); color: var(--text-muted); }

/* ── Themen-Seite ── */
.th-page { max-width: 1280px; }
.th-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 3px solid var(--th);
}
.th-head-main { flex: 1; min-width: 260px; }
.th-head-main h1 { margin: 0 0 .3rem; font-size: 1.5rem; display: flex; align-items: center; gap: .6rem; }
.th-head-main p { margin: 0 0 .6rem; color: var(--text-muted); }
.th-head-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.th-team { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; font-size: .82rem; }
.th-lead a { margin-left: .4rem; color: var(--primary); text-decoration: none; }
.th-member { display: inline-flex; align-items: center; gap: .3rem; }
.th-member .th-avatar { width: 22px; height: 22px; font-size: .6rem; border: none; }

.th-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1000px) { .th-cols { grid-template-columns: 1fr; } }

.th-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem 1rem;
    margin-bottom: 1.25rem;
}
.th-section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.th-section-head h2 {
    margin: 0;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}
.th-section-head h2 span {
    background: var(--surface-2);
    border-radius: 999px;
    padding: .05rem .45rem;
    margin-left: .3rem;
    font-size: .72rem;
}
.th-empty { color: var(--text-muted); font-size: .85rem; margin: .3rem 0; }

/* Stories */
.th-story {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .6rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--th);
    border-radius: var(--radius-sm);
    margin-bottom: .4rem;
}
.th-story.th-archived { opacity: .55; }
.th-story-main { flex: 1; min-width: 0; cursor: pointer; }
.th-story-main:hover .th-story-title { color: var(--primary); }
.th-story-title { font-weight: 600; font-size: .92rem; }
.th-type { font-size: .65rem; font-weight: 700; padding: .05rem .35rem; border-radius: 3px; margin-right: .3rem; vertical-align: 1px; }
.th-story-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.th-free { font-style: italic; }
.th-story-actions { display: flex; gap: .2rem; }

/* Sendeverlauf */
.th-timeline { display: flex; flex-direction: column; gap: .6rem; }
.th-tl-day { border-left: 2px solid var(--th); padding-left: .7rem; }
.th-tl-day.th-past { opacity: .55; border-left-style: dashed; }
.th-tl-day.th-today .th-tl-date { color: var(--th); }
.th-tl-date { font-size: .78rem; font-weight: 700; margin-bottom: .2rem; }
.th-tl-row {
    display: grid;
    grid-template-columns: 48px minmax(0, .8fr) minmax(0, 1.2fr);
    gap: .5rem;
    font-size: .82rem;
    padding: .15rem .3rem;
    border-radius: 4px;
    cursor: pointer;
}
.th-tl-row:hover { background: var(--surface-2); }
.th-tl-time { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.th-tl-show { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-tl-story { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Recherche-Sammlung */
.th-add { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.th-add-btn {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: .3rem .6rem;
    font-size: .8rem;
    cursor: pointer;
}
.th-add-btn:hover { border-color: var(--th); }
.th-upload { border-style: dashed; }
.th-join-hint { font-size: .85rem; color: var(--text-muted); margin-bottom: .6rem; }

.th-filter { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .6rem; }
.th-filter button {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: .75rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    cursor: pointer;
}
.th-filter button.active { background: var(--th); color: #fff; }

.th-entries { display: flex; flex-direction: column; gap: .5rem; min-height: 60px; border-radius: var(--radius-sm); }
.th-entries.th-drop { outline: 2px dashed var(--th); outline-offset: 4px; }

.th-entry {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .7rem;
    background: var(--bg);
}
.th-entry.th-pinned { border-color: var(--th); box-shadow: inset 3px 0 0 var(--th); }
.th-entry-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.th-entry-kind { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.th-entry-title { font-size: .9rem; }
.th-entry-by { margin-left: auto; font-size: .7rem; color: var(--text-muted); }
.th-entry-body { font-size: .88rem; line-height: 1.5; margin-top: .25rem; white-space: normal; }
.th-entry-actions { display: flex; gap: .2rem; justify-content: flex-end; margin-top: .35rem; }
.th-entry-actions .th-del:hover { color: var(--danger); }

.th-e-contact { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .88rem; align-items: baseline; }
.th-e-contact a, .th-e-link { color: var(--primary); text-decoration: none; word-break: break-all; }
.th-e-take { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .85rem; }
.th-e-take audio, .se-take-file audio { height: 32px; max-width: 100%; }
.th-e-dur { font-weight: 700; font-variant-numeric: tabular-nums; }
.th-e-img { display: block; max-width: 100%; max-height: 220px; border-radius: 4px; margin-top: .4rem; }

/* Auswahl-Listen in Modals */
.th-assign-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; }
.th-assign-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .88rem;
}
.th-assign-row:hover { border-color: var(--primary); background: var(--surface-2); }
.th-assign-row small { color: var(--text-muted); }

/* Farbwahl & Team im Formular */
.th-colors { display: flex; gap: .4rem; flex-wrap: wrap; }
.th-color input { display: none; }
.th-color span {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c);
    cursor: pointer;
    border: 3px solid transparent;
}
.th-color input:checked + span { border-color: var(--text); }
.th-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .25rem .75rem;
    max-height: 200px;
    overflow-y: auto;
    padding: .4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .3rem;
}
.th-people label { display: flex; align-items: center; gap: .35rem; font-size: .88rem; cursor: pointer; }

/* Pool: Themen-Etikett und Gruppen */
.th-badge {
    background: transparent;
    color: var(--th);
    border: 1px solid var(--th);
    cursor: pointer;
}
.pool-group { margin-bottom: 1rem; border-left: 3px solid var(--th); padding-left: .7rem; }
.pool-group-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    padding: .35rem 0;
    user-select: none;
}
.pool-group-count {
    background: var(--surface-2);
    border-radius: 999px;
    padding: .05rem .45rem;
    font-size: .72rem;
    color: var(--text-muted);
}
.pool-group-head .btn { margin-left: auto; }
.pool-group-body { display: flex; flex-direction: column; gap: .6rem; }

/* Story-Editor: Themen-Chip, Audio im Take */
.se-theme-chip {
    color: var(--th);
    border: 1px solid var(--th);
    border-radius: 999px;
    padding: .02rem .5rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}
.se-take-file { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .5rem; font-size: .8rem; color: var(--text-muted); }

/* Team mit dauerhaft sichtbaren Kontaktdaten */
.th-team {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .45rem .9rem;
    margin-top: .3rem;
}
.th-person {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    padding: .35rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.th-person-lead { border-color: var(--th); }
.th-person .th-avatar { width: 30px; height: 30px; font-size: .7rem; border: none; }
.th-person-info { min-width: 0; line-height: 1.3; }
.th-person-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-lead-tag {
    font-size: .62rem;
    font-weight: 700;
    color: var(--th);
    border: 1px solid var(--th);
    border-radius: 999px;
    padding: 0 .35rem;
    vertical-align: 1px;
}
.th-person-contact { display: flex; flex-wrap: wrap; gap: 0 .6rem; font-size: .76rem; }
.th-person-contact a {
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.th-person-contact a:hover { color: var(--primary); }
.th-nocontact { color: var(--text-muted); font-style: italic; opacity: .7; }

/* Abweichende Erreichbarkeit pro Thema */
.th-person { position: relative; }
.th-person-away { background: linear-gradient(0deg, var(--surface), var(--surface)), var(--surface); box-shadow: inset 3px 0 0 var(--warning); }
.th-person-contact a.th-tmp-phone { color: var(--warning); font-weight: 700; }
.th-person-contact a.th-secondary { opacity: .6; font-size: .7rem; }
.th-reach-note { font-size: .72rem; color: var(--warning); font-style: italic; margin-top: .1rem; }
.th-person-edit {
    margin-left: auto;
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
    padding: 0 .1rem;
}
.th-person:hover .th-person-edit, .th-person-edit:focus { opacity: 1; }
@media (hover: none) { .th-person-edit { opacity: .7; } }
