.xs-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }

.xs-hero { margin-bottom: 1.25rem; }
.xs-hero h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.35rem; }
.xs-hero-sub { font-size: 0.9rem; color: var(--text-muted); }

.xs-trust {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}
.xs-offline-btn {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--logo-teal);
    text-decoration: none;
    border: 1px solid var(--logo-teal);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
}
.xs-offline-btn:hover { background: var(--accent-muted); }

.xs-warn {
    border: 1px solid #b45309;
    border-radius: var(--radius-sm);
    background: #fef3c7;
    color: #78350f;
    padding: 0.6rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
}
[data-theme="dark"] .xs-warn { background: #292010; border-color: #b45309; color: #fde68a; }
.xs-warn summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; list-style: none; }
.xs-warn summary::-webkit-details-marker { display: none; }
.xs-warn ul { margin: 0.5rem 0 0 1rem; padding: 0; }
.xs-warn li { margin-bottom: 0.35rem; line-height: 1.5; }

.xs-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.xs-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.xs-tab--active { color: var(--logo-teal); border-bottom-color: var(--logo-teal); }
.xs-tab:hover:not(.xs-tab--active) { color: var(--text-primary); }

.xs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
@media (max-width: 600px) { .xs-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .xs-grid { grid-template-columns: repeat(2, 1fr); } }

.xs-word-wrap { position: relative; }
.xs-word-num {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
    line-height: 1;
}
.xs-word-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.4rem 0.45rem 1.6rem;
    font-size: 0.82rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-input, var(--bg-card));
    color: var(--text-primary);
    transition: border-color 0.15s;
}
.xs-word-input:focus { outline: none; border-color: var(--logo-teal); }
.xs-word-input.xs-word--valid    { border-color: #16a34a; }
.xs-word-input.xs-word--invalid  { border-color: #dc2626; }
.xs-word-input.xs-word--missing  { border-color: var(--logo-teal); background: var(--accent-muted); }
/* Word 25 (checksum) gets a subtle orange tint to distinguish it */
.xs-word-wrap--checksum .xs-word-input { border-color: #d97706; }
.xs-word-wrap--checksum .xs-word-num   { color: #d97706; }

/* Create mode - word 25 auto-computed (read-only) */
.xs-word-input--auto {
    background: var(--bg-secondary, var(--bg-card));
    color: var(--text-muted);
    cursor: default;
    border-style: dashed;
    font-style: italic;
}
.xs-word-input--auto.xs-word--valid {
    border-style: solid;
    border-color: #16a34a;
    color: var(--text-primary);
    font-style: normal;
}

/* Create mode - triplet invalid (amber, distinct from red invalid) */
.xs-word-input.xs-word--triplet-invalid { border-color: #f59e0b; background: #fffbeb; }
[data-theme="dark"] .xs-word-input.xs-word--triplet-invalid { background: #1c1003; border-color: #f59e0b; }

.xs-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 160px;
    overflow-y: auto;
    z-index: 100;
    list-style: none;
    margin: 0;
    padding: 0;
}
.xs-ac-item {
    padding: 0.35rem 0.5rem 0.35rem 1.6rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-primary);
}
.xs-ac-item:hover, .xs-ac-item.xs-ac--active { background: var(--accent-muted); color: var(--logo-teal); }

.xs-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    min-height: 1.2em;
}

.xs-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.xs-btn-download {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--logo-teal);
    background: none;
    border: 1px solid var(--logo-teal);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.xs-btn-download:hover { background: var(--accent-muted); }
.xs-btn-copy {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.xs-btn-copy:hover { border-color: var(--logo-teal); color: var(--logo-teal); }
.xs-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    background: var(--logo-teal);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.xs-btn-primary:hover { opacity: 0.88; }

.xs-result {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.xs-result--valid   { background: #f0fdf4; border: 1px solid #16a34a; color: #15803d; }
.xs-result--invalid { background: #fef2f2; border: 1px solid #dc2626; color: #b91c1c; }
.xs-result--info    { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); }
[data-theme="dark"] .xs-result--valid   { background: #052e16; border-color: #16a34a; color: #4ade80; }
[data-theme="dark"] .xs-result--invalid { background: #2d0a0a; border-color: #dc2626; color: #f87171; }

.xs-candidates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}
.xs-candidate {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    background: var(--accent-muted);
    border: 1px solid var(--logo-teal);
    border-radius: var(--radius-sm);
    color: var(--logo-teal);
    cursor: pointer;
}
.xs-candidate:hover { background: var(--logo-teal); color: #fff; }

/* Reference / how-it-works dropdown */
.xs-ref { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.xs-ref-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.xs-ref-toggle:hover { color: var(--text-primary); }
.xs-ref-chevron { width: 13px; height: 13px; transition: transform 0.2s ease; flex-shrink: 0; }
.xs-ref-toggle[aria-expanded="true"] .xs-ref-chevron { transform: rotate(180deg); }
.xs-ref-body { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.xs-ref-body[hidden] { display: none; }
.xs-ref-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
}
.xs-ref-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.xs-ref-rules {
    margin: 0 0 0.5rem 1.1rem;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.xs-ref-rules li { margin-bottom: 0.1rem; }
.xs-ref-gotcha {
    font-size: 0.775rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 0.4rem 0.6rem;
    border-left: 2px solid var(--border-strong);
    margin-top: 0.4rem;
}
