:root {
    --bg: #f7f6f1;
    --surface: #ffffff;
    --surface-2: #fffdf7;
    --text: #1f2a37;
    --muted: #586776;

    --primary: #1da9a2;
    --primary-strong: #0c7f7a;
    --primary-soft: #dff5f4;

    --accent: #ffd553;
    --accent-strong: #e9b92f;
    --accent-soft: #fff4c9;

    --danger: #b42318;
    --success: #166947;

    --border: #d7dee6;
    --radius-s: 12px;
    --radius-m: 18px;
    --radius-l: 26px;

    --shadow-soft: 0 10px 24px rgba(15, 44, 61, 0.08);
    --shadow-mid: 0 16px 36px rgba(15, 44, 61, 0.12);
    --shadow-hero: 0 24px 54px rgba(16, 62, 88, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% 10%, #fff6d8 0%, rgba(255, 246, 216, 0) 34%),
        radial-gradient(circle at 90% 0%, #def6f4 0%, rgba(222, 246, 244, 0) 38%),
        linear-gradient(180deg, #fffef9 0%, #f7f6f1 54%, #f1f8f9 100%);
    color: var(--text);
    line-height: 1.7;
    font-size: 18px;
}

a {
    color: var(--primary-strong);
    text-underline-offset: 0.12em;
}

.container {
    width: min(1060px, 92%);
    margin: 0 auto;
}

.site-header,
.admin-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.nav-inner,
.admin-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 74px;
    gap: 1rem;
}

.brand {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    color: #0e6f6b;
}

nav a,
.admin-nav a {
    margin-left: 0.7rem;
    text-decoration: none;
    font-weight: 700;
    padding: 0.5rem 0.72rem;
    border-radius: 11px;
    transition: background-color 0.2s ease, transform 0.12s ease;
}

nav a:hover,
.admin-nav a:hover {
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.hero {
    position: relative;
    overflow: hidden;
    margin: 1.4rem 0 2.1rem;
    padding: clamp(1.3rem, 4vw, 2.4rem);
    border-radius: var(--radius-l);
    border: 1px solid #eed89a;
    background:
        radial-gradient(circle at 15% 10%, #fff8dd 0%, rgba(255, 248, 221, 0) 36%),
        radial-gradient(circle at 84% 80%, #d9f7f3 0%, rgba(217, 247, 243, 0) 40%),
        linear-gradient(128deg, #fff2bf 0%, #fffdf7 44%, #d9f4f2 100%);
    box-shadow: var(--shadow-hero);
}

.hero-orb {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(1px);
}

.hero-orb-a {
    width: 220px;
    height: 220px;
    right: -70px;
    top: -76px;
    background: radial-gradient(circle, rgba(255, 225, 122, 0.78) 0%, rgba(255, 225, 122, 0) 72%);
}

.hero-orb-b {
    width: 280px;
    height: 280px;
    left: -110px;
    bottom: -150px;
    background: radial-gradient(circle, rgba(46, 180, 172, 0.34) 0%, rgba(46, 180, 172, 0) 74%);
}

.hero-orb-c {
    width: 160px;
    height: 160px;
    right: 28%;
    bottom: -90px;
    background: radial-gradient(circle, rgba(255, 245, 200, 0.75) 0%, rgba(255, 245, 200, 0) 74%);
}

.hero-kicker {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8c6800;
}

.beta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.45rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #d2bf75;
    background: rgba(255, 255, 255, 0.9);
    color: #5f6e7b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.hero h1 {
    margin: 0.32rem 0 0.62rem;
    max-width: 13ch;
    font-size: clamp(2.2rem, 7vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: #17303f;
    text-wrap: balance;
}

.hero-text {
    margin: 0 0 1.2rem;
    max-width: 50ch;
    font-size: clamp(1.06rem, 2.6vw, 1.22rem);
    color: #2f4556;
}

.hero-beta-note {
    margin: -0.45rem 0 1rem;
    max-width: 62ch;
    color: #566676;
    font-size: 0.95rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.hero-cta {
    border-color: #138b86;
    background: linear-gradient(160deg, #1fc0b7 0%, #0f8984 100%);
    box-shadow: 0 10px 24px rgba(12, 127, 122, 0.3);
}

.hero-cta:hover {
    background: linear-gradient(160deg, #1aaea6 0%, #0b746f 100%);
}

.hero-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    border: 1px solid #e5d79f;
    background: rgba(255, 255, 255, 0.78);
    color: #4b5f6f;
    font-size: 0.9rem;
    font-weight: 700;
}

.home-latest {
    margin-bottom: 2.35rem;
}

.home-feedback {
    margin: 0 0 2.2rem;
}

.feedback-box {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1.1rem;
    border: 1px solid #d8e5e9;
    border-radius: var(--radius-m);
    background: linear-gradient(160deg, #f6fcfb 0%, #fffdf8 100%);
}

.feedback-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    color: #1f3444;
}

.feedback-text {
    margin: 0 0 0.9rem;
    color: #4d6172;
    max-width: 62ch;
}

.feedback-link {
    min-width: 180px;
}

.home-levels {
    margin: 0 0 2rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.9rem;
}

.level-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(160deg, #ffffff 0%, #fffaf0 100%);
    border: 1px solid #e6ddc0;
    border-radius: var(--radius-m);
    padding: 0.95rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.14s ease, box-shadow 0.2s ease;
}

.level-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-mid);
}

.level-card p {
    margin: 0.45rem 0 0;
    color: #3c5062;
}

.level-count {
    display: block;
    margin-top: 0.42rem;
    color: #5c6f7e;
    font-size: 0.88rem;
    font-weight: 700;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff0b7 0%, #ffe38a 100%);
    border: 1px solid #ebc85a;
    color: #6a5100;
    font-weight: 800;
    font-size: 0.9rem;
}

.home-summary {
    margin: 0 0 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.summary-card {
    background: #fff;
    border: 1px solid #dde4eb;
    border-radius: var(--radius-m);
    padding: 0.85rem;
    box-shadow: var(--shadow-soft);
}

.summary-card strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.1;
    color: #17303f;
}

.summary-card span {
    color: #5f7080;
    font-size: 0.9rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.45rem, 4vw, 2rem);
}

.section-link {
    font-weight: 800;
}

.empty-note {
    margin: 0.8rem 0;
    color: var(--muted);
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.7rem 1.05rem;
    border-radius: 13px;
    border: 1px solid var(--primary);
    background: linear-gradient(160deg, #1db3ab 0%, #0f847f 100%);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 6px 14px rgba(13, 121, 116, 0.25);
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(13, 121, 116, 0.3);
    filter: saturate(1.05);
}

.btn-large {
    min-height: 50px;
    padding: 0.82rem 1.24rem;
}

.btn-muted {
    background: #fff;
    color: var(--primary-strong);
    border-color: #9ad8d2;
    box-shadow: none;
}

.btn-muted:hover {
    background: #f2fbfa;
    box-shadow: 0 5px 12px rgba(15, 127, 122, 0.1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
}

.card {
    display: block;
    background: var(--surface);
    border: 1px solid #dde4eb;
    border-radius: var(--radius-m);
    padding: 1.05rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-soft);
}

.flash {
    padding: 0.72rem 0.9rem;
    border-radius: var(--radius-s);
    margin-top: 1rem;
    font-size: 0.95rem;
}

.flash-success {
    background: #def7e9;
    border: 1px solid #a2d8b9;
    color: var(--success);
}

.flash-error {
    background: #ffe7e7;
    border: 1px solid #f3bbbb;
    color: var(--danger);
}

.filter-form,
.stack-form {
    display: grid;
    gap: 0.72rem;
    margin: 1rem 0 1.5rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd8e0;
    border-radius: 12px;
    padding: 0.68rem 0.76rem;
    background: #fff;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6fc9c4;
    box-shadow: 0 0 0 4px rgba(30, 169, 162, 0.14);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox input {
    width: auto;
}

.workflow-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.workflow-quick-action-btn {
    min-height: 40px;
    padding: 0.5rem 0.82rem;
    border-color: #b8d7df;
    background: #f4fbff;
    color: #285b73;
    font-size: 0.93rem;
}

.workflow-quick-action-btn:hover {
    background: #e9f7fd;
    box-shadow: 0 5px 12px rgba(24, 102, 137, 0.12);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

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

.inline-form {
    display: inline-block;
    margin-left: 0.45rem;
}

.inline-edit-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

.admin-card {
    max-width: 460px;
    margin: 2rem auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.admin-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.meta {
    color: var(--muted);
}

.admin-texts-head {
    margin: 1rem 0 0.75rem;
}

.admin-texts-tabs {
    margin: 0 0 1rem;
    padding: 0.45rem;
    border: 1px solid #dbe5ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.admin-texts-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.45rem 0.8rem;
    border-radius: 11px;
    border: 1px solid #cfe1ea;
    background: #f7fbfd;
    color: #355163;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.admin-texts-tab:hover {
    background: #edf8fb;
    border-color: #b9dce7;
}

.admin-texts-tab.is-active {
    border-color: #117f79;
    background: linear-gradient(160deg, #1cb2aa 0%, #0f857f 100%);
    color: #fff;
}

.admin-texts-section {
    margin: 0 0 1rem;
    padding: 0.95rem;
    border: 1px solid #dbe4ec;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: var(--shadow-soft);
}

.admin-texts-section--draft {
    border-color: #d9e1ea;
}

.admin-texts-section--review {
    border-color: #e6d7a8;
}

.admin-texts-section--approved {
    border-color: #c6dfcf;
}

.admin-texts-section--published {
    border-color: #b7dfe0;
}

.admin-texts-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.admin-texts-section-head h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #1f3444;
}

.admin-texts-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #d5e2ea;
    background: #f4f8fb;
    color: #4b6172;
    font-size: 0.85rem;
    font-weight: 800;
}

.workflow-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.16rem 0.58rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.workflow-badge--draft {
    background: #f2f5f8;
    border-color: #d5dde5;
    color: #425567;
}

.workflow-badge--review {
    background: #fff7dd;
    border-color: #ebd79b;
    color: #6f580a;
}

.workflow-badge--approved {
    background: #e9f8ef;
    border-color: #b7deca;
    color: #1f6a4b;
}

.workflow-badge--published {
    background: #e8f9f8;
    border-color: #b8dfdc;
    color: #0f6f6a;
}

.taxonomy-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.16rem 0.58rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.taxonomy-badge--category {
    background: #f4eefc;
    border-color: #dacdf0;
    color: #4c3d68;
}

.taxonomy-badge--level {
    background: #eef7ff;
    border-color: #cfe0f0;
    color: #2c4f6b;
}

.taxonomy-badge--empty {
    background: #f4f6f8;
    border-color: #dde3e8;
    color: #627181;
}

.taxonomy-fields {
    margin: 0.25rem 0;
    padding: 0.85rem;
    border: 1px solid #d9e3eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #f9fcfe 0%, #ffffff 100%);
}

.taxonomy-fields legend {
    padding: 0 0.35rem;
    color: #355264;
    font-size: 0.92rem;
    font-weight: 800;
}

.taxonomy-field + .taxonomy-field {
    margin-top: 0.65rem;
}

.taxonomy-field-label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 800;
}

.taxonomy-field-help {
    margin: 0.3rem 0 0;
    color: #5c7080;
    font-size: 0.86rem;
}

.admin-texts-empty {
    margin: 0.2rem 0 0;
}

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

.admin-texts-table {
    margin: 0;
    min-width: 640px;
}

.admin-texts-table th {
    color: #53697b;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 800;
}

.admin-texts-title {
    color: #203241;
}

.admin-texts-actions {
    white-space: nowrap;
}

.admin-texts-action-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.26rem 0.58rem;
    border-radius: 9px;
    border: 1px solid #c5d9e3;
    background: #f7fbfe;
    color: #33556a;
    text-decoration: none;
    font-weight: 700;
}

.admin-texts-action-link:hover {
    background: #edf7fc;
}

.admin-texts-delete-form {
    margin-left: 0.34rem;
}

.admin-texts-action-delete {
    min-height: 34px;
    padding: 0.26rem 0.58rem;
    border-radius: 9px;
    border: 1px solid #efc7c7;
    background: #fff5f5;
    color: #8a2d2d;
    box-shadow: none;
    font-weight: 700;
}

.admin-texts-action-delete:hover {
    background: #ffeaea;
    box-shadow: none;
}

.admin-taxonomy-layout {
    margin-top: 0.2rem;
}

.admin-taxonomy-panel {
    margin-bottom: 0;
}

.admin-taxonomy-form {
    margin: 0.15rem 0 0;
}

.admin-taxonomy-list {
    display: grid;
    gap: 0.7rem;
}

.admin-taxonomy-item {
    border: 1px solid #dce5ec;
    border-radius: 14px;
    background: #fff;
    padding: 0.72rem;
}

.admin-taxonomy-item-head {
    margin-bottom: 0.5rem;
}

.admin-taxonomy-item-body {
    display: grid;
    gap: 0.42rem;
}

.admin-taxonomy-edit-form {
    margin-bottom: 0;
}

.admin-taxonomy-edit-stack {
    margin: 0;
    gap: 0.42rem;
}

.texts-overview {
    margin: 1.2rem 0 2.1rem;
}

.texts-overview-header h1 {
    margin-bottom: 0.3rem;
    font-size: clamp(2rem, 5vw, 2.7rem);
    line-height: 1.12;
}

.texts-overview-header p {
    margin-top: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.texts-filter-panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(148deg, #fff9e4 0%, #ffffff 42%, #edfbf9 100%);
    border: 1px solid #ebdfbb;
    border-radius: var(--radius-m);
    padding: 1.05rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-soft);
}

.texts-filter-panel::after {
    content: "";
    position: absolute;
    top: -36px;
    right: -30px;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 220, 102, 0.28) 0%, rgba(255, 220, 102, 0) 72%);
    pointer-events: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.filter-grid label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 800;
    font-size: 0.96rem;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.58rem;
    margin-top: 0.85rem;
}

.filter-note {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
}

.result-count {
    margin: 0.15rem 0 1rem;
    color: #4b5e6f;
    font-weight: 700;
}

.active-filters-label {
    color: var(--muted);
    font-weight: 800;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.76rem;
    border-radius: 999px;
    border: 1px solid #ebda93;
    background: linear-gradient(180deg, #fff9dd 0%, #fff0b8 100%);
    color: #6b550d;
    font-size: 0.9rem;
    font-weight: 800;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.meta-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(141, 106, 0, 0.14);
}

.text-card-grid {
    gap: 1.15rem;
}

.text-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.text-card-accent {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #ffd451 0%, #6ad4cb 100%);
    opacity: 0.9;
}

.text-card:hover {
    transform: translateY(-4px);
    border-color: #c9d9e3;
    box-shadow: var(--shadow-mid);
}

.text-card h2,
.text-card h3 {
    margin: 0.25rem 0 0;
    font-size: 1.26rem;
    line-height: 1.28;
}

.text-card-excerpt {
    margin: 0;
    color: #3a4f60;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-card-excerpt-muted {
    color: #7b8895;
    font-style: italic;
}

.text-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.43rem;
}

.text-card-link-wrap {
    margin: 0.14rem 0 0;
}

.text-card-link {
    font-weight: 800;
}

.empty-state {
    background: #fff;
    border: 1px dashed #cfdce7;
    border-radius: var(--radius-m);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.empty-state h2 {
    margin-top: 0;
    margin-bottom: 0.45rem;
}

.empty-state p {
    margin: 0.4rem 0 0;
}

.reading-stage {
    position: relative;
    margin: 1.1rem 0 2.2rem;
    padding: 0.2rem 0;
}

.reading-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 32px;
    background:
        radial-gradient(circle at 100% 10%, rgba(255, 224, 118, 0.24) 0%, rgba(255, 224, 118, 0) 32%),
        radial-gradient(circle at 0% 85%, rgba(36, 168, 160, 0.15) 0%, rgba(36, 168, 160, 0) 32%);
    pointer-events: none;
}

.reading-article {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.reading-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reading-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.back-link {
    color: var(--primary-strong);
    text-decoration: none;
    font-weight: 800;
}

.back-link:hover,
.back-link:focus {
    text-decoration: underline;
}

.reading-header h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(2rem, 5.5vw, 3rem);
    line-height: 1.14;
    text-wrap: balance;
}

.reading-label {
    margin: 0 0 0.35rem;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6a7a87;
}

.reading-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.46rem;
    margin-bottom: 0.85rem;
}

.reading-excerpt {
    margin: 0 0 1rem;
    color: #364e60;
    font-size: 1.08rem;
}

.reading-body,
.print-body {
    font-size: clamp(1.16rem, 2.8vw, 1.34rem);
    line-height: 2;
    letter-spacing: 0.012em;
}

.reading-body {
    background: linear-gradient(180deg, #fffef8 0%, #ffffff 100%);
    border: 1px solid #ebdfbf;
    border-radius: 22px;
    padding: clamp(1rem, 3vw, 1.9rem);
    box-shadow: var(--shadow-mid);
}

.reading-body p,
.print-body p {
    margin: 0 0 1.08em;
}

.reading-body p:last-child,
.print-body p:last-child {
    margin-bottom: 0;
}

.reading-stage.reading-mode-active .reading-article {
    max-width: 920px;
}

.reading-stage.reading-mode-active .reading-body {
    max-width: 720px;
    margin: 0 auto;
    font-size: clamp(1.28rem, 3.2vw, 1.62rem);
    line-height: 2.25;
    letter-spacing: 0.008em;
    background: #fffefb;
    border: 1px solid #dfd3ad;
    border-radius: 24px;
    box-shadow: 0 18px 34px rgba(34, 44, 56, 0.12);
    padding: clamp(1.2rem, 3.4vw, 2.2rem);
}

.reading-stage.reading-mode-active .reading-excerpt {
    max-width: 55ch;
    margin-inline: auto;
}

.print-page {
    background: #fff;
    color: #111;
}

.print-wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.2rem;
}

.print-sheet {
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.print-brand {
    margin: 0 0 0.3rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5f6e7c;
}

.print-header h1 {
    margin: 0 0 0.7rem;
    font-size: 1.8rem;
    line-height: 1.2;
}

.print-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.8rem;
    color: #2f3e4d;
    font-size: 0.92rem;
}

.print-meta span {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d5dde6;
    border-radius: 999px;
    padding: 0.16rem 0.56rem;
    background: #f9fbfd;
}

.print-divider {
    margin: 0 0 0.95rem;
    border: 0;
    border-top: 1px solid #dbe2ea;
}

.print-footer {
    margin-top: 1.2rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e4e9ef;
    color: #677886;
    font-size: 0.82rem;
    text-align: right;
}

.site-footer {
    margin-top: 2.2rem;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.75);
}

.footer-inner {
    padding: 1rem 0 1.4rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.footer-nav a {
    text-decoration: none;
    font-weight: 700;
    color: #456173;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-note {
    margin: 0;
    color: #6d7b88;
    font-size: 0.9rem;
}

.legal-page {
    max-width: 760px;
    margin: 1.2rem auto 2rem;
    background: #fff;
    border: 1px solid #dde4eb;
    border-radius: var(--radius-m);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-soft);
}

.legal-page h1 {
    margin-top: 0;
}

.legal-page h2 {
    margin-top: 1.2rem;
    margin-bottom: 0.35rem;
    font-size: 1.12rem;
}

.legal-page p {
    margin: 0.32rem 0 0;
}

@media (min-width: 760px) {
    .filter-form {
        grid-template-columns: 2fr 1fr 1fr auto;
        align-items: end;
    }

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

    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .taxonomy-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .taxonomy-field + .taxonomy-field {
        margin-top: 0;
    }
}

@media (max-width: 760px) {
    body {
        font-size: 17px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .reading-topbar,
    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .reading-actions {
        width: 100%;
    }

    .reading-actions .btn {
        width: 100%;
        text-align: center;
    }

    .reading-stage.reading-mode-active .reading-body {
        max-width: 100%;
        font-size: clamp(1.2rem, 5vw, 1.4rem);
        line-height: 2.05;
        padding: 1rem 0.95rem;
    }

    .hero h1 {
        max-width: 100%;
    }

    .hero-kicker {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.28rem;
    }

    .beta-badge {
        margin-left: 0;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .btn,
    button {
        min-height: 48px;
    }

    .filter-actions .btn,
    .filter-actions button {
        width: 100%;
    }

    .result-count {
        margin-top: 0.55rem;
    }

    .footer-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .feedback-link {
        width: 100%;
    }

    .admin-texts-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-texts-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-texts-tab {
        width: 100%;
    }

    .admin-texts-section {
        padding: 0.75rem;
    }

    .admin-texts-actions {
        white-space: normal;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .admin-texts-delete-form {
        margin-left: 0;
    }

    .admin-texts-action-link,
    .admin-texts-action-delete {
        min-height: 38px;
    }

    .workflow-quick-actions .workflow-quick-action-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-taxonomy-item {
        padding: 0.62rem;
    }

    .admin-taxonomy-item-body .inline-form {
        margin-left: 0;
    }
}

@media print {
    @page {
        size: A4;
        margin: 14mm 12mm;
    }

    .site-header,
    .admin-header,
    .btn,
    button,
    form,
    .reading-topbar,
    .back-link,
    .hero-orb,
    .text-card-accent {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .print-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .print-sheet {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .print-header h1 {
        font-size: 18pt;
    }

    .print-meta {
        color: #000;
        font-size: 11pt;
    }

    .print-meta span {
        border-color: #aeb6bf;
        background: #fff;
    }

    .print-brand,
    .print-footer {
        color: #000;
    }

    .print-body {
        font-size: 12pt;
        line-height: 1.6;
    }

    .reading-body,
    .card,
    .admin-card,
    .texts-filter-panel,
    .hero {
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }
}
