body {
    font-family: 'Roboto', sans-serif;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: #1f2933;
    background: #ffffff;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid #8b9aab;
    border-radius: 6px;
    background: #f7f9fb;
    color: #1f2933;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #e8eef5;
}

button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

.link-button {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #0645ad;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.link-button:hover {
    background: transparent;
}

.button:focus-visible,
button:focus-visible,
.drop-zone:focus-visible {
    outline: 3px solid #6aa7d8;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 12px;
    z-index: 1000;
    padding: 8px 12px;
    border: 2px solid #1f2933;
    border-radius: 4px;
    background: #ffffff;
    color: #0645ad;
}

.skip-link:focus {
    top: 12px;
}

.tool-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.nav-button {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.9rem;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.analyze-tool {
    width: min(100%, 1500px);
}

.class-report {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 2px solid #c7d0d9;
}

.report-heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.report-heading-row h2 {
    margin: 0 0 6px;
}

.report-summary,
.report-description {
    color: #4f5f6f;
}

.report-summary {
    margin: 0;
}

.report-controls {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #c7d0d9;
    border-radius: 6px;
    background: #f7f9fb;
}

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #8b9aab;
}

.report-tabs button {
    margin-bottom: -1px;
    border-radius: 6px 6px 0 0;
    border-color: #c7d0d9;
    background: #eef4f8;
    color: #174f78;
}

.report-tabs button[aria-selected="true"] {
    padding-top: 6px;
    border-top: 3px solid #2673a6;
    border-bottom-color: #ffffff;
    background: #ffffff;
    color: #1f2933;
    font-weight: 700;
}

#clear-student-files-button,
#clear-all-button {
    border-color: #d7aaa2;
    background: #fff7f5;
    color: #8a2d20;
}

#clear-student-files-button:hover,
#clear-all-button:hover {
    background: #fdeeea;
}

.report-panel {
    min-width: 0;
}

.report-panel > h3:first-child {
    margin-top: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.metric-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid #c7d0d9;
    border-radius: 6px;
    background: #f7f9fb;
}

.metric-label {
    color: #4f5f6f;
    font-size: 0.9rem;
}

.metric-value {
    font-size: 1.35rem;
}

.interpretation-note {
    max-width: 960px;
    padding: 12px 14px;
    border-left: 4px solid #2673a6;
    background: #eaf4fb;
}

.sequence-overview {
    max-width: 1100px;
    margin: 22px 0;
}

.sequence-overview-list {
    display: grid;
    gap: 8px;
}

.sequence-overview-row {
    padding: 10px 12px;
    border-left: 3px solid #c7d0d9;
    background: #f7f9fb;
}

.fixed-sequence-row {
    border-left-color: #8b9aab;
    background: #eef1f4;
}

.sequence-row-annotation {
    display: block;
    margin: 6px 0 0 38px;
    color: #8a4b08;
    font-size: 0.9rem;
    font-weight: 600;
}

.sequence-range-block {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 2px solid #c67519;
    border-radius: 8px;
    background: #fff8ed;
}

.sequence-range-block .sequence-overview-row {
    border-left-color: #c67519;
    background: #ffffff;
}

.hotspot-range-block {
    border-color: #0f766e;
    background: #eefaf7;
}

.hotspot-range-block .sequence-overview-row {
    border-left-color: #0f766e;
}

.broad-range-block {
    border-color: #9b1c1c;
    background: #fff3f3;
}

.broad-range-block .sequence-overview-row {
    border-left-color: #9b1c1c;
}

.sequence-range-heading {
    margin: 0;
    font-size: 1rem;
}

.sequence-range-rate {
    margin: 0 0 4px;
    color: #4f5f6f;
}

.sequence-findings-section {
    max-width: 1200px;
    margin: 28px 0;
}

.segment-finding-card {
    margin: 12px 0 18px;
    padding: 16px;
    border: 1px solid #c67519;
    border-radius: 8px;
    background: #fffdf8;
}

.key-hotspots-section {
    margin-top: 18px;
}

.hotspot-finding-card {
    border-color: #0f766e;
    background: #fbfffe;
}

.broad-finding-card {
    border-color: #9b1c1c;
    background: #fffafa;
}

.segment-finding-card h5 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.segment-finding-card h6 {
    margin: 16px 0 6px;
    font-size: 0.95rem;
}

.segment-finding-summary {
    margin: 0;
    color: #4f5f6f;
}

.order-pattern {
    font-family: Consolas, "Courier New", monospace;
    white-space: nowrap;
}

.expected-order-pattern {
    display: inline-block;
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    padding: 8px 10px;
    border-radius: 4px;
    background: #eef1f4;
}

.segment-element-list {
    display: grid;
    gap: 6px;
    max-width: 1000px;
    margin: 10px 0;
    padding-left: 28px;
}

.supporting-summary-heading {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid #c7d0d9;
}

.overview-findings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.finding-section {
    padding: 14px;
    border: 1px solid #c7d0d9;
    border-radius: 6px;
}

.finding-section h4 {
    margin: 0 0 12px;
}

.finding-list {
    margin: 0;
    padding-left: 24px;
}

.finding-list li {
    margin-bottom: 12px;
}

.finding-metric {
    display: block;
    margin-top: 3px;
    color: #4f5f6f;
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 14px 0;
    padding: 12px;
    border: 1px solid #c7d0d9;
    border-radius: 6px;
    background: #f7f9fb;
}

.report-filters select {
    max-width: min(420px, 100%);
    padding: 7px;
    border: 1px solid #8b9aab;
    border-radius: 4px;
    background: #ffffff;
    font: inherit;
}

.table-scroll {
    max-width: 100%;
    margin-bottom: 24px;
    overflow-x: auto;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.pagination-status {
    color: #4f5f6f;
}

.report-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    border: 1px solid #c7d0d9;
}

.report-table caption {
    padding: 0 0 8px;
    color: #4f5f6f;
    text-align: left;
}

.report-table th,
.report-table td {
    padding: 10px;
    border: 1px solid #c7d0d9;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    background: #e8eef5;
}

.report-table tbody tr:nth-child(even) {
    background: #f7f9fb;
}

.visual-pattern-section {
    margin: 24px 0 34px;
}

.visual-pattern-section > h4 {
    margin-bottom: 6px;
}

.heat-map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
    margin: 10px 0;
    color: #4f5f6f;
    font-size: 0.9rem;
}

.heat-map-gradient {
    display: inline-block;
    flex: 1;
    min-width: 120px;
    height: 14px;
    border: 1px solid #8b9aab;
    border-radius: 4px;
    background: linear-gradient(to right, #eff6fc, #075184);
}

.heat-map-scroll {
    max-width: 100%;
    margin: 12px 0 28px;
    overflow: auto;
}

.heat-map-table {
    border-collapse: collapse;
    border: 1px solid #c7d0d9;
    background: #ffffff;
}

.heat-map-table th,
.heat-map-table td {
    border: 1px solid #d7e0e8;
}

.heat-map-axis-label,
.heat-map-corner {
    min-width: 54px;
    padding: 7px 8px;
    background: #e8eef5;
    color: #1f2933;
    text-align: center;
    white-space: nowrap;
}

.heat-map-corner {
    min-width: 44px;
}

.heat-map-cell {
    min-width: 58px;
    height: 42px;
    padding: 0 6px;
    text-align: center;
    font-weight: 700;
    vertical-align: middle;
}

.heat-map-empty-cell {
    background: #f5f7f9;
}

.expected-transition-cell {
    outline: 3px solid #1f2933;
    outline-offset: -4px;
}

.dense-heat-map .heat-map-axis-label,
.dense-heat-map .heat-map-corner {
    min-width: 34px;
    padding: 5px;
    font-size: 0.78rem;
}

.dense-heat-map .heat-map-cell {
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0;
}

.dominant-pattern-grid {
    display: grid;
    gap: 18px;
    max-width: 1120px;
}

.dominant-pattern-card {
    padding: 16px;
    border: 1px solid #c7d0d9;
    border-radius: 8px;
    background: #ffffff;
}

.dominant-pattern-card h5 {
    margin: 0 0 8px;
}

.reorder-plot-wrapper {
    max-width: 100%;
    margin: 14px 0;
    overflow-x: auto;
    border: 1px solid #d7e0e8;
    border-radius: 6px;
    background: #fbfcfd;
}

.reorder-plot {
    display: block;
    min-width: 640px;
    width: 100%;
    height: auto;
}

.reorder-flow {
    fill: none;
    opacity: 0.58;
    stroke-linecap: round;
    stroke-width: 3.5;
}

.reorder-flow-stable {
    stroke: #6b879c;
}

.reorder-flow-moved {
    stroke: #6a51a3;
}

.reorder-node {
    fill: #ffffff;
    stroke: #1f2933;
    stroke-width: 1.2;
}

.reorder-node-moved {
    fill: #f5f0ff;
    stroke: #6a51a3;
    stroke-width: 2;
}

.reorder-column-heading,
.reorder-node-label {
    fill: #1f2933;
    font-weight: 700;
    text-anchor: middle;
    pointer-events: none;
}

.reorder-column-heading {
    font-size: 14px;
}

.reorder-node-label {
    font-size: 13px;
}

.reorder-pattern-label {
    margin: 0;
    padding: 0 12px 12px;
    color: #4f5f6f;
    font-weight: 700;
}

.sort-button {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
}

.sort-button:hover {
    background: transparent;
}

.element-reference {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-width: 240px;
}

.element-label {
    color: #174f78;
}

.compact-element-text {
    min-width: 0;
}

.class-report:not(.show-full-text) .compact-element-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.full-text-only {
    display: none;
}

.class-report.show-full-text .full-text-only {
    display: block;
}

.relationship-cell,
.element-summary-cell {
    display: grid;
    gap: 8px;
}

.relationship-label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.relationship-full-text {
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    color: #4f5f6f;
}

.class-report.show-full-text .relationship-full-text {
    display: flex;
}

.relationship-operator {
    display: inline-flex;
    align-items: center;
    min-height: 1.45em;
    padding: 0 6px;
    border: 1px solid #c7d0d9;
    border-radius: 999px;
    background: #eef1f4;
    color: #1f2933;
    font-size: 0.88em;
    font-style: italic;
    font-weight: 700;
}

.relationship-text-part {
    min-width: 0;
}

.report-details {
    min-width: 220px;
}

.report-details summary {
    color: #0645ad;
    cursor: pointer;
    text-decoration: underline;
}

.report-details h5 {
    margin-bottom: 6px;
}

.student-detail-section {
    margin-top: 14px;
}

.student-detail-section h4 {
    margin: 0 0 8px;
}

.report-details ul {
    margin-top: 6px;
}

.full-reference {
    margin-top: 12px;
}

.full-reference p,
.full-element-text {
    margin: 4px 0 10px;
    white-space: normal;
}

.report-details dl {
    display: grid;
    grid-template-columns: minmax(180px, auto) 1fr;
    gap: 4px 12px;
    margin-bottom: 0;
}

.report-details dt {
    font-weight: 700;
}

.report-details dd {
    margin: 0;
}

.empty-message {
    color: #4f5f6f;
    font-style: italic;
}

.error-text {
    color: #9b1c1c;
}

.file-panel {
    max-width: 720px;
    margin-bottom: 16px;
}

.file-panel-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.form-field {
    max-width: 720px;
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.optional-text {
    color: #4f5f6f;
    font-weight: 400;
}

.optional-file-loader {
    max-width: 720px;
    margin-top: 10px;
}

.optional-file-loader summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 12px;
}

.home-page {
    text-align: center;
    padding-top: 50px;
}

.home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    column-gap: 20px;
    width: min(100%, 640px);
    margin: 10px auto;
}

.home-actions > :first-child {
    justify-self: end;
}

.home-actions > :last-child {
    justify-self: start;
}

.drop-zone {
    display: grid;
    gap: 6px;
    max-width: 720px;
    min-height: 88px;
    padding: 16px;
    margin: 8px 0 16px;
    border: 2px dashed #8b9aab;
    border-radius: 8px;
    background: #f7f9fb;
    cursor: pointer;
}

.drop-zone span,
.drop-status {
    color: #4f5f6f;
}

.drop-status {
    display: block;
    margin: -10px 0 16px;
}

.drop-zone.drag-over {
    border-color: #2673a6;
    background: #eaf4fb;
}

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

.about-dialog {
    max-width: 640px;
    width: min(640px, calc(100vw - 32px));
    border: 1px solid #8b9aab;
    border-radius: 8px;
    padding: 20px;
}

.about-dialog::backdrop {
    background: rgba(31, 41, 51, 0.45);
}

.about-dialog h2 {
    margin-top: 0;
}

.about-dialog-content {
    max-height: min(65vh, 620px);
    margin-bottom: 16px;
    overflow-y: auto;
    padding-right: 8px;
}

.about-dialog-content h3 {
    margin: 18px 0 6px;
}

.about-dialog-content h3:first-child {
    margin-top: 0;
}

.about-dialog-content p {
    margin: 0 0 10px;
}

.terms-dialog {
    width: min(860px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 32px));
    border: 1px solid #8b9aab;
    border-radius: 8px;
    padding: 20px;
}

.terms-dialog::backdrop {
    background: rgba(31, 41, 51, 0.45);
}

.terms-dialog h2 {
    margin-top: 0;
}

.terms-dialog iframe {
    display: block;
    width: 100%;
    height: calc(100% - 92px);
    margin-bottom: 16px;
    border: 1px solid #c7d0d9;
    background: #ffffff;
}

.terms-of-service {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.55;
}

.instructor-tool {
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #ccc;
    padding: 20px;
}

.excluded {
    text-decoration: line-through;
    opacity: 0.5;
}

.sequence-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.button-group {
    display: flex;
    gap: 4px;
    margin-right: 10px; /* Adds space between the buttons and the sequence text */
}

.sequence-action-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.sequence-text {
    flex-grow: 1;
}

textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 100px;
    padding: 10px;
    margin: 0;
}

.sortable-drag {
    opacity: 0.6;
}

#sequenceList .sequence-item:not(.locked-item) {
    cursor: move; /* Standard "drag" cursor */
}

#sequenceList .locked-item {
    cursor: not-allowed;
}

#startingList .sequence-item, #endingList .sequence-item {
    user-select: none;
    cursor: default;
}

footer {
    width: auto;
    margin: auto -20px -20px;
    text-align: center;
    padding: 10px 5px;
    background-color: #f1f1f1;
    font-size: 0.8em;
}

@media (max-width: 720px) {
    .report-heading-row {
        display: block;
    }

    .report-controls {
        margin-top: 14px;
    }

    .report-filters {
        align-items: stretch;
    }

    .report-filters label,
    .report-filters select {
        width: 100%;
    }
}

@media print {
    body {
        display: block;
        padding: 0;
        color: #000000;
    }

    .tool-nav,
    #analysis-inputs,
    .report-controls,
    .report-filters,
    .report-tabs,
    .pagination,
    footer {
        display: none !important;
    }

    .class-report {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .report-panel[hidden] {
        display: block !important;
    }

    .report-panel {
        break-before: page;
    }

    #overview-panel {
        break-before: auto;
    }

    .table-scroll {
        overflow: visible;
    }

    .report-table {
        min-width: 0;
        font-size: 0.75rem;
    }

    .report-details summary {
        display: none;
    }

    .report-details > :not(summary) {
        display: block;
    }

    .compact-element-text {
        display: block !important;
        overflow: visible !important;
    }
}
.primary-button,
button.primary-button,
#load-example-button {
    border-color: #1f648f;
    background: #2673a6;
    color: #ffffff;
}

.primary-button:hover,
button.primary-button:hover,
#load-example-button:hover {
    background: #1f648f;
}

.eyebrow {
    margin: 0 0 4px;
    color: #1f648f;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.example-home-card,
.example-panel {
    width: min(100%, 760px);
    box-sizing: border-box;
    border: 1px solid #a9c8dc;
    border-radius: 10px;
    background: #f2f8fc;
}

.example-home-card {
    margin: 110px auto 0;
    padding: 16px 18px;
    font-size: 0.88rem;
}

.example-home-card h2,
.example-panel h2 {
    margin: 0 0 8px;
}

.example-home-card h2 {
    font-size: 1.2rem;
}

.example-home-card > p:not(.eyebrow),
.example-panel > div > p:not(.eyebrow) {
    margin: 0;
    color: #405466;
}

.example-home-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.example-home-actions .button {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.example-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 26px;
    padding: 18px;
}

.example-panel .tool-actions {
    margin: 0;
}

#distractorMessage:not(:empty) {
    display: inline-block;
    margin: 10px 0 14px;
    padding: 8px 12px;
    border: 2px solid #9b5c00;
    border-radius: 6px;
    background: #fff4d6;
    color: #5f3700;
    font-size: 1.08rem;
    font-weight: 700;
}

@media (max-width: 680px) {
    .example-home-actions,
    .example-panel .tool-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .example-home-actions > *,
    .example-panel .tool-actions > * {
        width: 100%;
        box-sizing: border-box;
    }
}
