/* Keep previous styles */
body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 20px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #343a40;
    margin-bottom: 30px;
    text-align: center;
}

#flowchart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 700px;
}

.flow-step {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: left;
}

/* Center Step titles */
.flow-step h4 {
    margin-top: 0;
    color: #007bff;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.content label { /* Keeping for potential future use, but graphics use .box-label */
    font-weight: bold;
    color: #495057;
    display: block;
    margin-bottom: 5px;
}

.content p.description { /* Style for descriptive text */
    margin: 10px 0;
    color: #6c757d;
    font-size: 0.95em;
}

.content hr {
    border: 0;
    height: 1px;
    background-color: #e9ecef;
    margin: 15px 0;
}

pre {
    background-color: #f1f3f5; /* Slightly different background */
    padding: 10px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.95em;
    border: 1px solid #ced4da;
    margin-top: 5px; /* Space from label */
}

code {
    font-family: monospace;
    color: #212529;
}

/* Main flowchart arrow */
.arrow {
    font-size: 1.8em; /* Adjusted size */
    color: #adb5bd;
    margin: -5px 0 10px 0; /* Adjust margins */
    line-height: 1;
    text-align: center; /* Ensure icon centers */
}

/* --- Styles for Graphical Steps --- */

/* Container for horizontal process (like Step 2) */
.graphical-process {
    display: flex;
    align-items: center; /* Vertically align items */
    justify-content: space-around; /* Distribute space */
    gap: 15px; /* Space between elements */
}

/* Container for distinct input/output blocks */
.graphical-input-output {
    display: flex;
    flex-direction: column; /* Stack input/output vertically by default */
    gap: 15px;
}
/* Layout for Step 4 to have input above output */
.graphical-input-output.column-layout {
     align-items: center; /* Center items horizontally */
}


/* Box for processing action */
.processing-box {
    background-color: #fff0c1; /* Light yellow */
    border: 1px dashed #f0ad4e; /* Orange dashed border */
    border-radius: 5px;
    padding: 15px 20px;
    text-align: center;
    font-weight: bold;
    color: #8a6d3b; /* Dark yellow text */
    flex-shrink: 0; /* Prevent shrinking */
}
.processing-box i {
    margin-right: 8px;
    color: #f0ad4e;
}

/* Box for data input/output */
.data-box {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 15px;
    background-color: #f8f9fa; /* Light grey background */
    flex-grow: 1; /* Allow boxes to grow */
    min-width: 150px; /* Minimum width */
}
.data-box.full-width { /* Modifier for Step 4 output */
    width: 100%;
}

.box-label {
    font-weight: bold;
    font-size: 0.95em;
    color: #495057;
    display: block;
    margin-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
}
.box-label i {
    margin-right: 6px;
    color: #007bff; /* Use theme color for icons */
}

/* Arrow within a graphical step */
.process-arrow {
    font-size: 1.5em;
    color: #6c757d; /* Grey arrow */
    flex-shrink: 0;
}
.process-arrow.vertical-arrow { /* Style for vertical arrow in Step 4 */
    margin: 5px 0;
}

/* Container for token boxes */
.token-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Align tokens to the start */
    gap: 8px;
    margin-top: 5px;
    padding: 5px 0; /* Add some padding */
}

/* Individual token box */
.token-box {
    background-color: #d1ecf1; /* Light blue */
    border: 1px solid #bee5eb; /* Blue border */
    color: #0c5460; /* Dark blue text */
    padding: 4px 10px;
    border-radius: 15px; /* Pill shape */
    font-size: 0.9em;
    font-family: monospace;
    white-space: nowrap; /* Prevent wrapping within a token */
}

.output-count {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 8px;
    text-align: right;
}

/* Step 3 Model Graphic Specifics (slight adjustments) */
.model-graphic {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 15px; /* Reduced padding */
    margin-top: 15px;
    background-color: #e7f3ff;
}
.model-graphic .graphic-label {
    font-size: 0.9em;
    color: #555;
    display: flex; /* Align icon and text */
    align-items: center;
    justify-content: center; /* Center label content */
    margin-bottom: 10px;
}
.model-graphic .graphic-label i {
    margin-right: 5px;
}
.model-graphic #graphic-tokens-container { /* Re-use token container style */
     justify-content: center; /* Center tokens in Step 3 input */
     margin-bottom: 10px;
}
.model-box {
    background-color: #fff;
    border: 2px solid #0056b3;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: auto; /* Let content determine width */
    min-width: 200px; /* Ensure minimum size */
}
.model-icon i { /* Style the brain icon */
    font-size: 1.8em;
    color: #0056b3; /* Darker blue */
    margin-bottom: 5px;
    display: block; /* Put icon on its own line */
}
.model-box small {
    font-size: 0.8em;
    color: #6c757d;
    display: block;
    margin-top: 5px;
}


/* --- Step 4 Vector Output Styles --- */
#vector-pairs-output {
    display: flex;
    flex-direction: column; /* Stack pairs vertically */
    gap: 10px; /* Space between pairs */
    margin-top: 10px;
}

.vector-pair {
    display: flex;
    align-items: center; /* Align token and vector */
    gap: 10px;
    background-color: #f8f9fa; /* Match data box background */
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.vector-pair .token-box { /* Re-use token style */
   flex-shrink: 0; /* Don't shrink token */
}

.vector-box {
    font-family: monospace;
    font-size: 0.9em;
    color: #343a40; /* Dark text for vector */
    background-color: #e9ecef; /* Slightly different background */
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #ced4da;
    flex-grow: 1; /* Allow vector box to take remaining space */
    white-space: nowrap; /* Prevent vector preview wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis for long vectors */
}