/* ===========================================
   HAWKSBURY TIMBER CALCULATOR
   Version: 20260207-005
   All selectors scoped to .htc- prefix.
   =========================================== */

/* --- Page Wrapper --- */
.htc-page {
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 60px;
    box-sizing: border-box;
}

.htc-page *,
.htc-page *::before,
.htc-page *::after {
    box-sizing: border-box;
}

/* --- Page Title --- */
.htc-page-title {
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 2rem;
    font-weight: 800;
    color: #2D3748;
    margin: 0 0 30px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #E6C261;
    line-height: 1.3;
}

/* --- Calculator Shell --- */
.htc-calculator {
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 16px;
    line-height: 1.6;
    color: #2D3748;
    background: #f4f1ea;
    border: 4px solid #2D3748;
    box-shadow: 8px 8px 0 rgba(45, 55, 72, 0.15);
}

/* --- Header --- */
.htc-header {
    background: #A8B39B;
    padding: 28px 40px;
    color: #2D3748;
}

.htc-header-title {
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #2D3748;
}

.htc-header-sub {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
    color: #2D3748;
}

/* --- Tabs --- */
.htc-tabs {
    display: flex;
    border-bottom: 3px solid #2D3748;
    background: #f4f1ea;
    margin: 0;
    padding: 0;
    list-style: none;
}

.htc-tab {
    padding: 14px 28px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2D3748;
    background: transparent;
    border: none;
    border-bottom: 4px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -3px;
}

.htc-tab:hover {
    background: rgba(45, 55, 72, 0.06);
}

.htc-tab.is-active {
    background: #2D3748;
    color: #ffffff;
    border-bottom-color: #E6C261;
}

/* --- Body / Content Area --- */
.htc-body {
    padding: 30px 40px;
}

/* --- Section Card --- */
.htc-section {
    background: #ffffff;
    border: 2px solid #2D3748;
    padding: 28px;
    margin-bottom: 24px;
}

.htc-section-title {
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: #2D3748;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #E6C261;
}

/* --- Unit Toggle --- */
.htc-unit-toggle {
    margin-bottom: 24px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #2D3748;
}

/* --- Mode Toggle Switch --- */
.htc-mode-toggle,
.htc-orientation-toggle {
    margin-bottom: 20px;
}

.htc-toggle-switch {
    display: flex;
    gap: 0;
    border: 2px solid #2D3748;
    background: #ffffff;
    overflow: hidden;
}

.htc-toggle-switch input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.htc-toggle-option {
    flex: 1;
    padding: 12px 20px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    color: #2D3748;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    border-right: 1px solid rgba(45, 55, 72, 0.1);
}

.htc-toggle-option:last-child {
    border-right: none;
}

.htc-toggle-switch input[type="radio"]:checked+.htc-toggle-option {
    background: #A8B39B;
    color: #2D3748;
    font-weight: 800;
}

/* Unit toggle active state uses sage green */
.htc-unit-toggle .htc-toggle-switch input[type="radio"]:checked+.htc-toggle-option {
    background: #A8B39B;
    color: #2D3748;
}

.htc-toggle-switch input[type="radio"]:not(:checked)+.htc-toggle-option:hover {
    background: rgba(45, 55, 72, 0.05);
}

/* --- Product Selector --- */
.htc-product-selector {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(45, 55, 72, 0.12);
}

.htc-select--product {
    background-color: #fffdf5;
    border-color: #E6C261;
    font-weight: 600;
    font-size: 0.9rem;
}

.htc-select--product:focus {
    border-color: #2D3748;
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.15);
}

/* Auto-populated field flash */
.htc-input--populated {
    background-color: #fef9e7 !important;
    border-color: #E6C261 !important;
    transition: background-color 0.6s ease, border-color 0.6s ease;
}

/* --- Form Grid --- */
.htc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.htc-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.htc-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.htc-grid--5 {
    grid-template-columns: repeat(5, 1fr);
}

/* --- Labels --- */
.htc-label {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2D3748;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.htc-label-hint {
    display: block;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.75rem;
    font-weight: 400;
    color: #718096;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}

/* --- Inputs --- */
.htc-input,
.htc-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #2D3748;
    background: #ffffff;
    color: #2D3748;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 0.9375rem;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

.htc-input:focus,
.htc-select:focus {
    outline: none;
    border-color: #E6C261;
    box-shadow: 0 0 0 3px rgba(230, 194, 97, 0.25);
}

.htc-input::placeholder {
    color: #A0AEC0;
}

/* Readonly inputs (Stock mode) */
.htc-input--readonly {
    background-color: #f7f5f0 !important;
    color: #718096 !important;
    cursor: not-allowed;
}

.htc-input--readonly:focus {
    border-color: #A0AEC0 !important;
    box-shadow: none !important;
}

/* --- Imperial Input Wrapper (Feet/Inches) --- */
.htc-input-wrapper {
    position: relative;
}

.htc-input-imperial {
    display: flex;
    align-items: center;
    gap: 4px;
}

.htc-input-feet,
.htc-input-inches {
    flex: 1;
    min-width: 0;
}

.htc-input-feet {
    max-width: 80px;
}

.htc-input-inches {
    max-width: 100px;
}

.htc-input-separator {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2D3748;
    flex-shrink: 0;
    padding: 0 2px;
}

/* Label visibility toggle */
.htc-label-metric,
.htc-label-imperial {
    display: inline;
}

/* Result brackets */
.htc-result-brackets {
    font-size: 0.85em;
    opacity: 0.7;
    font-weight: 400;
}

/* --- Add to Cart --- */
.htc-add-to-cart {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #2D3748;
}

.htc-add-to-cart-btn {
    width: 100%;
    padding: 16px 24px;
    background: #C79A7F;
    color: #3C3C3B;
    border: 2px solid #3C3C3B;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(60, 60, 59, 0.3);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.htc-add-to-cart-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(60, 60, 59, 0.4);
    background: #d4a890;
}

.htc-add-to-cart-btn:active:not(:disabled) {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 rgba(60, 60, 59, 0.3);
}

.htc-add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.htc-add-to-cart-spinner {
    display: none;
    font-size: 1.2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Basket mode toggle (Replace / Add to existing) */
.htc-basket-mode {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.htc-basket-mode .htc-radio-label,
.htc-basket-mode .htc-radio-label--sm {
    color: #ffffff;
    font-size: 0.8rem;
    opacity: 0.85;
}

.htc-basket-mode input[type="radio"] {
    accent-color: #C79A7F;
}

/* Success state */
.htc-btn--success {
    background: #28a745 !important;
    color: #fff !important;
    border-color: #1e7e34 !important;
}

.htc-btn--success:hover:not(:disabled) {
    background: #218838 !important;
}

.htc-add-to-cart-message {
    margin-top: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    display: none;
}

.htc-add-to-cart-message:not(:empty) {
    display: block;
}

.htc-add-to-cart-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.htc-add-to-cart-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.htc-view-cart-link {
    color: #3C3C3B;
    font-weight: 800;
    text-decoration: underline;
    margin-left: 8px;
}

.htc-view-cart-link:hover {
    text-decoration: none;
}

/* Select arrow */
.htc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232D3748' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* --- Radio Group --- */
.htc-radios {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.htc-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.9rem;
    color: #2D3748;
    cursor: pointer;
}

.htc-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #2D3748;
    margin: 0;
}

/* --- Results Panel --- */
.htc-results {
    background: #2D3748;
    color: #ffffff;
    padding: 28px;
    margin-bottom: 24px;
    border-bottom: 4px solid #E6C261;
}

.htc-results-title {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #E6C261;
    margin: 0 0 16px 0;
}

.htc-results .htc-grid {
    gap: 24px;
}

.htc-result-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0 0 4px 0;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
}

.htc-result-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    font-family: "IBM Plex Mono", monospace;
}

.htc-results-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 20px 0;
}

.htc-results-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0 0 12px 0;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
}

/* Stock length boxes */
.htc-stock-box {
    background: rgba(255, 255, 255, 0.12);
    padding: 14px;
    text-align: center;
}

.htc-stock-length {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 0 0 4px 0;
}

.htc-stock-count {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    font-family: "IBM Plex Mono", monospace;
}

/* --- Footer / Totals --- */
.htc-footer {
    background: #A8B39B;
    padding: 28px 40px;
}

.htc-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #2D3748;
}

.htc-footer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.htc-footer-title {
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1.1rem;
    font-weight: 800;
    color: #2D3748;
    margin: 0;
}

.htc-action-btn {
    padding: 12px 24px;
    background: #3C3C3B;
    color: #ffffff;
    border: 2px solid #C79A7F;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(199, 154, 127, 0.3);
    transition: all 0.15s ease;
}

.htc-action-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(199, 154, 127, 0.4);
}

.htc-action-btn:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 rgba(199, 154, 127, 0.3);
}

/* Legacy class for backward compatibility */
.htc-copy-btn {
    padding: 12px 24px;
    background: #3C3C3B;
    color: #ffffff;
    border: 2px solid #C79A7F;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(199, 154, 127, 0.3);
    transition: all 0.15s ease;
}

.htc-copy-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(199, 154, 127, 0.4);
}

.htc-copy-btn:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 rgba(199, 154, 127, 0.3);
}

.htc-total-box {
    background: rgba(255, 255, 255, 0.5);
    padding: 18px 20px;
}

.htc-total-label {
    font-size: 0.8rem;
    color: #2D3748;
    opacity: 0.8;
    margin: 0 0 4px 0;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
}

.htc-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2D3748;
    margin: 0;
    font-family: "IBM Plex Mono", monospace;
}

/* --- Tab Panels --- */
.htc-panel {
    display: none;
}

.htc-panel.is-active {
    display: block;
}

/* --- Note --- */
.htc-note {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 4px;
}

/* =============================================
   HELP & GUIDES SECTION
   ============================================= */

/* --- Toggle Button --- */
.htc-help {
    margin-bottom: 40px;
}

.htc-help-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 18px 28px;
    background: #A8B39B;
    border: 3px solid #2D3748;
    color: #2D3748;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-radius: 0;
}

.htc-help-toggle:hover {
    background: #99a88c;
}

.htc-help-toggle-icon {
    flex-shrink: 0;
    color: #2D3748;
}

.htc-help-toggle span {
    flex: 1;
}

.htc-help-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.htc-help-toggle.is-open .htc-help-chevron {
    transform: rotate(180deg);
}

/* --- Collapsible Content --- */
.htc-help-content {
    display: none;
    border: 3px solid #2D3748;
    border-top: none;
    background: #F7F2E8;
    padding: 32px;
}

.htc-help-content.is-open {
    display: block;
}

/* --- Help Cards --- */
.htc-help-card {
    background: #ffffff;
    border: 2px solid rgba(45, 55, 72, 0.15);
    padding: 32px;
    margin-bottom: 24px;
}

.htc-help-card:last-child {
    margin-bottom: 0;
}

.htc-help-card-title {
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1.2rem;
    font-weight: 800;
    color: #3C3C3B;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #A8B39B;
}

/* --- Help Text --- */
.htc-help-text {
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.95rem;
    line-height: 1.7;
    color: #3C3C3B;
    margin: 0 0 16px 0;
}

.htc-help-text:last-child {
    margin-bottom: 0;
}

.htc-help-text strong {
    color: #2D3748;
    font-weight: 700;
}

.htc-help-text em {
    color: #718096;
}

/* --- T&G Diagram --- */
.htc-help-diagram {
    background: #faf8f4;
    border: 1px solid rgba(45, 55, 72, 0.1);
    padding: 24px 16px;
    margin: 24px 0;
    text-align: center;
}

.htc-help-svg {
    width: 100%;
    max-width: 560px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- Steps --- */
.htc-help-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.htc-help-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid rgba(45, 55, 72, 0.08);
}

.htc-help-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.htc-help-step:first-child {
    padding-top: 0;
}

.htc-help-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #2D3748;
    color: #E6C261;
    font-family: "IBM Plex Mono", monospace;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.htc-help-step-body {
    flex: 1;
    min-width: 0;
}

.htc-help-step-title {
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: #3C3C3B;
    margin: 0 0 6px 0;
}

.htc-help-step-body p {
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.9rem;
    line-height: 1.7;
    color: #3C3C3B;
    margin: 0;
}

/* --- Joiner's Tip Callouts --- */
.htc-help-tip {
    background: #F7F2E8;
    border-left: 4px solid #E6C261;
    padding: 20px 24px;
    margin: 20px 0;
}

.htc-help-tip:last-child {
    margin-bottom: 0;
}

.htc-help-tip-badge {
    display: inline-block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ffffff;
    background: #A8B39B;
    padding: 3px 10px;
    margin-bottom: 10px;
}

.htc-help-tip p {
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.9rem;
    line-height: 1.7;
    color: #3C3C3B;
    margin: 0;
}

.htc-help-tip p strong {
    color: #2D3748;
}

/* --- Help Footer / Close Button --- */
.htc-help-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid rgba(45, 55, 72, 0.12);
    text-align: center;
}

.htc-help-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2D3748;
    color: #ffffff;
    border: none;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    border-bottom: 3px solid #E6C261;
    box-shadow: 4px 4px 0 rgba(45, 55, 72, 0.2);
    transition: all 0.15s ease;
}

.htc-help-close:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(45, 55, 72, 0.25);
    background: #1a202c;
}

.htc-help-close:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 rgba(45, 55, 72, 0.2);
}

.htc-help-close svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* === RESPONSIVE === */

@media (max-width: 1024px) {
    .htc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .htc-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .htc-grid--5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .htc-page {
        padding: 30px 16px 40px;
    }

    .htc-page-title {
        font-size: 1.75rem;
    }

    .htc-calculator {
        border-width: 3px;
        box-shadow: 6px 6px 0 rgba(45, 55, 72, 0.12);
    }

    .htc-header {
        padding: 20px 24px;
    }

    .htc-header-title {
        font-size: 1.25rem;
    }

    .htc-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .htc-tab {
        padding: 12px 18px;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .htc-body {
        padding: 24px 20px;
    }

    .htc-section {
        padding: 20px;
    }

    .htc-grid,
    .htc-grid--2,
    .htc-grid--3,
    .htc-grid--4,
    .htc-grid--5 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .htc-results {
        padding: 20px;
    }

    .htc-results .htc-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .htc-result-value {
        font-size: 1.2rem;
    }

    .htc-footer {
        padding: 24px 20px;
    }

    .htc-footer-top {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .htc-action-btn,
    .htc-copy-btn {
        width: 100%;
        text-align: center;
    }

    .htc-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .htc-total-value {
        font-size: 1.2rem;
    }

    .htc-radios {
        flex-direction: column;
        gap: 12px;
    }

    .htc-stock-box {
        padding: 12px;
    }

    /* Help & Guides responsive */
    .htc-help {
        margin-bottom: 30px;
    }

    .htc-help-toggle {
        padding: 14px 20px;
        font-size: 0.9rem;
        gap: 10px;
    }

    .htc-help-content {
        padding: 20px 16px;
    }

    .htc-help-card {
        padding: 20px;
    }

    .htc-help-card-title {
        font-size: 1.05rem;
    }

    .htc-help-step {
        gap: 14px;
    }

    .htc-help-step-num {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .htc-help-tip {
        padding: 16px 18px;
    }

    .htc-help-diagram {
        padding: 16px 8px;
        margin: 16px 0;
    }

    .htc-help-footer {
        margin-top: 24px;
        padding-top: 20px;
    }

    .htc-help-close {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .htc-page {
        padding: 20px 12px 30px;
    }

    .htc-header {
        padding: 16px 18px;
    }

    .htc-body {
        padding: 18px 16px;
    }

    .htc-section {
        padding: 16px;
    }

    .htc-footer {
        padding: 18px 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Print-only content - hidden on screen */
.htc-print-only {
    display: none;
    background: white;
    color: black;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    padding: 20mm;
    box-sizing: border-box;
}

/* Print styles */
@media print {

    /* Hide everything except print content */
    body * {
        visibility: hidden;
    }

    .htc-print-only,
    .htc-print-only * {
        visibility: visible;
    }

    .htc-print-only {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block;
        background: white;
        color: black;
        padding: 20mm;
        font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
    }

    /* Hide navigation, help, inputs, buttons */
    header,
    nav,
    .htc-help,
    .htc-header,
    .htc-tabs,
    .htc-panel,
    .htc-footer,
    .htc-footer-actions,
    .htc-input-wrapper,
    .htc-product-selector,
    .htc-mode-toggle,
    .htc-orientation-toggle,
    .htc-unit-toggle,
    button,
    input,
    select {
        display: none !important;
        visibility: hidden !important;
    }

    /* Print header */
    .htc-print-header {
        border-bottom: 3px solid black;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    .htc-print-logo {
        font-family: "IBM Plex Mono", monospace;
        font-size: 24pt;
        font-weight: 900;
        margin: 0 0 10px 0;
        color: black;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .htc-print-date {
        font-size: 10pt;
        color: #333;
        margin: 0;
    }

    /* Print title */
    .htc-print-title {
        font-size: 18pt;
        font-weight: 800;
        margin: 0 0 20px 0;
        color: black;
        text-transform: uppercase;
    }

    /* Print sections */
    .htc-print-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #ccc;
        display: block;
        /* Show by default, JS will hide if empty */
    }

    .htc-print-section h3 {
        font-size: 14pt;
        font-weight: 700;
        margin: 0 0 8px 0;
        color: black;
        text-transform: uppercase;
    }

    .htc-print-product {
        font-size: 12pt;
        font-weight: 600;
        margin: 5px 0;
        color: black;
    }

    .htc-print-detail {
        font-size: 11pt;
        margin: 5px 0;
        color: #333;
        line-height: 1.6;
    }

    /* Print totals */
    .htc-print-totals {
        margin-top: 25px;
        padding-top: 20px;
        border-top: 2px solid black;
    }

    .htc-print-totals h3 {
        font-size: 16pt;
        font-weight: 800;
        margin: 0 0 15px 0;
        color: black;
        text-transform: uppercase;
    }

    .htc-print-totals-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .htc-print-total-item {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #ddd;
    }

    .htc-print-total-label {
        font-weight: 600;
        color: black;
    }

    .htc-print-total-value {
        font-weight: 700;
        color: black;
    }

    /* Print disclaimer */
    .htc-print-disclaimer {
        margin-top: 25px;
        padding-top: 15px;
        border-top: 1px solid #ccc;
        font-size: 9pt;
        color: #555;
        line-height: 1.5;
    }

    .htc-print-disclaimer strong {
        color: black;
    }

    /* Page breaks */
    .htc-print-section {
        page-break-inside: avoid;
    }

    .htc-print-totals {
        page-break-inside: avoid;
    }

    /* Ensure black text for printing */
    * {
        color: black !important;
        background: white !important;
    }
}

/* ================================================================
   VARIATION DROPDOWNS (Profile + Length)
   Dynamically injected by calculator.js for variable products.
   ================================================================ */

.htc-field--variation {
    animation: htcFadeIn 0.3s ease;
}

@keyframes htcFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.htc-select--variation {
    background-color: #fffdf5 !important;
    border-color: #C8A96E !important;
    font-weight: 600 !important;
}

.htc-select--variation:focus {
    border-color: #2D3748 !important;
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2) !important;
}

/* ===========================================
   PHASE 2: VERIFIED DATA UI
   =========================================== */

/* Verified Badge in Calculator Results (Tiny Version) */
.htc-product-calc__value-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.htc-product-calc__value-wrap .htc-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #E6C261;
    color: #2D3748;
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
}

.htc-verified-icon {
    line-height: 1;
    font-weight: 900;
}

/* ---------------------------------------------------------
   TECHNICAL SPECS BLOCK ("THE DATA PLATE")
   --------------------------------------------------------- */
.htc-technical-specs {
    margin-top: 40px;
    padding: 0;
    background: #f4f1ea;
    /* Paper */
    border: 2px solid #2D3748;
    /* Slate Frame */
    box-shadow: 6px 6px 0 rgba(45, 55, 72, 0.1);
    position: relative;
    overflow: hidden;
}

/* --- Header Bar --- */
.htc-specs-header {
    background: #2D3748;
    /* Slate */
    color: #ffffff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #E6C261;
    /* Gold Accent Line */
}

.htc-specs-title {
    font-family: 'IBM Plex Mono', monospace;
    /* Technical font */
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    color: #ffffff;
}

/* --- Verified Badge (Header Version) --- */
.htc-specs-header .htc-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #E6C261;
    /* Solid Gold for High Contrast */
    padding: 6px 12px;
    border: 1px solid #E6C261;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.htc-specs-header .htc-verified-icon {
    color: #2D3748;
    /* Slate Check */
    font-size: 1.1rem;
}

.htc-verified-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2D3748;
    /* Slate Text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Body Section --- */
.htc-specs-body {
    padding: 24px 28px;
}

.htc-specs-intro {
    font-size: 0.9rem;
    color: #2D3748;
    /* Darker Slate for Intro */
    margin-bottom: 24px;
    font-family: var(--font-primary, sans-serif);
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(45, 55, 72, 0.1);
}

.htc-specs-intro a {
    color: #C8A96E;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.htc-specs-intro a:hover {
    color: #2D3748;
}

/* --- Data Grid --- */
.htc-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    /* Gap for borders */
    background: rgba(45, 55, 72, 0.1);
    /* Divider color */
    border: 1px solid rgba(45, 55, 72, 0.1);
}

.htc-spec-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #fdfcf9;
    /* Slightly lighter than paper */
}

/* Labels */
.htc-spec-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4A5568;
    /* Darker Cool Gray for better contrast */
    font-weight: 700;
    margin-bottom: 8px;
}

/* Values */
.htc-spec-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    color: #2D3748;
    /* Slate */
    font-weight: 700;
}

.htc-spec-value a {
    color: #2D3748;
    text-decoration: none;
    background: linear-gradient(to bottom, transparent 65%, #E6C261 65%);
    background-size: 100% 10px;
    background-repeat: no-repeat;
    background-position: bottom;
    transition: background-size 0.2s ease;
}

.htc-spec-value a:hover {
    background-size: 100% 100%;
    /* Highlight effect */
}

/* Disclaimer */
.htc-specs-disclaimer {
    margin-top: 24px;
    color: #4A5568;
    /* Darker Cool Gray for readability */
    font-size: 0.8rem;
    font-style: italic;
    font-family: var(--font-primary, sans-serif);
}

/* Print Overrides */
@media print {
    .htc-technical-specs {
        border: 2px solid #000;
        background: #fff;
        box-shadow: none;
    }

    .htc-specs-header {
        background: #ccc;
        color: #000;
        border-bottom: 2px solid #000;
    }

    .htc-specs-title {
        color: #000;
    }
}