.companion-wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.companion-wizard {
    width: min(560px, 100%);
    max-height: min(90vh, 720px);
    background: var(--surface-elevated, #fff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.18));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.companion-wizard__header {
    padding: var(--space-4, 16px) var(--space-5, 20px);
    border-bottom: 1px solid var(--border-color, #dde3ea);
}

.companion-wizard__header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.companion-wizard__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.companion-wizard__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary, #5a6a80);
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    padding: 0;
}

.companion-wizard__close:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-primary, #0f172a);
}

.companion-wizard__steps {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.companion-wizard__step-dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color, #dde3ea);
}

.companion-wizard__step-dot.is-active,
.companion-wizard__step-dot.is-done {
    background: var(--brand-accent, #356a9e);
}

.companion-wizard__body {
    padding: var(--space-5, 20px);
    overflow-y: auto;
    flex: 1;
}

.companion-wizard__footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: var(--space-4, 16px) var(--space-5, 20px);
    border-top: 1px solid var(--border-color, #dde3ea);
}

.companion-wizard__hint {
    color: var(--text-secondary, #5a6a80);
    font-size: 0.92rem;
    margin: 0 0 12px;
}

.companion-wizard__warning {
    background: var(--warning-bg, #fff8e6);
    border: 1px solid var(--warning-border, #f0d78a);
    border-radius: var(--radius-md, 8px);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.92rem;
}

.term-checklist-card {
    background: var(--surface-elevated, #fff);
    border: 1px solid var(--border-color, #dde3ea);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-4, 16px);
    margin-bottom: var(--space-4, 16px);
}

.term-checklist-card__header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.term-checklist-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.wizard-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.wizard-check-row input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    flex-shrink: 0;
    box-shadow: none;
}

.wizard-auto-hint {
    margin: 6px 0 8px;
}

.wizard-auto-fields {
    margin-left: 1.5rem;
    margin-top: 4px;
}

.wizard-auto-fields.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.term-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle, #eef2f6);
}

.term-checklist-item:last-child {
    border-bottom: none;
}

.term-checklist-item__status {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #dde3ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.term-checklist-item.is-done .term-checklist-item__status {
    background: var(--success, #1f9d4d);
    border-color: var(--success, #1f9d4d);
    color: #fff;
}

.term-checklist-item.is-skipped .term-checklist-item__status {
    background: var(--text-muted, #94a3b8);
    border-color: var(--text-muted, #94a3b8);
    color: #fff;
}

.term-checklist-item__body {
    flex: 1;
    min-width: 0;
}

.term-checklist-item__label {
    font-weight: 600;
    margin: 0 0 4px;
}

.term-checklist-item__desc {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: var(--text-secondary, #5a6a80);
}

.companion-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    /* Let header controls (Help, language) stay clickable behind the dim. */
    pointer-events: none;
}

.companion-welcome {
    width: min(480px, 100%);
    background: var(--surface-elevated, #fff);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-5, 20px);
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.2));
    pointer-events: auto;
}

.companion-spotlight-ring {
    position: fixed;
    z-index: 1150;
    pointer-events: none;
    border: 2px solid var(--brand-accent, #356a9e);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.42);
    transition: top 0.2s, left 0.2s, width 0.2s, height 0.2s;
}

.companion-spotlight-tooltip {
    position: fixed;
    z-index: 1151;
    max-width: 280px;
    background: var(--surface-elevated, #fff);
    border-radius: var(--radius-md, 8px);
    padding: 12px 14px;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.15));
    font-size: 0.92rem;
}

.companion-spotlight-tooltip__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.companion-help-menu {
    position: relative;
    display: inline-block;
}

.companion-help-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    background: var(--surface-elevated, #fff);
    border: 1px solid var(--border-color, #dde3ea);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    z-index: 200;
    padding: 6px 0;
}

/* Portaled help menu always above overlays */
body > .companion-help-dropdown {
    z-index: 10000;
    background: var(--surface, #fff);
    color: var(--text-primary, #1c2430);
}

.companion-help-menu.is-open .companion-help-dropdown {
    z-index: 600;
}

.companion-help-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.companion-help-dropdown button:hover {
    background: var(--surface-hover, #f1f5f9);
}

.term-checklist-show-strip {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 var(--space-3, 12px);
    padding: var(--space-4, 16px);
    padding-bottom: 0;
}

.wizard-sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.wizard-sessions-table th,
.wizard-sessions-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle, #eef2f6);
    text-align: left;
}

.wizard-sessions-table input {
    width: 100%;
}
