.hoiqc-wrap {
    --hoiqc-bg: #f6f7fb;
    --hoiqc-panel: #ffffff;
    --hoiqc-panel-soft: #f8fafc;
    --hoiqc-text: #111827;
    --hoiqc-muted: #5f6673;
    --hoiqc-border: #d8dde7;
    --hoiqc-line: #e8ecf3;
    --hoiqc-accent: #253044;
    --hoiqc-accent-strong: #0f172a;
    --hoiqc-accent-soft: #eef2f7;
    --hoiqc-success: #166534;
    --hoiqc-warning: #8a4b10;
    --hoiqc-danger: #991b1b;
    --hoiqc-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
    --hoiqc-card-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
    width: min(100%, 1180px);
    max-width: 1180px;
    margin: 24px auto;
    padding: 0;
    color: var(--hoiqc-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
    isolation: isolate;
}

.hoiqc-wrap,
.hoiqc-wrap * {
    box-sizing: border-box;
}

.hoiqc-wrap[data-theme="dark"] {
    --hoiqc-bg: #0b1120;
    --hoiqc-panel: #111827;
    --hoiqc-panel-soft: #172033;
    --hoiqc-text: #f8fafc;
    --hoiqc-muted: #cbd5e1;
    --hoiqc-border: #314158;
    --hoiqc-line: #263448;
    --hoiqc-accent: #d1d5db;
    --hoiqc-accent-strong: #f9fafb;
    --hoiqc-accent-soft: #1f2937;
    --hoiqc-success: #86efac;
    --hoiqc-warning: #facc15;
    --hoiqc-danger: #fca5a5;
    --hoiqc-shadow: 0 22px 65px rgba(0, 0, 0, 0.34);
    --hoiqc-card-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.hoiqc-shell {
    background: var(--hoiqc-bg);
    border: 1px solid var(--hoiqc-border);
    border-radius: 30px;
    padding: 16px;
    box-shadow: var(--hoiqc-shadow);
    overflow: clip;
}

.hoiqc-header {
    display: grid;
    gap: 18px;
    align-items: start;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--hoiqc-border);
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.10), transparent 34%),
        linear-gradient(135deg, var(--hoiqc-panel), var(--hoiqc-panel-soft));
}

.hoiqc-eyebrow {
    display: inline-flex;
    width: fit-content;
    margin: 0 0 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--hoiqc-accent-soft);
    color: var(--hoiqc-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hoiqc-header h2 {
    margin: 0;
    color: var(--hoiqc-text);
    font-size: clamp(1.55rem, 6vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-transform: capitalize;
}

.hoiqc-subtitle {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--hoiqc-muted);
    font-size: clamp(0.98rem, 2.5vw, 1.08rem);
    line-height: 1.7;
}

.hoiqc-theme-toggle,
.hoiqc-btn {
    appearance: none;
    -webkit-appearance: none;
    min-height: 48px;
    border: 1px solid var(--hoiqc-border);
    border-radius: 999px;
    background: var(--hoiqc-panel);
    color: var(--hoiqc-text);
    padding: 11px 16px;
    font: inherit;
    font-weight: 800;
    line-height: 1.1;
    cursor: pointer;
    transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease, border-color 170ms ease;
}

.hoiqc-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.hoiqc-theme-toggle:hover,
.hoiqc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.hoiqc-theme-toggle:focus-visible,
.hoiqc-btn:focus-visible,
.hoiqc-field input:focus-visible,
.hoiqc-field select:focus-visible,
.hoiqc-check input:focus-visible {
    outline: 3px solid rgba(37, 48, 68, 0.32);
    outline-offset: 3px;
}

.hoiqc-form {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.hoiqc-card {
    width: 100%;
    background: var(--hoiqc-panel);
    border: 1px solid var(--hoiqc-border);
    border-radius: 24px;
    padding: clamp(18px, 3vw, 24px);
    box-shadow: var(--hoiqc-card-shadow);
}

.hoiqc-card-heading {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 18px;
}

.hoiqc-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: var(--hoiqc-accent-soft);
    border: 1px solid var(--hoiqc-border);
    color: var(--hoiqc-accent-strong);
    font-weight: 900;
}

.hoiqc-card-heading h3 {
    margin: 0;
    color: var(--hoiqc-text);
    font-size: clamp(1.08rem, 3vw, 1.28rem);
    line-height: 1.2;
}

.hoiqc-card-heading p {
    margin: 5px 0 0;
    color: var(--hoiqc-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.hoiqc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.hoiqc-field,
.hoiqc-check {
    min-width: 0;
}

.hoiqc-field {
    display: grid;
    gap: 7px;
}

.hoiqc-field span,
.hoiqc-check span {
    color: var(--hoiqc-text);
    font-size: 0.93rem;
    font-weight: 800;
    line-height: 1.35;
}

.hoiqc-field input,
.hoiqc-field select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 50px;
    border: 1px solid var(--hoiqc-border);
    border-radius: 16px;
    background: var(--hoiqc-panel-soft);
    color: var(--hoiqc-text);
    padding: 11px 13px;
    font: inherit;
    font-size: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hoiqc-field input::placeholder {
    color: var(--hoiqc-muted);
}

.hoiqc-field input:invalid {
    border-color: rgba(153, 27, 27, 0.48);
}

.hoiqc-inline-check {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 50px;
    padding: 12px 13px;
    border: 1px solid var(--hoiqc-border);
    border-radius: 16px;
    background: var(--hoiqc-panel-soft);
}

.hoiqc-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--hoiqc-accent-strong);
}

.hoiqc-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.hoiqc-btn {
    width: 100%;
    min-width: 0;
}

.hoiqc-btn-primary {
    background: var(--hoiqc-accent-strong);
    border-color: var(--hoiqc-accent-strong);
    color: var(--hoiqc-panel);
}

.hoiqc-results {
    width: 100%;
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: 0;
    scroll-margin-top: 24px;
}

.hoiqc-result-placeholder {
    display: grid;
    place-items: center;
    min-height: 116px;
    padding: 22px;
    border: 1px dashed var(--hoiqc-border);
    border-radius: 22px;
    background: var(--hoiqc-panel);
    color: var(--hoiqc-muted);
    text-align: center;
}

.hoiqc-result-placeholder span {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: var(--hoiqc-accent-soft);
    color: var(--hoiqc-accent-strong);
    font-size: 1.35rem;
}

.hoiqc-result-placeholder p {
    margin: 0;
}

.hoiqc-summary {
    display: grid;
    gap: 16px;
    width: 100%;
}

.hoiqc-winner {
    width: 100%;
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--hoiqc-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.08), transparent 34%),
        linear-gradient(135deg, var(--hoiqc-panel), var(--hoiqc-panel-soft));
    box-shadow: var(--hoiqc-card-shadow);
}

.hoiqc-winner h3 {
    margin: 0 0 10px;
    color: var(--hoiqc-text);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hoiqc-winner p {
    margin: 0;
    color: var(--hoiqc-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.hoiqc-result-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

.hoiqc-result-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hoiqc-border);
    border-radius: 24px;
    background: var(--hoiqc-panel);
    box-shadow: var(--hoiqc-card-shadow);
}

.hoiqc-result-card.is-best {
    border-color: var(--hoiqc-accent-strong);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.10), var(--hoiqc-card-shadow);
}

.hoiqc-result-card h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid var(--hoiqc-line);
    background: var(--hoiqc-panel-soft);
    color: var(--hoiqc-text);
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    line-height: 1.25;
}

.hoiqc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--hoiqc-accent-strong);
    color: var(--hoiqc-panel);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.hoiqc-metrics {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
}

.hoiqc-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--hoiqc-line);
    background: var(--hoiqc-panel);
}

.hoiqc-metric small {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--hoiqc-muted);
    font-size: 0.93rem;
    font-weight: 800;
    line-height: 1.35;
}

.hoiqc-metric strong {
    flex: 0 0 auto;
    color: var(--hoiqc-text);
    font-size: clamp(1.02rem, 4vw, 1.22rem);
    font-weight: 900;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.hoiqc-bar-wrap {
    display: grid;
    gap: 8px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--hoiqc-line);
    background: var(--hoiqc-panel);
}

.hoiqc-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--hoiqc-muted);
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.35;
}

.hoiqc-bar-label span:last-child {
    white-space: nowrap;
}

.hoiqc-bar {
    position: relative;
    height: 11px;
    border-radius: 999px;
    background: rgba(107, 114, 128, 0.20);
    overflow: hidden;
}

.hoiqc-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--hoiqc-accent), var(--hoiqc-accent-strong));
    transition: width 260ms ease;
}

.hoiqc-notes {
    display: grid;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 16px 18px;
    list-style: none;
}

.hoiqc-summary > .hoiqc-notes {
    padding: 0;
}

.hoiqc-notes li {
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid var(--hoiqc-line);
    border-left: 4px solid var(--hoiqc-accent-strong);
    border-radius: 14px;
    background: var(--hoiqc-panel-soft);
    color: var(--hoiqc-muted);
    font-size: 0.94rem;
    line-height: 1.5;
}

.hoiqc-error {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(153, 27, 27, 0.35);
    border-radius: 18px;
    background: rgba(153, 27, 27, 0.08);
    color: var(--hoiqc-danger);
    font-weight: 800;
}

.hoiqc-toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 99999;
    max-width: calc(100vw - 28px);
    transform: translateX(-50%);
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--hoiqc-accent-strong);
    color: var(--hoiqc-panel);
    box-shadow: var(--hoiqc-shadow);
    font-weight: 800;
    text-align: center;
}

@media (max-width: 679px) {
    .hoiqc-wrap {
        width: 100vw;
        max-width: 100vw;
        margin: 0 0 20px 50%;
        padding: 0;
        transform: translateX(-50%);
    }

    .hoiqc-shell {
        border: 0;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        overflow-x: hidden;
    }

    .hoiqc-header {
        border-left: 0;
        border-right: 0;
        border-radius: 0 0 22px 22px;
        padding: 22px 16px;
    }

    .hoiqc-form {
        gap: 14px;
        margin-top: 0;
        padding: 14px;
    }

    .hoiqc-card {
        border-radius: 20px;
        padding: 16px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
    }

    .hoiqc-card-heading {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px;
    }

    .hoiqc-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .hoiqc-results {
        width: auto;
        margin: 2px 14px 18px;
    }

    .hoiqc-winner,
    .hoiqc-result-card,
    .hoiqc-result-placeholder {
        border-radius: 20px;
    }

    .hoiqc-result-card h4 {
        padding: 15px 16px;
    }

    .hoiqc-metric,
    .hoiqc-bar-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hoiqc-notes {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (min-width: 680px) {
    .hoiqc-shell {
        padding: 18px;
    }

    .hoiqc-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hoiqc-theme-toggle {
        width: auto;
        white-space: nowrap;
    }

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

    .hoiqc-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hoiqc-results {
        margin-top: 18px;
    }

    .hoiqc-result-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .hoiqc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hoiqc-quote-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hoiqc-actions {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .hoiqc-result-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .hoiqc-wrap *,
    .hoiqc-wrap *::before,
    .hoiqc-wrap *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    .hoiqc-wrap,
    .hoiqc-wrap * {
        visibility: visible;
    }

    .hoiqc-wrap {
        position: absolute;
        inset: 0 auto auto 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        transform: none;
        box-shadow: none;
        background: #ffffff;
        color: #111827;
    }

    .hoiqc-shell,
    .hoiqc-header,
    .hoiqc-card,
    .hoiqc-result-card,
    .hoiqc-winner {
        box-shadow: none;
    }

    .hoiqc-actions,
    .hoiqc-theme-toggle {
        display: none !important;
    }
}
