body {
    margin: 0;
    font-family: "SF Pro Text", "Segoe UI", Arial, sans-serif;
    color: #172033;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

a {
    color: #2563eb;
    text-decoration: none;
}

.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: rgba(15, 23, 42, 0.06);
    padding: 1px 6px;
    border-radius: 6px;
}

.topbar,
.detail-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h1,
.detail-topbar h1 {
    margin: 0;
}

.muted {
    color: #64748b;
}

.pill-row,
.topics-row,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #1e293b;
}

.status-badge.on { background: #dcfce7; color: #166534; }
.status-badge.off { background: #fee2e2; color: #991b1b; }
.status-badge.paused { background: #fef3c7; color: #92400e; }
.status-badge.provider { background: #dbeafe; color: #1d4ed8; }
.status-badge.today { background: #fecdd3; color: #9f1239; }
.status-badge.soon { background: #fde68a; color: #92400e; }
.status-badge.upcoming { background: #e0e7ff; color: #4338ca; }
.status-badge.archived { background: #e5e7eb; color: #374151; }
.status-badge.bot { background: #ede9fe; color: #6d28d9; }

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.category-chip.friend {
    background: #fee2e2;
    color: #be123c;
}

.category-chip.work {
    background: #dbeafe;
    color: #1d4ed8;
}

.category-chip.other {
    background: #e2e8f0;
    color: #334155;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.filters-panel {
    margin-bottom: 20px;
}

.onboarding-progress-card {
    margin-bottom: 20px;
    padding: 18px 20px;
}

.onboarding-progress-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.onboarding-progress-head h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.onboarding-progress-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(248, 250, 252, 0.85);
}

.onboarding-step-completed {
    background: rgba(220, 252, 231, 0.85);
    border-color: rgba(74, 222, 128, 0.32);
}

.onboarding-step-current {
    background: rgba(219, 234, 254, 0.9);
    border-color: rgba(59, 130, 246, 0.28);
}

.onboarding-step-upcoming {
    background: rgba(248, 250, 252, 0.85);
}

.onboarding-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.28);
    flex: 0 0 auto;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.welcome-step-card {
    padding: 20px;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.setup-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 18px;
    background: rgba(248, 250, 252, 0.8);
}

.setup-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.setup-fields {
    display: grid;
    gap: 16px;
}

.setup-field {
    display: grid;
    gap: 8px;
}

.setup-meta,
.setup-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
}

.bulk-label {
    min-width: 240px;
}

.contact-card-wrap {
    position: relative;
}

.select-chip {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 12px;
    font-weight: 600;
}

.contact-card,
.panel,
.login-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.contact-card {
    display: block;
    padding: 18px;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
}

.card-head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.avatar,
.avatar-placeholder {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: white;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.card-title {
    margin: 0;
    font-size: 18px;
}

.username {
    margin-top: 4px;
    font-size: 13px;
    color: #64748b;
}

.meta-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    font-size: 13px;
}

.meta-line strong {
    color: #475569;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.landing-card {
    max-width: 760px;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0 24px;
}

.landing-panel {
    margin-top: 12px;
    padding: 18px 20px;
}

.login-card {
    width: min(420px, 100%);
    padding: 28px;
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    margin: 0 0 20px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding-top: 24px;
}

.checkbox-label input {
    width: auto;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: white;
    font: inherit;
}

textarea {
    min-height: 140px;
}

button,
.button-link {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #0f172a;
    color: white;
    cursor: pointer;
    font: inherit;
}

button.secondary,
.button-link.secondary {
    background: white;
    color: #0f172a;
}

.error-box,
.hint-box {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
}

.hint-box {
    background: #eff6ff;
    color: #1d4ed8;
}

.panel {
    padding: 20px;
    margin-bottom: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px 16px;
}

.diagnostics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-hero {
    display: flex;
    gap: 16px;
    align-items: center;
}

.history-list {
    display: grid;
    gap: 12px;
}

.history-item {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(248, 250, 252, 0.8);
}

.history-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.history-text {
    color: #1e293b;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .topbar,
    .detail-topbar,
    .detail-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}
