.delfo-teacher {
    --delfo-ink: #17212b;
    --delfo-muted: #52606d;
    --delfo-border: #cbd5df;
    --delfo-surface: #fff;
    --delfo-soft: #f5f8fb;
    --delfo-primary: #175a72;
    --delfo-primary-dark: #0f4559;
    --delfo-success: #176b49;
    --delfo-warning: #7a4d00;
    --delfo-error: #a12a2a;
    color: var(--delfo-ink);
    font-size: 1rem;
    line-height: 1.55;
    margin: clamp(1rem, 3vw, 2.5rem) auto;
    max-width: 72rem;
    width: 100%;
}

.delfo-teacher *,
.delfo-teacher *::before,
.delfo-teacher *::after {
    box-sizing: border-box;
}

.delfo-teacher [hidden] {
    display: none !important;
}

.delfo-teacher h1,
.delfo-teacher h2,
.delfo-teacher h3 {
    color: var(--delfo-ink);
    line-height: 1.25;
    margin-top: 0;
}

.delfo-teacher h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
.delfo-teacher h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); }
.delfo-teacher h3 { font-size: 1.08rem; }

.delfo-teacher a { color: var(--delfo-primary); }
.delfo-teacher a:hover { color: var(--delfo-primary-dark); }

.delfo-teacher :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #f0a126;
    outline-offset: 3px;
}

.delfo-teacher-heading,
.delfo-activity-card-title,
.delfo-teacher-actions,
.delfo-wizard-nav,
.delfo-add-route {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.delfo-teacher-heading,
.delfo-activity-card-title { justify-content: space-between; }

.delfo-teacher-heading { margin-bottom: 1.5rem; }
.delfo-teacher-heading p { color: var(--delfo-muted); margin-bottom: 0; }

.delfo-teacher-breadcrumb {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: .95rem;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.delfo-teacher-card,
.delfo-publication {
    background: var(--delfo-surface);
    border: 1px solid var(--delfo-border);
    border-radius: .75rem;
    box-shadow: 0 2px 9px rgba(23, 33, 43, .07);
    margin: 0 0 1.25rem;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.delfo-teacher-narrow { max-width: 40rem; }
.delfo-teacher-access { max-width: 34rem; }
.delfo-teacher-login-form { margin-top: 1.25rem; }
.delfo-teacher-login-form > p { margin: 0 0 1rem; }
.delfo-teacher-login-form .delfo-login-remember {
    align-items: center;
    display: inline-flex;
    font-weight: 600;
    gap: .55rem;
    margin: 0;
}
.delfo-teacher-login-form .delfo-login-remember input {
    flex: 0 0 auto;
    margin: 0;
    width: auto;
}

.delfo-activity-grid,
.delfo-publication-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.delfo-activity-card,
.delfo-publication {
    display: flex;
    flex-direction: column;
}

.delfo-activity-card .delfo-teacher-actions { margin-top: auto; }

.delfo-status-badge {
    background: #e7f1f5;
    border-radius: 999px;
    color: var(--delfo-primary-dark);
    display: inline-block;
    font-size: .82rem;
    font-weight: 700;
    padding: .28rem .65rem;
}

.delfo-button,
.delfo-teacher .button {
    align-items: center;
    background: var(--delfo-surface);
    border: 1px solid var(--delfo-primary);
    border-radius: .4rem;
    color: var(--delfo-primary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: .94rem;
    font-weight: 650;
    justify-content: center;
    line-height: 1.3;
    min-height: 2.75rem;
    padding: .62rem .9rem;
    text-decoration: none;
}

.delfo-button:hover,
.delfo-teacher .button:hover {
    background: #edf6f8;
    color: var(--delfo-primary-dark);
}

.delfo-button-primary {
    background: var(--delfo-primary);
    color: #fff !important;
}

.delfo-button-primary:hover { background: var(--delfo-primary-dark); }

.delfo-button:disabled,
.delfo-teacher .button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.delfo-teacher .button-link-delete {
    background: transparent;
    border: 0;
    color: var(--delfo-error);
    cursor: pointer;
    font: inherit;
    padding: .4rem;
    text-decoration: underline;
}

.delfo-teacher label,
.delfo-teacher legend {
    color: var(--delfo-ink);
    display: block;
    font-weight: 700;
    margin: .85rem 0 .35rem;
}

.delfo-teacher input[type="text"],
.delfo-teacher input[type="datetime-local"],
.delfo-teacher input:not([type]),
.delfo-teacher select,
.delfo-teacher textarea {
    background: #fff;
    border: 1px solid #8898a8;
    border-radius: .35rem;
    color: var(--delfo-ink);
    font: inherit;
    max-width: 100%;
    min-height: 2.75rem;
    padding: .6rem .7rem;
    width: 100%;
}

.delfo-teacher textarea { min-height: 7rem; resize: vertical; }
.delfo-teacher fieldset { border: 1px solid var(--delfo-border); border-radius: .45rem; margin: 1rem 0; padding: .8rem 1rem 1rem; }
.delfo-teacher .delfo-radio { display: block; font-weight: 400; margin: .45rem 0; }
.delfo-teacher .delfo-radio input { margin-right: .35rem; }
.delfo-help-text { color: var(--delfo-muted); font-size: .92rem; }

.delfo-teacher-notice {
    border-left: 5px solid var(--delfo-primary);
    border-radius: .25rem;
    margin: 1rem 0;
    padding: .75rem 1rem;
}

.delfo-teacher-notice p:last-child { margin-bottom: 0; }
.delfo-teacher-notice-info { background: #eef7fa; }
.delfo-teacher-notice-success { background: #edf8f3; border-color: var(--delfo-success); }
.delfo-teacher-notice-warning { background: #fff8e8; border-color: var(--delfo-warning); }
.delfo-teacher-notice-error { background: #fff1f1; border-color: var(--delfo-error); }

.delfo-wizard-progress { color: var(--delfo-primary-dark); font-weight: 750; }
.delfo-wizard-nav { justify-content: space-between; margin: .5rem 0 1rem; }
.delfo-status { min-height: 1.5rem; }
.delfo-prepare-form { border-top: 1px solid var(--delfo-border); margin-top: 1.25rem; padding-top: 1.25rem; }

.delfo-route-list { list-style: decimal; padding-left: 1.5rem; }
.delfo-route-list li {
    align-items: center;
    background: var(--delfo-soft);
    border: 1px solid var(--delfo-border);
    border-radius: .4rem;
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(10rem, 1fr) auto auto auto;
    margin: .5rem 0;
    padding: .65rem;
}
.delfo-route-list small { color: var(--delfo-muted); display: block; }
.delfo-guidance { background: var(--delfo-soft); border-radius: .45rem; margin: 1rem 0; padding: 1rem; }

.delfo-strategy-summary ol li,
.delfo-strategy-summary ul li { margin-bottom: .65rem; }
.delfo-primary-actions { margin-bottom: 1.25rem; }
.delfo-version-comparison dt { font-weight: 750; margin-top: .9rem; }
.delfo-version-comparison dd { margin-left: 0; }

.delfo-date-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.delfo-short-code {
    background: var(--delfo-soft);
    border: 1px solid var(--delfo-border);
    border-radius: .25rem;
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: .08em;
    padding: .25rem .5rem;
}
.delfo-break-link { overflow-wrap: anywhere; }
.delfo-qr canvas { height: auto; max-width: 100%; }

.delfo-results-table-wrap { border: 1px solid var(--delfo-border); border-radius: .5rem; overflow-x: auto; }
.delfo-results-table { border-collapse: collapse; min-width: 40rem; width: 100%; }
.delfo-results-table th,
.delfo-results-table td { border-bottom: 1px solid var(--delfo-border); padding: .8rem; text-align: left; vertical-align: middle; }
.delfo-results-table thead { background: var(--delfo-soft); }
.delfo-results-table tbody tr:last-child td { border-bottom: 0; }
.delfo-transcript summary { cursor: pointer; font-weight: 750; }
.delfo-transcript p { border-bottom: 1px solid var(--delfo-border); padding-bottom: .75rem; }

.delfo-teacher-anchor { display: block; height: 0; overflow: hidden; }

.delfo-teacher .screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

@media (max-width: 720px) {
    .delfo-teacher { margin: 1rem auto; }
    .delfo-teacher-heading { align-items: stretch; flex-direction: column; }
    .delfo-teacher-actions { align-items: stretch; flex-direction: column; }
    .delfo-teacher-actions form { width: 100%; }
    .delfo-teacher-actions .delfo-button,
    .delfo-teacher-heading .delfo-button { width: 100%; }
    .delfo-date-grid { grid-template-columns: 1fr; }
    .delfo-route-list li { grid-template-columns: 1fr 1fr; }
    .delfo-route-list li span { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .delfo-teacher * { scroll-behavior: auto !important; }
}
