* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f7f7f4;
    color: #1f2933;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

a {
    color: #0f6f68;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
.button {
    align-items: center;
    background: #1f6f64;
    border: 1px solid #1f6f64;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
}

button.secondary,
.button.secondary {
    background: #fff;
    color: #1f2933;
    border-color: #c6cbd1;
}

button.danger,
.button.danger {
    background: #b42318;
    border-color: #b42318;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #c6cbd1;
    border-radius: 6px;
    color: #1f2933;
    font: inherit;
    padding: 10px 12px;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 16px;
}

.page-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.brand {
    color: #141a21;
    font-size: 20px;
    font-weight: 800;
}

.muted {
    color: #667085;
}

.notice {
    background: #e7f4ef;
    border: 1px solid #9fd4c1;
    border-radius: 6px;
    margin: 14px 0;
    padding: 10px 12px;
}

.errors {
    background: #fff0ed;
    border: 1px solid #ffb4a8;
    border-radius: 6px;
    margin: 14px 0;
    padding: 10px 12px;
}

.story-list {
    display: grid;
    gap: 16px;
}

.story-card,
.panel {
    background: #fff;
    border: 1px solid #dde1e5;
    border-radius: 8px;
    overflow: hidden;
}

.story-card-body,
.panel-body {
    padding: 16px;
}

.cover,
.cover-placeholder {
    aspect-ratio: 16 / 10;
    background: #d9e1df;
    object-fit: cover;
    width: 100%;
}

.cover-placeholder {
    align-items: center;
    color: #53625f;
    display: flex;
    font-weight: 700;
    justify-content: center;
}

.story-title {
    font-size: 28px;
    line-height: 1.15;
    margin: 12px 0;
}

.story-text {
    background: #fff;
    border: 1px solid #dde1e5;
    border-radius: 8px;
    font-size: 18px;
    margin: 18px 0;
    padding: 18px;
    white-space: normal;
}

.story-text p {
    margin: 0 0 16px;
}

.story-text p:last-child {
    margin-bottom: 0;
}

.audio {
    width: 100%;
    margin: 10px 0 4px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comments {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.comment {
    background: #fff;
    border: 1px solid #dde1e5;
    border-radius: 8px;
    padding: 12px;
}

.comment-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

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

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

.admin-nav {
    background: #141a21;
    color: #fff;
    padding: 18px;
}

.admin-nav a,
.admin-nav button {
    color: #fff;
}

.admin-nav nav {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.admin-main {
    padding: 22px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    background: #fff;
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

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

th {
    background: #edf1f1;
}

.inline-form {
    display: inline;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.pagination {
    margin-top: 18px;
}

@media (max-width: 760px) {
    .page {
        padding: 12px;
    }

    .story-title {
        font-size: 24px;
    }

    .story-text {
        font-size: 17px;
        padding: 14px;
    }

    .admin-shell {
        display: block;
    }

    .admin-nav {
        position: static;
    }

    .admin-main {
        padding: 14px;
    }
}
