/* ── PulseSteer dashboard (/app) ── */
/* Dashboard (/app) styles. Base fonts come from app.css. */
h1:focus { outline: none; }

.ps-app-layout { grid-template-columns: auto 1fr; }
.ps-app-layout .rz-header { background: var(--rz-base-background-color); border-bottom: 1px solid var(--rz-base-300); }
.page-body { max-width: 1500px; margin: 0 auto; }

.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; }

.sidebar-foot { padding: 1rem; border-top: 1px solid var(--rz-base-300); margin-top: auto; }

.live-pill { display: inline-flex; gap: .4rem; align-items: center; font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; background: var(--rz-base-200); color: var(--rz-text-secondary-color); }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rz-base-500); }
.live-pill.live { background: color-mix(in srgb, var(--rz-success) 15%, transparent); color: var(--rz-success-dark); }
.live-pill.live .dot { background: var(--rz-success); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rz-success) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.page-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-title h1 { margin: 0; font-size: 1.6rem; font-weight: 600; }
.page-title .sub { color: var(--rz-text-secondary-color); margin: .2rem 0 0; }

.stat-card { height: 100%; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--rz-text-secondary-color); font-size: .85rem; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--rz-primary-lighter); color: var(--rz-primary); }

.feed { display: flex; flex-direction: column; gap: .25rem; max-height: 560px; overflow: auto; }
.feed-item { display: grid; grid-template-columns: 36px 1fr auto; gap: .75rem; align-items: start; padding: .6rem .5rem; border-radius: 8px; cursor: pointer; }
.feed-item:hover { background: var(--rz-base-100); }
.feed-item.new { animation: flash 2s ease-out; }
@keyframes flash { from { background: var(--rz-primary-lighter); } to { background: transparent; } }
.feed-item .title { font-weight: 500; }
.feed-item .meta { color: var(--rz-text-secondary-color); font-size: .8rem; }
.feed-item .ai { font-size: .82rem; color: var(--rz-text-color); margin-top: .15rem; }
.cat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }

.cat-Customer { background: #e0f2fe; color: #0369a1; }
.cat-Financial { background: #dcfce7; color: #15803d; }
.cat-Technical { background: #fee2e2; color: #b91c1c; }
.cat-Marketing { background: #fae8ff; color: #a21caf; }
.cat-Operations { background: #fef3c7; color: #b45309; }
.cat-Task { background: #ede9fe; color: #6d28d9; }
.cat-Analytics { background: #e0e7ff; color: #4338ca; }
.cat-Website { background: #ccfbf1; color: #0f766e; }
.cat-Authentication { background: #e0f2fe; color: #075985; }
.cat-Data { background: #f1f5f9; color: #334155; }
.cat-Other { background: var(--rz-base-200); color: var(--rz-text-secondary-color); }

.json-view { background: var(--rz-base-100); border: 1px solid var(--rz-base-300); border-radius: 8px; padding: .75rem; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; margin: 0; }
.code-block { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 1rem; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; white-space: pre; overflow: auto; margin: 0; }
.muted { color: var(--rz-text-secondary-color); }
.small { font-size: .82rem; }
.clickable { cursor: pointer; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--rz-text-secondary-color); }
.empty-state .rzi { font-size: 48px; opacity: .5; }
.guide-step { border-left: 3px solid var(--rz-primary); padding: .25rem 0 .25rem 1rem; margin-bottom: 1rem; }
.key-box { font-family: ui-monospace, Consolas, monospace; background: var(--rz-base-100); padding: .75rem; border-radius: 8px; border: 1px dashed var(--rz-primary); word-break: break-all; }

/* Account pages (sign in / register) – brand styles; form fields and buttons come from app.css */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.1fr; background: #fff; }
.auth-panel { position: relative; overflow: hidden; padding: 2.5rem 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-panel-body { max-width: 460px; }
.auth-panel h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); margin: 0 0 1rem; }
.auth-panel p { font-size: 1.05rem; }
.auth-areas { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .85rem; }
.auth-areas li { display: flex; gap: .75rem; align-items: center; color: #CBD5E1; }
.auth-areas li b { color: #fff; }
.auth-areas .rzi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(94,234,212,.12); color: var(--ps-teal-300); font-size: 20px; flex: none; }
.auth-panel .pulse-line { margin: 0; height: 60px; }
.auth-main { display: flex; flex-direction: column; padding: 1.6rem 2rem; }
.auth-top { text-align: right; font-size: .9rem; }
.auth-box { width: 100%; max-width: 420px; margin: auto; padding: 2rem 0; }
.auth-box h1 { font-size: 2rem; margin-bottom: .35rem; }
.auth-box .sub { margin-bottom: 1.8rem; }
.auth-box .remember { display: flex; justify-content: space-between; align-items: center; margin: .2rem 0 1.3rem; font-size: .92rem; }
.auth-box .remember label { display: inline-flex; gap: .45rem; align-items: center; font-weight: 500; margin: 0; }
.auth-box .remember input { width: auto; }
.auth-mobile-logo { display: none !important; margin-bottom: 2rem; }
.auth-foot { text-align: center; }
.auth-error { background: var(--ps-coral-50); color: var(--ps-coral-700); border-radius: 10px; padding: .75rem 1rem; margin-top: 1rem; font-size: .92rem; }
.auth-notice { background: var(--ps-teal-50); color: var(--ps-teal-700); border-radius: 10px; padding: .75rem 1rem; margin: 0 0 1rem; font-size: .92rem; }
.auth-box .auth-error.top { margin: 0 0 1rem; }

/* Verify-your-email splash and confirmation result */
.verify-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 1.4rem;
               background: linear-gradient(135deg, var(--ps-teal), var(--ps-teal-700)); color: #fff; box-shadow: 0 14px 30px -14px rgba(15,118,110,.8); }
.verify-icon .rzi { font-size: 34px; }
.verify-icon.warn { background: linear-gradient(135deg, var(--ps-coral), var(--ps-coral-700)); box-shadow: 0 14px 30px -14px rgba(194,65,12,.7); }
.verify-steps { margin: 0 0 1.6rem; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .7rem; }
.verify-steps li { counter-increment: step; display: flex; gap: .8rem; align-items: flex-start; font-size: .96rem; color: var(--ps-slate); }
.verify-steps li::before { content: counter(step); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
                           background: var(--ps-teal-50); color: var(--ps-teal-700); font-weight: 800; font-size: .85rem; }
.verify-actions { display: grid; gap: .7rem; }
.verify-actions form { margin: 0; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ps-teal-700); text-decoration: underline; cursor: pointer; }
/* Connector functions (event imports / actions) */
.connector-functions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.connector-functions .fn { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.connector-functions .fn .rzi { font-size: 14px; }
.connector-functions .fn-import { background: var(--rz-base-100); color: var(--ps-slate); }
.connector-functions .fn-action { background: var(--ps-teal-50); color: var(--ps-teal-700); }

/* To Do */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-row { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .8rem .2rem; border-top: 1px solid var(--rz-base-200); }
.todo-row:first-child { border-top: 0; }
.todo-row.done .todo-title { text-decoration: line-through; color: var(--ps-slate); }
.todo-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--rz-base-400); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; margin-top: .1rem; }
.todo-check:hover { border-color: var(--ps-teal-700); color: var(--ps-teal-700); }
.todo-row.done .todo-check { background: var(--ps-teal-700); border-color: var(--ps-teal-700); color: #fff; }
.todo-check .rzi { font-size: 16px; }
.todo-title { font-weight: 600; }
.todo-details { white-space: pre-line; color: var(--ps-slate); font-size: .9rem; margin-top: .2rem; }
.todo-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--ps-slate); margin-top: .35rem; }
.todo-meta .rzi { font-size: 14px; vertical-align: -2px; }
.todo-meta .overdue { color: var(--ps-danger); font-weight: 600; }

/* Irreversible actions (e.g. delete an event) */
.danger-zone { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.1rem;
               border: 1px solid color-mix(in srgb, var(--ps-danger) 35%, transparent); border-radius: 12px;
               background: color-mix(in srgb, var(--ps-danger) 5%, var(--rz-base-background-color)); }
.danger-zone b { color: var(--ps-danger); }
.danger-zone p { margin: .25rem 0 0; font-size: .85rem; color: var(--ps-slate); }
.danger-zone .rz-button { flex: none; }
@media (max-width: 600px) { .danger-zone { flex-direction: column; align-items: flex-start; } }

.mono { font-family: var(--ps-font-mono, ui-monospace, Consolas, monospace); font-size: .82rem; overflow-wrap: anywhere; }
@media (max-width: 700px) { .info-row { grid-template-columns: 1fr; gap: .15rem; } }

.validation-message { color: var(--ps-danger); font-size: .84rem; margin-top: .3rem; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .auth-mobile-logo { display: inline-flex !important; }
    .hide-sm { display: none; }
}

#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred." }

/* First-sign-in tutorial (OnboardingDialog) */
.onboarding-dialog .rz-dialog-content { padding: 0; }
.onboarding { display: flex; flex-direction: column; }
.onboarding-hero { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; color: #fff; transition: background .3s ease; }
.onboarding-hero .rzi { font-size: 64px; opacity: .95; }
.onboarding-count { position: absolute; top: 14px; left: 18px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.2); padding: .2rem .6rem; border-radius: 999px; }
.onboarding-body { padding: 1.4rem 1.6rem .4rem; min-height: 250px; }
.onboarding-welcome { font-size: .9rem; color: var(--rz-text-secondary-color); margin-bottom: .2rem; }
.onboarding-body h2 { font-size: 1.45rem; margin: 0 0 .5rem; }
.onboarding-body p { color: var(--rz-text-secondary-color); margin: 0 0 .9rem; }
.onboarding-points { list-style: none; padding: 0; margin: 0 0 .6rem; }
.onboarding-points li { display: flex; gap: .55rem; align-items: flex-start; margin: .45rem 0; }
.onboarding-points .rzi { color: var(--rz-success); font-size: 1.15rem; margin-top: .1rem; }
.onboarding-footer { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.6rem 1.2rem; border-top: 1px solid var(--rz-base-200); }
.onboarding-dots { display: flex; gap: .45rem; }
.onboarding-dots button { width: 9px; height: 9px; border-radius: 999px; border: 0; padding: 0; background: var(--rz-base-300); cursor: pointer; transition: all .2s ease; }
.onboarding-dots button.active { width: 26px; background: var(--rz-primary); }
.onboarding-buttons { display: flex; gap: .5rem; }

/* Inbox */
.inbox-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.inbox-card-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--rz-primary-lighter); color: var(--rz-primary); }
.inbox-card-icon .rzi { font-size: 26px; }
.inbox-card-text { flex: 1; min-width: 240px; }
.inbox-card-headline { font-size: 1.05rem; font-weight: 600; }
.mail-row { display: grid; grid-template-columns: 40px 1fr auto; gap: .9rem; align-items: start; padding: .85rem 1rem; border-bottom: 1px solid var(--rz-base-200); }
.mail-row:last-child { border-bottom: 0; }
.mail-row:hover { background: var(--rz-base-50, #fafafa); }
.mail-row.important { box-shadow: inset 3px 0 0 var(--rz-danger); }
.mail-row.spam { opacity: .75; }
.mail-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--rz-base-200); color: var(--rz-text-secondary-color); }
.mail-main { min-width: 0; cursor: pointer; }
.mail-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mail-from { font-weight: 600; }
.mail-time { margin-left: auto; font-size: .8rem; color: var(--rz-text-secondary-color); }
.mail-subject { font-weight: 500; margin-top: .1rem; }
.mail-preview { font-size: .85rem; color: var(--rz-text-secondary-color); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mail-actions { display: flex; gap: .15rem; align-items: center; }
.reply-original { background: var(--rz-base-100); border-radius: 10px; padding: .7rem .9rem; }
@media (max-width: 700px) { .mail-row { grid-template-columns: 1fr; } .mail-avatar { display: none; } }

/* Brand in the dashboard chrome */
.ps-app-layout .rz-header { box-shadow: none; }
/* Account name flush left, lined up with the sidebar menu icons. */
.app-header-bar { padding: 0 1rem 0 1.05rem; }
.sidebar-toggle-mobile { display: none; }
@media (max-width: 767.98px) {
    .app-header-bar { padding-left: .5rem; }
    .sidebar-toggle-mobile { display: inline-flex; }
}
.app-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none !important; color: var(--ps-navy); }
.app-brand img { display: block; }
.app-brand .wordmark { font-size: 1.3rem; }
.app-brand-name { font-family: var(--ps-font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--ps-navy); }
.wordmark { font-family: var(--ps-font-brand); font-weight: 800; letter-spacing: -0.045em; color: var(--ps-navy); }
.wordmark::after { content: "."; color: var(--ps-coral); }
.powered-by { font-size: .78rem; color: var(--rz-text-secondary-color); margin-bottom: .6rem; }
.powered-by .wordmark { font-size: .9rem; }
.page-title h1 { font-family: var(--ps-font-display); font-weight: 800; letter-spacing: -0.03em; color: var(--ps-navy); }
.ps-app-layout .rz-sidebar { background: #fff; }

/* Timeline */
.tl-day { margin-bottom: 1.6rem; }
.tl-day-head { font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--rz-text-secondary-color); margin: 0 0 .6rem; }
.tl { position: relative; padding-left: 1.75rem; }
.tl::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--rz-base-300); }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: .75rem; padding: .55rem .75rem; border-radius: 10px; }
.tl-item:hover { background: var(--rz-base-100); }
.tl-dot { position: absolute; left: -1.75rem; top: .65rem; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--rz-base-300); }
.tl-dot .rzi { font-size: 14px; }
.tl-item.k-Signal .tl-dot { border-color: var(--ps-coral); color: var(--ps-coral-700); }
.tl-item.k-Insight .tl-dot { border-color: #7C3AED; color: #6D28D9; }
.tl-item.k-Decision .tl-dot { border-color: var(--ps-teal); color: var(--ps-teal-700); }
.tl-item.k-Action .tl-dot { border-color: var(--ps-teal-700); background: var(--ps-teal-50); color: var(--ps-teal-700); }
.tl-item.k-Resolution .tl-dot { border-color: #16A34A; color: #15803D; }
.tl-title { font-weight: 500; }
.tl-meta { font-size: .8rem; color: var(--rz-text-secondary-color); }
.tl-time { font-size: .8rem; color: var(--rz-text-secondary-color); white-space: nowrap; }

/* Monitoring schedule note (connector settings) */
.plan-note { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: 10px; background: var(--ps-teal-50); color: var(--ps-navy); font-size: .9rem; }
.plan-note .rzi { color: var(--ps-teal-700); font-size: 20px; flex: none; }

/* Settings → AI Automation */
.ai-automation { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.ai-credit-label { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ps-slate); }
.ai-credit-value { font-family: var(--ps-font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ps-navy); line-height: 1.1; }
.ai-switch { display: flex; align-items: center; gap: .8rem; }
.rule-chat-heading, .rule-chat-footer, .rule-chat-draft { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.rule-chat-heading > div { flex:1; min-width:230px; }
.rule-chat-heading p { margin:.5rem 0; }
.rule-chat-scope { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin:.5rem 0; }
.rule-chat-history { max-height:340px; overflow:auto; padding:1rem; margin:1rem 0; border:1px solid var(--rz-base-300); border-radius:10px; background:var(--rz-base-background-color); }
.rule-chat-message { padding:.65rem .85rem; margin-bottom:.65rem; border-radius:8px; max-width:90%; background:var(--rz-base-100); }
.rule-chat-message.from-user { margin-left:auto; border-left:3px solid #0f766e; }
.rule-chat-message.from-assistant { border-left:3px solid #8b5cf6; }
.rule-chat-message p { white-space:pre-wrap; overflow-wrap:anywhere; margin:.3rem 0 0; }
.rule-chat-draft { border:1px solid #0f766e; background:var(--rz-base-background-color); padding:1rem; border-radius:10px; margin:1rem 0; }
.rule-chat-draft p { margin:.5rem 0; }
.rule-chat-input { display:block; width:100%; box-sizing:border-box; padding:.75rem; border:1px solid var(--rz-base-400); border-radius:8px; font:inherit; color:var(--rz-text-color); background:var(--rz-input-background-color); resize:vertical; margin:.4rem 0 .75rem; }
.rule-chat-error { color:var(--rz-danger); }

/* Command → monthly usage meter */
/* Monthly updates: a one-line bar in the header, details on hover or focus */
.usage-chip { position: relative; display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--rz-base-300); background: var(--rz-base-background-color, #fff); cursor: default; font-size: .8rem; color: var(--ps-slate); white-space: nowrap; }
.usage-chip:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 2px; }
.usage-chip-label b { color: var(--ps-navy); }
.usage-bar { display: block; width: 72px; height: 6px; border-radius: 999px; background: var(--rz-base-200); overflow: hidden; }
.usage-bar.wide { width: 100%; height: 8px; margin: .6rem 0 .1rem; }
.usage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ps-teal-700); transition: width .4s ease; }
.usage-chip.near .usage-bar span { background: var(--ps-warning); }
.usage-chip.over .usage-bar span { background: var(--ps-danger); }
.usage-chip.near { border-color: color-mix(in srgb, var(--ps-warning) 45%, transparent); }
.usage-chip.over { border-color: color-mix(in srgb, var(--ps-danger) 45%, transparent); }
.usage-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1000; width: 320px; padding: .9rem 1rem; border-radius: 12px; background: #fff; border: 1px solid var(--rz-base-300);
             box-shadow: 0 18px 40px -18px rgba(15,30,54,.45); white-space: normal; color: var(--ps-navy); font-size: .9rem;
             opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.usage-chip:hover .usage-pop, .usage-chip:focus-within .usage-pop { opacity: 1; visibility: visible; transform: none; }
.usage-pop::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; } /* keeps hover alive between chip and panel */
.usage-note { margin-top: .5rem; color: var(--ps-slate); }
.usage-chip.over .usage-note { color: var(--ps-danger); }
.usage-upgrade { margin-top: .6rem; }
@media (max-width: 900px) { .usage-chip-label { display: none; } .usage-chip { padding: .45rem .55rem; } .usage-bar { width: 44px; } }
@media (max-width: 560px) { .usage-chip { display: none; } }
@media (prefers-reduced-motion: reduce) { .usage-pop, .usage-bar span { transition: none; } }

/* Repeating settings groups (e.g. a database check connector's checks) */
.config-list { display: flex; flex-direction: column; gap: 0.75rem; }
.config-list-item { padding: 0.9rem 1rem !important; }
.config-list-item textarea { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }

/* AI usage (Settings → AI Automation and Administration → AI) */
.ai-allowance-bar { height: 8px; border-radius: 999px; background: var(--rz-base-300); overflow: hidden; margin: .5rem 0 .35rem; max-width: 360px; }
.ai-allowance-bar > span { display: block; height: 100%; background: var(--ps-teal, #0f766e); border-radius: inherit; transition: width .3s; }
.ai-allowance-bar.warn > span { background: #d97706; }
.ai-allowance-bar.full > span { background: #dc2626; }
.ai-usage-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-top: 1rem; }
.ai-usage-stat { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .85rem; border: 1px solid var(--rz-base-300); border-radius: 10px; }
.ai-usage-stat .label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ps-slate); }
.ai-usage-stat b { font-size: 1.25rem; color: var(--ps-navy); }
.ai-credit-of { font-size: 1rem; font-weight: 600; color: var(--ps-slate); letter-spacing: 0; }

/* Rule Creator */
.rule-creator-scope { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.rule-creator-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.rule-creator-panel { display: flex; flex-direction: column; gap: .5rem; padding: 1.4rem; border: 1px solid var(--rz-base-300); border-radius: 14px; background: var(--rz-base-background-color, #fff); }
.rule-creator-panel h3 { margin: .25rem 0 0; font-size: 1.15rem; color: var(--ps-navy); }
.rule-creator-panel p { margin: 0; }
.rule-creator-panel .rz-button { margin-top: auto; align-self: flex-start; }
.rule-creator-panel > p.small { margin-bottom: .75rem; }
.rule-creator-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.rule-creator-icon .rzi { font-size: 24px; }
.rule-creator-icon.prompt { background: var(--ps-teal-50); color: var(--ps-teal-700); }
.rule-creator-icon.manual { background: #eef2ff; color: #4338ca; }
.rule-creator-icon.suggest { background: #fff7ed; color: #c2410c; }
.rule-creator-ideas { margin-top: 1.5rem; }
.rule-ideas { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.rule-ideas button { all: unset; cursor: pointer; display: block; padding: .45rem .6rem; border-radius: 8px; font-size: .9rem; }
.rule-ideas button:hover, .rule-ideas button:focus-visible { background: var(--ps-teal-50); outline: none; }

/* Rule chat inside a dialog */
.rule-chat.embedded .rule-chat-history { max-height: 300px; }
.rule-chat-examples { display: grid; gap: .4rem; }
.rule-chat-example { text-align: left; padding: .5rem .7rem; border: 1px solid var(--rz-base-300); border-radius: 8px; background: transparent; cursor: pointer; font: inherit; font-size: .88rem; color: inherit; }
.rule-chat-example:hover:not(:disabled) { border-color: var(--ps-teal); background: var(--ps-teal-50); }
.rule-chat-draft-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Guided rule builder and suggestions */
.rule-wizard-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.rule-wizard-steps button { all: unset; display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .75rem; border-radius: 999px; font-size: .88rem; color: var(--ps-slate); cursor: pointer; }
.rule-wizard-steps button:disabled { cursor: default; opacity: .6; }
.rule-wizard-steps button span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--rz-base-200); font-weight: 700; font-size: .8rem; }
.rule-wizard-steps .current button { background: var(--ps-teal-50); color: var(--ps-navy); font-weight: 600; }
.rule-wizard-steps .current button span, .rule-wizard-steps .done button span { background: var(--ps-teal); color: #fff; }
.rule-wizard-lead { font-weight: 600; font-size: 1.05rem; color: var(--ps-navy); margin: 0 0 .75rem; }
.rule-wizard-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.rule-wizard-search { flex: 1; min-width: 220px; padding: .65rem .8rem; border: 1px solid var(--rz-base-300); border-radius: 8px; font: inherit; }
.rule-wizard-options { margin: .5rem 0; }
.rule-wizard-list { display: grid; gap: .4rem; max-height: 340px; overflow: auto; padding: .15rem; }
.rule-wizard-list.compact { max-height: 240px; }
.rule-wizard-option { display: flex; gap: .7rem; align-items: flex-start; text-align: left; padding: .6rem .75rem; border: 1px solid var(--rz-base-300); border-radius: 10px; background: transparent; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.rule-wizard-option:hover { border-color: var(--ps-teal); }
.rule-wizard-option.selected { border-color: var(--ps-teal); background: var(--ps-teal-50); box-shadow: inset 0 0 0 1px var(--ps-teal); }
.rule-wizard-option code { margin-left: .3rem; }
.rule-wizard-fields { margin-top: 1rem; display: grid; gap: .75rem; }
.rule-wizard-field { display: grid; gap: .3rem; }
.rule-wizard-field-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rule-wizard-field textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--rz-base-300); border-radius: 8px; font: inherit; resize: vertical; }
.rule-wizard-summary { padding: .9rem 1rem; border-radius: 10px; background: var(--ps-teal-50); color: var(--ps-navy); margin-bottom: 1rem; }
.rule-wizard-choice { display: grid; gap: .5rem; }
.rule-wizard-enabled { display: inline-flex; align-items: center; gap: .5rem; }
.rule-wizard-footer { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; padding-top: .9rem; border-top: 1px solid var(--rz-base-300); flex-wrap: wrap; }
.rule-wizard-advanced { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--ps-teal-700); }
.rule-wizard-advanced:hover, .rule-wizard-advanced:focus-visible { text-decoration: underline; }
.rule-suggest-loading { display: flex; gap: 1rem; align-items: center; padding: 1.5rem .5rem; }
.rule-suggest-list { display: grid; gap: .6rem; }
.rule-suggestion { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--rz-base-300); border-radius: 10px; }
.rule-suggestion.selected { border-color: var(--ps-teal); background: var(--ps-teal-50); }
.rule-suggestion-body { flex: 1; display: grid; gap: .25rem; cursor: pointer; }
.rule-suggestion-tags { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Connector setup guide: example code */
.guide-example { margin-top: .6rem; border: 1px solid var(--rz-base-300); border-radius: 10px; overflow: hidden; background: #0f172a; }
.guide-example-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem .4rem .3rem .8rem; background: #1e293b; color: #cbd5e1; font-size: .78rem; font-family: ui-monospace, Consolas, monospace; }
.guide-example-head .rz-button { color: #cbd5e1; }
.guide-example pre { margin: 0; padding: .8rem 1rem; max-height: 340px; overflow: auto; color: #e2e8f0; font-size: .8rem; line-height: 1.5; font-family: ui-monospace, Consolas, monospace; white-space: pre; }
