/* =================================================================
   Embedded Industrial PCs — typography + layout
   ================================================================= */
:root {
    --bg:        #f6f7f9;
    --paper:     #ffffff;
    --fg:        #1a2330;
    --muted:     #5d6776;
    --soft:      #8b94a3;
    --line:      #e1e5eb;
    --line-soft: #eef0f4;
    --accent:    #1f5fa6;
    --accent-hi: #154277;
    --accent-bg: #eaf2fb;
    --ok:        #1f7a3a;
    --ok-bg:     #e2f1e7;
    --warn-bg:   #fff4d6;
    --header-bg: #1f2937;
    --header-fg: #ffffff;
    --max-w:     1400px;
    --content-w: 920px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* --- header / nav --- */
header {
    background: var(--header-bg);
    color: var(--header-fg);
}
header nav {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
}
header nav a {
    color: var(--header-fg);
    text-decoration: none;
    padding: 14px 18px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}
header nav a:hover    { background: rgba(255,255,255,0.07); }
header nav a.active   { border-bottom-color: #5fa6ff; }
header nav a.disabled { color: #97a3b0; pointer-events: none; }

/* --- breadcrumb bar --- */
.breadcrumb-bar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.breadcrumb-bar .inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 10px 24px;
    color: var(--muted);
}
.breadcrumb-bar a { color: var(--accent); text-decoration: none; }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar span { color: var(--fg); font-weight: 500; }

/* =================================================================
   COMPARISON TABLE (index)
   ================================================================= */
main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px 24px 48px;
}

main:not(.product) h1 {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.4px;
}
.lede {
    color: var(--muted);
    margin: 4px 0;
    max-width: 70ch;
    font-size: 15px;
}

table.compare {
    border-collapse: collapse;
    width: 100%;
    margin: 24px 0 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    font-size: 13.5px;
}
table.compare th, table.compare td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    vertical-align: middle;
}
table.compare th:last-child, table.compare td:last-child { border-right: none; }
table.compare thead th {
    background: #ecf0f4;
    color: #2c3e50;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid #c2cbd4;
}
table.compare thead tr.grouping th {
    background: #dde4ec;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #36475a;
}
table.compare tbody tr:nth-child(even):not(.series-header) { background: #fafbfd; }
table.compare tbody tr:hover:not(.series-header) { background: #fff7e0; }
table.compare tr.series-header th {
    background: #e8ecf0;
    color: #2c3e50;
    text-align: left;
    font-weight: 600;
    padding: 11px 14px;
    border-top: 2px solid #b9c3cd;
    border-bottom: 1px solid #b9c3cd;
}
table.compare td.model {
    font-weight: 600;
    white-space: nowrap;
}
table.compare td.model a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
table.compare td.model a:hover { color: var(--accent-hi); border-bottom-style: solid; }
table.compare td.num { text-align: center; }
table.compare .nowrap { white-space: nowrap; }

p.notes, ol.notes { color: var(--muted); font-size: 13px; }
ol.notes { padding-left: 22px; margin-top: 4px; }
p.notes  { margin-top: 28px; margin-bottom: 4px; }

footer {
    background: var(--paper);
    border-top: 1px solid var(--line);
    margin-top: 32px;
}
footer .inner, footer {
    color: var(--muted);
    font-size: 13px;
}
footer .inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 16px 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
body > footer:not(:has(.inner)) {
    text-align: center;
    padding: 16px 24px 28px;
}

/* =================================================================
   PRODUCT DETAIL PAGE
   ================================================================= */
body.product-page { background: var(--bg); }

.page-layout {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px 24px 48px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

/* sticky sidebar TOC */
.toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}
.toc-inner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 8px;
}
.toc-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--soft);
    padding: 0 10px 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line-soft);
}
.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc li a {
    display: block;
    padding: 6px 10px;
    color: var(--fg);
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 4px;
    border-left: 2px solid transparent;
}
.toc li a:hover {
    background: var(--accent-bg);
    color: var(--accent-hi);
    border-left-color: var(--accent);
}

/* main product content */
main.product {
    max-width: var(--content-w);
    margin: 0;
    padding: 0;
}

/* HERO --------------------------------------------------------- */
.hero {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px 32px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(20,30,50,0.04);
}
.hero h1 {
    margin: 0 0 4px;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--fg);
}
.hero .subtitle {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--muted);
}
.hero .subtitle .series-name { color: var(--fg); font-weight: 600; }
.hero .subtitle .mfr { color: var(--accent); text-decoration: none; }
.hero .subtitle .mfr:hover { text-decoration: underline; }
.hero .subtitle .dot { margin: 0 4px; color: var(--soft); }
.hero .subtitle .meta { color: var(--soft); font-size: 13px; }

.hero .order-desc {
    margin: 12px 0 24px;
    padding: 12px 16px;
    background: var(--accent-bg);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: #1a3760;
    line-height: 1.55;
    max-width: 90ch;
}

/* hero stat grid */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
}
.stat {
    padding: 14px 18px;
    background: var(--paper);
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--soft);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.25;
}
.stat-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* CARDS --------------------------------------------------------- */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px 28px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(20,30,50,0.04);
    scroll-margin-top: 24px;
}
.card h2 {
    margin: 0 0 18px;
    padding: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--fg);
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.card h2 .count {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--line-soft);
    padding: 3px 10px;
    border-radius: 11px;
}
.card h3 {
    margin: 18px 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-hi);
    font-weight: 600;
}
.card h3:first-of-type { margin-top: 6px; }

/* KEY-VALUE LISTS ---------------------------------------------- */
dl.kv {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(160px, max-content) 1fr;
    column-gap: 24px;
    row-gap: 0;
}
dl.kv dt {
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
}
dl.kv dd {
    padding: 9px 0;
    margin: 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--fg);
    font-size: 14px;
}
dl.kv > dt:last-of-type,
dl.kv > dd:last-of-type {
    border-bottom: none;
}
dl.kv dd .note {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 3px;
}

/* TABLES inside cards ------------------------------------------- */
.card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin: 0;
}
.card table thead th {
    background: #f4f6f9;
    color: var(--muted);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.card table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}
.card table tbody tr:last-child td { border-bottom: none; }
.card table tbody tr:hover td { background: #fafbfd; }
.card table .num { text-align: center; white-space: nowrap; }
.card table .note-cell {
    color: var(--muted);
    font-size: 12.5px;
}
.card table tr.default td { background: var(--warn-bg); }
.card table tr.default:hover td { background: #fff0b8; }

/* PILLS / tags -------------------------------------------------- */
.pill {
    display: inline-block;
    padding: 2px 8px;
    background: var(--line-soft);
    color: var(--muted);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.pill.loc  { background: var(--accent-bg); color: var(--accent-hi); }
.pill.ok   { background: var(--ok-bg); color: var(--ok); }
.pill.alt  { background: #fdecd3; color: #8a5a14; }
.pill.big  { padding: 6px 14px; font-size: 13px; font-weight: 500; background: var(--paper); color: var(--fg); border: 1px solid var(--line); }
.pill.big strong { margin-right: 4px; color: var(--fg); }
.pill.small { font-size: 10.5px; padding: 1px 7px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* DETAILS / collapsible ----------------------------------------- */
.reveal > summary {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--accent-bg);
    color: var(--accent-hi);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    list-style: none;
    user-select: none;
    border: 1px solid #d4e3f5;
    margin-bottom: 0;
    transition: background 0.1s;
}
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s;
}
.reveal[open] > summary::before { transform: rotate(90deg); }
.reveal > summary:hover { background: #dde9f8; }
.reveal[open] > summary { margin-bottom: 12px; }

/* PORTS TABLE specifics */
.ports tbody tr td:nth-child(2) { white-space: nowrap; }

/* CERTIFICATIONS grid */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.cert-group {
    background: #fafbfd;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 12px 14px;
}
.cert-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-hi);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-soft);
}
.cert-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}
.cert-group li { padding: 4px 0; }
.cert-group li .note {
    color: var(--muted);
    font-size: 12px;
    display: block;
    margin-top: 1px;
}

/* ACCESSORIES tables */
.acc-cat {
    margin-top: 22px !important;
    margin-bottom: 8px !important;
}

/* PACKAGE list */
ul.package {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 32px;
}
ul.package li {
    padding: 6px 0;
    font-size: 14px;
    break-inside: avoid;
}
ul.package .qty {
    display: inline-block;
    min-width: 28px;
    color: var(--accent);
    font-weight: 600;
}

/* SIBLINGS list */
ul.siblings {
    list-style: none;
    padding: 0;
    margin: 0;
}
ul.siblings li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}
ul.siblings li:last-child { border-bottom: none; }
ul.siblings a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
ul.siblings a:hover { text-decoration: underline; }
ul.siblings .note {
    color: var(--muted);
    font-size: 12.5px;
    margin-left: 12px;
}

/* RESPONSIVE ---------------------------------------------------- */
@media (max-width: 1080px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
    .toc {
        position: static;
        max-height: none;
    }
    .toc ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .toc li a {
        padding: 6px 12px;
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: 16px;
        border-left: 1px solid var(--line);
    }
    .toc-label { display: none; }
    .toc-inner { padding: 10px 12px; }
}

@media (max-width: 720px) {
    .page-layout { padding: 16px 12px 32px; }
    .hero { padding: 20px 18px 18px; }
    .hero h1 { font-size: 26px; }
    .card { padding: 18px 16px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { padding: 12px; }
    .stat-value { font-size: 15px; }
    dl.kv { grid-template-columns: 1fr; }
    dl.kv dt { padding: 8px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: none; }
    dl.kv dd { padding: 2px 0 8px; border-bottom: 1px solid var(--line-soft); }
    ul.package { columns: 1; }
    main.product .card table { font-size: 12.5px; }
    .card table thead th, .card table tbody td { padding: 6px 6px; }
    table.compare { font-size: 12px; }
}
