:root {
    --ink: #0b152f;
    --muted: #3d4a63;
    --paper: #f6f8fb;
    --card: #ffffff;
    --line: #d5dbe3;
    --green: #0b152f;
    --green-dark: #0b152f;
    --green-soft: #e7ebf1;
    --amber: #0b152f;
    --amber-soft: #e7ebf1;
    --red: #0b152f;
    --red-soft: #e7ebf1;
    --blue: #0b152f;
    --blue-soft: #e7ebf1;
    --sidebar: #0b152f;
    --sidebar-text: #f6f8fb;
    --sans: "Source Sans 3", "Segoe UI", sans-serif;
    --serif: "Literata", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.5;
    overflow-x: clip;
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 560;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a { color: var(--green-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3.5rem;
    z-index: 5;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    padding: 0.55rem 0.8rem;
}
.skip-link:focus { top: 0.75rem; }

.brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: var(--serif); font-size: 1rem; }
.brand small { color: var(--muted); font-size: 0.82rem; }
.brand-inverse,
.brand-inverse:hover { color: var(--sidebar-text); }
.brand-inverse small,
.brand-inverse:hover small { color: #c5cad3; }
.brand-inverse .brand-mark {
    background: #f6f8fb;
    color: #0b152f;
    box-shadow: none;
}

.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #0b152f;
    color: #f6f8fb;
    font-family: var(--serif);
    font-weight: 680;
    box-shadow: inset 0 0 0 2px rgba(246, 248, 251, 0.35);
}

.public-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

.site-header {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    box-sizing: border-box;
    background-color: #0b152f;
    color: var(--sidebar-text);
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid rgba(246, 248, 251, 0.12);
}

.site-header-inner,
.site-footer-inner {
    width: min(1080px, calc(100% - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
    margin: 0 auto;
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.9rem 0;
    min-width: 0;
}
.site-header-inner .brand { min-width: 0; flex: 0 1 auto; }
.site-header-inner .brand span:last-child { min-width: 0; }
.site-header-inner .brand strong,
.site-header-inner .brand small { overflow-wrap: anywhere; }
.site-header-inner .public-nav { flex: 0 0 auto; margin-left: auto; }

.public-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.public-nav a { display: inline-flex; align-items: center; min-height: 1.85rem; text-decoration: none; font-weight: 600; color: var(--sidebar-text); }
.public-nav a:hover { color: #f6f8fb; }
.public-nav .button { color: #0b152f; background: #f6f8fb; }
.public-nav .button:hover { color: #0b152f; background: #e7ebf1; }

.public-main {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    min-width: 0;
}
.layout-public .public-main:has(.landing-hero) {
    justify-content: flex-start;
}
.layout-public .public-main:not(:has(.landing-hero)) {
    width: min(1080px, calc(100% - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
    justify-content: center;
}

.site-footer {
    margin-top: auto;
    background: #0b152f;
    color: var(--sidebar-text);
    border-top: 0;
}

.site-footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem 0;
}

.site-footer p { margin: 0; color: #c5cad3; }
.site-footer strong { color: #f6f8fb; }

.app-nav { gap: 0.35rem 0.85rem; }
.app-nav a.is-active {
    box-shadow: inset 0 -2px 0 #f6f8fb;
}
.nav-signout { margin: 0; }
.nav-signout .link-button {
    color: var(--sidebar-text);
    font-weight: 600;
    min-height: 1.85rem;
}
.nav-signout .link-button:hover { color: #f6f8fb; }

.app-main {
    flex: 1 1 auto;
    width: min(1080px, calc(100% - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
    margin: 0 auto;
    padding: 1.35rem 0 2rem;
    min-width: 0;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.page-heading h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.page-heading .lead { margin: 0.45rem 0 0; max-width: 40rem; }
.page-heading-user { text-align: right; }
.page-heading-user strong,
.page-heading-user small { display: block; }
.page-heading-user small { color: var(--muted); margin-top: 0.15rem; }

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin: 0.7rem 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
    grid-template-areas: "copy visual";
    gap: 0;
    align-items: stretch;
    width: 100%;
    min-height: min(34rem, calc(100dvh - 9rem));
    animation: landing-in 0.55s ease both;
}
.landing-copy {
    grid-area: copy;
    max-width: 34rem;
    width: 100%;
    min-width: 0;
    padding: clamp(1.5rem, 4vw, 3.2rem) clamp(1rem, 4vw, 3.5rem);
    padding-left: max(clamp(1rem, 4vw, 3.5rem), env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.landing-hero h1 {
    margin: 0;
    font-size: clamp(1.85rem, 5vw, 3.4rem);
    overflow-wrap: anywhere;
}
.landing-visual {
    grid-area: visual;
    position: relative;
    z-index: 0;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
    background: #0b152f;
    animation: landing-visual-in 0.7s ease 0.08s both;
}
.landing-visual img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: min(34rem, calc(100dvh - 9rem));
    object-fit: cover;
    object-position: center;
    transform: scale(1.02);
    transition: transform 0.45s ease;
}
.landing-visual:hover img { transform: scale(1.05); }

@keyframes landing-in {
    from { opacity: 0; transform: translateY(0.7rem); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes landing-visual-in {
    from { opacity: 0; transform: translateX(0.85rem); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-hero, .landing-visual { animation: none; }
    .landing-visual img, .landing-visual:hover img { transition: none; transform: none; }
}

@media (max-width: 980px) {
    .landing-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "visual"
            "copy";
        min-height: 0;
        animation: none;
    }
    .landing-visual {
        animation: none;
        min-height: clamp(12rem, 36vw, 20rem);
        max-height: none;
    }
    .landing-visual img {
        min-height: clamp(12rem, 36vw, 20rem);
        height: clamp(12rem, 36vw, 20rem);
        max-height: none;
        transform: none;
        object-position: center top;
    }
    .landing-visual:hover img { transform: none; }
    .landing-copy {
        max-width: 36rem;
        padding: 1.5rem max(1.25rem, env(safe-area-inset-right)) 2.25rem max(1.25rem, env(safe-area-inset-left));
    }
}

@media (min-width: 600px) and (max-width: 980px) {
    .landing-copy { max-width: 40rem; }
    .hero-actions .button,
    .hero-actions .button-secondary { width: auto; min-width: 8.5rem; }
}

.card, .auth-card, .assignment-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
}
.card + .card { margin-top: 0.9rem; }
.assignment-card p { margin: 0; color: var(--muted); }

.auth-card { width: min(22rem, 100%); margin: 1.5rem auto; padding: 1.15rem 1.2rem 1.25rem; }
.auth-card h1 { margin: 0 0 0.35rem; font-size: 2rem; }
.auth-card > p { margin-top: 0; color: var(--muted); }

.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-width: 0; transition: grid-template-columns 0.18s ease; }
.app > * { min-width: 0; }
html.sidebar-collapsed .app { grid-template-columns: 4.4rem minmax(0, 1fr); }
.app-panel { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; background: var(--paper); }
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.15rem clamp(0.85rem, 2vw, 1.8rem) 1rem;
    padding-left: max(clamp(0.85rem, 2vw, 1.8rem), env(safe-area-inset-left));
    padding-right: max(clamp(0.85rem, 2vw, 1.8rem), env(safe-area-inset-right));
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}
.app-header-label {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.app-header h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.app-header .lead { margin: 0.45rem 0 0; max-width: 40rem; }
.app-header-user { text-align: right; }
.app-header-user strong, .app-header-user small { display: block; }
.app-header-user small { color: var(--muted); margin-top: 0.15rem; }
.sidebar {
    position: relative;
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 0.85rem 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.sidebar-head {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-right: 2.8rem;
}
.sidebar-head .brand { padding-left: 0.75rem; }
html.sidebar-collapsed .sidebar { align-items: center; padding-left: 0.45rem; padding-right: 0.45rem; }
html.sidebar-collapsed .sidebar-head { padding-right: 0; justify-content: center; }
html.sidebar-collapsed .brand,
html.sidebar-collapsed .side-nav,
html.sidebar-collapsed .sidebar-user { display: none; }
.side-nav { display: grid; gap: 0.25rem; }
.side-nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.72rem 0.75rem;
    border-radius: 0;
    font-weight: 600;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}
.side-nav a:hover { background: rgba(246, 248, 251, 0.12); }
.side-nav a.is-active {
    background: rgba(246, 248, 251, 0.16);
    color: #f6f8fb;
    box-shadow: inset 3px 0 0 #f6f8fb;
}
.sidebar-user {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(246, 248, 251, 0.2);
}
.sidebar-user strong, .sidebar-user small { display: block; overflow-wrap: anywhere; }
.sidebar-user small { color: #c5cad3; margin: 0.15rem 0 0.45rem; }

.main {
    flex: 1;
    padding: 1.25rem clamp(0.85rem, 2vw, 1.8rem) 2rem;
    padding-left: max(clamp(0.85rem, 2vw, 1.8rem), env(safe-area-inset-left));
    padding-right: max(clamp(0.85rem, 2vw, 1.8rem), env(safe-area-inset-right));
    min-width: 0;
}
.sidebar-toggle {
    position: absolute;
    top: 0.55rem;
    right: 0.35rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: 0;
    padding: 0;
    display: grid;
    place-items: center;
}
html.sidebar-collapsed .sidebar-toggle { position: static; }
.sidebar-toggle:hover { background: rgba(246, 248, 251, 0.12); }
.sidebar-toggle-icon {
    width: 0.55rem;
    height: 0.55rem;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 0.2rem;
}
html.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(-135deg);
    margin-left: 0;
    margin-right: 0.2rem;
}
.sidebar-toggle-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.lead { margin: 0.4rem 0 0; max-width: 42rem; color: var(--muted); }

.button, button, input, select, textarea { font: inherit; }
.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 0;
    border-radius: 0;
    background: #0b152f;
    color: #f6f8fb;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    min-height: 2.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}
.button:hover, button.button:hover { background: #16233f; color: #f6f8fb; }
.button-secondary, button.button-secondary {
    background: transparent;
    color: #0b152f;
    box-shadow: inset 0 0 0 1.5px #0b152f;
}
.button-secondary:hover { background: #ffffff; color: #0b152f; }
.button-danger, button.button-danger { background: transparent; color: #0b152f; box-shadow: inset 0 0 0 1.5px #0b152f; }
.button-danger:hover { background: var(--red-soft); color: var(--red); }
.button-small { min-height: 1.85rem; padding: 0.22rem 0.6rem; font-size: 0.84rem; }
.auth-card .button, .auth-card button.button { width: 100%; margin-top: 0.2rem; }
.link-button {
    border: 0;
    background: transparent;
    color: #f6f8fb;
    padding: 0;
    font-weight: 700;
    cursor: pointer;
}
.link-button:hover { color: white; }

.alert { border-radius: 0; border-left: 4px solid currentColor; padding: 0.75rem 0.9rem; margin: 0 0 1rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-success { background: var(--green-soft); color: var(--green-dark); }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-warn { background: var(--amber-soft); color: var(--amber); }
.alert a { color: inherit; font-weight: 700; }

.card, .assignment-card { padding: 1.1rem 1.15rem 1.2rem; min-width: 0; max-width: 100%; container-type: inline-size; container-name: panel; }
.stack { display: grid; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 0.8rem; margin: 1rem 0 1.2rem; }
.stat { padding: 1rem; display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--green); }
.stat b { display: block; font-family: var(--serif); font-size: 1.8rem; }
.stat span { color: var(--muted); }

label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field { margin-bottom: 0.7rem; }
.hint { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.92rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], input[type="search"], input[type="file"], select, textarea {
    width: 100%;
    max-width: min(16.5rem, 100%);
    border: 1px solid var(--line);
    background: white;
    border-radius: 0;
    padding: 0.42rem 0.65rem;
    min-height: 2.15rem;
    font-size: 0.95rem;
    color: var(--ink);
}
textarea { min-height: 5.5rem; max-width: min(24rem, 100%); resize: vertical; }
select.programme-multi {
    max-width: min(24rem, 100%);
    min-height: 7rem;
    height: auto;
    padding: 0.35rem;
}
.auth-card input, .auth-card select, .auth-card textarea { max-width: 100%; }
.toolbar .field { width: min(16.5rem, 100%); max-width: 100%; min-width: 0; flex: 1 1 12rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--green); }
.check { display: flex; gap: 0.55rem; align-items: center; font-weight: 600; }
.check input { width: auto; }

.toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 0.8rem; flex-wrap: wrap; }
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filters a { text-decoration: none; padding: 0.28rem 0.55rem; min-height: 1.85rem; display: inline-flex; align-items: center; border-radius: 0; color: var(--muted); font-size: 0.9rem; }
.filters a.is-active { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.search-form { display: flex; flex-wrap: wrap; gap: 0.5rem; min-width: 0; }
.search-form input { width: min(16rem, 100%); }

.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:hover { background: rgba(0, 0, 0, 0.04); }
th { font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
td .sub { display: block; color: var(--muted); font-size: 0.92rem; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.badge {
    display: inline-block;
    border-radius: 0;
    padding: 0.15rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--amber-soft);
    color: var(--amber);
}
.badge-open, .badge-done { background: var(--green-soft); color: var(--green-dark); }
.badge-soon { background: var(--amber-soft); color: var(--amber); }
.badge-closed { background: var(--red-soft); color: var(--red); }
.badge-wait { background: var(--blue-soft); color: var(--blue); }

.assignment-list { display: grid; gap: 0.9rem; margin-top: 1rem; }
.card-top, .split { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: start; }
.assignment-card h2 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.45rem); }
.meta { margin: 0.45rem 0 !important; }
.instructions { white-space: pre-wrap; margin: 0.7rem 0 !important; }
.card-actions { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin-top: 0.85rem; }
.doc-line { margin-top: 0.7rem !important; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.file-row .sub { display: block; }
.file-row a { flex: none; }
.version-list { list-style: none; margin: 0.45rem 0 0; padding: 0; }
.version-list li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; align-items: baseline; padding: 0.4rem 0; border-top: 1px solid var(--line); }
.submission-now { margin: 0.2rem 0 1rem; }

.accordion { display: grid; gap: 0.65rem; margin-top: 0.85rem; }
.accordion-item,
.accordion-subitem {
    border: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
}
.accordion-summary,
.accordion-subsummary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    cursor: pointer;
    list-style: none;
    padding: 0.85rem 1rem;
}
.accordion-summary::-webkit-details-marker,
.accordion-subsummary::-webkit-details-marker { display: none; }
.accordion-title,
.accordion-meta { min-width: 0; }
.accordion-title .sub,
.accordion-meta .sub { display: block; }
.accordion-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(45deg);
    flex: none;
    transition: transform 0.18s ease;
}
.accordion-item[open] > .accordion-summary .accordion-chevron {
    transform: rotate(-135deg);
}
.accordion-body { padding: 0 0.65rem 0.65rem; }
.accordion-subitem { margin-top: 0.55rem; background: var(--paper); }
.accordion-subitem:first-child { margin-top: 0; }
.accordion-subsummary { padding: 0.75rem 0.85rem; }
.accordion-subbody {
    padding: 0 0.85rem 0.85rem;
    border-top: 1px solid var(--line);
}
.accordion-subbody .report-lines { margin-top: 0.75rem; }
.accordion-subbody .card-actions { margin-top: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
    .accordion-chevron { transition: none; }
}
.report-lines { display: grid; gap: 0.65rem; margin: 0 0 0.9rem; }
.report-lines div { display: grid; gap: 0.1rem; }
.report-lines dt { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.report-lines dd { margin: 0; }
.report-lines .sub { margin-left: 0.35rem; }
.modal {
    width: min(28rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--card);
    color: var(--ink);
}
.modal::backdrop { background: rgba(11, 21, 47, 0.45); }
.modal-body { padding: 1.1rem 1.15rem 1.2rem; overflow: auto; max-height: calc(100vh - 3rem); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.85rem; }
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.modal-close { border: 0; background: transparent; color: var(--ink); min-height: 2.15rem; padding: 0 0.2rem; font-weight: 700; cursor: pointer; }
.modal input, .modal select, .modal textarea { max-width: 100%; }
.work-head, .work-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(8.5rem, 1fr) 6.5rem minmax(0, 1.2fr) 5.5rem;
    gap: 0.55rem 0.85rem;
    align-items: center;
}
.work-head {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.work-row { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.work-row:last-child { border-bottom: 0; padding-bottom: 0; }
.work-title, .work-file { min-width: 0; overflow-wrap: anywhere; }
.work-file .sub, .work-title .sub { display: block; }
.work-action { justify-self: end; }
.empty { color: var(--muted); padding: 0.4rem 0 0.2rem; }
.inline { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
code { font-family: Consolas, "Courier New", monospace; font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.card h2, .auth-card h2 { margin: 0 0 0.55rem; font-size: 1.35rem; }

@media (prefers-reduced-motion: reduce) {
    .app { transition: none; }
}

@container panel (max-width: 46rem) {
    .work-head { display: none; }
    .work-row { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
    .work-action { justify-self: start; }
    .work-due::before, .work-file::before {
        content: "Due";
        display: block;
        margin-bottom: 0.1rem;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--muted);
    }
    .work-file::before { content: "Your file"; }
}

@container panel (max-width: 36rem) {
    thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tr { padding: 0.35rem 0 0.7rem; border-bottom: 1px solid var(--line); }
    tr:last-child { border-bottom: 0; }
    td { border: 0; padding: 0.35rem 0; }
    td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.1rem;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--muted);
    }
}

@media (max-width: 900px) {
    .app, html.sidebar-collapsed .app { display: block; }
    .app-panel { min-height: 0; }
    .sidebar { position: sticky; top: 0; z-index: 2; max-width: 100%; }
    html.sidebar-collapsed .sidebar { align-items: stretch; padding-left: 0.85rem; padding-right: 0.85rem; }
    html.sidebar-collapsed .brand { display: flex; }
    html.sidebar-collapsed .side-nav { display: grid; }
    html.sidebar-collapsed .sidebar-user { display: flex; }
    html.sidebar-collapsed .sidebar-head { width: auto; padding-right: 0; justify-content: flex-start; }
    .sidebar-toggle { display: none; }
    .sidebar-head { padding-right: 0; }
    .sidebar-head, .side-nav, .sidebar-user { min-width: 0; max-width: 100%; }
    .side-nav { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.2rem), 1fr)); overflow: visible; }
    .side-nav a { min-height: 2.4rem; padding: 0.45rem 0.7rem; }
    .sidebar-user { margin-top: 0.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
    .main { padding: 1.2rem max(1rem, env(safe-area-inset-right)) 2.5rem max(1rem, env(safe-area-inset-left)); }
    .search-form, .search-form input, .toolbar .field { width: 100%; max-width: 100%; }
}

@media (max-width: 520px) {
    body { font-size: 16px; }
    .hero-actions { width: 100%; }
    .hero-actions .button,
    .hero-actions .button-secondary,
    .card-actions .button,
    .card-actions .button-secondary { width: 100%; }
    .auth-card {
        width: min(22rem, calc(100% - 0.5rem));
        margin-left: auto;
        margin-right: auto;
    }
    .auth-card h1, .page-heading h1, .landing-hero h1 { font-size: clamp(1.7rem, 8vw, 2.1rem); }
    .page-heading-user { text-align: left; }
    .app-main {
        width: calc(100% - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right));
    }
    .app-nav { width: 100%; }
    .site-header-inner, .site-footer-inner {
        width: calc(100% - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right));
    }
    .landing-visual, .landing-visual img {
        min-height: 12rem;
        height: 12rem;
        max-height: none;
    }
    .lede { font-size: 1.05rem; }
}
