:root {
    --navy: #1a2e4a;
    --blue: #2d6a9f;
    --light-blue: #e8f0f7;
    --mid-blue: #c5d8ec;
    --border: #a0b8d0;
    --caption: #555555;
    --white: #ffffff;
    --accent: #2d6a9f;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    line-height: 1.5;
    padding: 40px 20px;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Navbar / Toolbar */
header {
    margin-bottom: 24px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

h1 {
    color: var(--navy);
    font-size: 24px;
    font-weight: 700;
}

.intro {
    color: var(--caption);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 12px;
}

button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

button.primary {
    background-color: var(--blue);
    color: white;
}

button.primary:hover {
    background-color: var(--navy);
    transform: translateY(-1px);
}

button.secondary {
    background-color: white;
    color: var(--navy);
    border: 1px solid var(--border);
}

button.secondary:hover {
    background-color: var(--light-blue);
}

/* Sheet View */
.sheet {
    background: white;
    padding: 40px 50px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 297mm;
    /* A4 aspect ratio helper for screen */
}

.doc-header {
    margin-bottom: 30px;
}

h2 {
    color: var(--navy);
    font-size: 22px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 12px;
    color: var(--caption);
    font-style: italic;
    margin-top: 8px;
}

.accent-rule {
    border: none;
    height: 1px;
    background-color: var(--accent);
}

/* Process Flow */
.process-flow {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background-color: var(--light-blue);
    border: 1px solid var(--border);
    margin-top: 20px;
    border-radius: 4px;
    overflow: hidden;
}

.step {
    padding: 10px 5px;
    text-align: center;
    font-size: 9px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step:last-child {
    border-right: none;
}

.step.start,
.step.end {
    background-color: var(--mid-blue);
}

.step strong {
    font-size: 11px;
    display: block;
    margin-bottom: 2px;
    color: var(--navy);
}

.caption {
    font-size: 10px;
    color: var(--caption);
    text-align: center;
    margin-top: 6px;
}

/* Sections */
.content-section {
    margin-bottom: 25px;
}

.section-banner {
    background-color: var(--navy);
    color: white;
    padding: 6px 12px;
    margin-bottom: 15px;
    position: relative;
    /* For popout positioning */
}

.header-with-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Info Popout Styles */
.info-popout {
    position: relative;
    display: inline-block;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--blue);
    color: white;
    border-radius: 50%;
    font-family: serif;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.info-icon:hover {
    background-color: var(--mid-blue);
}

.popout-content {
    visibility: hidden;
    width: 300px;
    background-color: white;
    color: var(--navy);
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    position: absolute;
    z-index: 100;
    right: 0;
    top: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 11px;
    font-weight: normal;
    text-transform: none;
    /* Override parent uppercase if any */
    letter-spacing: normal;
}

.popout-content p {
    margin-bottom: 8px;
}

.popout-content p:last-child {
    margin-bottom: 0;
}

.popout-content .citation {
    border-top: 1px solid var(--light-blue);
    padding-top: 8px;
    font-size: 10px;
    color: var(--caption);
}

.popout-content .citation a {
    color: var(--blue);
    text-decoration: underline;
}

.info-popout:hover .popout-content {
    visibility: visible;
    opacity: 1;
}

h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-header {
    margin-bottom: 15px;
}

/* Grids */
.grid-3-col {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 15px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Inputs */
.field {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: var(--navy);
    margin-bottom: 4px;
}

.field-note {
    font-size: 10.5px;
    color: var(--caption);
    font-style: italic;
    margin-top: 2px;
}

textarea,
input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.2s;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: var(--blue);
    background-color: #fafcfe;
}

textarea {
    resize: vertical;
}

.inline-input {
    width: auto;
    padding: 2px 5px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
}

/* Classification Grid */
.classification-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.classification-grid .class-group:last-child {
    grid-column: span 2;
}

h4 {
    font-size: 12px;
    color: var(--navy);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--mid-blue);
    padding-bottom: 4px;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.check-list label {
    font-weight: 400;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip {
    font-size: 10px;
    background-color: #fff9db;
    padding: 6px;
    border-left: 3px solid #fcc419;
    margin-top: 10px;
}

.conflict-check {
    margin-top: 20px;
    background-color: var(--light-blue);
    padding: 15px;
    border-radius: 4px;
}

.check-row {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.check-row label {
    font-weight: 400;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.scenario-table {
    width: 100%;
    border-collapse: collapse;
}

.scenario-table th,
.scenario-table td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.scenario-table th {
    background-color: var(--light-blue);
    font-size: 11px;
    color: var(--navy);
}

.scenario-table td:first-child {
    width: 30%;
}

/* Evidence Block */
.evidence-block {
    margin-top: 20px;
    background-color: var(--light-blue);
    padding: 15px;
    border-radius: 4px;
}

/* Footer */
.doc-footer {
    margin-top: 40px;
    text-align: center;
}

.thin-rule {
    border: none;
    height: 1px;
    background-color: var(--border);
    margin-bottom: 10px;
}

.doc-footer p {
    font-size: 10px;
    color: var(--caption);
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }

    .app-container {
        max-width: 100%;
        margin: 0;
    }

    .sheet {
        box-shadow: none;
        padding: 0;
        min-height: auto;
    }

    .content-section {
        page-break-inside: avoid;
    }

    textarea,
    input {
        border-color: #ddd;
    }

    /* Print styling to look like a document */
    .field label {
        color: var(--navy) !important;
    }

    .section-banner {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background-color: var(--navy) !important;
        color: white !important;
    }
}