.unlock-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: min(100%, 300px);
    aspect-ratio: 1;
    border: 1px solid #94a3b8;
    border-radius: 16px;
    color: #2563eb;
    touch-action: none;
    user-select: none;
}
.unlock-grid svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.unlock-grid button {
    z-index: 1;
    place-self: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #64748b;
    background: var(--card-bg, white);
    color: var(--bs-body-color, #334155);
    font-weight: 700;
    padding: 0;
    touch-action: none;
}
.unlock-grid button.selected { color: white; background: #2563eb; border-color: #2563eb; }
.unlock-grid button:disabled { opacity: 1; }
.unlock-grid button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }

/* Shared form rhythm and native, keyboard-accessible controls. */
.repair-form { --repair-accent: #2563eb; }
.repair-form .card-soft { border: 1px solid rgba(148,163,184,.22); box-shadow: 0 4px 18px rgba(15,23,42,.035); }
.repair-form .form-select, .repair-form .form-control {
    min-height: 46px;
    border-radius: 12px;
    border-color: rgba(148,163,184,.4);
    font-size: .94rem;
}
.repair-form .form-select { padding-right: 2.5rem; cursor: pointer; }
.repair-form .form-select:focus, .repair-form .form-control:focus {
    border-color: var(--repair-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.repair-form .label { font-size: .85rem; font-weight: 600; }
.unlock-editor { margin-top: 1.75rem; border-top: 1px solid rgba(148,163,184,.22); padding-top: 1.5rem; }
.unlock-editor legend, .repair-assignment legend { float: none; width: auto; font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.unlock-help { font-size: .82rem; line-height: 1.6; color: var(--bs-secondary-color, #64748b); }
.unlock-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.unlock-option { min-width: 0; border: 1px solid rgba(148,163,184,.35); padding: 20px; border-radius: 16px; background: var(--card-bg, var(--bs-body-bg, #fff)); transition: border-color .15s, box-shadow .15s; }
.unlock-option.is-selected, .unlock-option:has(input[data-unlock-type]:checked) { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.unlock-choice { display: flex; gap: 10px; align-items: center; cursor: pointer; margin-bottom: 22px; }
.unlock-choice input, .assignment-choice input { accent-color: #2563eb; width: 18px; height: 18px; flex-shrink: 0; }
.unlock-choice strong, .assignment-choice strong { display: block; font-size: .94rem; }
.unlock-choice small, .assignment-choice small { display: block; color: var(--bs-secondary-color, #64748b); font-size: .78rem; margin-top: 3px; }
.unlock-choice-icon { display: grid; place-items: center; color: #2563eb; background: rgba(37,99,235,.09); border-radius: 10px; width: 36px; height: 36px; flex-shrink: 0; }
.unlock-field-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 8px; }
.unlock-code { font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.unlock-code::placeholder { letter-spacing: normal; font-size: .82rem; }
.unlock-pattern-body { display: flex; justify-content: center; }
.unlock-pattern-body .unlock-grid { border: 0; background: rgba(148,163,184,.07); width: 150px; }
.unlock-pattern-body .unlock-grid button { width: 28px; height: 28px; font-size: .75rem; line-height: 1; }
.unlock-reset { border: 0; background: none; padding: 8px 0; color: var(--bs-secondary-color, #64748b); font-size: .8rem; }
.unlock-reset:hover { color: #2563eb; }
.repair-assignment { border-top: 1px solid rgba(148,163,184,.22); padding-top: 22px; }
.assignment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.assignment-choice { display: flex; align-items: center; gap: 10px; cursor: pointer; border: 1px solid rgba(148,163,184,.35); border-radius: 12px; padding: 15px; }
.assignment-choice:has(input:checked) { border-color: #2563eb; background: rgba(37,99,235,.055); }
.assignment-choice > i { margin-left: auto; color: #2563eb; }
.assignment-choice:focus-within { outline: 2px solid #2563eb; outline-offset: 2px; }
[data-assignment-picker][hidden] { display: none; }
@media (max-width: 1100px) { .unlock-options { grid-template-columns: 1fr; } }
@media (max-width: 575px) {
    .unlock-option { padding: 16px; }
    .unlock-pattern-body { grid-template-columns: 1fr; }
    .unlock-pattern-body .unlock-grid { width: 150px; }
    .assignment-options { grid-template-columns: 1fr; }
}
