* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #17202a;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: #176b87;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: #111820;
    color: #fff;
    border-bottom: 4px solid #2fa36b;
}

.site-header-inner,
.page-shell,
.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2fa36b;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #d9e2e7;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 14px;
}

.main-nav a.active,
.main-nav a:hover {
    background: #25313d;
    color: #fff;
    text-decoration: none;
}

.page-shell {
    padding: 24px 0 40px;
}

.utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.search-form,
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.search-form {
    max-width: 620px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #c8d2da;
    background: #fff;
    color: #17202a;
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid #176b87;
    background: #176b87;
    color: #fff;
    border-radius: 6px;
    padding: 0 14px;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.button:hover,
button:hover {
    text-decoration: none;
    background: #12566c;
}

.button-strong {
    background: #2f7d4f;
    border-color: #2f7d4f;
}

.button-strong:hover {
    background: #266640;
}

.button-ghost {
    background: #fff;
    color: #176b87;
}

.button-ghost:hover {
    background: #e9f4f6;
}

.button-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.favorites-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #d0a541;
    background: #fff8e6;
    color: #6b4d0b;
    border-radius: 6px;
    white-space: nowrap;
}

.hero-band,
.detail-panel,
.form-panel,
.content-section,
.thread-card,
.empty-state {
    background: #fff;
    border: 1px solid #dce3e8;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.hero-band {
    padding: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.hero-band h1,
.page-title h1,
.form-panel h1,
.detail-panel h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.eyebrow {
    margin: 0 0 8px;
    color: #60717f;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.category-tile {
    display: grid;
    gap: 6px;
    min-height: 150px;
    padding: 18px;
    background: #fff;
    border: 1px solid #dce3e8;
    border-radius: 8px;
    color: #17202a;
}

.category-tile:hover {
    border-color: #2fa36b;
    text-decoration: none;
}

.category-tile span {
    font-size: 18px;
    font-weight: 700;
}

.category-tile strong {
    color: #2f7d4f;
    font-size: 34px;
}

.category-tile small {
    color: #60717f;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-title h1,
.section-title h2 {
    margin: 0;
}

.page-title,
.form-panel,
.content-section,
.detail-panel {
    padding: 22px;
    margin-bottom: 18px;
}

.thread-card {
    padding: 18px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
}

.thread-card h2 {
    margin: 6px 0 8px;
    font-size: 22px;
}

.thread-card p {
    margin: 0;
    color: #445260;
}

.thread-meta,
.thread-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: #60717f;
    font-size: 13px;
}

.thread-tags {
    margin-top: 12px;
}

.thread-tags span,
.thread-meta span,
.thread-meta a {
    background: #eef3f6;
    color: #43515d;
    border-radius: 999px;
    padding: 3px 9px;
}

.thread-actions,
.row-actions,
.detail-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.attachment-strip {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
}

.attachment-pill,
.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafb;
    border: 1px solid #e4eaee;
    border-radius: 6px;
    padding: 10px;
}

.attachment-pill span,
.file-row span {
    display: block;
    color: #60717f;
    font-size: 13px;
}

.file-list {
    display: grid;
    gap: 8px;
}

.music-player {
    border-color: #cddce0;
    background: #fbfcfd;
}

.music-player-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.music-player h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.music-player audio {
    width: 100%;
    display: block;
    margin: 10px 0 12px;
}

.player-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.track-list {
    display: grid;
    gap: 8px;
}

.track-row {
    width: 100%;
    min-height: 54px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid #d8e2e7;
    background: #fff;
    color: #17202a;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: left;
    white-space: normal;
}

.track-row:hover,
.track-row.active {
    border-color: #2fa36b;
    background: #eef8f2;
}

.track-row span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #17202a;
    font-weight: 700;
}

.track-row small {
    color: #60717f;
    white-space: nowrap;
}

.player-status {
    margin: 12px 0 0;
}

.abduction-hero {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 18px;
    color: #eef8f2;
    background: #111820;
    border: 1px solid #25313d;
    border-radius: 8px;
    overflow: hidden;
}

.abduction-hero h1 {
    max-width: 760px;
    margin: 0;
    color: #fff;
    font-size: 34px;
    line-height: 1.15;
}

.abduction-hero p {
    max-width: 680px;
    color: #d9e2e7;
    margin: 12px 0 0;
}

.abduction-hero .eyebrow {
    color: #8fd6b0;
}

.abduction-hero img {
    width: 130px;
    max-width: 28vw;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: #fff;
}

.abduction-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 18px;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.choice-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    border: 1px solid #dce3e8;
    border-radius: 6px;
    padding: 12px;
}

.choice-row legend {
    padding: 0 6px;
    color: #344352;
    font-weight: 700;
}

.choice-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 400;
}

.choice-row input {
    width: auto;
}

.abduction-aside {
    margin-bottom: 0;
}

.abduction-report {
    display: grid;
    gap: 5px;
    padding: 12px 0;
    border-bottom: 1px solid #e4eaee;
}

.abduction-report:last-child {
    border-bottom: 0;
}

.abduction-report strong {
    color: #17202a;
}

.abduction-report span,
.abduction-report small {
    color: #60717f;
    font-size: 13px;
}

.abduction-report p {
    margin: 0;
    color: #344352;
}

.body-copy {
    margin-top: 18px;
    color: #27323c;
}

.stacked-form {
    display: grid;
    gap: 14px;
}

.stacked-form label {
    display: grid;
    gap: 6px;
    color: #344352;
    font-weight: 700;
}

.compact-form {
    margin-top: 18px;
    max-width: 720px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.reply {
    background: #f8fafb;
    border: 1px solid #e4eaee;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.reply span {
    color: #60717f;
    font-size: 13px;
    margin-left: 8px;
}

.flash {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.flash-success {
    background: #e9f7ef;
    color: #1f6b3d;
    border: 1px solid #b8e0c8;
}

.flash-error {
    background: #fff0f0;
    color: #9a2b2b;
    border: 1px solid #f0c0c0;
}

.empty-state,
.muted {
    color: #60717f;
}

.empty-state {
    padding: 20px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 34px;
    color: #60717f;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-side {
    background: #111820;
    color: #fff;
    padding: 22px;
}

.admin-side a {
    display: block;
    color: #d9e2e7;
    padding: 10px;
    border-radius: 6px;
    margin-top: 4px;
}

.admin-side a.active,
.admin-side a:hover {
    background: #25313d;
    color: #fff;
    text-decoration: none;
}

.admin-main {
    padding: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #dce3e8;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e8edf1;
    vertical-align: top;
}

.admin-table th {
    background: #f8fafb;
    color: #344352;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    background: #fff;
    border: 1px solid #dce3e8;
    border-radius: 8px;
    padding: 16px;
}

.stat-card span {
    color: #60717f;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    color: #2f7d4f;
}

@media (max-width: 820px) {
    .site-header-inner,
    .utility-row,
    .hero-band,
    .abduction-hero,
    .section-title,
    .music-player-top,
    .file-row,
    .attachment-pill,
    .site-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .category-grid,
    .abduction-grid,
    .form-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .thread-card {
        grid-template-columns: 1fr;
    }

    .thread-actions,
    .row-actions,
    .detail-actions {
        justify-content: flex-start;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .track-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
