:root {
    --navy-950: #071126;
    --navy-900: #0a1833;
    --navy-800: #102449;
    --navy-700: #173461;
    --navy-600: #20457c;
    --navy-500: #2d5fa7;
    --blue-100: #e9f1ff;
    --blue-50: #f5f8ff;
    --ink: #172033;
    --muted: #647089;
    --line: #dde5f2;
    --line-soft: #edf2fa;
    --surface: #ffffff;
    --soft: #f7f9fd;
    --accent: #f2b84b;
    --success: #10845b;
    --danger: #b42318;
    --shadow: 0 18px 55px rgba(7, 17, 38, 0.09);
    --radius: 8px;
    --sidebar: 308px;
    --bonusbar: 0px;
    --article-p: 18px;
    --article-h1: 56px;
    --article-h2: 34px;
    --article-h3: 20px;
}

* {
    box-sizing: border-box;
}

.is-hidden {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr) auto;
    align-items: center;
    min-height: 72px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.reading-progress {
    position: sticky;
    top: 72px;
    z-index: 20;
    overflow: hidden;
    height: 4px;
    margin: 0 0 14px;
    border-radius: 999px;
    background: rgba(45, 95, 167, 0.08);
    pointer-events: none;
}

.reading-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(32, 69, 124, 0.34), rgba(45, 95, 167, 0.62));
    border-radius: inherit;
    transition: width 90ms linear;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border: 0;
    border-right: 1px solid var(--line-soft);
    min-height: 72px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: background 150ms ease;
}

.brand:hover,
.brand:focus-visible {
    background: var(--blue-50);
    outline: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--navy-900);
    color: #fff;
    font-size: 20px;
}

.brand-title {
    display: grid;
    gap: 1px;
}

.brand-title strong {
    font-size: 15px;
    line-height: 1.1;
    color: var(--navy-950);
    letter-spacing: 0;
}

.brand-title span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.2;
}

.topbar-center {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 0 24px;
}

.mobile-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--navy-800);
    cursor: pointer;
    font-size: 22px;
}

.mobile-bonus {
    display: none;
    margin-left: auto;
}

.chapter-title-top {
    min-width: 0;
}

.chapter-title-top span {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-500);
}

.chapter-title-top strong {
    display: block;
    overflow: hidden;
    color: var(--navy-950);
    font-size: 16px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
    border-left: 1px solid var(--line-soft);
    min-height: 72px;
}

.icon-button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--navy-800);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.icon-button {
    width: 42px;
    height: 42px;
    font-size: 21px;
}

.icon-button.is-complete {
    border-color: rgba(16, 132, 91, 0.34);
    background: #f1fff8;
    color: var(--success);
}

.icon-button.is-complete:hover {
    border-color: var(--success);
    background: #e8fff4;
    color: var(--success);
}

.button {
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 800;
}

.button.primary {
    border-color: var(--navy-900);
    background: var(--navy-900);
    color: #fff;
}

.button:hover,
.icon-button:hover {
    border-color: var(--navy-500);
    color: var(--navy-900);
    background: var(--blue-50);
    transform: translateY(-1px);
}

.button.primary:hover {
    background: var(--navy-700);
    color: #fff;
}

.app {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

.sidebar,
.bonus-panel {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow: auto;
    background: #fff;
}

.sidebar {
    border-right: 1px solid var(--line);
}

.bonus-panel {
    position: fixed;
    top: 72px;
    right: 0;
    z-index: 60;
    width: 330px;
    max-width: calc(100vw - 28px);
    height: calc(100vh - 72px);
    border-left: 1px solid var(--line);
    transform: translateX(105%);
    transition: transform 180ms ease;
    box-shadow: -22px 0 45px rgba(7, 17, 38, 0.16);
}

.bonus-panel.open {
    transform: translateX(0);
}

.sidebar-inner,
.bonus-inner {
    padding: 22px;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100%;
}

.progress-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, var(--blue-50) 100%);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--navy-900);
    font-size: 13px;
    font-weight: 800;
}

.progress-track {
    overflow: hidden;
    height: 8px;
    border-radius: 99px;
    background: var(--line);
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--navy-700), var(--navy-500));
    transition: width 180ms ease;
}

.search-wrap {
    position: relative;
    margin-top: 18px;
}

.search-wrap i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--muted);
    transform: translateY(-50%);
    font-size: 20px;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    outline: 0;
    background: #fff;
}

.search-input:focus {
    border-color: var(--navy-500);
    box-shadow: 0 0 0 3px rgba(45, 95, 167, 0.12);
}

.side-section-title {
    margin: 24px 0 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

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

.chapter-link {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.chapter-link:hover {
    background: var(--blue-50);
    border-color: var(--line);
}

.chapter-link.active {
    background: var(--navy-900);
    color: #fff;
    border-color: var(--navy-900);
    box-shadow: 0 12px 30px rgba(7, 17, 38, 0.16);
}

.chapter-link.completed:not(.active) .chapter-number {
    background: rgba(16, 132, 91, 0.12);
    color: var(--success);
}

.chapter-number {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--blue-100);
    color: var(--navy-700);
    font-size: 12px;
    font-weight: 900;
}

.chapter-link.active .chapter-number {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.chapter-meta {
    min-width: 0;
}

.chapter-meta strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-meta span {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-link.active .chapter-meta span {
    color: rgba(255, 255, 255, 0.72);
}

.chapter-status {
    color: var(--muted);
    font-size: 18px;
}

.chapter-link.active .chapter-status {
    color: rgba(255, 255, 255, 0.75);
}

.reader {
    min-width: 0;
    background: linear-gradient(180deg, var(--soft) 0%, #fff 420px);
}

.cover-screen {
    display: grid;
    min-height: calc(100vh - 72px);
    padding: 58px 42px;
    background:
    radial-gradient(circle at 18% 12%, rgba(45, 95, 167, 0.12), transparent 30%),
    linear-gradient(180deg, #fff 0%, var(--blue-50) 100%);
    border-bottom: 1px solid var(--line);
}

.cover-screen.is-hidden {
    display: none;
}

.cover-screen-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 42px;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    align-items: center;
}

.book-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--blue-50);
    color: var(--navy-700);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cover-screen h1 {
    max-width: 620px;
    margin: 18px 0 14px;
    color: var(--navy-950);
    font-size: clamp(36px, 5vw, 62px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.96;
}

.cover-screen p {
    max-width: 660px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.cover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.cover-actions .button {
    min-height: 48px;
    padding: 0 18px;
    font-size: 15px;
}

.cover-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--navy-900);
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 5;
}

.cover-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 42px 70px;
}

.content-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.heading-toc {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    z-index: 40;
    width: min(420px, calc(100vw - 28px));
    max-height: min(430px, calc(100vh - 180px));
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 32px rgba(7, 17, 38, 0.07);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
}

.heading-toc.is-empty {
    display: none;
}

.heading-toc h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--navy-950);
    font-size: 13px;
    font-weight: 900;
}

.heading-toc nav {
    display: grid;
    gap: 4px;
}

.heading-toc button {
    display: block;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    text-align: left;
}

.heading-toc button:hover {
    background: var(--blue-50);
    color: var(--navy-900);
}

.heading-toc button.level-3 {
    padding-left: 18px;
    font-weight: 650;
}

.content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--blue-50);
    border-radius: 8px 8px 0 0;
}

.content-toolbar-info {
    min-width: 0;
}

.content-toolbar-info strong {
    display: block;
    overflow: hidden;
    color: var(--navy-900);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-toolbar-info span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.toolbar-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.article {
    max-width: 720px;
    margin: 0 auto;
    padding: 42px 42px 54px;
}

.article.loading {
    min-height: 420px;
}

.article h1,
.article h2,
.article h3 {
    color: var(--navy-950);
    line-height: 1.16;
    letter-spacing: 0;
    scroll-margin-top: 104px;
}

.article h1 {
    margin: 0 0 10px;
    font-size: clamp(34px, 5vw, var(--article-h1));
    font-weight: 900;
}

.article h2 {
    margin: 44px 0 14px;
    padding-top: 4px;
    font-size: clamp(24px, 3.2vw, var(--article-h2));
    font-weight: 900;
}

.article h3 {
    margin: 30px 0 10px;
    font-size: var(--article-h3);
    font-weight: 850;
}

.article p {
    margin: 14px 0;
    color: #26324a;
    font-size: var(--article-p);
}

.article strong {
    color: var(--navy-900);
    font-weight: 850;
}

.article ul,
.article ol {
    margin: 18px 0 18px 0;
    padding-left: 24px;
}

.article li {
    margin: 9px 0;
    color: #26324a;
    font-size: var(--article-p);
}

.article blockquote {
    margin: 28px 0;
    padding: 18px 22px;
    border-left: 4px solid var(--navy-600);
    border-radius: 0 8px 8px 0;
    background: var(--blue-50);
    color: var(--navy-900);
    font-weight: 700;
}

.article figure {
    margin: 30px 0;
}

.article figure img {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--blue-50);
    box-shadow: 0 14px 38px rgba(7, 17, 38, 0.08);
}

.article figure figcaption {
    margin-top: 9px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.video-embed {
    margin: 30px 0;
}

.video-frame {
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--navy-950);
    box-shadow: 0 14px 38px rgba(7, 17, 38, 0.08);
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-caption {
    margin-top: 9px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.article hr {
    height: 1px;
    margin: 34px 0;
    border: 0;
    background: var(--line);
}

.article code {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--blue-50);
    color: var(--navy-700);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

.article .worksheet-line {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 12px 0;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px dashed #b9c4d6;
    background: transparent;
    color: #26324a;
    outline: 0;
    resize: none;
    font: inherit;
    font-size: var(--article-p);
    line-height: 1.55;
    overflow: hidden;
}

.article .worksheet-line:focus {
    border-bottom-color: var(--navy-500);
    box-shadow: 0 2px 0 rgba(45, 95, 167, 0.12);
}

.article .worksheet-line::placeholder {
    color: #9aa7ba;
}

.article-nav {
    position: sticky;
    bottom: 0;
    z-index: 18;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 16px auto 0;
    padding: 10px;
    border-top: 1px solid rgba(221, 229, 242, 0.92);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
}

.toc-nav {
    position: relative;
}

.bonus-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.bonus-head h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: 18px;
    line-height: 1.2;
}

.bonus-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.bonus-list {
    display: grid;
    gap: 10px;
}

.bonus-download {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 28px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.bonus-download:hover {
    border-color: var(--navy-500);
    background: var(--blue-50);
    transform: translateY(-1px);
}

.bonus-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-top: 0;
    border-radius: 8px;
    background: var(--navy-900);
    color: #fff;
    font-size: 21px;
}

.bonus-icon i {
    display: block;
    line-height: 1;
}

.bonus-download strong {
    display: block;
    overflow: hidden;
    color: var(--navy-950);
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bonus-download > span:not(.bonus-icon),
.bonus-download > span:not(.bonus-icon) span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.bonus-download > i:last-child {
    color: var(--navy-600);
    font-size: 21px;
    transition: color 150ms ease, transform 150ms ease;
}

.bonus-download.is-loading {
    pointer-events: none;
    border-color: rgba(45, 95, 167, 0.36);
    background: var(--blue-50);
}

.bonus-download.is-complete {
    border-color: rgba(16, 132, 91, 0.32);
    background: #f1fff8;
}

.bonus-download.is-complete > i:last-child {
    color: var(--success);
    transform: scale(1.08);
}

.quick-card {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--blue-50);
}

.quick-card h3 {
    margin: 0 0 8px;
    color: var(--navy-950);
    font-size: 14px;
}

.quick-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.quick-card ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 78px;
    z-index: 80;
    display: none;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 13px 15px;
    border: 1px solid rgba(16, 132, 91, 0.28);
    border-radius: var(--radius);
    background: #f1fff8;
    color: var(--success);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 800;
}

.toast.show {
    display: flex;
}

.empty-state {
    padding: 42px;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    display: block;
    margin-bottom: 12px;
    color: var(--navy-500);
    font-size: 44px;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: none;
    background: rgba(7, 17, 38, 0.42);
}

.drawer-backdrop.show {
    display: block;
}

@media (max-width: 1180px) {
    .topbar-center::after {
    content: none;
    }

    .mobile-bonus {
    display: inline-flex;
    }
}

@media (max-width: 860px) {
    :root {
    --sidebar: 0px;
    }

    .topbar {
    grid-template-columns: minmax(0, 1fr);
    }

    .brand {
    display: none;
    }

    .mobile-menu {
    display: inline-flex;
    }

    .topbar-center {
    padding: 0 14px;
    }

    .app {
    grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    z-index: 60;
    width: 330px;
    max-width: calc(100vw - 28px);
    height: calc(100vh - 72px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 22px 0 45px rgba(7, 17, 38, 0.16);
    }

    .sidebar.open {
    transform: translateX(0);
    }

    .cover-screen-inner {
    grid-template-columns: minmax(0, 1fr);
    }

    .cover-screen {
    padding: 42px 22px;
    }

    .cover-card {
    width: 100%;
    max-width: none;
    }

    .content-shell {
    padding: 22px 14px 54px;
    }

    .article {
    padding: 30px 22px 40px;
    }

    .article p,
    .article li {
    font-size: var(--article-p);
    }
}

@media (max-width: 520px) {
    .cover-screen h1 {
    font-size: 36px;
    }

    .cover-screen p {
    font-size: 16px;
    }

    .chapter-title-top strong {
    font-size: 14px;
    }

    .button .label {
    display: none;
    }

    .content-toolbar {
    align-items: flex-start;
    }

    .article-nav {
    gap: 6px;
    padding: 8px;
    }

    .toc-nav {
    flex: 1 1 0;
    min-width: 0;
    }

    .article-nav .button {
    min-height: 38px;
    width: 100%;
    gap: 4px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    }

    .article-nav > .button {
    flex: 1 1 0;
    min-width: 0;
    }

    .article-nav .button i {
    font-size: 16px;
    }

    .toast {
    right: 30px;
    left: 30px;
    bottom: 75px;
    max-width: none;
    }
}

.user-badge {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.user-badge-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-500);
}

.user-badge strong {
    max-width: 180px;
    overflow: hidden;
    font-size: 13px;
    color: var(--navy-950);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-body,
.admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(45, 95, 167, 0.14), transparent 26%),
        linear-gradient(180deg, #fff 0%, var(--blue-50) 100%);
}

.auth-shell,
.admin-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px 0;
}

.auth-card,
.admin-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(520px, 100%);
    padding: 32px;
}

.auth-card h1,
.admin-topbar h1,
.panel-head h2 {
    margin: 14px 0 10px;
    color: var(--navy-950);
    line-height: 1.05;
}

.auth-card h1,
.admin-topbar h1 {
    font-size: clamp(32px, 4vw, 46px);
}

.auth-card p,
.panel-head p,
.admin-topbar p {
    margin: 0;
    color: var(--muted);
}

.auth-form,
.admin-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 13px;
    font-weight: 800;
    color: var(--navy-900);
}

.field input,
.field select {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: 0;
    background: #fff;
}

.field input:focus,
.field select:focus {
    border-color: var(--navy-500);
    box-shadow: 0 0 0 3px rgba(45, 95, 167, 0.12);
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 14px;
}

.auth-submit {
    min-height: 48px;
}

.auth-feedback {
    min-height: 24px;
    font-size: 14px;
    color: var(--muted);
}

.auth-feedback[data-tone="success"] {
    color: var(--success);
}

.auth-feedback[data-tone="danger"] {
    color: var(--danger);
}

.auth-links {
    margin-top: 18px;
    font-size: 14px;
    color: var(--navy-600);
}

.admin-topbar {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.admin-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-shell {
    display: grid;
    gap: 22px;
    padding-bottom: 40px;
}

.admin-panel {
    padding: 24px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-head h2 {
    font-size: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.admin-table th {
    color: var(--navy-900);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-pill.is-active {
    background: rgba(16, 132, 91, 0.1);
    color: var(--success);
}

.status-pill.is-muted {
    background: var(--blue-50);
    color: var(--muted);
}

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

.table-actions .button {
    min-height: 36px;
    font-size: 12px;
    padding: 0 10px;
}

.table-empty {
    color: var(--muted);
    text-align: center;
}

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

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--navy-800);
    font-size: 14px;
    font-weight: 800;
}

.admin-nav-link.is-active {
    border-color: var(--navy-900);
    background: var(--navy-900);
    color: #fff;
}

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

.overview-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.overview-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-500);
}

.overview-card strong {
    display: block;
    margin-top: 10px;
    color: var(--navy-950);
    font-size: 28px;
    line-height: 1.1;
}

.overview-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.overview-link {
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.overview-link:hover {
    transform: translateY(-1px);
    border-color: var(--navy-500);
    box-shadow: var(--shadow);
}

.top-gap {
    margin-top: 18px;
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    padding-left: 22px;
    padding-right: 22px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 18%, rgba(255, 255, 255, 1) 42%);
}

.sidebar-footer-actions {
    display: grid;
    gap: 10px;
    grid-auto-flow: column;
}

.sidebar-footer-actions .button {
    width: 100%;
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 14px;
}

.admin-status-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, var(--blue-50) 100%);
}

.admin-status-card strong {
    display: block;
    color: var(--navy-950);
    font-size: 15px;
}

.admin-status-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.field-actions {
    justify-content: end;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
}

@media (max-width: 1100px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .brand {
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .topbar-center,
    .topbar-actions {
        min-height: 64px;
    }
}

@media (max-width: 820px) {
    .topbar-actions {
        padding-top: 10px;
        padding-bottom: 14px;
        border-left: 0;
    }

    .admin-topbar {
        flex-direction: column;
    }

    .admin-panel {
        padding: 18px;
    }

    .admin-status-card {
        flex-direction: column;
    }

    .field-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 24px 18px;
    }

    .user-badge {
        display: grid;
    }
}

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

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-card,
.status-card,
.payment-method-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.stat-card {
    padding: 18px;
}

.stat-card span,
.status-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: var(--navy-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong,
.status-card strong {
    display: block;
    margin-top: 10px;
    color: var(--navy-950);
    font-size: 28px;
    line-height: 1;
}

.stat-card p,
.status-card p,
.table-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.checkout-shell {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
    min-height: 100vh;
    display: grid;
    align-items: center;
}

.checkout-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    padding: 30px;
}

.checkout-card h1 {
    margin: 14px 0 10px;
    color: var(--navy-950);
    line-height: 1.08;
    font-size: clamp(32px, 4vw, 46px);
}

.checkout-price {
    margin: 22px 0 8px;
    color: var(--navy-700);
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
}

.payment-method-list {
    display: grid;
    gap: 12px;
}

.payment-method-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    cursor: pointer;
}

.payment-method-card input {
    margin-top: 4px;
}

.payment-method-card strong {
    display: block;
    color: var(--navy-900);
}

.payment-method-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.status-card {
    padding: 18px;
}

.status-notes {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--blue-50);
    color: var(--navy-700);
}

.checklist-item {
    list-style: none;
}

.reader-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.reader-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.reader-check-box {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    transition: border-color 150ms ease, background 150ms ease;
}

.reader-check.is-checked .reader-check-box {
    border-color: var(--success);
    background: var(--success);
    box-shadow: inset 0 0 0 4px #fff;
}

.reader-check-label {
    display: block;
}

.checkout-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

@media (max-width: 760px) {
    .admin-grid-two,
    .dashboard-stats,
    .status-grid,
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .checkout-card {
        padding: 22px 18px;
    }
}
