/*******************************************************************************
 * SRF Method Interface Styles
 * 
 * A comprehensive stylesheet for the Simos' Revised Framework (SRF) web interface.
 * Organized in sections:
 * 1. CSS Variables - Theme Colors
 * 2. Base Styles
 * 3. Method Instructions Section
 * 4. Card Drop Zone
 * 5. Cards and Interactive Elements
 * 6. Control Buttons
 * 7. Form Controls and Input Fields
 * 8. Results Display
 * 9. Footer
 *******************************************************************************/

/* =============================================================================
   1. CSS Variables - Theme Colors
   Centralized color management for consistent theming and easy modifications
============================================================================= */
:root {
    --color-header-bg: #325d88;      /* Primary brand color */
    --color-header-text: #fff;        /* Header text color */
    --color-background: #fff;         /* Main background */
    --color-footer-bg: #f8fafc;       /* Footer and page background */
    --color-drop-zone-bg: #fff;       /* Card drop area background */
    --color-drop-zone-text: #7a8794;  /* Placeholder text color */
    --color-main-text: #1f2933;       /* Primary text color */
    --color-button-bg: #325d88;       /* Button background */
    --color-button-bg-hover: #244767; /* Button hover state */
    --color-button-text: #fff;        /* Button text color */
    --color-form-border: #d7e0e6;     /* Form element borders */
    --color-table-border: #e7e9eb;    /* Table borders */
    --color-link: #325d88;            /* Link color */
    --color-link-hover: #b76b43;      /* Link hover state */
    --color-muted-text: #5f6f7a;
    --color-surface-muted: #f8fafc;
    --color-surface-strong: #edf3f8;
    --color-border-strong: #b9c8d0;
    --color-accent: #b76b43;
    --shadow-sm: 0 2px 8px rgba(31, 41, 51, 0.07);
    --shadow-md: 0 12px 32px rgba(31, 41, 51, 0.10);
    --radius: 8px;
}

/* =============================================================================
   2. Base Styles
   Core styling for basic elements and typography
============================================================================= */
* {
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-background);
    color: var(--color-main-text);
    font-size: 15px;
    line-height: 1.55;
}

html {
    background-color: var(--color-footer-bg);
}

/* Header styling with sticky positioning */
header {
    width: 100%;
    background-color: var(--color-header-bg);
    position: sticky;
    top: 0;
    z-index: 10000;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(17, 38, 43, 0.18);
}

header nav {
    display: flex;
    unicode-bidi: isolate;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    gap: 0.75rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

header a {
    text-decoration: none;
    color: var(--color-header-text);
}

header .navbar-brand {
    margin-left: 0.5rem;
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

header .nav-link {
    padding: 0.45rem 0.72rem;
    font-size: 13px;
    font-weight: 600;
    line-height: 22px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

header .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

header .nav-link.nav-link-active,
header .nav-link[aria-current="page"] {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 700;
}

/* Main content area */
main {
    flex: 1 0 auto;
    width: min(90%, 1800px);
    max-width: 1800px;
    margin: 0 auto 2rem;
    padding: 34px 0 28px;
    align-items: center;
    background-color: var(--color-background);
    color: var(--color-main-text);
}

/* Link styling */
main a,
footer a {
    text-decoration: underline;
    color: var(--color-link);
}

main a:hover,
footer a:hover {
    color: var(--color-link-hover);
}

/* Page title */
main > h1 {
    max-width: none;
    color: var(--color-button-bg-hover);
    text-align: center;
    font-size: clamp(1.65rem, 2vw, 2rem);
    margin-top: 0;
    margin-bottom: 2rem;
    font-weight: 500;
    line-height: 1.2;
}

main li {
    margin-bottom: 0.5rem;
}

/* Method selection dropdown */
.dropdown-menu-srf-method {
    border: 1px solid var(--color-form-border);
    border-radius: var(--radius);
    line-height: 1.5;
    font-size: 1rem;
    color: var(--color-main-text);
    min-width: min(100%, 28rem);
    margin: 0.35rem 0 1.25rem;
    padding: 0.45rem 0.65rem;
    background: #ffffff;
}

/* =============================================================================
   3. Method Instructions Section
   Styling for the collapsible method description and instructions
============================================================================= */
.method-details-instructions {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.method-details-instructions p {
    display: block;
    margin-block-start: 0;
    margin-block-end: 0.5em;
    line-height: 1.5;
}

/* Collapsible button styling */
.button-collapsible {
    background-color: transparent;
    color: var(--color-main-text);
    cursor: pointer;
    padding: 0.5rem 0 0 0;
    margin: 0;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
}

/* Collapsible button arrow indicator */
.button-collapsible:before {
    content: ">";
    display: inline-block;
    margin-right: 0.5rem;
    margin-left: 0.2rem;
    transform: rotate(0deg);
    color: var(--color-link);
}

.active, .button-collapsible:hover {
    text-shadow: 0 0 1px var(--color-drop-zone-text);
}

.active:before {
    content: ">";
    display: inline-block;
    margin-right: 0.5rem;
    margin-left: 0.2rem;
    transform: rotate(90deg);
    color: var(--color-link);
}

.detailed-procedure-collapsable {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    margin: 0;
}

/* =============================================================================
   4. Card Drop Zone
   Styling for the interactive card arrangement area
============================================================================= */
.drop-zone-container {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: left;
    min-height: 220px;
    margin-bottom: 0.5%;
    border: 2px dashed #ccc;
    background-color: var(--color-drop-zone-bg);
    border-radius: 8px;
}

.drop-zone {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    grid-template-rows: auto;
    min-height: 120px;
    min-width: 100%;
    padding: 50px 20px 30px 20px;
    gap: 12px;
}

/* Rank indicators below cards */
.ranks-container {
    display: grid;
    justify-content: right;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 12px;
    position: absolute;
    bottom: 5px;
    left: 20px;
    padding: 0;
    min-width: 100%;
    text-align: center;
}

.rank {
    font-size: 0.7rem;
    color: var(--color-main-text);
}

/* Empty state placeholder */
.placeholder-text {
    position: absolute;
    top: 40%;
    width: 100%;
    color: var(--color-drop-zone-text);
    font-size: 1.5rem;
    text-align: center;
    vertical-align: middle;
    display: none;
    pointer-events: none;
}

.drop-zone.empty + .placeholder-text {
    display: block;
}

/* Importance direction indicator */
.importance-texts {
    display: flex;
    font-size: 0.8rem;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.arrow-line {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: var(--color-main-text);
    margin-top: 20px;
    margin-bottom: 15px;
}

.arrow-line::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -1px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 10px solid var(--color-main-text);
}

/* =============================================================================
   5. Cards and Interactive Elements
   Styling for draggable cards and their interactions
============================================================================= */
.card {
    display: flex;
    width: 80px;
    height: 120px;
    border-radius: 8px;
    font-size: 0.8rem;
    box-shadow: 2px 2px 5px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
    justify-content: center;
    align-items: center;
    text-align: center;
    align-self: start;
    overflow-wrap: anywhere;
    white-space: normal;
    hyphens: auto;
}

.card:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Criterion cards */
.card.criterion {
    background: url("/static/images/card_design.png");
    background-size: cover;
	color: #FFFFFF;
    border: 1px solid #ccc;
}

/* Blank cards */
.card.white {
    background: url("/static/images/card_design_white.png");
    background-size: cover;
    color: #000000;
    border: 1px solid #000000;
}

/* Card delete button */
.drop-zone .card button {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.8rem;
    padding: 0.3rem;
    background-color: #A82217;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: none;
}

.drop-zone .card button:hover {
    background-color: #7B1108;
}

.drop-zone .card:hover button {
    display: block;
}

/* Card stacks for source cards */
.card-stacks {
    display: flex;
    gap: 5rem;
    margin-top: 0;
    margin-left: 5rem;
    position: relative;
}

.stack {
    position: relative;
    width: 100px;
    height: 150px;
}

.stack .card {
    position: absolute;
    top: calc(var(--z-index, 0) * 5px);
    left: calc(var(--z-index, 0) * 5px);
    z-index: calc(var(--z-index, 0));
}

/* Stack card positioning */
.stack .card:nth-child(2) { --z-index: 1; }
.stack .card:nth-child(3) { --z-index: 2; }
.stack .card:nth-child(4) { --z-index: 3; }
.stack .card:nth-child(5) { --z-index: 4; }

/* Column insertion button */
.insert-column-btn {
    position: absolute;
    display: none;
    top: 25px;
    background-color: transparent;
    color: var(--color-button-bg);
    font-size: 1.3rem;
    border: none;
    z-index: 10;
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
}

.dz-container:hover .insert-column-btn {
    display: block;
}

/* =============================================================================
   6. Control Buttons
   Styling for action buttons (clear, import, export, calculate)
============================================================================= */
.clear-button, .import-button, .export-button {
    position: absolute;
    top: 0;
    padding: 3px 0;
    width: 5rem;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    z-index: 1000;
    font-weight: 500;
    text-transform: uppercase;
    line-height: 1.5;
    vertical-align: middle;
    text-align: center;
}
.clear-button {
    right: 0;
}
.import-button {
    right: 5.25rem;
}
.export-button {
    right: 10.5rem;
}

/* Calculate and download buttons */
.calculate-button,
.download-button {
    position: static;
    padding: 0.375rem 0.75rem;
    width: 10rem;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    line-height: 1.5;
    vertical-align: middle;
    text-align: center;
}

.calculate-button:hover,
.download-button:hover,
.clear-button:hover,
.import-button:hover,
.export-button:hover {
    background-color: var(--color-button-bg-hover);
}

/* =============================================================================
   7. Form Controls and Input Fields
   Styling for input elements and form controls
============================================================================= */
.form-control {
    width: 6.5rem;
    text-align: center;
    border: 1px solid var(--color-form-border);
    border-radius: 0.375rem;
    line-height: 1.5;
}

/* =============================================================================
   8. Results Display
   Styling for results tables and visualizations
============================================================================= */
.results-container {
    display: flex;
    flex-direction: column;
    justify-content: left;
    width: 100%;
}

.asi_value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.asi-value-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.7rem 0.9rem;
    border: 1px solid #dbe1e9;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 6px 18px rgba(50, 93, 136, 0.08);
}

.asi-value-label {
    font-weight: 600;
}

.asi-value-number {
    font-size: 1.05rem;
}

.results-figure-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
    margin-top: 1rem;
}

.results-figure-card {
    border: 1px solid #dbe1e9;
    border-radius: 0.85rem;
    background: #ffffff;
    padding: 1rem 1rem 0.8rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    min-width: 0;
}

.results-figure-card-wide {
    grid-column: 1 / -1;
}

.results-figure-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    position: relative;
}

.results-figure-header > :first-child {
    flex: 1 1 0;
    min-width: 0;
}

.results-figure-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.results-figure-description {
    margin: 0.3rem 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #5a6372;
    max-width: none;
}

.info-popover {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-popover-trigger {
    border: 1px solid #d5dce5;
    border-radius: 999px;
    background: #ffffff;
    color: var(--color-button-bg);
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.info-popover-trigger:hover,
.info-popover-trigger:focus-visible {
    background: #f4f8fc;
    outline: none;
}

.info-popover-content {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 1001;
    width: min(34rem, 88vw);
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    background: rgba(30, 41, 59, 0.96);
    color: #ffffff;
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
    overflow-x: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.info-popover:hover .info-popover-content,
.info-popover:focus-within .info-popover-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.info-popover-content .asi-math-block {
    margin: 0.35rem 0 0.55rem;
}

.info-popover-content mjx-container {
    color: #ffffff !important;
}

.info-popover-content mjx-container[display="true"] {
    display: block;
    margin: 0.35rem 0;
}

.results-figure-header .info-popover {
    position: static;
}

.results-figure-header .info-popover-content {
    top: calc(100% + 0.35rem);
    right: 0;
    left: auto;
    width: min(30rem, calc(100vw - 4rem));
    max-width: 100%;
}

.asi-info-popover .info-popover-content {
    left: 0;
    right: auto;
    width: min(40rem, calc(100vw - 3rem));
}

/* Results table */
table {
    margin-bottom: 2rem;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.9rem;
    text-align: left;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    width: 53rem;
}
td {
    padding: 6px;
    border: none;
}
th {
    background-color: var(--color-button-bg);
    color: var(--color-header-text);
    font-weight: bold;
    padding: 10px;
    border: none;
}
tr {
    border-bottom: 1px solid #ddd;
}
tr:nth-child(odd) {
    background-color: #FFFFFF;
    color: #000000;
}
tr:nth-child(even) {
    background-color: var(--color-table-border);
    color: #000000;
}

/* Results visualization */
.results-boxplot {
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    align-items: start;
    justify-content: left;
    align-content: start;
    min-height: 22rem;
}

.plot-container {
    display: flex;
    align-items: start;
    justify-content: left;
    align-content: start;
}

.results-pca-plot {
    width: 100%;
    min-height: 22rem;
}

@media (max-width: 1100px) {
    .results-figure-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .results-figure-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    table {
        width: 100%;
        font-size: 0.84rem;
    }

    .results-figure-card {
        padding: 0.9rem 0.85rem 0.75rem;
    }

    .results-figure-header {
        flex-direction: column;
        align-items: stretch;
    }

    .info-popover-content {
        right: auto;
        left: 0;
        width: min(30rem, calc(100vw - 3rem));
    }

    .results-figure-header .info-popover-content {
        left: 0;
        right: auto;
        width: min(30rem, calc(100vw - 2rem));
        max-width: calc(100vw - 2rem);
    }

    .asi-info-popover .info-popover-content {
        width: min(30rem, calc(100vw - 2rem));
    }
}

/* =============================================================================
   9. Footer
   Styling for footer content and disclaimers
============================================================================= */
footer {
    background-color: var(--color-footer-bg);
    margin-top: auto;
    padding: 20px 0px;
}

footer .disclaimer {
    max-width: 70%;
    margin: 0px auto;
}

footer p {
    display: block;
    margin-block-start: 1rem;
    margin-block-end: 1rem;
    color: grey;
    font-size: smaller;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.home-main {
    max-width: 75rem;
    margin: 2.5rem auto 4rem auto;
    width: 92%;
}

.home-hero {
    background: linear-gradient(140deg, #f0f6ff 0%, #ffffff 70%);
    border: 1px solid #dbe6f3;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.home-hero h1 {
    margin: 0 0 0.75rem 0;
    font-size: 2rem;
    font-weight: 500;
}

.home-hero p {
    margin: 0 0 1.5rem 0;
    max-width: 58rem;
    line-height: 1.6;
    color: #586070;
}

.home-cta {
    display: inline-block;
    background-color: var(--color-button-bg);
    color: #ffffff;
    text-decoration: none;
    padding: 0.55rem 1rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.home-cta:hover {
    background-color: var(--color-button-bg-hover);
    color: #ffffff;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.9rem;
}

.home-card {
    border: 1px solid #e3e8ef;
    border-radius: 0.6rem;
    padding: 1rem;
    background-color: #ffffff;
}

.home-card h2 {
    margin: 0 0 0.45rem 0;
    font-size: 1.06rem;
}

.home-card p {
    margin: 0;
    line-height: 1.5;
    color: #5a6372;
    font-size: 0.95rem;
}

.home-reference {
    margin-top: 1.8rem;
    border: 1px solid #dbe1e9;
    border-radius: 0.7rem;
    background-color: #f6f8fa;
    padding: 1.2rem;
}

.home-reference h2 {
    margin: 0 0 0.7rem 0;
    text-align: center;
    font-size: 2rem;
    font-weight: 400;
}

.home-reference p {
    margin: 0 0 0.85rem 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #3f4756;
}

.home-cite-box {
    position: relative;
    margin: 0.55rem 0 1rem 0;
    border: 1px solid #cfd6df;
    border-radius: 0.45rem;
    background-color: #ffffff;
}

.home-cite-box pre {
    margin: 0;
    padding: 1.2rem 2.8rem 1rem 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre;
    overflow-x: auto;
    color: #1e2939;
}

.home-copy-btn {
    position: absolute;
    right: 0.55rem;
    top: 0.5rem;
    border: 1px solid #cfd6df;
    border-radius: 0.35rem;
    background-color: #ffffff;
    color: #485366;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    cursor: pointer;
}

.home-copy-btn:hover {
    border-color: #9bb0c9;
    color: #1f3047;
}

.home-copy-feedback {
    min-height: 1rem;
    font-size: 0.82rem;
    color: #2f7d32;
}

/* =============================================================================
   MCDA-aligned layout refresh
============================================================================= */
.drop-zone-container {
    min-height: 240px;
    border: 2px dashed #d0d0d0;
    background: #ffffff;
    box-shadow: none;
}

.drop-zone {
    padding: 56px 20px 34px;
}

.dz-container {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.placeholder-text {
    color: var(--color-drop-zone-text);
    font-size: 1.15rem;
    font-weight: 600;
}

.card {
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.13);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
    box-shadow: 0 12px 26px rgba(31, 41, 51, 0.18);
}

.card.criterion {
    border-color: rgba(36, 71, 103, 0.42);
}

.card.white {
    border-color: var(--color-border-strong);
}

.card-stacks {
    align-self: stretch;
    gap: 5rem;
    margin-left: 5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.clear-button,
.import-button,
.export-button,
.calculate-button,
.download-button {
    border-radius: 0.375rem;
    box-shadow: none;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.clear-button:hover,
.import-button:hover,
.export-button:hover,
.calculate-button:hover,
.download-button:hover {
    transform: none;
    box-shadow: none;
}

.calculate-button,
.download-button {
    width: 10rem;
    min-width: 10rem;
    margin-right: 0.5rem;
    padding: 0.375rem 0.75rem;
}

.form-control {
    min-height: 2.15rem;
    border-color: var(--color-form-border);
}

#additional-inputs {
    display: block;
    margin: 0.75rem 0;
}

#additional-inputs > div {
    align-items: center;
    gap: 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    max-width: 50rem;
}

#additional-inputs label {
    color: #34434b;
    line-height: 1.45;
}

.arrow-line {
    background-color: var(--color-border-strong);
}

.arrow-line::before {
    border-right-color: var(--color-border-strong);
}

.importance-texts {
    color: var(--color-muted-text);
    font-weight: 600;
}

table {
    width: min(100%, 53rem);
    box-shadow: var(--shadow-sm);
}

.results-figure-card,
.asi-value-pill {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

footer {
    border-top: 1px solid var(--color-form-border);
}

footer .disclaimer {
    max-width: min(1120px, calc(100% - 32px));
}

.home-main {
    max-width: 1120px;
    margin: 0 auto 4rem;
    padding-top: 34px;
    width: min(1120px, calc(100% - 32px));
}

.home-hero {
    border-radius: var(--radius);
    border-color: var(--color-form-border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-sm);
}

.home-hero h1 {
    color: var(--color-button-bg-hover);
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    font-weight: 700;
    line-height: 1.12;
}

.home-hero p,
.home-card p,
.home-reference p {
    color: var(--color-muted-text);
}

.home-cta {
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.home-card {
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.home-card h2,
.home-reference h2 {
    color: var(--color-button-bg-hover);
    text-align: left;
    font-weight: 700;
}

.home-reference {
    border-radius: var(--radius);
    background: var(--color-surface-muted);
    box-shadow: var(--shadow-sm);
}

.home-cite-box,
.home-copy-btn {
    border-radius: 6px;
}

@media (max-width: 900px) {
    header nav {
        align-items: flex-start;
    }

    header .navbar-brand {
        white-space: normal;
    }

    main,
    .home-main {
        width: calc(100% - 24px);
        padding-top: 24px;
    }

    main > h1 {
        margin-bottom: 1.2rem;
    }

    main > div[style*="flex-direction: row"] {
        flex-direction: column !important;
        gap: 0.9rem;
    }

    .card-stacks {
        width: 100%;
        min-height: 170px;
        margin-left: 0;
        gap: 1.5rem;
    }

    #additional-inputs > div {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .clear-button,
    .import-button,
    .export-button {
        position: static;
        width: auto;
        min-width: 5.25rem;
        padding: 0.35rem 0.6rem;
        margin-left: 0.35rem;
    }

    .dz-container > div:first-child {
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    header nav,
    header nav > div {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    header nav > div:last-child {
        flex-direction: row !important;
        flex-wrap: wrap;
    }

    .home-hero,
    .home-reference {
        padding: 1rem;
    }

    .home-cite-box pre {
        font-size: 0.82rem;
    }

    .calculate-button,
    .download-button {
        width: 100%;
        margin: 0 0 0.5rem;
    }
}
