:root {
        --bg-light: #f8fafc;
        --panel-main: #ffffff;
        --panel-sub: #f1f5f9;
        --accent: #2563eb;         /* Shifted accent to a vivid high-contrast blue */
        --accent-dim: rgba(37, 99, 235, 0.08);
        --text-main: #0f172a;      /* Deep dark slate for primary structure */
        --text-muted: #334155;     /* Darkened gray for clear, readable labels */
        --border-color: #cbd5e1;   /* Defined, clean border line */
        --error: #dc2626;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

    body {
        background-color: var(--bg-light);
        color: var(--text-main);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* GLOBAL HEADER & NAVIGATION */
    .app-header {
        background: var(--panel-main);
        border-bottom: 1px solid var(--border-color);
        padding: 15px 30px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    }
    
    .brand-group { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-main); }
    .brand-group p.subtitle { color: var(--text-muted); font-size: 12px; font-weight: 500; }

    .app-menu {
        display: flex;
        gap: 15px;
        align-items: center;
    }
    
    .menu-link {
        color: var(--text-muted);
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 6px;
        transition: all 0.15s ease;
        background: transparent;
        border: none;
        cursor: pointer;
    }
    
    .menu-link:hover, .menu-link.active {
        color: var(--accent);
        background: var(--panel-sub);
    }

    /* MAIN CONTAINER ADJUSTMENT */
    .container {
        width: 100%;
        max-width: 1100px;
        margin: 40px auto;
        background: var(--panel-main);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 30px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.05);
        flex-grow: 1;
    }

    .workspace {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .io-panel {
        display: grid;
        grid-template-columns: 200px 1fr 140px;
        gap: 12px;
        align-items: end;
    }

    @media (max-width: 768px) {
        .app-header { padding: 15px; flex-direction: column; gap: 15px; align-items: flex-start; }
        .app-menu { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
        .io-panel { grid-template-columns: 1fr; }
    }

    .control-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-main); font-weight: 700; }

    select, input {
        width: 100%;
        background: var(--panel-sub);
        border: 2px solid var(--border-color);
        color: var(--text-main);
        padding: 14px;
        border-radius: 8px;
        font-size: 16px;
        font-family: 'Courier New', monospace;
        font-weight: 600;
        transition: all 0.2s ease;
    }
p{
	font-size:15px; 
	padding-top:10px;
	padding-bottom:15px;
	line-height:30px;
}
    select:focus, input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 10px var(--accent-dim);
    }

    input.invalid {
        border-color: var(--error);
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.15);
    }

    .error-msg {
        color: var(--error);
        font-size: 12px;
        margin-top: 4px;
        min-height: 18px;
    }

    /* Table Layouts */
    .results-table, .reference-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin-top: 15px;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid var(--border-color);
    }

    th, td { padding: 12px 16px; text-align: left; }
    th { background: var(--panel-sub); color: var(--text-main); font-size: 12px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
    td { background: var(--panel-main); border-top: 1px solid var(--border-color); font-family: 'Courier New', monospace; font-size: 15px; }
    
    .format-col { width: 220px; font-weight: 700; color: var(--text-main); font-family: inherit; }
    .value-cell { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
    
    .value-text { word-break: break-all; white-space: normal; line-height: 1.4; color: #000000; font-weight: 700; font-size: 16px; }
    
    .row-meta { font-size: 11px; color: var(--text-muted); font-weight: 600; display: block; margin-top: 2px; text-transform: uppercase; }

    /* Interactive Buttons */
    .btn-action {
        background: transparent;
        border: 1px solid var(--border-color);
        color: var(--text-main);
        padding: 6px 12px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 12px;
        font-weight: 600;
        font-family: sans-serif;
        transition: all 0.15s ease;
        flex-shrink: 0;
    }
    .btn-action:hover { background: var(--panel-sub); border-color: var(--text-main); }
    .btn-action.copied { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

    /* Explicitly styling the Switch Direction button as Dark Blue */
    .btn-reverse-trigger {
        padding: 14px;
        background: #1e3a8a !important;
        border-color: #1e3a8a !important;
        color: #ffffff !important;
    }
    .btn-reverse-trigger:hover {
        opacity: 0.9;
        background: #1e3a8a !important;
    }

    /* RESPONSIVE MOBILE OVERRIDES */
    @media (max-width: 650px) {
        .results-table thead { display: none; }
        .results-table tr { display: flex; flex-direction: column; border-bottom: 1px solid var(--border-color); padding: 14px 0; }
        .results-table td { border: none; padding: 4px 16px; }
        .results-table .format-col { width: 100%; padding-bottom: 2px; color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
        .value-cell { flex-direction: column; align-items: flex-start; gap: 10px; }
        .value-cell .btn-action { align-self: flex-end; margin-top: 4px; }

        /* Make the "Switch Directions" button noticeably larger and punchier on touch devices */
        .btn-reverse-trigger {
            font-size: 16px !important;
            font-weight: 700 !important;
            padding: 16px !important;
        }
    }

    /* Pipeline Step Framework */
    .pipeline-card {
        background: var(--panel-sub);
        border-left: 4px solid var(--accent);
        border: 1px solid var(--border-color);
        border-left-width: 4px;
        border-radius: 4px 8px 8px 4px;
        padding: 20px;
        margin-top: 10px;
    }
    .pipeline-card h3 { font-size: 13px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; letter-spacing: 0.5px; font-weight: 700; }
    .pipeline-data { font-family: 'Courier New', monospace; font-size: 13px; font-weight: 700; line-height: 1.6; color: #1e3a8a; white-space: pre-wrap; word-break: break-all; }

    /* Reference Sheets Core Matrix */
    .reference-section {
        margin-top: 35px;
        border-top: 1px solid var(--border-color);
        padding-top: 25px;
    }
    .reference-section h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-main); margin-bottom: 6px; font-weight: 700; }
    .reference-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; font-weight: 500; }
    
    .grid-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 25px;
    }

    .reference-table td, .reference-table th { padding: 6px 12px; font-size: 13px; }
    .reference-table th { background: var(--panel-sub); color: var(--text-main); font-weight: 700; }
    .reference-table td { background: #ffffff; color: #000000; font-weight: 600; }
    .table-wrapper h3 { font-size: 12px; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.5px; font-weight: 700; }
    
    .scrollable-table {
        max-height: 300px;
        overflow-y: auto;
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }
    .scrollable-table .reference-table { margin-top: 0; border: none; border-radius: 0; }
    .scrollable-table th { position: sticky; top: 0; z-index: 1; }

    /* APP FOOTER STYLES */
    .app-footer {
        background: var(--panel-sub);
        border-top: 1px solid var(--border-color);
        padding: 40px 30px 20px 30px;
    }

    .footer-links-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
        max-width: 1100px;
        margin: 0 auto 30px auto;
        text-align: left;
    }

    .footer-column h4 {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-main);
        margin-bottom: 12px;
        font-weight: 700;
    }

    .footer-column ul {
        list-style: none;
    }

    .footer-column ul li {
        margin-bottom: 8px;
    }

    .footer-column ul li a {
        font-size: 13px;
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.15s ease;
    }

    .footer-column ul li a:hover {
        color: var(--accent);
    }

    .footer-bottom {
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
        text-align: center;
        font-size: 12px;
        color: var(--text-muted);
        font-weight: 500;
    }
    
    .footer-bottom a {
        color: var(--accent);
        text-decoration: none;
        font-weight: 600;
    }
    .footer-bottom a:hover {
        text-decoration: underline;
    }

.app-menu {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 8px 14px;

    text-decoration: none;
    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;

    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;

    transition:
        color .15s ease,
        background-color .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.menu-link:hover {
    color: var(--accent);
    background: var(--panel-sub);
    border-color: var(--border-color);
}

.menu-link:focus-visible {
    outline: none;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.menu-link.active {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.menu-link.active:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.menu-link-clear {
    color: var(--error);
}

.menu-link-clear:hover {
    color: #ffffff;
    background: var(--error);
    border-color: var(--error);
}

/* MOBILE HAMBURGER BUTTON */
.menu-toggle {
    display: none;
    background: var(--panel-sub);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 20px;
    cursor: pointer;
    transition: all .2s ease;
}

.menu-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* DESKTOP */
.app-menu {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* MOBILE */
@media (max-width: 768px) {

    .app-header {
        flex-wrap: wrap;
        padding: 15px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .app-menu {
        display: none;
        width: 100%;
        margin-top: 12px;
        flex-direction: column;
        gap: 6px;
    }

    .app-menu.open {
        display: flex;
    }

    .menu-link {
        width: 100%;
        padding: 12px 14px;
        justify-content: flex-start;
        background: var(--panel-sub);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    .menu-link:hover {
        border-color: var(--accent);
    }
}

    @media (max-width: 600px) {
        .footer-links-grid { grid-template-columns: 1fr; gap: 20px; text-align: center; }
    }