/* =========================================================
   HELP BUILD — CHAIN LINK CALCULATOR
   ========================================================= */

#hb-chain-v19,
#hb-chain-v19 * {
    box-sizing: border-box;
}

#hb-chain-v19 {
    --dark: #152018;
    --dark2: #223128;
    --green: #42664f;
    --tan: #d8c19a;
    --cream: #f4f2ec;
    --white: #fff;
    --text: #202520;
    --muted: #687068;
    --line: #dfe2dc;
    --soft: #f8f9f6;

    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;

    background: var(--cream);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

#hb-chain-v19 a {
    text-decoration: none;
}

.hbv19-container {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}


/* =========================================================
   HEADER
   ========================================================= */

.hbv19-header {
    background: var(--white);
    border-bottom: 1px solid #e7e9e4;
}

.hbv19-header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.hbv19-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dark) !important;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.7px;
}

.hbv19-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: var(--dark);
    color: var(--white);
    font-size: 16px;
    font-weight: 900;
}

.hbv19-back {
    color: var(--green) !important;
    font-size: 14px;
    font-weight: 800;
}


/* =========================================================
   HERO
   ========================================================= */

.hbv19-hero {
    padding: 64px 0 52px;
    background: var(--dark);
}

.hbv19-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--tan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.hbv19-hero h1 {
    max-width: 850px;
    margin: 0 0 16px;
    color: var(--white) !important;
    font-size: clamp(42px, 5vw, 66px);
    line-height: 1.05;
    letter-spacing: -2px;
}

.hbv19-hero p {
    max-width: 820px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 18px;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.hbv19-main {
    padding: 46px 0 84px;
}

#hb-chain-v19 .card {
    margin: 0 0 22px;
    padding: 26px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .035);
}

#hb-chain-v19 .card h1,
#hb-chain-v19 .card h2 {
    margin: 0 0 10px;
    color: var(--dark);
    line-height: 1.1;
}

#hb-chain-v19 .card h1 {
    font-size: 28px;
}

#hb-chain-v19 .card h2 {
    font-size: 22px;
}

#hb-chain-v19 p {
    margin: 0 0 12px;
}

#hb-chain-v19 .muted {
    color: var(--muted);
    font-size: 13px;
}


/* =========================================================
   FORM GRID
   ========================================================= */

#hb-chain-v19 .grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

#hb-chain-v19 .field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

#hb-chain-v19 .field.wide {
    grid-column: span 2;
    max-width: 340px;
}

#hb-chain-v19 label {
    color: #343b35;
    font-size: 13px;
    font-weight: 800;
}

#hb-chain-v19 input,
#hb-chain-v19 select,
#hb-chain-v19 button {
    font: inherit;
}


/* All input/select fields use identical height */

#hb-chain-v19 input,
#hb-chain-v19 select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 46px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cfd5ce;
    border-radius: 4px;
    background: var(--soft);
    color: var(--text);
    line-height: 1.2;
}

#hb-chain-v19 select {
    max-width: 340px;
    padding-right: 28px;
}

#hb-chain-v19 input:focus,
#hb-chain-v19 select:focus {
    outline: 2px solid rgba(66, 102, 79, .18);
    border-color: var(--green);
}

#hb-chain-v19 input[readonly] {
    background: #eef1ed;
    color: #4b554d;
}


/* =========================================================
   ACTION BUTTONS
   ========================================================= */

#hb-chain-v19 .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

#hb-chain-v19 button {
    min-height: 48px;
    padding: 11px 18px;
    border-radius: 4px;
    border: 1px solid #cad0ca;
    background: #eef1ed;
    color: var(--dark);
    cursor: pointer;
    font-weight: 800;
}

#hb-chain-v19 button:hover {
    background: #e3e7e1;
}

#hb-chain-v19 button.primary {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

#hb-chain-v19 button.primary:hover {
    background: var(--dark);
    border-color: var(--dark);
}


/* =========================================================
   SUMMARY
   ========================================================= */

#hb-chain-v19 .summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

#hb-chain-v19 .summary .card-mini {
    min-height: 92px;
    padding: 16px;
    background: var(--dark2);
    border: 0;
    border-radius: 4px;
    color: var(--white);
}

#hb-chain-v19 .summary .card-mini .muted {
    color: rgba(255, 255, 255, .62);
}

#hb-chain-v19 .summary .card-mini strong {
    display: block;
    margin-top: 5px;
    color: var(--white);
    font-size: 19px;
}


/* =========================================================
   BILL OF MATERIALS
   ========================================================= */

#hb-chain-v19 #bom {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#hb-chain-v19 table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
    background: var(--white);
}

#hb-chain-v19 th,
#hb-chain-v19 td {
    border-bottom: 1px solid var(--line);
    padding: 11px 9px;
    text-align: left;
    vertical-align: top;
}

#hb-chain-v19 th {
    background: var(--dark);
    color: var(--white);
    font-size: 12px;
    letter-spacing: .4px;
}

#hb-chain-v19 tbody tr:hover {
    background: #fafbf8;
}


/* =========================================================
   NOTE / FOOTER
   ========================================================= */

.hbv19-note {
    margin-top: 18px;
    padding: 16px 18px;
    background: #ece5d8;
    border-left: 4px solid var(--tan);
    color: #5f584b;
    font-size: 12px;
}

.hbv19-footer {
    padding: 42px 0;
    background: #101711;
    color: rgba(255, 255, 255, .62);
    font-size: 13px;
}


/* =========================================================
   SHOP DRAWING
   Wide SVG scrolls INSIDE this area only
   ========================================================= */

#hb-chain-v19 .hb-shop-card {
    overflow: hidden;
}

#hb-chain-v19 .hb-shop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

#hb-chain-v19 .hb-shop-head h2 {
    margin-bottom: 6px;
}

#hb-chain-v19 .hb-shop-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

#hb-chain-v19 .hb-shop-project-grid {
    margin-bottom: 20px;
}

#hb-chain-v19 .hb-shop-stage {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 18px;
    background: #e9ece7;
    border: 1px solid #d1d7d0;
    border-radius: 5px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

#hb-chain-v19 .hb-shop-stage svg {
    display: block;
    width: 100%;
    min-width: 760px;
    max-width: none;
    height: auto;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
}

#hb-chain-v19 .hb-shop-placeholder {
    min-height: 360px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

#hb-chain-v19 .hb-shop-actions {
    margin-top: 16px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {

    #hb-chain-v19 .grid,
    #hb-chain-v19 .summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    #hb-chain-v19 {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }

    .hbv19-container {
        width: calc(100% - 28px);
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hbv19-header-inner {
        min-height: 68px;
    }

    .hbv19-back {
        font-size: 12px;
    }

    .hbv19-hero {
        padding: 52px 0 42px;
    }

    #hb-chain-v19 .grid,
    #hb-chain-v19 .summary {
        grid-template-columns: minmax(0, 1fr);
    }

    #hb-chain-v19 .field.wide {
        grid-column: span 1;
        max-width: 100%;
    }

    #hb-chain-v19 input,
    #hb-chain-v19 select {
        height: 46px;
        min-height: 46px;
    }

    #hb-chain-v19 select {
        max-width: 100%;
    }

    #hb-chain-v19 .actions {
        flex-direction: column;
    }

    #hb-chain-v19 button {
        width: 100%;
    }

    #hb-chain-v19 .card {
        max-width: 100%;
    }

    #hb-chain-v19 .hb-shop-stage {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    #hb-chain-v19 .hb-shop-stage svg {
        min-width: 760px;
        max-width: none;
    }
}


/* =========================================================
   SHOP DRAWING MOBILE HEADER
   ========================================================= */

@media (max-width: 760px) {

    #hb-chain-v19 .hb-shop-head {
        display: block;
    }

    #hb-chain-v19 .hb-shop-head button {
        margin-top: 14px;
        width: 100%;
    }
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    .hbv19-header,
    .hbv19-hero,
    .hbv19-footer,
    #hb-chain-v19 .actions,
    .hbv19-note {
        display: none !important;
    }

    #hb-chain-v19 {
        width: auto;
        margin: 0;
        background: #fff;
        overflow: visible;
    }

    #hb-chain-v19 .card {
        box-shadow: none;
        break-inside: avoid;
    }

    #hb-chain-v19 .hb-shop-project-grid,
    #hb-chain-v19 .hb-shop-head button,
    #hb-chain-v19 .hb-shop-actions {
        display: none !important;
    }

    #hb-chain-v19 .hb-shop-stage {
        padding: 0;
        border: 0;
        background: #fff;
        overflow: visible;
    }

    #hb-chain-v19 .hb-shop-stage svg {
        min-width: 0;
        box-shadow: none;
    }
}