/* Webzilla stylesheet. Keep this source formatted for direct editing. */

/* Theme and typography */

:root {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #25272c;
    background: #f6f6f3;
    font-synthesis: none;
    --muted: #70747c;
    --border: #dedfda;
    --red: #ad403e;
    --blue: #3b60a1;
    --ink: #23262b;
}

/* Base elements */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
textarea {
    outline-offset: 4px;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: .55;
}

button {
    border: 0;
    border-radius: 7px;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -.035em;
}

h2 {
    font-size: 25px;
}

h3 {
    font-size: 17px;
}

/* Buttons and shared utilities */

.primary {
    background: var(--ink);
    color: white;
    border: 1px solid var(--ink);
}

.primary:hover {
    background: #3c414b;
}

.secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink);
}

.secondary:hover {
    background: #f3f4f2;
}

.danger {
    background: #a42f36;
    border: 1px solid #a42f36;
    color: white;
}

.danger:hover {
    background: #86252b;
}

.delete-action {
    color: #a42f36;
    font-size: 12px;
}

.quiet {
    background: transparent;
    color: #656b75;
    padding: 8px;
    font-weight: 500;
}

.quiet:hover {
    background: #e9eae5;
    color: #24272c;
}

.full {
    width: 100%;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
    line-height: 1.65;
}

.eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    line-height: 1.5;
}

/* Branding and team labels */

.wordmark {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 13px;
    letter-spacing: .13em;
    font-weight: 750;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    background: var(--ink);
    color: #fff;
    width: 33px;
    height: 33px;
    border-radius: 8px;
    font-size: 19px;
    letter-spacing: -.1em;
    padding-right: 2px;
}

.team-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 650;
    border-radius: 5px;
    padding: 7px 9px;
    letter-spacing: .015em;
}

.red {
    background: #f3e6e2;
    color: var(--red);
}

.blue {
    background: #e5ecf7;
    color: var(--blue);
}

.team-labels {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Notifications and loading state */

.notice {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background: #fff4dd;
    color: #674918;
    border: 1px solid #dec798;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 5px 25px #0001;
    max-width: min(90vw, 740px);
    font-size: 13px;
}

.loading {
    padding: 50px;
    color: var(--muted);
    text-align: center;
}

/* Login screen */

.login-screen {
    max-width: 1100px;
    min-height: 100vh;
    margin: auto;
    padding: 80px 55px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 100px;
    align-items: center;
}

.login-intro > .wordmark {
    margin-bottom: 75px;
}

.login-intro > .eyebrow {
    margin-bottom: 20px;
}

.login-intro h1 {
    font-size: clamp(35px, 4vw, 54px);
    line-height: 1.12;
    letter-spacing: -.055em;
    margin-bottom: 26px;
}

.intro-text {
    max-width: 400px;
    font-size: 14px;
    line-height: 1.8;
    color: #656b75;
    margin-bottom: 28px;
}

.login-card {
    padding: 36px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 12px 40px #1d222a06;
}

.login-card h2 {
    margin: 10px 0;
}

.login-card > p.muted {
    font-size: 14px;
    margin-bottom: 30px;
}

.login-foot {
    margin: 25px 0 0;
    text-align: center;
}

/* Form controls */

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

input:not([type=radio]),
textarea {
    display: block;
    width: 100%;
    border: 1px solid #d7d9d4;
    border-radius: 6px;
    background: #fff;
    padding: 11px 12px;
    color: var(--ink);
}

form > input,
form > textarea {
    margin-bottom: 22px;
}

input:focus,
textarea:focus {
    border-color: #777e89;
    outline: 2px solid #d8dce2;
    outline-offset: 1px;
}

.error-text {
    font-size: 13px;
    line-height: 1.6;
    color: #a43932;
    min-height: 1px;
}

/* Main workspace and assignment sidebar */

.workspace {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 248px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 25px 20px;
    background: #efefeb;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 47px 2px 15px;
    color: var(--muted);
}

.count {
    font-size: 10px;
    background: #e0e2dc;
    border-radius: 4px;
    padding: 2px 5px;
}

.project-list {
    margin: 18px -7px 25px;
    overflow: auto;
    flex: 1;
}

.project-button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    margin-bottom: 5px;
    padding: 12px 11px;
    overflow-wrap: anywhere;
    font-weight: 500;
    color: #595f67;
}

.project-button small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    margin-top: 6px;
    color: #777e88;
}

.project-button[aria-current=true] {
    background: #fff;
    box-shadow: 0 1px 3px #0000000b;
    border: 1px solid #dbded6;
    color: #20242a;
}

.project-button:hover {
    background: #f9faf7;
}

.sidebar-footer {
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.sidebar-footer > div {
    display: flex;
    align-items: center;
    gap: 7px;
}

.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 100%;
    background: #65886d;
}

.main-panel {
    min-width: 0;
    flex: 1;
}

/* Empty workspace */

.empty-workspace {
    max-width: 780px;
    margin: 80px auto;
    padding: 0 50px;
}

.empty-workspace h1 {
    font-size: 46px;
    line-height: 1.1;
    margin-top: 20px;
}

.empty-workspace > p {
    line-height: 1.8;
    color: var(--muted);
    max-width: 530px;
    font-size: 15px;
}

.empty-workspace > .primary {
    margin-top: 10px;
}

.foundation-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 65px;
}

.foundation-cards > div {
    border-top: 1px solid var(--border);
    padding-top: 22px;
}

.foundation-cards h3 {
    margin-top: 18px;
    margin-bottom: 10px;
}

.foundation-cards p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

/* Assignment heading */

.assignment-header {
    padding: 29px 36px 23px;
}

.assignment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.assignment-actions .breadcrumb {
    margin-bottom: 0;
}

/* Source uploads and page viewer */

.sources-panel {
    padding: 28px 36px;
}

.sources-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.sources-heading h2 {
    margin-bottom: 8px;
    font-size: 21px;
}

.sources-layout {
    display: grid;
    grid-template-columns: minmax(180px, 270px) minmax(0, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.source-item {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.source-item small {
    display: block;
    color: var(--muted);
    margin-top: 8px;
    font-weight: 400;
}

.source-item:hover,
.source-item[aria-current="true"] {
    border-color: var(--ink);
    background: #efefea;
}

.source-viewer {
    min-width: 0;
    overflow-wrap: anywhere;
}

.source-view-toggle[aria-pressed="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
}

.source-pdf-frame {
    display: block;
    width: 100%;
    height: 75vh;
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 18px 0 12px;
    background: white;
}

.source-page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 24px 0 16px;
}

.source-page-controls input {
    width: 75px;
    margin: 0;
}

.source-page-controls label {
    margin: 0;
}

.source-page-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    max-height: 65vh;
    overflow: auto;
    font: 13px/1.7 "Consolas", monospace;
}

#source-form select,
#source-details-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
}

#source-status[data-state="failed"] {
    color: var(--red);
}

#source-status[data-state="needs_review"] {
    color: #8a5700;
}

.breadcrumb {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 9px;
    letter-spacing: .12em;
    color: #777e88;
    font-weight: 650;
    margin-bottom: 15px;
}

.assignment-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.objective {
    font-size: 13px;
    line-height: 1.65;
    color: #69707b;
    max-width: 950px;
    margin-bottom: 0;
    white-space: pre-wrap;
    max-height: 110px;
    overflow: auto;
}

/* Report navigation */

.report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    gap: 10px;
    background: #fafaf8;
}

.report-tabs {
    display: flex;
    align-self: stretch;
}

.report-tab {
    border-radius: 0;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 17px 14px;
    background: none;
    color: #747983;
    font-weight: 500;
}

.report-tab[aria-selected=true] {
    border-bottom-color: var(--ink);
    color: var(--ink);
    font-weight: 650;
}

.red-tab[aria-selected=true] {
    border-bottom-color: var(--red);
}

.blue-tab[aria-selected=true] {
    border-bottom-color: var(--blue);
}

.tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.red-dot {
    background: var(--red);
}

.blue-dot {
    background: var(--blue);
}

/* Report editor and save controls */

.editor-layout {
    display: flex;
    align-items: stretch;
}

.editor-panel {
    flex: 1;
    min-width: 0;
    background: white;
    margin: 24px 28px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.editor-meta {
    display: flex;
    justify-content: space-between;
    padding: 15px 21px;
    border-bottom: 1px solid #eceee8;
    font-size: 10px;
    color: #757b84;
    letter-spacing: .06em;
}

.report-editor {
    border: 0 !important;
    outline: none !important;
    resize: vertical;
    min-height: 390px;
    height: calc(100vh - 375px);
    border-radius: 0 !important;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    line-height: 1.9;
    padding: 24px !important;
    tab-size: 4;
}

.report-editor:focus-visible {
    box-shadow: inset 3px 0 #c4cad4;
}

.save-bar {
    border-top: 1px solid #eceee8;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}

.save-details {
    flex: 1;
    min-width: 120px;
}

.save-details input {
    font-size: 12px;
    padding: 8px;
    border-color: #e2e4de;
    max-width: 380px;
}

.save-details > span {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    color: #667a6d;
}

.save-details > span[data-dirty=true] {
    color: #936524;
}

.save-details > span[data-error=true] {
    color: #a43932;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    background: #fafbf8;
    border-top: 1px solid #eceee8;
    color: #80858b;
    padding: 10px 20px;
    font-size: 10px;
}

/* Revision history */

.history-panel {
    width: 310px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    background: #f4f5f1;
    padding: 21px 20px;
    overflow: auto;
    max-height: calc(100vh - 200px);
}

.history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-heading h2 {
    font-size: 16px;
    margin: 0;
}

.history-item {
    display: block;
    text-align: left;
    background: white;
    border: 1px solid var(--border);
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    font-size: 12px;
    font-weight: 500;
}

.history-item small {
    display: block;
    font-size: 10px;
    color: #717781;
    margin-top: 5px;
    line-height: 1.5;
}

.history-item:hover {
    border-color: #8b919a;
}

.revision-text,
.conflict-banner pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.7;
    max-height: 300px;
    overflow: auto;
    background: #fff;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.text-link {
    display: inline-block;
    font-size: 12px;
    margin: 0 0 12px;
    color: var(--blue);
}

#revision-preview {
    margin-top: 25px;
}

#revision-preview h3 {
    font-size: 15px;
}

/* Recovery and conflict notices */

.inline-banner,
.conflict-banner {
    padding: 14px 20px;
    font-size: 12px;
    line-height: 1.65;
    background: #fff4de;
    color: #755522;
    border-bottom: 1px solid #e5ce9f;
}

.conflict-banner p {
    margin: 7px 0 10px;
}

.conflict-banner summary {
    cursor: pointer;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Assignment dialogs */

dialog {
    border: 1px solid var(--border);
    border-radius: 12px;
    width: min(540px, calc(100vw - 30px));
    padding: 30px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 90px #0002;
}

dialog::backdrop {
    background: #23262b70;
    backdrop-filter: blur(3px);
}

#delete-project-title {
    overflow-wrap: anywhere;
}

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

.dialog-heading .eyebrow {
    margin-bottom: 8px;
    color: var(--muted);
}

.dialog-heading h2 {
    margin-bottom: 26px;
}

fieldset {
    padding: 0;
    border: 0;
    margin: 0 0 20px;
}

legend {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.radio-label {
    display: flex;
    align-items: start;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-weight: 400;
}

.radio-label input {
    margin-top: 3px;
    accent-color: var(--ink);
}

.radio-label strong {
    font-size: 12px;
}

.radio-label small {
    display: block;
    font-size: 11px;
    color: #707781;
    line-height: 1.6;
    margin-top: 3px;
}

/* Accessibility and visibility */

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

[hidden] {
    display: none !important;
}

/* Responsive layout: wide screens */

@media (min-width: 1700px) {
    .assignment-header {
        padding-left: 60px;
    }

    .report-toolbar {
        padding-left: 52px;
    }

    .editor-panel {
        margin-left: 52px;
        margin-right: 52px;
    }

    .report-editor {
        font-size: 14px;
        padding: 30px !important;
    }
}

/* Responsive layout: smaller desktops and tablets */

@media (max-width: 1100px) {
    .sources-layout {
        grid-template-columns: 1fr;
    }

    .sources-panel {
        padding: 24px 18px;
    }

    .sidebar {
        width: 215px;
        padding: 24px 15px;
    }

    .editor-layout {
        flex-wrap: wrap;
    }

    .history-panel {
        width: 100%;
        border-left: 0;
        margin: 20px 28px;
        border: 1px solid var(--border);
        border-radius: 8px;
    }

    .editor-panel {
        width: calc(100% - 56px);
    }

    .login-screen {
        gap: 45px;
        padding: 55px 30px;
    }
}

/* Responsive layout: mobile */

@media (max-width: 700px) {
    .login-screen {
        display: block;
        padding: 30px 20px;
    }

    .login-intro > .wordmark {
        margin-bottom: 30px;
    }

    .login-intro h1 {
        font-size: 35px;
    }

    .login-intro h1 br {
        display: none;
    }

    .intro-text {
        display: none;
    }

    .team-labels {
        margin-bottom: 25px;
    }

    .login-card {
        padding: 25px;
    }

    .workspace {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 16px;
    }

    .sidebar-heading {
        margin-top: 24px;
    }

    .project-list {
        max-height: 180px;
        margin: 12px 0;
    }

    .sidebar-footer {
        padding-top: 8px;
    }

    .assignment-header {
        padding: 24px 18px;
    }

    .assignment-header h1 {
        font-size: 24px;
    }

    .report-toolbar {
        padding: 0 10px;
        flex-wrap: wrap;
    }

    .report-tab {
        padding: 15px 10px;
        font-size: 12px;
    }

    .report-toolbar > .secondary {
        font-size: 11px;
        padding: 8px;
    }

    .editor-panel {
        margin: 15px 10px 0;
        width: calc(100% - 20px);
    }

    .report-editor {
        padding: 16px !important;
        height: 55vh;
        font-size: 12px;
    }

    .save-bar {
        flex-wrap: wrap;
        padding: 12px;
    }

    .save-details {
        flex-basis: 100%;
    }

    .save-bar > .primary {
        margin-left: auto;
    }

    .editor-footer {
        padding: 10px;
    }

    .history-panel {
        margin: 15px 10px;
    }

    .empty-workspace {
        margin: 40px 0;
        padding: 0 25px;
    }

    .empty-workspace h1 {
        font-size: 36px;
    }

    .foundation-cards {
        gap: 16px;
        margin-top: 40px;
    }

    .notice {
        top: 6px;
        font-size: 12px;
    }
}
