:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --header-bg: linear-gradient(90deg, #007bff, #0056b3);
    --hero-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --hero-eyebrow: #b8d7ff;
    --hero-copy: #e5ebff;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #1f2937;
    --muted: #475569;
    --border: #cbd5e1;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --hero-heading-size: clamp(2.8rem, 4vw, 4rem);
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: var(--text);
    line-height: 1.6;
}

header {
    background: var(--header-bg);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    height: 50px;
    object-fit: contain;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: none;
    font-style: normal;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 26px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

nav a:hover {
    text-decoration: underline;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.phone {
    font-weight: 600;
    color: #e5ebff;
}

.us, .login {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.us:hover, .login:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hero {
    background: var(--hero-bg);
    color: white;
    padding: 60px 32px 48px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.hero-copy .eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.78rem;
    color: var(--hero-eyebrow);
    margin-bottom: 18px;
}

.hero-branding {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hero-wekey {
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    margin: 0;
    padding: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--primary, #1d4ed8) 0%, var(--primary, #2563eb) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero-copy h1 {
    margin: 0;
    font-size: var(--hero-heading-size);
    line-height: 1.02;
}

.hero-copy p {
    max-width: 620px;
    margin: 24px 0 0;
    font-size: 1.05rem;
    color: var(--hero-copy);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.hero-stats div {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 22px;
}

.hero-stats strong {
    display: block;
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.hero-stats span {
    color: #e4ecff;
    font-size: 0.98rem;
}

.search-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 20px;
}

.search-status {
    background: rgba(14, 165, 233, 0.14);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.86rem;
}

.search-body {
    color: #334155;
}

.search-prompt,
.search-result {
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: var(--surface-muted);
}

.search-prompt {
    border-left: 4px solid var(--primary);
}

.search-result {
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.search-input {
    display: grid;
    gap: 12px;
}

.search-input label {
    font-size: 0.9rem;
    color: #475569;
}

.search-input input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 1rem;
    outline: none;
}

.search-input button {
    width: fit-content;
    padding: 14px 24px;
    border-radius: 16px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.search-input button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-controls,
.history-controls {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.control-field,
.history-controls {
    display: grid;
    gap: 8px;
}

.control-field label,
.history-controls label {
    font-size: 0.95rem;
    color: #475569;
}

.dashboard-controls input,
.dashboard-controls select,
.history-controls input {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    min-width: 260px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.section-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 2rem;
}

.section-header p {
    margin: 0;
    color: #475569;
    max-width: 600px;
}

.dashboard,
.quote-tool,
.reference,
.history,
.account-portal {
    margin-top: 40px;
    padding: 30px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

thead th {
    text-align: left;
    padding: 16px 18px;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 700;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

tbody tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

tbody td {
    padding: 16px 18px;
    color: #334155;
}

.quote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

#quote-form {
    display: grid;
    gap: 16px;
}

#quote-form label {
    color: #475569;
    font-weight: 600;
}

#quote-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

#quote-form button {
    width: fit-content;
    padding: 14px 22px;
    border-radius: 14px;
    border: none;
    background: #2563eb;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

#quote-form button:hover {
    background: #1d4ed8;
}

.quote-result {
    border-radius: 22px;
    padding: 24px;
    background: #f8fafc;
    color: #334155;
    min-height: 220px;
}

.account-login-grid {
    grid-template-columns: 340px 1fr 1fr;
}

.login-card,
.workspace-card {
    display: grid;
    gap: 14px;
}

.login-card label,
.login-card input,
.workspace-card button {
    width: 100%;
}

.login-card input {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.login-card button,
#account-logout {
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    background: #0284c7;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.login-card button:hover,
#account-logout:hover {
    background: #0369a1;
}

.login-message {
    font-size: 0.94rem;
    color: #334155;
    min-height: 1.2rem;
}

.workspace-summary {
    display: grid;
    gap: 10px;
    padding: 18px;
    background: #eef2ff;
    border-radius: 18px;
    color: #0f172a;
}

.workspace-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

@media (max-width: 960px) {
    .account-login-grid {
        grid-template-columns: 1fr;
    }
}

.reference-grid,
.account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.reference-card,
.account-card {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    padding: 24px;
}

.solutions {
    margin-top: 40px;
    background: #fbfcff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(22, 38, 74, 0.05);
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.solution-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(27, 104, 188, 0.12);
    min-height: 180px;
}

.solution-card h3 {
    margin-bottom: 14px;
}

.reference-card h3,
.account-card h3 {
    margin-top: 0;
    color: #0f172a;
}

.reference-card ul,
.reference-card p,
.account-card p {
    color: #475569;
    margin: 12px 0 0;
}

.reference-card ul {
    list-style: disc;
    padding-left: 18px;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-item {
    padding: 18px 20px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #334155;
}

.history-item strong {
    display: block;
    margin-bottom: 6px;
}

@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .quote-grid,
    .reference-grid,
    .solution-grid,
    .account-grid,
    .product-grid,
    .support-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

footer {
    background: #f8f9fa;
    padding: 40px 32px;
    text-align: center;
    color: #475569;
}

.about-content h3 {
    margin-bottom: 16px;
    color: #0f172a;
}

.about-content p {
    margin: 8px 0;
}

.login-section {
    padding: 60px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-container {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    max-width: 400px;
    width: 100%;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #0f172a;
}

#login-form {
    display: grid;
    gap: 16px;
}

#login-form label {
    font-weight: 600;
    color: #475569;
}

#login-form input {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

#login-form button {
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    background: #0284c7;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

#login-form button:hover {
    background: #0369a1;
}

.products-section, .support-section, .resources-section, .about-section {
    padding: 40px 32px;
}

.product-grid, .support-grid, .resource-grid, .repair-grid, .wiring-grid, .labor-grid, .training-grid, .portal-grid, .reporting-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.product-card, .support-card, .resource-card, .repair-card, .wiring-card, .labor-card, .training-card, .portal-card, .reporting-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid rgba(24, 76, 127, 0.08);
    box-shadow: 0 10px 30px rgba(22, 38, 74, 0.05);
}

.product-card h3, .support-card h3, .resource-card h3, .repair-card h3, .wiring-card h3, .labor-card h3, .training-card h3, .portal-card h3, .reporting-card h3 {
    margin-bottom: 12px;
    color: #0f172a;
}

.product-card p, .support-card p, .resource-card p, .repair-card p, .wiring-card p, .labor-card p, .training-card p, .portal-card p, .reporting-card p {
    color: #475569;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

..about-content p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.wekey-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: inherit;
}

.chat-launcher {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
    font-size: 1.9rem;
    display: grid;
    place-items: center;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    cursor: pointer;
}

.chat-panel {
    width: min(360px, calc(100vw - 40px));
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    background: #0f172a;
    color: white;
}

.chat-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.3rem;
    overflow: hidden;
}

.chat-header-text h4,
.chat-header-text p {
    margin: 0;
}

.chat-header-text h4 {
    font-size: 1rem;
}

.chat-header-text p {
    font-size: 0.84rem;
    opacity: 0.82;
}

.chat-close,
#chat-close {
    border: none;
    background: transparent;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

.chat-body {
    padding: 18px 20px;
    display: grid;
    gap: 12px;
    min-height: 160px;
    background: #f8fafc;
}

.chat-message {
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.5;
    max-width: 88%;
}

.chat-message.bot {
    background: #eef2ff;
    color: #0f172a;
    align-self: flex-start;
}

.chat-message.user {
    background: #1d4ed8;
    color: #ffffff;
    align-self: flex-end;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.chat-input-area input {
    flex: 1;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    padding: 14px 16px;
    font-size: 0.95rem;
    outline: none;
}

.chat-input-area input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.chat-send-btn {
    border: none;
    background: #2563eb;
    color: white;
    border-radius: 14px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 700;
}

.chat-send-btn:hover,
.chat-avatar-upload:hover {
    background: #1d4ed8;
}

.chat-avatar-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: center;
}

.chat-avatar-upload input[type="file"] {
    display: none;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.chat-avatar span {
    display: inline-block;
}

.chat-actions {
    display: grid;
    gap: 12px;
    padding: 16px 20px 20px;
    background: white;
}

.chat-action-btn,
.chat-action-dismiss {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.chat-action-btn {
    background: #2563eb;
    color: white;
}

.chat-action-btn:hover {
    background: #1d4ed8;
}

.chat-action-dismiss {
    background: #f1f5f9;
    color: #0f172a;
}

.chat-action-dismiss:hover {
    background: #e2e8f0;
}

.hidden {
    display: none !important;
}

@media (max-width: 720px) {
    :root {
        --hero-heading-size: clamp(1.8rem, 5vw, 2.5rem);
    }

    header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .logo-section {
        justify-content: space-between;
    }

    .logo {
        font-size: 1.5rem;
    }

    nav ul {
        flex-direction: column;
        gap: 8px;
    }

    nav a {
        display: block;
        padding: 12px;
        font-size: 0.95rem;
    }

    .header-right {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .phone {
        font-size: 0.9rem;
    }

    .us, .login {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .hero {
        padding: 32px 16px 24px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero-wekey {
        font-size: 3.5rem;
    }

    .hero-copy h1 {
        font-size: 1.5rem;
    }

    .hero-copy p {
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-stats div {
        padding: 16px;
    }

    .hero-stats strong {
        font-size: 0.9rem;
    }

    .hero-stats span {
        font-size: 0.85rem;
    }

    main {
        padding: 0 16px 32px;
    }

    .search-card {
        border-radius: 18px;
        padding: 18px;
        margin-top: 20px;
    }

    .search-header {
        flex-direction: column;
        gap: 12px;
    }

    .search-input {
        gap: 10px;
    }

    .search-input input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .search-input button {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .dashboard,
    .quote-tool,
    .reference,
    .history,
    .account-portal {
        margin-top: 24px;
        padding: 18px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.95rem;
    }

    .dashboard-controls,
    .history-controls {
        flex-direction: column;
        gap: 12px;
    }

    .control-field,
    .history-controls {
        gap: 6px;
    }

    .dashboard-controls input,
    .dashboard-controls select,
    .history-controls input {
        min-width: auto;
        width: 100%;
        padding: 12px 14px;
        font-size: 16px;
    }

    .control-field label,
    .history-controls label {
        font-size: 0.9rem;
    }

    table {
        font-size: 0.85rem;
    }

    thead th {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    tbody td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    .quote-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    #quote-form {
        gap: 12px;
    }

    #quote-form input {
        padding: 12px 14px;
    }

    #quote-form button {
        padding: 12px 18px;
    }

    .account-login-grid {
        grid-template-columns: 1fr;
    }

    .reference-grid,
    .account-grid,
    .solution-grid,
    .product-grid,
    .support-grid,
    .resource-grid,
    .repair-grid,
    .wiring-grid,
    .labor-grid,
    .training-grid,
    .portal-grid,
    .reporting-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card,
    .support-card,
    .resource-card,
    .reference-card,
    .account-card,
    .solution-card {
        padding: 16px;
    }

    .product-card h3,
    .support-card h3,
    .resource-card h3,
    .reference-card h3,
    .account-card h3,
    .solution-card h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .reference-card p,
    .support-card p,
    .product-card p,
    .resource-card p {
        font-size: 0.9rem;
    }

    .login-section {
        padding: 32px 16px;
        min-height: auto;
    }

    .login-container {
        padding: 24px 16px;
        max-width: 100%;
    }

    .login-container h2 {
        font-size: 1.4rem;
        margin-bottom: 18px;
    }

    #login-form {
        gap: 12px;
    }

    #login-form input {
        padding: 12px 14px;
        font-size: 16px;
    }

    #login-form button {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .products-section,
    .support-section,
    .resources-section,
    .about-section {
        padding: 24px 16px;
    }

    .about-content {
        text-align: left;
    }

    .about-content h3 {
        font-size: 1.2rem;
    }

    .about-content p {
        font-size: 1rem;
    }

    .wekey-chat-widget {
        right: 0;
        bottom: 0;
        width: 100%;
        padding: 0 12px 12px;
    }

    .chat-panel {
        width: 100vw;
        right: 0;
        border-radius: 20px 20px 0 0;
    }

    .chat-launcher {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .chat-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .chat-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .chat-header-text h4 {
        font-size: 0.95rem;
    }

    .chat-header-text p {
        font-size: 0.8rem;
    }

    .chat-body {
        padding: 14px 16px;
        min-height: 140px;
        gap: 10px;
    }

    .chat-message {
        padding: 10px 12px;
        border-radius: 14px;
        font-size: 0.9rem;
        max-width: 90%;
    }

    .chat-input-area {
        gap: 8px;
        padding: 12px 16px;
    }

    .chat-input-area input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .chat-send-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .chat-avatar-upload {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .chat-actions {
        padding: 12px 16px 14px;
        gap: 10px;
    }

    .chat-action-btn,
    .chat-action-dismiss {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .hidden {
        display: none !important;
    }
}

