/* Holt — app chrome styles (articles have their own dynamic styling) */

/* --- Form elements --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #334155;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.15);
}

/* --- Checkboxes & radios --- */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #64748b;
}

/* --- Range slider --- */
input[type="range"] {
    width: 100%;
    accent-color: #64748b;
}

/* --- Buttons --- */
button,
a[role="button"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4375rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary,
button[type="submit"] {
    background-color: #334155;
    color: #fff;
    border: 1px solid #334155;
}

.btn-primary:hover,
button[type="submit"]:hover {
    background-color: #1e293b;
    border-color: #1e293b;
}

.btn-secondary,
a[role="button"],
button.outline {
    background-color: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover,
a[role="button"]:hover,
button.outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background-color: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background-color: #fef2f2;
    border-color: #f87171;
}

/* --- Tables --- */
table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 500;
    color: #64748b;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

/* --- Pipeline progress --- */
.stage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stage-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid #f1f5f9;
}

.stage-item .icon {
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.stage-item .name {
    flex: 1;
    color: #334155;
}

.stage-item .elapsed {
    color: #94a3b8;
    font-size: 0.6875rem;
}

.stage-item.pending .icon { color: #cbd5e1; }
.stage-item.running .icon { color: #64748b; }
.stage-item.complete .icon { color: #059669; }
.stage-item.error .icon { color: #dc2626; }

/* --- Chat / onboarding --- */
.chat-container {
    display: flex;
    gap: 2rem;
    min-height: 50vh;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    max-height: 50vh;
    padding: 0.75rem 0;
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.chat-message.system {
    background: #f8fafc;
    border-left: 2px solid #cbd5e1;
    color: #475569;
}

.chat-message.user {
    background: #f1f5f9;
    margin-left: 2rem;
    color: #334155;
}

.chat-input-area {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

/* --- Reading values grid --- */
.reading-values-grid {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.8125rem;
}

/* --- Completion card --- */
.completion-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-top: 1rem;
}

/* --- Profile cards --- */
.profile-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.15s ease;
}

.profile-card:hover {
    border-color: #cbd5e1;
}

/* --- Fieldset --- */
fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
}

fieldset legend {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    padding: 0 0.25rem;
}

/* --- Progress section --- */
.progress-section {
    margin-bottom: 0.75rem;
}

.progress-section h6 {
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

/* --- Loading spinner (aria-busy) --- */
[aria-busy="true"]::before {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e2e8f0;
    border-top-color: #64748b;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Deepen profile */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-tab {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 1rem;
    background: var(--holt-bg-subtle);
    color: var(--pico-muted-color);
}

.category-tab.active {
    background: var(--holt-accent);
    color: #fff;
    border-color: var(--holt-accent);
}

.deepen-card {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.option-list label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.option-list small.meta {
    color: var(--pico-muted-color);
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.deepen-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.text-xs {
    font-size: 0.85rem;
}

.mt-3 {
    margin-top: 0.75rem;
}
