* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: color .2s ease, background-color .2s ease;
}
    .lessons-section {
        padding: 28px 30px 30px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--panel);
        box-shadow: var(--shadow);
    }

    .lesson-heading {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 20px;
    }

    .lesson-search-wrap { flex: 0 0 260px; }
    .lessons-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .lesson-card { display: flex; min-height: 250px; flex-direction: column; padding: 22px 20px 20px; border: 1px solid var(--line); border-radius: 6px; color: inherit; background: color-mix(in srgb, var(--panel) 88%, var(--teal)); text-decoration: none; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
    .lesson-card:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-3px); }
    .lesson-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
    .lesson-number { margin-bottom: 10px; color: var(--coral); font-family: var(--font-display); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
    .lesson-card h3 { margin: 0 0 14px; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; line-height: 1.35; }
    .lesson-card h3 small { color: var(--teal); font-family: var(--font-body); font-size: .8rem; font-weight: 500; }
    .lesson-card p { margin: 0; color: var(--body-copy); font-size: .88rem; line-height: 1.55; }
    .card-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 20px; color: var(--coral-dark); font-family: var(--font-display); font-size: .78rem; font-weight: 700; }
    .card-link span { font-size: 1.1rem; }
    .lesson-card[hidden] { display: none; }

body::before {
    content: '';
    position: fixed;
    inset: 0 0 auto;
    height: 8px;
    background: var(--coral);
    z-index: 2;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 28px 18px;
}

a.logo {
    text-decoration: none;
    color: var(--ink);
}

.brand {
    color: var(--coral-dark);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.header-note,
.subtitle,
.panel-heading p,
footer {
    color: var(--muted);
}

.header-note {
    font-size: .85rem;
    text-decoration: underline;
    text-decoration-color: var(--teal);
    text-decoration-thickness: 1px;
    text-underline-offset: .3lh;
}

.theme-toggle {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--panel);
    font: 600 .78rem var(--font-body);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--teal);
    color: var(--teal);
}

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 28px 76px;
}

.title-container {
    max-width: 780px;
    margin-bottom: 42px;
}

.eyebrow,
.panel-kicker {
    color: var(--teal);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.title {
    margin: 8px 0 2px;
    font-family: var(--font-display);
    font-size: clamp(2.9rem, 7vw, 5.7rem);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: .98;
}

.subtitle {
    margin: 17px 0 0;
    font-size: 1.1rem;
}

.content-container {
    display: grid;
    gap: 26px;
    min-width: 0;
}

.lesson-panel,
.verbs-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.lesson-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
    overflow: hidden;
}

.lesson-copy,
.rule-card,
.panel-heading,
.table-wrap {
    min-width: 0;
}

.lesson-copy {
    padding: 32px 36px;
}

.panel-kicker {
    color: var(--coral);
}

h2 {
    margin: 5px 0 12px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.15;
}

h3 {
    margin: 0 0 7px;
    font-family: var(--font-display);
    font-size: 1rem;
}

.lesson-copy p {
    margin: 0 0 19px;
    color: var(--soft-text);
}

.usage-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usage-list li {
    position: relative;
    padding-left: 22px;
    color: var(--soft-text);
}

.usage-list li::before {
    content: '';
    position: absolute;
    top: .7em;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
}

.rule-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background: var(--teal);
    color: white;
}

.rule-card h2 {
    color: white;
    font-size: 1.65rem;
}

.rule-card p {
    margin: 0 0 20px;
    color: var(--teal-text);
}

.formula {
    padding: 15px 17px;
    border-left: 3px solid var(--yellow);
    background: rgba(0, 0, 0, .14);
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.formula strong {
    color: var(--yellow);
    font-weight: 600;
}

.verbs-panel {
    padding: 28px 30px 30px;
}

.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin-bottom: 0;
}

.panel-heading p {
    margin: 0;
    font-size: .9rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search {
    width: min(260px, 100%);
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--panel);
    font: inherit;
}

.search:focus {
    outline: 3px solid var(--focus-ring);
    border-color: var(--teal);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    background: var(--table-head);
    font-size: .72rem;
    letter-spacing: .09em;
    text-transform: uppercase;
}

td {
    color: var(--cell-text);
    font-size: .94rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--table-hover);
}

td:first-child {
    width: 8%;
    color: var(--muted);
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4) {
    color: var(--coral-dark);
    font-weight: 700;
}

.empty-row {
    display: none;
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.tenses-section {
    padding: 28px 30px 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2 {
    margin-bottom: 7px;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

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

.tense-card {
    position: relative;
    min-width: 0;
    padding: 22px 20px 20px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: color-mix(in srgb, var(--panel) 88%, var(--teal));
}

.tense-number {
    display: block;
    margin-bottom: 10px;
    color: var(--coral);
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.tense-card h3 {
    min-height: 48px;
    margin: 0 0 14px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.35;
}

.tense-card h3 small {
    color: var(--teal);
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 500;
}

.tense-card p {
    min-height: 52px;
    margin: 0 0 10px;
    color: var(--body-copy);
    font-size: .84rem;
    line-height: 1.55;
}

.tense-card p strong {
    color: var(--ink);
}

.structure {
    min-height: 88px;
    margin-top: 15px;
    padding: 12px 13px;
    border-left: 3px solid var(--coral);
    background: var(--table-head);
    color: var(--body-copy);
    font-family: var(--font-display);
    font-size: .76rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.structure b {
    display: inline-block;
    width: 18px;
    color: var(--coral-dark);
}

footer {
    padding: 0 28px 30px;
    font-size: .8rem;
    text-align: center;

    & a{
        color: inherit;
        font-weight: 500;
        text-decoration: underline;
        text-decoration-color: var(--teal);
        text-decoration-thickness: 1px;
        text-underline-offset: .2lh;
    }
}

@media (max-width: 720px) {
    header {
        padding: 27px 18px 10px;
    }

    .header-note {
        /* display: none; */
        margin-top: 0px;
        line-height: 1;
    }

    main {
        padding: 30px 18px 54px;
    }

    .title {
        font-size: 3.35rem;
    }

    .lesson-panel {
        grid-template-columns: 1fr;
    }

    .lesson-copy,
    .rule-card {
        padding: 25px 23px;
    }

    .verbs-panel {
        padding: 23px 16px 18px;
    }

    .panel-heading {
        display: block;
    }

    .panel-heading p {
        margin: 7px 0 14px;
    }

    .search {
        width: 100%;
    }

    th,
    td {
        padding: 11px 12px;
    }

    .tenses-section {
        padding: 23px 16px 18px;
    }

    .tenses-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tense-card h3,
    .tense-card p {
        min-height: 0;
    }

    .lessons-section {
        padding: 23px 16px 18px;
    }

    .lesson-heading {
        display: block;
    }

    .lesson-search-wrap {
        display: block;
        margin-top: 14px;
    }

    .lessons-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}