:root {
    --primary-color: #577582;
    --secondary-color: #7195a4;
    --tertiary-color: #364d57;
    --quaternary-color: #c73364;
    --quinary-color: #f58025;
    --senary-color: #ffdd00;
    --nstx-white: #f5f5f7;
    --nstx-black: #1a1a1a;
}

html,
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    height: 100%;
    margin: 0;
}

.page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1 0 auto;
}

.footer {
    background: #ffffff;
    padding: 2em 0 0 0;
    margin-top: auto;
}

.footer-text {
    margin: 5px 0 0 0;
    line-height: 1.2;
    font-size: small;
    color: #555;
}

/* Simple Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 100%;
    max-width: 100%;
}

.col-10 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
}

.col-9 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 75%;
    max-width: 75%;
}

.col-8 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

.col-7 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
}

.col-6 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 50%;
    max-width: 50%;
}

.col-4 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-3 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 25%;
    max-width: 25%;
}

.col-2 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

.col-1 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 8.333333%;
    max-width: 8.333333%;
}

/* Header Container */
.header-container {
    padding: 0;
    margin-bottom: 0;
}

/* Base nav */
.software-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    background-color: var(--nstx-white);
    padding: 0 0.5rem;
    margin-bottom: 0;
}

.software-nav a,
.nav-trigger {
    text-decoration: none;
    color: var(--primary-color);
    padding: 0.4rem 0.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s ease;
}

/* Hover */
.software-nav a:hover,
.nav-trigger:hover,
.nav-trigger:focus-visible {
    font-weight: 500;
}

/* Active */
.software-nav a,
.nav-trigger {
    text-decoration: none;
    color: var(--primary-color);
    padding: 0.4rem 0.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: inset 0 -2px 1px transparent;
}

/* Hover */
.software-nav a:hover,
.nav-trigger:hover,
.nav-trigger:focus-visible {
    font-weight: 500;
    box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.15);
}

/* Active */
.software-nav a.active,
.nav-item.active>.nav-trigger {
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--primary-color);
}

/* Nav item wrapper */
.nav-item {
    position: relative;
    display: inline-flex;
    font-weight: 400;
}

/* Left side (logo) */
.nav-left {
    display: flex;
    align-items: center;
}

/* Right side (all nav items) */
.nav-right {
    margin-left: auto;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

/* Dropdown trigger */
.nav-trigger {
    background: none;
    border: none;
    cursor: pointer;
}

/* Single arrow definition */
.nav-trigger::after {
    content: "";
    margin-left: 4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s ease;
}

/* Rotate arrow */
.nav-item:hover .nav-trigger::after,
.nav-item:focus-within .nav-trigger::after {
    transform: rotate(180deg);
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    display: none;
    z-index: 1000;
}

/* Show dropdown */
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
    display: block;
}

/* Dropdown links */
.dropdown a {
    display: block;
    padding: 6px 12px;
    font-weight: 400;
}

.dropdown a:hover {
    background-color: #e9ecef;
}

/* Make submenu parent positionable */
.dropdown-item.has-submenu {
    position: relative;
}

/* Style submenu trigger like the other dropdown links */
.dropdown-item.has-submenu > .submenu-trigger {
    display: block;
    padding: 6px 12px;
    font-weight: 400;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

/* Right arrow for submenu trigger */
.dropdown-item.has-submenu > .submenu-trigger::after {
    content: "";
    float: right;
    margin-top: 0.4em;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
}

/* Second-level menu */
.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 200px;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    display: none;
    z-index: 1100;
    margin-left: 2px;
}

.dropdown-item.has-submenu > .submenu {
    display: none;
}

/* Show submenu on hover/focus */
.dropdown-item.has-submenu:hover > .submenu,
.dropdown-item.has-submenu:focus-within > .submenu {
    display: block;
}

/* Hover styles */
.dropdown-item.has-submenu > .submenu-trigger:hover,
.dropdown-item.has-submenu > .submenu-trigger:focus-visible,
.submenu a:hover {
    background-color: #e9ecef;
}

/* Google CSE Overrides */
.gsc-clear-button,
.gsc-clear-button-inside,
.gsc-clear-button-inside:hover,
.gsst_a {
    display: none !important;
}

form.gsc-search-box {
    max-width: 30em;
    margin-bottom: 0 !important;
}

/* Make sure the input padding doesn't reserve space for the hidden icon */
.gsc-input-box {
    padding-right: 0 !important;
    background: transparent !important;
    border: 1px solid var(--primary-color) !important;
}

/* Remove internal borders from CSE table structure */
.gsc-input-box table,
.gsc-input-box td,
.gsc-input-box .gsc-input,
.gsib_a,
.gsib_b {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: none !important;
}

/* Ensure the input field itself has no border or background */
input.gsc-input {
    border: none !important;
    background: transparent !important;
    padding-left: 10px !important;
    box-shadow: none !important;
    outline: none !important;
}

.gsc-search-button {
    width: auto !important;
    min-width: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: transparent !important;
    border: none !important;
    margin-left: -5px;
    padding-left: 0 !important;
}

.gsc-search-button svg {
    fill: var(--primary-color) !important;
    width: 16px !important;
    height: 16px !important;
}

.gsc-control-cse {
    padding: 0 !important;
    background-color: transparent !important;
    border: none !important;
}

/* If CSE uses the "search" input type, also disable native cancel buttons */
.gsc-input input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.gsc-input input[type="search"]::-ms-clear {
    display: none;
}

/* Base styles for table compatibility */

/* Responsive Design */
@media (max-width: 900px) {
    .software-nav {
        flex-wrap: wrap;
        padding: 0.5rem;
    }

    .software-nav a {
        padding: 0.5rem;
        margin-right: 0.1rem;
        font-size: 0.95rem;
    }

    .nav-search {
        width: 100%;
        margin-top: 0.5rem;
        margin-left: 0;
    }

    form.gsc-search-box {
        max-width: 100%;
        width: 100%;
    }

    @media (max-width: 900px) {

        .col-12,
        .col-10,
        .col-9,
        .col-8,
        .col-7,
        .col-6,
        .col-4,
        .col-3,
        .col-2,
        .col-1 {
            flex: 0 0 100%;
            max-width: 100%;
        }
    }
}

/* --- Main site style buttons --- */

.nstx-btn {
    display: inline-block;
    padding: 8px 18px;
    width: 80%;

    background-color: var(--quaternary-color);
    color: #ffffff;

    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;

    border: none;
    border-radius: 6px;

    cursor: pointer;

    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nstx-btn:hover {
    background-color: color-mix(in srgb, var(--quaternary-color) 90%, black);
}

.nstx-btn:active {
    transform: translateY(1px);
}

.nstx-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 400px);
    gap: 24px 40px;
    justify-content: center;
    justify-items: center;
}

.nstx-btn-below {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.nstx-dark-btn {
    display: inline-block;
    padding: 8px 18px;
    min-width: 320px;   /* optional: match grid button width */
    text-align: center;

    background-color: var(--primary-color);
    color: #ffffff;

    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;

    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nstx-dark-btn:hover {
    background-color: color-mix(in srgb, var(--primary-color) 90%, black);
    color: #ffffff;
}

.nstx-dark-btn:active {
    transform: translateY(1px);
}

/* --- Grid of month cards --- */
.months-grid {
    --border: #d7dbe2;
    --muted: #5b6472;
    --ink: #141824;
    --bg: #ffffff;
    --head: #f2f4f8;
    --stripe: #fafbfc;
    --hover: #f1f5ff;
    --link: #1f5bd8;

    --cols: 4;

    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);

    display: grid;
    gap: 12px;
    align-items: start;

    grid-template-columns: repeat(var(--cols), minmax(260px, 1fr));
}

/* 3 across */
@media (max-width: 1200px) {
    .months-grid {
        --cols: 3;
    }
}

/* 2 across */
@media (max-width: 900px) {
    .months-grid {
        --cols: 2;
    }
}

/* 1 across */
@media (max-width: 600px) {
    .months-grid {
        --cols: 1;
    }
}

.months-grid.cols-3 {
    --cols: 3;
}

.months-grid.cols-2 {
    --cols: 2;
}

.months-grid.cols-1 {
    --cols: 1;
}

/* --- Card --- */
.month-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

/* Compact title bar */
.month-card__title {
    display: block;

    background: var(--head);
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.2px;

    text-decoration: none;
    color: var(--ink);
}

.month-card__content {
    padding: 0.5em;
}

.month-card__content p {
    margin: 0 0 0.5em 0;
}

.month-card__content ul {
    margin: 0 0 0.75em 1.25em;
    padding-left: 1em;
}

.months-grid.shot-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
}

.month-card__content.shot-summary {
    text-align: center;
}

.month-card__content.shot-summary img {
    max-width: 100%;
    height: auto;
}

.month-card__badge {
    font-size: 0.75rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 8px;
    background: #fff;
}

/* --- Table --- */
.month-table {
    width: 100%;
    border-collapse: collapse;
}

.month-table thead th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 5px 10px;
    /* tight */
    border-bottom: 1px solid var(--border);
}

.month-table tbody td {
    padding: 4px 10px;
    /* tight */
    border-bottom: 1px solid #eef1f5;
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Zebra striping + hover */
.month-table tbody tr:nth-child(even) td {
    background: var(--stripe);
}

.month-table tbody tr:hover td {
    background: var(--hover);
}

/* Column sizing + alignment */
.col-day {
    width: 44px;
}

.col-num {
    text-align: left;
    font-variant-numeric: tabular-nums;
    width: 90px;
}

.col-link {
    text-align: left;
    width: 92px;
}

/* Links look like “data”, not giant blue anchors */
.month-table a {
    color: var(--link);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.month-table a:hover {
    text-decoration: underline;
}

/* --- Year selector (nav-style buttons) --- */
.year-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 6px;
}

.year-nav-left {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 6px;
}

.year-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.35rem 0.55rem;
    min-width: 3.2em;

    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;

    color: var(--primary-color);
    background-color: #f8f9fa;

    border: 1px solid #dcdcdc;
    border-radius: 6px;

    transition: background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.05s ease;
}

/* Hover = same as nav hover */
.year-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Active year */
.year-link.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

/* Keyboard focus (important for accessibility) */
.year-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Small screens: slightly tighter */
@media (max-width: 600px) {
    .year-link {
        padding: 0.3rem 0.45rem;
        font-size: 0.85rem;
    }
}

.months-grid.months-grid--stack {
    grid-template-columns: 1fr;
    max-width: 95%;
    margin: inherit;
}

.xp-title {
    display: inline-block;
    margin-left: 0.5em;
    font-weight: 600;
    color: #000000;
}

.xp-pi {
    display: inline-block;
    margin-left: 0.5em;
    font-weight: normal;
    color: #666;
}

/* 2-column list of rows; each row is [+] then label */
.diag-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(320px, 1fr));
    gap: 18px 28px;
}

/* One entry = button + label */
.diag-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 16px;
}

/* Make the + look like your year-link but compact/square */
.diag-plus.year-link {
    min-width: 0;
    /* override year-link min width */
    width: 2.2em;
    padding: 0.35rem 0;
    /* tighter horizontally */
    font-weight: 700;
    font-size: 1.1rem;
}

/* Label is not a link */
.diag-label {
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.2;
}

/* Responsive: collapse to one column */
@media (max-width: 900px) {
    .diag-grid {
        grid-template-columns: 1fr;
    }
}



.mdsplus-tree-table {
    border-collapse: collapse;
    width: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.35;
    margin-bottom: 20px;
}

.mdsplus-tree-table th,
.mdsplus-tree-table td {
    border: 1px solid #d7dbe2;
    padding: 10px 12px;
    vertical-align: top;
}

.mdsplus-tree-table thead th {
    background: #f2f4f8;
    font-weight: 600;
    text-align: left;
}

.mdsplus-tree-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

.mdsplus-tree-table td:first-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: nowrap;
}

.mdsplus-tree-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.92em;
    background: #f6f8fa;
    padding: 0.1em 0.25em;
    border-radius: 4px;
}

.mdsplus-tree-table caption {
    caption-side: top;
    font-weight: bold;
    font-size: 1.2em;
    text-align: left;
    padding: 8px 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    width: 100%;
    flex: 1 1 100%;
}

.video-card {
    margin: 0;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: #fff;
}

.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    /* same height everywhere */
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.video-poster {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    /* preserves original aspect ratio */
    background: #000;
}

.play-badge {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 56px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.video-caption {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.65);
}

.references-block {
    display: block;
    clear: both;
    margin-top: 0.75rem;
}

.references-title {
    margin: 0 0 0.35rem 0;
}

.reference-list {
    margin-top: 0;
}

/* ----------------------------
   TDI legacy documentation
---------------------------- */

.tdi-doc {
    font-size: 0.95rem;
    line-height: 1.35;
}

.tdi-doc pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    overflow: auto;
}

.tdi-doc table td {
    padding: 2px 8px 2px 0;
    vertical-align: top;
}

.tdi-doc dir {
    margin: 0.25rem 0 0.75rem 1.25rem;
}

dt {
    margin-bottom: 0.75rem;
}