/* Public teacher dashboard, based on the KipSlide panel palette. */
body[data-page="teacher.index"] .vine-main {
    margin-top: clamp(12px, 2vw, 26px);
}

.teacher-dashboard {
    --teacher-background: #e3e7ee;
    --teacher-raised: #f2f5fa;
    --teacher-ink: #222936;
    --teacher-muted: #515c70;
    --teacher-accent: #0b5fd1;
    --teacher-on-accent: #fff;
    --teacher-line: #2229362b;
    --teacher-highlight: #fff;
    --teacher-lowlight: #b6bece;
    --teacher-shadow: 4px 4px 9px var(--teacher-lowlight), -4px -4px 9px var(--teacher-highlight);
    --teacher-inset: inset 3px 3px 8px var(--teacher-lowlight), inset -3px -3px 8px var(--teacher-highlight);
    --teacher-soft: color-mix(in srgb, var(--teacher-accent) 7%, var(--teacher-background));
    --teacher-gap: clamp(14px, 1.7vw, 22px);
    width: min(100%, 1240px);
    margin-inline: auto;
    padding-block: clamp(14px, 2.5vw, 28px) clamp(42px, 6vw, 70px);
    color: var(--teacher-ink);
    font-family: var(--fb, "Onest", "Segoe UI", system-ui, sans-serif);
}

:root[data-theme="ivory"] .teacher-dashboard {
    --teacher-background: #eee8db;
    --teacher-raised: #fbf8f0;
    --teacher-ink: #1d1a15;
    --teacher-muted: #625a4b;
    --teacher-accent: #8a6212;
    --teacher-on-accent: #fffdf7;
    --teacher-line: #1d1a1530;
    --teacher-highlight: #fffdf7;
    --teacher-lowlight: #cbc0aa;
}

:root[data-theme="dark"] .teacher-dashboard {
    --teacher-background: #061820;
    --teacher-raised: #0a2430;
    --teacher-ink: #e6f4f5;
    --teacher-muted: #a1bac2;
    --teacher-accent: #3ee8e4;
    --teacher-on-accent: #03171d;
    --teacher-line: #3ee8e434;
    --teacher-highlight: #0e2d39;
    --teacher-lowlight: #020b10;
}

.teacher-dashboard [hidden] { display: none !important; }
.teacher-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.teacher-dashboard :is(a, button, input):focus-visible {
    outline: 2px solid var(--teacher-accent);
    outline-offset: 3px;
}

.teacher-dashboard__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--teacher-muted);
    font-size: .875rem;
}
.teacher-dashboard__breadcrumbs a { color: var(--teacher-accent); text-underline-offset: .2em; }

.teacher-dashboard__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 28px;
    margin-bottom: var(--teacher-gap);
}
.teacher-dashboard .teacher-dashboard__heading h1 {
    margin: 0 0 8px;
    color: var(--teacher-ink);
    font: 650 clamp(1.55rem, 3vw, 2.45rem)/1.2 var(--fd, "Unbounded", system-ui, sans-serif);
    letter-spacing: -.025em;
}
.teacher-dashboard__heading p {
    max-width: 64ch;
    margin: 0;
    color: var(--teacher-muted);
    font-size: 1rem;
    line-height: 1.55;
}

.teacher-dashboard__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.teacher-dashboard .teacher-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid var(--teacher-line);
    border-radius: 12px;
    color: var(--teacher-ink);
    background: var(--teacher-background);
    box-shadow: var(--teacher-shadow);
    font-family: inherit;
    font-size: .875rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}
.teacher-dashboard .teacher-button:hover {
    border-color: var(--teacher-accent);
    color: var(--teacher-accent);
}
.teacher-dashboard .teacher-button--primary {
    color: var(--teacher-on-accent);
    border-color: var(--teacher-accent);
    background: var(--teacher-accent);
}
.teacher-dashboard .teacher-button--primary:hover {
    color: var(--teacher-on-accent);
    background: color-mix(in srgb, var(--teacher-accent) 88%, var(--teacher-ink));
}

.teacher-dashboard__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--teacher-gap);
    margin: 0 0 calc(var(--teacher-gap) * 1.25);
}
.teacher-panel {
    min-width: 0;
    border: 1px solid var(--teacher-line);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--teacher-raised), var(--teacher-background));
    box-shadow: var(--teacher-shadow);
}
.teacher-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: clamp(14px, 2vw, 22px);
}
.teacher-stat dt {
    margin: 0;
    color: var(--teacher-muted);
    font-size: .875rem;
    font-weight: 550;
    line-height: 1.35;
}
.teacher-stat dt a { color: inherit; text-decoration: none; }
.teacher-stat dt a::after { position: absolute; inset: 0; border-radius: 20px; content: ""; }
.teacher-stat dt a:hover { color: var(--teacher-accent); text-decoration: underline; }
.teacher-stat dd {
    margin: 0;
    color: var(--teacher-ink);
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.teacher-stat > i {
    position: absolute;
    inset: auto 18px 19px auto;
    color: var(--teacher-accent);
    font-size: 1.25rem;
}

.teacher-dashboard__columns {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--teacher-gap);
}
.teacher-dashboard__side { display: grid; gap: var(--teacher-gap); min-width: 0; }
.teacher-dashboard__updates { margin-top: var(--teacher-gap); }
.teacher-dashboard__updates > section:only-child { grid-column: 1 / -1; }
.teacher-panel__heading {
    padding: 14px clamp(14px, 2vw, 21px);
    border-bottom: 1px solid var(--teacher-line);
}
.teacher-dashboard .teacher-panel__heading h2 {
    margin: 0;
    color: var(--teacher-ink);
    font: 700 1.125rem/1.35 var(--fb, "Onest", system-ui, sans-serif);
}
.teacher-panel__body { padding: clamp(14px, 2vw, 21px); }

.teacher-section-search { padding: 15px clamp(14px, 2vw, 21px); }
.teacher-home-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
}
.teacher-home-search label {
    grid-column: 1 / -1;
    color: var(--teacher-muted);
    font-size: .875rem;
    font-weight: 600;
}
.teacher-home-search__field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 44px;
    padding-inline: 12px;
    border: 1px solid var(--teacher-line);
    border-radius: 12px;
    background: var(--teacher-background);
    box-shadow: var(--teacher-inset);
}
.teacher-home-search__field i { color: var(--teacher-accent); }
.teacher-dashboard .teacher-home-search__field input[type="search"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0;
    border: 0 !important;
    color: var(--teacher-ink);
    background: transparent !important;
    box-shadow: none !important;
    font: inherit;
}
.teacher-home-search__field input::placeholder { color: var(--teacher-muted); opacity: 1; }
.teacher-home-search__field:focus-within { outline: 2px solid var(--teacher-accent); outline-offset: 2px; }
.teacher-dashboard .teacher-home-search__field input:focus { outline: none; }
.teacher-home-search__feedback {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--teacher-muted);
    font-size: .875rem;
}
.teacher-home-search__feedback:has(p:not(:empty)) { margin-top: 10px; }
.teacher-home-search__feedback p { margin: 0; }
.teacher-home-search__feedback button {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--teacher-accent);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: .2em;
    cursor: pointer;
}

.teacher-directory__labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px clamp(14px, 2vw, 21px);
    border-block: 1px solid var(--teacher-line);
    background: var(--teacher-soft);
    color: var(--teacher-muted);
    font-size: .8125rem;
    font-weight: 700;
}
.teacher-directory-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 15px clamp(14px, 2vw, 21px);
}
.teacher-directory-card + .teacher-directory-card,
.teacher-link-list li + li,
.teacher-records li + li { border-top: 1px solid var(--teacher-line); }
.teacher-directory-card:hover, .teacher-directory-card:focus-within {
    background: color-mix(in srgb, var(--teacher-accent) 5%, transparent);
}
.teacher-directory-card:last-child { border-radius: 0 0 20px 20px; }
.teacher-directory-card__icon, .teacher-link-list a > i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid var(--teacher-line);
    border-radius: 10px;
    color: var(--teacher-accent);
    background: var(--teacher-soft);
    font-size: 1rem;
}
.teacher-directory-card__icon img { display: block; object-fit: contain; }
.teacher-dashboard :is(.teacher-directory-card, .teacher-records) h3 {
    margin: 0;
    color: var(--teacher-ink);
    font: 650 1rem/1.35 var(--fb, "Onest", system-ui, sans-serif);
    overflow-wrap: anywhere;
}
.teacher-dashboard :is(.teacher-directory-card, .teacher-records) h3 a {
    color: inherit;
    text-decoration: none;
}
.teacher-dashboard :is(.teacher-directory-card, .teacher-records) h3 a:hover {
    color: var(--teacher-accent);
    text-decoration: underline;
    text-underline-offset: .2em;
}
.teacher-dashboard :is(.teacher-directory-card p, .teacher-activity-feature p, .teacher-records p) {
    margin: 5px 0 0;
    color: var(--teacher-muted);
    font-size: .875rem;
    line-height: 1.55;
}
.teacher-dashboard .teacher-activity-feature > p { margin-top: 0; }
.teacher-directory-card__badge {
    justify-self: end;
    padding: 3px 8px;
    border: 1px solid var(--teacher-line);
    border-radius: 7px;
    background: var(--teacher-soft);
    color: var(--teacher-ink);
    font-size: .8125rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.teacher-directory-card__topics,
.teacher-link-list,
.teacher-records { margin: 0; padding: 0; list-style: none; }
.teacher-directory-card__topics,
.teacher-directory-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
}
.teacher-directory-card__topics { margin-top: 8px; }
.teacher-directory-card__topics li {
    padding: 2px 6px;
    border: 1px solid var(--teacher-line);
    border-radius: 6px;
    color: var(--teacher-muted);
    font-size: .8125rem;
    line-height: 1.4;
}

.teacher-link-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px clamp(14px, 2vw, 21px);
    color: var(--teacher-ink);
    text-decoration: none;
}
.teacher-link-list a:hover, .teacher-link-list a:focus-visible {
    background: color-mix(in srgb, var(--teacher-accent) 8%, transparent);
    color: var(--teacher-accent);
}
.teacher-link-list li:last-child a { border-radius: 0 0 20px 20px; }
.teacher-link-list strong, .teacher-link-list small { display: block; }
.teacher-link-list strong { font-size: .9375rem; font-weight: 650; }
.teacher-link-list small {
    margin-top: 2px;
    color: var(--teacher-muted);
    font-size: .8125rem;
    line-height: 1.4;
}

.teacher-activity-feature__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}
.teacher-activity-feature__stats > div {
    padding: 9px 7px;
    border: 1px solid var(--teacher-line);
    border-radius: 9px;
    background: var(--teacher-soft);
}
.teacher-activity-feature__stats dt {
    color: var(--teacher-muted);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.3;
}
.teacher-activity-feature__stats dd {
    margin: 4px 0 0;
    color: var(--teacher-ink);
    font-size: 1.25rem;
    font-weight: 700;
}

.teacher-records li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 12px;
    padding: 14px clamp(14px, 2vw, 21px);
}
.teacher-records .teacher-resource-card { grid-template-columns: auto minmax(0, 1fr); }
.teacher-records__meta { color: var(--teacher-muted); font-size: .8125rem; line-height: 1.35; }
.teacher-records time { white-space: nowrap; }
.teacher-dashboard [id] { scroll-margin-top: 120px; }

body[data-page="students.index"] .vine-main { margin-top: clamp(12px, 2vw, 26px); }
.student-dashboard .teacher-home-search {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto;
}
.student-dashboard .teacher-home-search select {
    min-height: 44px;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--teacher-line);
    border-radius: 12px;
    color: var(--teacher-ink);
    background: var(--teacher-background);
    box-shadow: var(--teacher-inset);
    font: inherit;
}
.student-dashboard .teacher-directory-grid { display: grid; }
.student-dashboard .student-directory-group + .student-directory-group {
    border-top: 1px solid var(--teacher-line);
}
.student-dashboard .student-directory-group__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px clamp(14px, 2vw, 21px);
    border-bottom: 1px solid var(--teacher-line);
    background: var(--teacher-soft);
}
.student-dashboard .student-directory-group__heading span {
    color: var(--teacher-muted);
    font-size: .8125rem;
}
.student-dashboard .student-directory-group__heading div > span {
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}
.student-dashboard .student-directory-group__heading h2 {
    margin: 0;
    color: var(--teacher-ink);
    font: 700 1.125rem/1.35 var(--fb, "Onest", system-ui, sans-serif);
}
.student-dashboard .student-directory-group:first-child .student-directory-group__heading {
    border-top: 0;
}
.student-dashboard .live-search-fragment > [style] { color: var(--teacher-muted) !important; }
.student-dashboard #student-display-tools {
    margin: 0;
    padding: 14px clamp(14px, 2vw, 21px);
}
body[data-page="about"] .vine-main { margin-top: clamp(12px, 2vw, 26px); }
.about-dashboard > .teacher-panel { margin-bottom: var(--teacher-gap); }
.about-dashboard__columns { margin-top: var(--teacher-gap); }
.about-dashboard__brand { display: flex; align-items: flex-start; gap: 12px; }
.about-dashboard__brand img { flex: 0 0 auto; border-radius: 12px; }
.about-dashboard__brand p { margin: 0; }
.about-dashboard__actions { margin-top: 16px; }
.about-dashboard__copy { overflow-wrap: anywhere; }
.about-dashboard__copy :is(p, ul, ol) { color: var(--teacher-muted); }
.about-dashboard__links { margin-top: var(--teacher-gap); }
.about-dashboard__links .teacher-dashboard__actions { padding: clamp(14px, 2vw, 21px); }

.about-legal__note {
    margin: 8px 0 0;
    color: var(--teacher-muted);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.55;
}
.about-legal__lead {
    margin: 0 0 16px;
    color: var(--teacher-muted);
    font-size: .9375rem;
    line-height: 1.6;
}
.about-legal__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--teacher-gap);
}
.about-legal__group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--teacher-line);
    border-radius: 14px;
    background: var(--teacher-soft);
}
.about-legal__group h3 {
    margin: 0 0 10px;
    color: var(--teacher-ink);
    font: 650 .9375rem/1.35 var(--fb, "Onest", system-ui, sans-serif);
}
.about-legal__list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.about-legal__list li {
    color: var(--teacher-muted);
    font-size: .8125rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.about-legal__list a {
    color: var(--teacher-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

@media (max-width: 920px) {
    .teacher-dashboard__columns { grid-template-columns: minmax(0, 1fr); }
    .teacher-dashboard__side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .about-legal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .teacher-dashboard__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-dashboard__side { grid-template-columns: minmax(0, 1fr); }
    .teacher-stat > i { inset: auto 13px 14px auto; }
    .student-dashboard .teacher-home-search { grid-template-columns: minmax(0, 1fr); }
    .student-dashboard .teacher-home-search select { width: 100%; min-width: 0; }
    .student-dashboard .student-directory-group__heading { align-items: flex-start; }
    .about-legal__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
    .teacher-directory-card { grid-template-columns: minmax(0, 1fr) auto; }
    .teacher-directory-card > .teacher-directory-card__icon { display: none; }
    .teacher-records .teacher-publication-card { grid-template-columns: minmax(0, 1fr); }
}
