:root {
    --app-font: "JetBrains Sans", "Segoe UI", Arial, sans-serif;
    --app-page: #f4f5fa;
    --app-surface: #ffffff;
    --app-surface-soft: #f8f8fc;
    --app-ink: #191a27;
    --app-muted: #76788b;
    --app-line: #e9eaf2;
    --app-accent: #6a57f2;
    --app-accent-strong: #5542d6;
    --app-accent-soft: #efedff;
    --app-green: #24896d;
    --app-shadow: 0 20px 60px rgba(35, 34, 72, 0.08);
    color-scheme: light;
    font-family: var(--app-font);
}
:root[data-theme="dark"] {
    --app-page: #10111a;
    --app-surface: #191a25;
    --app-surface-soft: #20212e;
    --app-ink: #f4f2fb;
    --app-muted: #aaa9bd;
    --app-line: #2e3040;
    --app-accent: #b7a4ff;
    --app-accent-strong: #c6baff;
    --app-accent-soft: #302a4a;
    --app-green: #7ee8c0;
    --app-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --app-page: #10111a;
        --app-surface: #191a25;
        --app-surface-soft: #20212e;
        --app-ink: #f4f2fb;
        --app-muted: #aaa9bd;
        --app-line: #2e3040;
        --app-accent: #b7a4ff;
        --app-accent-strong: #c6baff;
        --app-accent-soft: #302a4a;
        --app-green: #7ee8c0;
        --app-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
        color-scheme: dark;
    }
}
:root {
    --ux-page: var(--app-page);
    --ux-surface: var(--app-surface);
    --ux-surface-2: var(--app-surface-soft);
    --ux-surface-3: var(--app-line);
    --ux-ink: var(--app-ink);
    --ux-ink-2: var(--app-muted);
    --ux-ink-3: color-mix(in srgb, var(--app-muted) 72%, transparent);
    --ux-line: color-mix(in srgb, var(--app-line) 78%, transparent);
    --ux-line-2: var(--app-line);
    --ux-accent: var(--app-accent);
    --ux-accent-2: var(--app-accent-strong);
    --ux-accent-soft: var(--app-accent-soft);
    --ux-accent-ink: #fff;
    --ux-mint: var(--app-green);
    --ux-warn: #5b8cff;
    --ux-danger: #d93a55;
    --ux-shadow: rgba(54, 48, 104, 0.12);
    --ux-shadow-strong: rgba(36, 32, 78, 0.25);
    --ux-grad: linear-gradient(120deg, #7b61ff, #3d8bff 55%, #1fb89a);
}
:root[data-theme="dark"] {
    --ux-page: var(--app-page);
    --ux-surface: var(--app-surface);
    --ux-surface-2: var(--app-surface-soft);
    --ux-surface-3: var(--app-line);
    --ux-ink: var(--app-ink);
    --ux-ink-2: var(--app-muted);
    --ux-ink-3: color-mix(in srgb, var(--app-muted) 72%, transparent);
    --ux-line: color-mix(in srgb, var(--app-line) 78%, transparent);
    --ux-line-2: var(--app-line);
    --ux-accent: var(--app-accent);
    --ux-accent-2: var(--app-accent-strong);
    --ux-accent-soft: var(--app-accent-soft);
    --ux-accent-ink: #0b0c12;
    --ux-mint: var(--app-green);
    --ux-shadow: rgba(0, 0, 0, 0.32);
    --ux-shadow-strong: rgba(0, 0, 0, 0.55);
    --ux-grad: linear-gradient(120deg, #b7a4ff, #7db4ff 55%, #a5f2d3);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --ux-page: var(--app-page);
        --ux-surface: var(--app-surface);
        --ux-surface-2: var(--app-surface-soft);
        --ux-surface-3: var(--app-line);
        --ux-ink: var(--app-ink);
        --ux-ink-2: var(--app-muted);
        --ux-ink-3: color-mix(in srgb, var(--app-muted) 72%, transparent);
        --ux-line: color-mix(in srgb, var(--app-line) 78%, transparent);
        --ux-line-2: var(--app-line);
        --ux-accent: var(--app-accent);
        --ux-accent-2: var(--app-accent-strong);
        --ux-accent-soft: var(--app-accent-soft);
        --ux-accent-ink: #0b0c12;
        --ux-mint: var(--app-green);
        --ux-shadow: rgba(0, 0, 0, 0.32);
        --ux-shadow-strong: rgba(0, 0, 0, 0.55);
        --ux-grad: linear-gradient(120deg, #b7a4ff, #7db4ff 55%, #a5f2d3);
    }
}

* {
    box-sizing: border-box;
}
body [hidden] {
    display: none !important;
}
html {
    min-width: 320px;
    scroll-behavior: smooth;
}
body {
    margin: 0;
    color: var(--app-ink);
    background: var(--app-page);
    font-family: var(--app-font);
    -webkit-font-smoothing: antialiased;
}
.page-loading {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    background: color-mix(in srgb, var(--app-page) 88%, transparent);
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 650;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.16s ease;
}
.page-loading[hidden] {
    display: none !important;
}
.page-loading.is-visible {
    opacity: 1;
}
.page-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--app-line);
    border-top-color: var(--app-accent);
    border-radius: 50%;
    animation: page-loading-spin 0.7s linear infinite;
}
@keyframes page-loading-spin {
    to {
        transform: rotate(360deg);
    }
}
@media (prefers-reduced-motion: reduce) {
    .page-loading {
        transition: none;
    }
    .page-loading-spinner {
        animation-duration: 1.5s;
    }
}
body.app-page {
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(
            ellipse at 4% 0%,
            rgba(183, 164, 255, 0.22),
            transparent 34rem
        ),
        radial-gradient(
            ellipse at 96% 100%,
            rgba(96, 165, 250, 0.13),
            transparent 32rem
        ),
        var(--app-page);
}
a {
    color: inherit;
    text-decoration: none;
}
button,
input,
textarea,
select {
    font: inherit;
}
button,
a {
    -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--app-accent) 55%, transparent);
    outline-offset: 3px;
}
.app-shell {
    width: min(2200px, 100%);
    min-height: calc(100vh - 48px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 28px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}
.site-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 82px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--app-line);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
    font-size: 18px;
    font-weight: 780;
    letter-spacing: -0.04em;
}
.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    background: var(--app-accent-soft);
    color: var(--app-accent);
}
.brand-mark svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.1;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto;
    padding: 4px;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    background: var(--app-surface-soft);
}
.nav-link {
    padding: 10px 17px;
    border-radius: 999px;
    color: var(--app-muted);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--app-accent-strong);
    background: var(--app-accent-soft);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
    justify-content: flex-end;
}
.icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--app-line);
    border-radius: 50%;
    background: var(--app-surface);
    color: var(--app-muted);
    cursor: pointer;
}
.icon-button:hover {
    color: var(--app-accent);
    border-color: var(--app-accent);
}
.icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(140deg, #a8b6ff, #6858e8);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.account-menu {
    position: relative;
}
.avatar-trigger {
    padding: 0;
    border: 0;
    cursor: pointer;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.avatar-trigger:hover,
.avatar-trigger[aria-expanded="true"] {
    box-shadow: 0 0 0 4px var(--app-accent-soft);
    transform: translateY(-1px);
}
.account-menu-panel {
    position: absolute;
    z-index: 50;
    top: calc(100% + 10px);
    right: 0;
    width: min(260px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--app-line);
    border-radius: 16px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}
.account-menu-panel[hidden] {
    display: none;
}
.account-menu-profile {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px 11px;
}
.account-menu-profile strong {
    overflow: hidden;
    color: var(--app-ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-menu-profile span {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-menu-divider {
    height: 1px;
    margin: 4px 2px;
    background: var(--app-line);
}
.account-menu-logout {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 0 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--app-ink);
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}
.account-menu-logout:hover,
.account-menu-logout:focus-visible {
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
}
.account-menu-logout[hidden] {
    display: none;
}
.page-content {
    padding: 28px;
}
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.page-head > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
.page-head-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--app-accent-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1 {
    margin-bottom: 6px;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.14;
    letter-spacing: -0.045em;
}
.page-subtitle {
    margin: 0;
    color: var(--app-muted);
    font-size: 14px;
    line-height: 1.55;
}
.section-title {
    margin: 0;
    font-size: 17px;
    letter-spacing: -0.03em;
}
.section-subtitle {
    margin: 5px 0 0;
    color: var(--app-muted);
    font-size: 12px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--app-ink);
    color: var(--app-surface);
    font-size: 13px;
    font-weight: 720;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease,
        box-shadow 0.18s ease;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(54, 48, 104, 0.12);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--app-accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--app-accent-strong);
}
.btn-soft {
    border-color: var(--app-line);
    background: var(--app-surface);
    color: var(--app-ink);
}
.btn-quiet {
    min-height: 42px;
    padding: 0 12px;
    border-color: var(--app-line);
    border-radius: 10px;
    background: var(--app-surface);
    color: var(--app-muted);
    font-size: 12px;
}
.text-link {
    color: var(--app-accent-strong);
    font-size: 12px;
    font-weight: 720;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.metric-card {
    position: relative;
    min-height: 128px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 19px;
    background: var(--app-surface);
}
.metric-card::after {
    position: absolute;
    z-index: 0;
    right: 14px;
    bottom: -26px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: var(--app-accent-soft);
    content: "";
    pointer-events: none;
}
.metric-card .metric-top,
.metric-card .metric-value,
.metric-card .metric-note {
    position: relative;
    z-index: 1;
}
.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 650;
}
.metric-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    background: var(--app-accent-soft);
    color: var(--app-accent);
    font-size: 16px;
}
.metric-value {
    margin: 10px 0 1px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.055em;
    font-variant-numeric: tabular-nums;
}
.metric-note {
    color: var(--app-green);
    font-size: 11px;
    font-weight: 650;
}
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.85fr);
    gap: 18px;
    align-items: start;
}
.content-grid.equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.content-grid > .section-panel + .section-panel {
    margin-top: 0;
}
.section-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    background: var(--app-surface);
}
.section-panel + .section-panel {
    margin-top: 18px;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.package-list {
    display: grid;
    gap: 10px;
}
.package-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-height: 122px;
    padding: 15px;
    border: 1px solid var(--app-line);
    border-radius: 16px;
    background: var(--app-surface-soft);
}
.package-card > div:first-child {
    min-width: 0;
}
.package-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}
.package-art {
    display: grid;
    width: 48px;
    height: 48px;
    flex: none;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #e5e9ff, #f0f2ff);
    color: #5d59bc;
    font-size: 19px;
}
.package-copy {
    flex: 1;
    min-width: 0;
}
.package-heading {
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-width: 0;
}
.package-name {
    overflow: hidden;
    flex: 0 1 auto;
    max-width: 70%;
    margin: 0;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.package-meta {
    overflow: hidden;
    flex: none;
    max-width: 42%;
    margin: 0;
    color: var(--app-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.progress-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 10px;
    align-items: center;
    margin-top: 9px;
}
.progress-track,
.dashboard-progress-track {
    display: block;
    width: 100%;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: var(--app-line);
    color: #7b61ff;
}
.progress-track::-webkit-progress-bar,
.dashboard-progress-track::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--app-line);
}
.progress-track::-webkit-progress-value,
.dashboard-progress-track::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #7b61ff, #3d8bff 60%, #22c3a6);
}
.progress-track::-moz-progress-bar,
.dashboard-progress-track::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #7b61ff, #3d8bff 60%, #22c3a6);
}
.progress-label {
    color: var(--app-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.package-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}
.package-actions .btn {
    width: 70px;
    min-height: 40px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 11px;
}
.dashboard-table-scroll {
    overflow: auto;
    border: 1px solid var(--app-line);
    border-radius: 15px;
    background: var(--app-surface);
}
.dashboard-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}
.dashboard-table th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface-soft);
    color: var(--app-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.dashboard-table th:first-child,
.dashboard-table td:first-child {
    width: 60%;
    padding-left: 14px;
}
.dashboard-table th:nth-child(2),
.dashboard-table td:nth-child(2) {
    width: 22%;
}
.dashboard-table th:last-child,
.dashboard-table td:last-child {
    width: 18%;
    padding-right: 14px;
}
.dashboard-table td {
    height: 78px;
    padding: 10px;
    border-bottom: 1px solid var(--app-line);
    color: var(--app-ink);
    font-size: 11px;
    vertical-align: middle;
}
.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}
.dashboard-table tbody tr {
    transition: background 0.16s ease;
}
.dashboard-table tbody tr[data-dashboard-package-row] {
    cursor: pointer;
}
.dashboard-table tbody tr[data-dashboard-package-row]:hover {
    background: color-mix(
        in srgb,
        var(--app-accent-soft) 45%,
        var(--app-surface)
    );
}
.dashboard-table tbody tr[data-dashboard-package-row]:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: -2px;
}
.dashboard-package {
    min-width: 0;
}
.dashboard-package-copy {
    display: block;
    min-width: 0;
}
.dashboard-package-copy strong {
    display: block;
    overflow: hidden;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 740;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-package-progress {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto;
    gap: 8px;
    align-items: center;
    max-width: 480px;
}
.dashboard-word-count {
    font-weight: 700;
    white-space: nowrap;
}
.study-calendar {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.calendar-toolbar strong {
    font-size: 11px;
    font-weight: 750;
}
.calendar-nav {
    display: flex;
    gap: 5px;
}
.calendar-nav button {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-ink);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.calendar-nav button:disabled {
    opacity: 0.38;
    cursor: default;
}
.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    text-align: center;
}
.calendar-weekdays {
    margin-bottom: 5px;
    color: var(--app-muted);
    font-size: 9px;
    font-weight: 650;
}
.calendar-day {
    position: relative;
    display: flex;
    min-height: 34px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--app-ink);
    font-size: 10px;
    line-height: 1;
}
.calendar-day.is-outside {
    color: var(--app-muted);
    opacity: 0.42;
}
.calendar-day.is-active {
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
    font-weight: 750;
}
.calendar-day.is-today {
    border-color: var(--app-accent);
    box-shadow: inset 0 0 0 1px var(--app-accent);
}
.calendar-day i {
    height: 10px;
    font-size: 9px;
    font-style: normal;
    line-height: 10px;
}
.calendar-day .calendar-empty {
    visibility: hidden;
}
.calendar-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    color: var(--app-muted);
    font-size: 9px;
}
.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.legend-flame {
    font-size: 11px;
    font-style: normal;
}
.legend-today {
    width: 10px;
    height: 10px;
    border: 1px solid var(--app-accent);
    border-radius: 3px;
}
.ux {
    font-family: var(--app-font);
    letter-spacing: 0;
}
.u403 {
    max-width: 100%;
}
.u004 {
    max-width: 100%;
}
.explore-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(315px, 0.75fr);
    gap: 22px;
    align-items: start;
}
.explore-results {
    min-width: 0;
}
.explore-tools {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 13px;
}
.search-control {
    display: flex;
    min-width: 0;
    height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-surface);
    color: var(--app-muted);
}
.search-control svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.search-control input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-ink);
    font-size: 12px;
}
.search-control input::placeholder {
    color: var(--app-muted);
    opacity: 0.8;
}
.results-count {
    color: var(--app-muted);
    font-size: 11px;
    white-space: nowrap;
}
.explore-table-scroll {
    overflow: auto;
    border: 1px solid var(--app-line);
    border-radius: 15px;
    background: var(--app-surface);
}
.explore-table {
    width: 100%;
    min-width: 790px;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}
.explore-table th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface-soft);
    color: var(--app-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.explore-table th:first-child,
.explore-table td:first-child {
    width: 36%;
    padding-left: 14px;
}
.explore-table th:nth-child(2),
.explore-table td:nth-child(2) {
    width: 15%;
}
.explore-table th:nth-child(3),
.explore-table td:nth-child(3) {
    width: 14%;
}
.explore-table th:nth-child(4),
.explore-table td:nth-child(4) {
    width: 14%;
}
.explore-table th:nth-child(5),
.explore-table td:nth-child(5) {
    width: 8%;
}
.explore-table th:last-child,
.explore-table td:last-child {
    width: 13%;
    padding-right: 14px;
}
.explore-table td {
    height: 67px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--app-line);
    color: var(--app-ink);
    font-size: 11px;
    vertical-align: middle;
}
.explore-table tbody tr {
    cursor: pointer;
    transition: background 0.16s ease;
}
.explore-table tbody tr:last-child td {
    border-bottom: 0;
}
.explore-table tbody tr:hover,
.explore-table tbody tr[aria-selected="true"] {
    background: color-mix(
        in srgb,
        var(--app-accent-soft) 58%,
        var(--app-surface)
    );
}
.explore-table tbody tr:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: -2px;
}
.table-package {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}
.table-package .package-art {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 14px;
}
.table-package-copy {
    display: block;
    min-width: 0;
}
.table-package-copy strong,
.table-package-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table-package-copy strong {
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 740;
    white-space: nowrap;
}
.table-package-copy small {
    display: -webkit-box;
    color: var(--app-muted);
    font-size: 9px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.table-author {
    font-weight: 630;
    white-space: nowrap;
}
.category-tag {
    display: inline-flex;
    max-width: 100%;
    overflow: hidden;
    padding: 5px 7px;
    border-radius: 999px;
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
    font-size: 9px;
    font-weight: 690;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-muted {
    color: var(--app-muted) !important;
    font-size: 10px !important;
}
.table-number {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.detail-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0 0 4px !important;
    color: var(--app-muted);
    font-size: 11px !important;
}
.detail-byline strong {
    color: var(--app-ink);
    font-weight: 690;
}
.detail-updated {
    margin-left: auto;
    font-size: 10px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.browse-detail {
    padding: 24px;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    background: var(--app-surface-soft);
}
.browse-detail .eyebrow {
    margin-bottom: 10px;
}
.browse-detail h2 {
    margin-bottom: 7px;
    font-size: 22px;
    letter-spacing: -0.04em;
}
.browse-detail p {
    max-width: 410px;
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.6;
}
.browse-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}
.browse-detail-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 9px;
    margin-top: 18px;
}
.browse-detail-actions .btn {
    display: inline-flex;
    width: 100%;
    height: 40px;
    min-width: 0;
    min-height: 40px;
    max-height: 40px;
    box-sizing: border-box;
    align-self: stretch;
    margin: 0;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1;
    vertical-align: top;
    appearance: none;
}
.browse-detail-actions .btn:hover,
.browse-detail-actions .btn:active {
    transform: none;
}
.preview-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    background: var(--app-surface);
    color: var(--app-ink);
    box-shadow: var(--app-shadow);
}
.preview-dialog::backdrop {
    background: rgba(18, 19, 32, 0.48);
    backdrop-filter: blur(3px);
}
.preview-dialog-layout {
    display: flex;
    max-height: calc(100vh - 48px);
    flex-direction: column;
}
.preview-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--app-line);
}
.preview-dialog-header .eyebrow {
    margin-bottom: 7px;
}
.preview-dialog-header h2 {
    margin: 0 0 5px;
    font-size: 20px;
    letter-spacing: -0.035em;
}
.preview-dialog-header p:not(.eyebrow) {
    margin: 0;
    color: var(--app-muted);
    font-size: 11px;
}
.preview-dialog-header .icon-button {
    flex: none;
    font-size: 20px;
}
.preview-table-scroll {
    min-height: 120px;
    flex: 1;
    overflow: auto;
    padding: 0 18px;
}
.preview-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}
.preview-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 10px;
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface-soft);
    color: var(--app-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.preview-table th:first-child,
.preview-table td:first-child {
    width: 52px;
}
.preview-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--app-line);
    font-size: 12px;
    line-height: 1.5;
    vertical-align: top;
}
.preview-table tbody tr:last-child td {
    border-bottom: 0;
}
.preview-word-index {
    color: var(--app-muted);
    font-variant-numeric: tabular-nums;
}
.preview-table .preview-empty {
    padding: 28px 10px;
    text-align: center;
}
.preview-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 22px;
    border-top: 1px solid var(--app-line);
    color: var(--app-muted);
    font-size: 11px;
}
.preview-dialog-footer .btn {
    min-height: 36px;
}
.fact-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 650;
}
.status-pill.is-public {
    border-color: color-mix(in srgb, var(--app-green) 35%, var(--app-line));
    background: color-mix(in srgb, var(--app-green) 10%, var(--app-surface));
    color: var(--app-green);
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.library-card {
    padding: 18px;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    background: var(--app-surface);
}
.library-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.library-card-heading {
    min-width: 0;
    flex: 1 1 auto;
}
.library-card-top .status-pill {
    flex: none;
    white-space: nowrap;
}
.library-card-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}
.library-card h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
}
.library-card-count {
    color: var(--app-muted);
    font-size: 10px;
    line-height: 1.4;
    white-space: nowrap;
}
.library-card p {
    margin: 0;
    color: var(--app-muted);
    font-size: 11px;
    line-height: 1.5;
}
.library-card .progress-wrap {
    margin: 16px 0;
}
.library-card .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.library-card .card-actions .btn {
    width: 100%;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 12px;
    white-space: nowrap;
}
.word-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: start;
}
.word-table-container {
    min-width: 0;
}
.word-table-scroll {
    overflow: auto;
    border: 1px solid var(--app-line);
    border-radius: 14px;
    background: var(--app-surface);
}
.word-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}
.word-table th {
    padding: 12px 11px;
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface-soft);
    color: var(--app-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.word-table th:first-child {
    width: 22%;
}
.word-table th:nth-child(2) {
    width: 42%;
}
.word-table th:nth-child(3) {
    width: 16%;
}
.word-table th:last-child {
    width: 20%;
}
.word-table td {
    padding: 12px 11px;
    border-bottom: 1px solid var(--app-line);
    color: var(--app-ink);
    font-size: 11px;
    line-height: 1.5;
    vertical-align: middle;
}
.word-table tbody tr:last-child td {
    border-bottom: 0;
}
.word-table tbody tr:hover {
    background: color-mix(
        in srgb,
        var(--app-accent-soft) 40%,
        var(--app-surface)
    );
}
.word-table-term {
    font-size: 12px;
    font-weight: 700;
}
.word-table-meaning {
    color: var(--app-muted) !important;
}
.word-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--app-muted);
    font-size: 10px;
    white-space: nowrap;
    cursor: pointer;
}
.word-status input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--app-accent);
}
.word-table-empty {
    padding: 32px 12px !important;
    color: var(--app-muted) !important;
    text-align: center;
}
.word-table-loading {
    display: grid;
    min-height: 190px;
    place-content: center;
    justify-items: center;
    gap: 12px;
    color: var(--app-muted);
    font-size: 12px;
    text-align: center;
}
.word-table-loading[hidden],
.word-table-scroll[hidden] {
    display: none;
}
.word-table-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--app-line);
    border-top-color: var(--app-accent);
    border-radius: 50%;
    animation: word-table-spin 0.75s linear infinite;
}
@keyframes word-table-spin {
    to {
        transform: rotate(360deg);
    }
}
@media (prefers-reduced-motion: reduce) {
    .word-table-spinner {
        animation: none;
    }
}
.word-side-note {
    padding: 20px;
    border-radius: 18px;
    background: var(--app-accent-soft);
}
.word-side-note h2 {
    margin: 0 0 8px;
    font-size: 16px;
}
.word-package-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.word-package-title h2 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}
.word-package-title .status-pill {
    flex: none;
    padding: 5px 9px;
    white-space: nowrap;
}
.word-package-title .status-pill.is-private {
    border-color: var(--app-line);
    background: var(--app-surface);
    color: var(--app-muted);
}
.word-side-note p {
    margin: 0;
    color: var(--app-muted);
    font-size: 12px;
    line-height: 1.6;
}
.word-package-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    margin: 18px 0;
    padding: 16px 0;
    border-top: 1px solid color-mix(in srgb, var(--app-line) 75%, transparent);
    border-bottom: 1px solid
        color-mix(in srgb, var(--app-line) 75%, transparent);
}
.word-package-fact {
    display: grid;
    min-width: 0;
    gap: 4px;
}
.word-package-fact > span {
    color: var(--app-muted);
    font-size: 9px;
    font-weight: 720;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.word-package-fact > strong {
    overflow-wrap: anywhere;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}
.word-shortcuts {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.shortcut-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--app-muted);
    font-size: 11px;
}
kbd {
    min-width: 28px;
    padding: 4px 7px;
    border: 1px solid var(--app-line);
    border-radius: 7px;
    background: var(--app-surface);
    color: var(--app-ink);
    font: 650 10px/1.2 inherit;
    text-align: center;
}
.package-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
    gap: 20px;
    align-items: start;
}
.package-words-panel {
    min-width: 0;
    padding: 20px;
}
.package-words-head {
    margin-bottom: 14px;
}
.package-words-scroll {
    overflow: auto;
    border: 1px solid var(--app-line);
    border-radius: 15px;
    background: var(--app-surface);
}
.package-words-table {
    width: 100%;
    min-width: 590px;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}
.package-words-table th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface-soft);
    color: var(--app-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.04em;
}
.package-words-table th:first-child,
.package-words-table td:first-child {
    width: 48px;
    padding-left: 14px;
}
.package-words-table th:last-child,
.package-words-table td:last-child {
    width: 52px;
    padding-right: 10px;
    text-align: center;
}
.package-words-table td {
    height: 62px;
    padding: 8px 8px;
    border-bottom: 1px solid var(--app-line);
    color: var(--app-muted);
    font-size: 11px;
    vertical-align: middle;
}
.package-words-table tbody tr:last-child td {
    border-bottom: 0;
}
.package-words-table .text-input {
    min-height: 40px;
    padding: 9px 10px;
}
.package-word-index {
    font-variant-numeric: tabular-nums;
}
.package-word-remove {
    width: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 17px;
}
.package-add-row {
    margin-top: 14px;
}
.package-info-card {
    position: sticky;
    top: 18px;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    background: var(--app-surface-soft);
}
.package-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}
.package-info-top .package-art {
    width: 50px;
    height: 50px;
    margin: 0;
}
.package-info-card > .section-title {
    margin-bottom: 5px;
}
.package-info-note {
    margin-bottom: 17px;
    line-height: 1.5;
}
.package-meta-fields {
    display: grid;
    gap: 13px;
}
.package-meta-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.package-meta-split > div {
    min-width: 0;
}
.topic-combobox {
    position: relative;
    min-width: 0;
}
.topic-combobox > .text-input {
    padding-right: 40px;
}
.topic-combobox-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    display: grid;
    width: 40px;
    height: calc(100% - 2px);
    place-items: center;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: var(--app-muted);
    cursor: pointer;
}
.topic-combobox-toggle:hover,
.topic-combobox-toggle[aria-expanded="true"] {
    color: var(--app-accent-strong);
}
.topic-combobox-toggle:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: -3px;
}
.topic-combobox-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.topic-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 230px;
    gap: 2px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--app-line);
    border-radius: 13px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}
.topic-options[hidden] {
    display: none;
}
.topic-option {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--app-ink);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}
.topic-option[aria-selected="true"],
.topic-option:hover {
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
}
.topic-options-empty {
    padding: 9px 10px;
    color: var(--app-muted);
    font-size: 11px;
}
.package-form-summary {
    display: grid;
    margin-top: 17px;
    border-top: 1px solid var(--app-line);
}
.package-form-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--app-line);
    color: var(--app-muted);
    font-size: 11px;
}
.package-form-summary strong {
    color: var(--app-ink);
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}
.package-form-actions {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}
.package-form-actions .btn {
    width: 100%;
}
.package-local-note {
    margin: 12px 0 0;
    color: var(--app-muted);
    font-size: 10px;
    line-height: 1.5;
}
.field-label {
    display: block;
    margin: 0 0 7px;
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 720;
}
.text-input,
.text-area {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border: 1px solid var(--app-line);
    border-radius: 11px;
    background: var(--app-surface);
    color: var(--app-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.text-input:hover,
.text-area:hover {
    border-color: color-mix(in srgb, var(--app-accent) 45%, var(--app-line));
}
.text-input:focus,
.text-area:focus {
    outline: 0;
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 16%, transparent);
}
select.text-input {
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2376788b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
    cursor: pointer;
}
select option {
    background-color: var(--app-surface);
    color: var(--app-ink);
}
select option:checked {
    background-color: var(--app-accent-soft);
    color: var(--app-accent-strong);
}
:root[data-theme="dark"] select.text-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23aaa9bd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) select.text-input {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23aaa9bd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    }
}
@supports (appearance: base-select) {
    select.text-input,
    ::picker(select) {
        appearance: base-select;
    }
    select.text-input {
        display: inline-flex;
        align-items: center;
    }
    select.text-input::picker-icon {
        display: none;
    }
    ::picker(select) {
        margin-top: 6px;
        padding: 6px;
        border: 1px solid var(--app-line);
        border-radius: 14px;
        background: var(--app-surface);
        color: var(--app-ink);
        box-shadow: var(--app-shadow);
    }
    select option {
        padding: 8px 10px;
        border-radius: 9px;
        font-size: 12px;
        font-weight: 500;
        transition: background-color 0.15s ease, color 0.15s ease;
    }
    select option:hover {
        background-color: var(--app-surface-soft);
    }
    select option:checked {
        background-color: var(--app-accent-soft);
        color: var(--app-accent-strong);
        font-weight: 650;
    }
    select option::checkmark {
        color: var(--app-accent-strong);
    }
}
.text-area {
    min-height: 86px;
    resize: vertical;
}
.editor-words {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}
.editor-word {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--app-line);
    border-radius: 13px;
    background: var(--app-surface-soft);
}
.editor-add {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--app-line);
}
.auth-page {
    display: grid;
    min-height: calc(100vh - 48px);
    place-items: center;
    padding: 38px;
}
.auth-card {
    display: grid;
    width: min(980px, 100%);
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 26px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}
.auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 600px;
    padding: 32px;
    background: linear-gradient(150deg, #eeedff, #f8f8ff 55%, #e8f1ff);
}
:root[data-theme="dark"] .auth-aside {
    background: linear-gradient(150deg, #282444, #211f30 55%, #1e2b3d);
}
.auth-aside h1 {
    max-width: 350px;
    margin-top: 70px;
    font-size: 38px;
}
.auth-aside p {
    max-width: 330px;
    color: var(--app-muted);
    font-size: 14px;
    line-height: 1.7;
}
.auth-form-area {
    display: grid;
    place-items: center;
    padding: 34px 24px;
}
.auth-form-inner {
    width: min(100%, 400px);
}
.auth-form-inner h2 {
    margin: 0 0 8px;
    font-size: 24px;
    letter-spacing: -0.04em;
}
.auth-form-inner > p {
    color: var(--app-muted);
    font-size: 13px;
}
.auth-form-inner .u403 {
    margin: 18px auto 4px;
}
.signup-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}
.signup-form .btn {
    width: 100%;
}
.auth-switch {
    margin: 18px 0 0;
    color: var(--app-muted);
    font-size: 12px;
    text-align: center;
}
.auth-switch a {
    color: var(--app-accent-strong);
    font-weight: 720;
}
.study-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: var(--app-page);
}
.study-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px clamp(18px, 5vw, 64px);
}
.study-brand {
    color: var(--app-muted);
    font-size: 13px;
    font-weight: 720;
}
.study-main {
    display: flex;
    width: min(850px, 100%);
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 28px 24px 60px;
    text-align: center;
}
.study-progress {
    display: block;
    width: min(460px, 100%);
    height: 4px;
    margin-bottom: clamp(50px, 10vh, 100px);
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: var(--app-line);
    color: var(--app-accent);
}
.study-progress::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--app-line);
}
.study-progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #7b61ff, #3d8bff 60%, #22c3a6);
    transition: width 0.35s ease;
}
.study-progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #7b61ff, #3d8bff 60%, #22c3a6);
}
.study-type {
    margin: 0 0 24px;
    color: var(--app-accent-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.study-word {
    margin: 0;
    font-size: clamp(46px, 9vw, 84px);
    font-weight: 780;
    letter-spacing: -0.065em;
    line-height: 1.02;
}
.study-pronunciation {
    margin: 15px 0 0;
    color: var(--app-muted);
    font-size: 15px;
}
.study-divider {
    width: 42px;
    height: 1px;
    margin: 42px auto 28px;
    background: var(--app-line);
}
.study-meaning {
    max-width: 600px;
    margin: 0;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 560;
    line-height: 1.5;
}
.study-example {
    max-width: 560px;
    min-height: 28px;
    margin: 14px 0 0;
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.6;
}
.study-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 18px 30px;
}
.study-actions {
    display: flex;
    gap: 10px;
}
.study-actions .btn {
    min-width: 148px;
    min-height: 48px;
}
.study-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    color: var(--app-muted);
    font-size: 10px;
}
.study-complete {
    display: none;
    max-width: 500px;
}
.study-complete.is-visible {
    display: block;
}
.study-complete h1 {
    font-size: 38px;
}
.toast {
    position: fixed;
    z-index: 50;
    right: 24px;
    bottom: 24px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 16px;
    transform: translateY(12px);
    border-radius: 12px;
    background: var(--app-ink);
    color: var(--app-surface);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}
.empty-state {
    padding: 32px;
    border: 1px dashed var(--app-line);
    border-radius: 18px;
    color: var(--app-muted);
    font-size: 13px;
    text-align: center;
}
.hide {
    display: none !important;
}

@media (max-width: 1100px) {
    .library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 980px) {
    body.app-page {
        padding: 12px;
    }
    .app-shell {
        min-height: calc(100vh - 24px);
        border-radius: 22px;
    }
    .site-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 18px;
    }
    .brand,
    .header-actions {
        min-width: auto;
    }
    .primary-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }
    .header-actions {
        margin-left: auto;
    }
    .page-content {
        padding: 22px 18px;
    }
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .content-grid,
    .content-grid.equal,
    .word-page-grid {
        grid-template-columns: 1fr;
    }
    .explore-grid {
        grid-template-columns: 1fr;
    }
    .package-form-layout {
        grid-template-columns: 1fr;
    }
    .package-info-card {
        position: static;
    }
    .library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .auth-page {
        min-height: 100vh;
        padding: 0;
    }
    .auth-card {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }
    .auth-aside {
        min-height: 245px;
        padding: 20px;
    }
    .auth-aside h1 {
        margin: 25px 0 8px;
        font-size: 28px;
    }
    .auth-aside p {
        margin-bottom: 0;
        font-size: 12px;
    }
    .auth-form-area {
        align-items: start;
        padding: 28px 18px 36px;
    }
    .auth-form-inner .u403 {
        width: 100%;
    }
    .auth-form-inner .u403-form {
        width: min(280px, 100%);
    }
    .auth-form-inner .u403-go {
        width: 100%;
    }
    .auth-form-inner .u403-go.is-busy,
    .auth-form-inner .u403-go.is-ok {
        width: 48px;
    }
}
@media (max-width: 640px) {
    body.app-page {
        padding: 0;
    }
    .app-shell {
        min-height: 100vh;
        border-radius: 0;
    }
    .site-header {
        min-height: auto;
        padding: 12px 14px 10px;
    }
    .brand {
        font-size: 16px;
    }
    .brand-mark {
        width: 32px;
        height: 32px;
    }
    .icon-button {
        width: 36px;
        height: 36px;
    }
    .primary-nav {
        gap: 1px;
        padding: 3px;
    }
    .nav-link {
        padding: 9px 12px;
        font-size: 11px;
    }
    .page-content {
        padding: 20px 14px 28px;
    }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .page-head .btn {
        width: 100%;
    }
    .page-head-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .page-head-actions .btn {
        width: auto;
        flex: 1;
        white-space: normal;
    }
    .metric-grid {
        gap: 9px;
    }
    .metric-card {
        min-height: 116px;
        padding: 13px;
        border-radius: 16px;
    }
    .metric-value {
        font-size: 24px;
    }
    .metric-top {
        font-size: 10px;
    }
    .metric-icon {
        width: 30px;
        height: 30px;
    }
    .section-panel {
        padding: 15px;
        border-radius: 17px;
    }
    .package-card {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    .package-actions {
        justify-content: flex-end;
    }
    .explore-tools {
        grid-template-columns: minmax(0, 1fr);
    }
    .results-count {
        justify-self: end;
    }
    .explore-grid {
        gap: 16px;
    }
    .browse-detail {
        padding: 18px;
    }
    .preview-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }
    .preview-dialog-layout {
        max-height: calc(100vh - 20px);
    }
    .preview-dialog-header {
        padding: 16px 16px 13px;
    }
    .preview-table-scroll {
        padding: 0 10px;
    }
    .preview-table {
        min-width: 420px;
    }
    .preview-dialog-footer {
        padding: 12px 16px;
    }
    .library-grid {
        grid-template-columns: 1fr;
    }
    .package-form-layout {
        grid-template-columns: 1fr;
    }
    .package-info-card {
        position: static;
    }
    .package-words-panel {
        padding: 15px;
    }
    .package-info-card {
        padding: 16px;
    }
    .auth-page {
        min-height: 100vh;
        padding: 0;
    }
    .auth-card {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }
    .auth-aside {
        min-height: 245px;
        padding: 20px;
    }
    .auth-aside h1 {
        margin: 25px 0 8px;
        font-size: 28px;
    }
    .auth-aside p {
        margin-bottom: 0;
        font-size: 12px;
    }
    .auth-form-area {
        align-items: start;
        padding: 28px 18px 36px;
    }
    .auth-form-inner .u403 {
        width: 100%;
    }
    .auth-form-inner .u403-form {
        width: min(280px, 100%);
    }
    .auth-form-inner .u403-go {
        width: 100%;
    }
    .auth-form-inner .u403-go.is-busy,
    .auth-form-inner .u403-go.is-ok {
        width: 48px;
    }
    .study-header {
        padding: 16px;
    }
    .study-main {
        justify-content: flex-start;
        padding-top: 8vh;
    }
    .study-progress {
        margin-bottom: 8vh;
    }
    .study-divider {
        margin: 32px auto 22px;
    }
    .study-footer {
        padding-bottom: 20px;
    }
    .study-actions {
        width: 100%;
    }
    .study-actions .btn {
        min-width: 0;
        flex: 1;
        padding: 0 10px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

.u403 {
    position: relative;
    width: 340px;
    height: 300px;
    display: grid;
    place-items: center;
}
.u403-form {
    width: 280px;
    margin: 0;
}
.u403-f {
    position: relative;
    height: 52px;
    border-radius: 12px;
    background: var(--ux-surface);
    box-shadow: inset 0 0 0 1px var(--ux-line-2);
    transition: box-shadow 0.2s;
}
.u403-f + .u403-f {
    margin-top: 10px;
}
.u403-f:hover {
    box-shadow: inset 0 0 0 1px var(--ux-ink-3);
}
.u403-f.is-f {
    box-shadow: inset 0 0 0 1.5px var(--ux-accent),
        0 0 0 4px var(--ux-accent-soft);
}
.u403-f.is-err {
    box-shadow: inset 0 0 0 1px
        color-mix(in srgb, var(--ux-danger) 55%, transparent);
}
.u403-f::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--ux-danger);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ux-ease);
}
.u403-f.is-err::after {
    transform: scaleX(1);
}
.u403-f.is-shake {
    animation: u403-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes u403-shake {
    15% {
        transform: translateX(-7px);
    }
    35% {
        transform: translateX(6px);
    }
    55% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(2px);
    }
}
.u403-f label {
    position: absolute;
    left: 15px;
    top: 17px;
    font-size: 14px;
    color: var(--ux-ink-3);
    transform-origin: left top;
    transition: transform 0.4s var(--ux-spring), color 0.2s;
    pointer-events: none;
}
.u403-f.is-up label {
    transform: translateY(-10px) scale(0.76);
    color: var(--ux-ink-2);
}
.u403-f.is-f label {
    color: var(--ux-accent);
}
.u403-f.is-err label {
    color: var(--ux-danger);
}
.u403-in {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 21px 15px 6px;
    border: 0;
    border-radius: 12px;
    background: none;
    outline: none;
    font-size: 14px;
    color: var(--ux-ink);
}
.u403 .u403-in:focus-visible {
    outline: none;
}
.u403-in[type="password"] {
    letter-spacing: 0.14em;
}
.u403-pw .u403-in {
    padding-right: 48px;
}
.u403-eye {
    position: absolute;
    right: 8px;
    top: 9px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--ux-ink-3);
    transition: color 0.2s, background 0.2s;
}
.u403-eye:hover {
    color: var(--ux-ink);
    background: var(--ux-surface-2);
}
.u403 .u403-eye:focus-visible {
    outline: 2px solid var(--ux-accent);
    outline-offset: -2px;
}
.u403-eye svg {
    width: 20px;
    height: 20px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.u403-eye .lid {
    transform-origin: 10px 10px;
    transform: scaleY(0.1);
    transition: transform 0.45s var(--ux-spring);
}
.u403-eye .lash {
    opacity: 1;
    transition: opacity 0.2s, transform 0.4s var(--ux-spring);
    transform-origin: 10px 10px;
}
.u403-eye[aria-pressed="true"] .lid {
    transform: none;
}
.u403-eye[aria-pressed="true"] .lash {
    opacity: 0;
    transform: translateY(-3px);
}
.u403-msg {
    height: 24px;
    margin: 0;
    padding: 6px 4px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--ux-danger);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.35s var(--ux-spring);
}
.u403-msg.is-on {
    opacity: 1;
    transform: none;
}
.u403-go {
    position: relative;
    display: grid;
    place-items: center;
    width: 280px;
    height: 48px;
    margin: 6px auto 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--ux-ink);
    color: var(--ux-surface);
    font-size: 14.5px;
    font-weight: 600;
    overflow: hidden;
    transition: width 0.55s var(--ux-spring), border-radius 0.45s var(--ux-ease),
        background 0.35s, color 0.35s, transform 0.4s var(--ux-spring);
}
.u403-go:hover {
    transform: translateY(-1px);
}
.u403-go:active {
    transform: scale(0.97, 0.94);
    transition-duration: 0.55s, 0.45s, 0.35s, 0.35s, 0.1s;
}
.u403 .u403-go:focus-visible {
    outline: 2px solid var(--ux-accent);
    outline-offset: 3px;
}
.u403-go > * {
    grid-area: 1/1;
    transition: opacity 0.2s, transform 0.4s var(--ux-spring);
}
.u403-go i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    opacity: 0;
    transform: scale(0.5);
    animation: u403-spin 0.7s linear infinite;
}
.u403-go svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transform: scale(0.5);
}
.u403-go svg path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 0.4s var(--ux-ease) 0.1s;
}
@keyframes u403-spin {
    to {
        rotate: 360deg;
    }
}
.u403-go.is-busy,
.u403-go.is-ok {
    width: 48px;
    border-radius: 24px;
    cursor: default;
}
.u403-go.is-busy span,
.u403-go.is-ok span {
    opacity: 0;
    transform: scale(0.8);
}
.u403-go.is-busy i {
    opacity: 1;
    transform: none;
}
.u403-go.is-ok {
    background: var(--ux-mint);
    color: #ffffff;
    color: light-dark(#ffffff, #0b0c12);
}
.u403-go.is-ok svg {
    opacity: 1;
    transform: none;
}
.u403-go.is-ok svg path {
    stroke-dashoffset: 0;
}
.u403-live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.word-start-button {
    width: 100%;
    justify-content: center;
    margin-top: 16px;
}
.word-community-note {
    margin: 18px 2px 0;
    color: var(--app-muted);
    font-size: 11px;
    line-height: 1.6;
}
.library-customize-panel {
    margin-top: 18px;
}
