:root {
  --brand: #0891b2;
  --brand-dark: #0e7490;
  --indigo: #4f46e5;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --green: #059669;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 90% 0, #ecfeff 0, transparent 28rem), #f8fafc; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
[hidden] { display: none !important; }

.account-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 max(24px, calc((100vw - 1120px) / 2)); border-bottom: 1px solid rgba(226,232,240,.9); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #0f172a; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: white; background: linear-gradient(135deg, var(--brand), #6366f1); font-size: 11px; }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: #475569; font-size: 14px; text-decoration: none; }
nav a:hover { color: var(--ink); }

.account-shell { width: min(1120px, calc(100% - 32px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 62px 0 80px; }
.account-hero { max-width: 760px; margin-bottom: 32px; }
.eyebrow, .panel-kicker { margin-bottom: 8px; color: var(--brand-dark); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.account-hero h1 { margin: 0; max-width: 720px; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -.052em; }
.account-hero p { max-width: 680px; margin: 20px 0 0; color: #475569; font-size: 18px; line-height: 1.65; }

.panel { border: 1px solid var(--line); border-radius: 20px; padding: 28px; background: rgba(255,255,255,.94); box-shadow: 0 18px 50px rgba(15,23,42,.055); }
.panel h2 { margin: 0 0 10px; font-size: 25px; letter-spacing: -.03em; }
.panel > p { color: var(--muted); line-height: 1.6; }
.account-grid, .dashboard-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 20px; }

.auth-panel form { display: grid; gap: 10px; margin-top: 24px; }
label { font-size: 13px; font-weight: 700; }
input { width: 100%; border: 1px solid #cbd5e1; border-radius: 11px; padding: 12px 13px; color: var(--ink); background: white; font: inherit; outline: none; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,145,178,.11); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; border: 0; border-radius: 11px; padding: 10px 17px; font: inherit; font-size: 14px; font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, var(--brand), #4f46e5); box-shadow: 0 8px 22px rgba(8,145,178,.18); }
.button-secondary { color: var(--ink); border: 1px solid #cbd5e1; background: white; }
.button-dark { color: white; background: var(--ink); }
.text-button { margin-top: 18px; border: 0; padding: 0; color: var(--muted); background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.fine-print { color: #94a3b8 !important; font-size: 12px; line-height: 1.55 !important; }

.plan-preview { position: relative; overflow: hidden; color: white; border: 0; background: linear-gradient(145deg, #0f172a 0%, #172554 58%, #164e63 100%); }
.plan-preview::after { position: absolute; inset: auto -80px -120px auto; width: 280px; height: 280px; border-radius: 50%; background: rgba(34,211,238,.14); content: ""; }
.plan-preview h2 { font-size: 31px; }
.plan-preview p { color: #cbd5e1; }
.plan-badge { display: inline-flex; margin-bottom: 24px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 5px 9px; color: #a5f3fc; font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.price { display: flex; align-items: baseline; gap: 7px; margin: 18px 0 0; }
.price strong { font-size: 52px; letter-spacing: -.06em; }
.price span { color: #cbd5e1; }
.plan-preview ul { position: relative; z-index: 1; display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.plan-preview li::before { margin-right: 9px; color: #5eead4; content: "✓"; }

.message { margin-bottom: 20px; border: 1px solid #bae6fd; border-radius: 12px; padding: 12px 14px; color: #155e75; background: #ecfeff; font-size: 14px; }
.message.error { border-color: #fecaca; color: #991b1b; background: #fef2f2; }
.message.success { border-color: #a7f3d0; color: #065f46; background: #ecfdf5; }
.loading-panel { display: flex; align-items: center; gap: 12px; }
.loading-panel p { margin: 0; }
.spinner { width: 19px; height: 19px; border: 2px solid #bae6fd; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.connect-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; border: 1px solid #a5f3fc; border-radius: 20px; padding: 24px 28px; background: linear-gradient(120deg, #ecfeff, white); }
.connect-banner h2 { margin: 0 0 5px; font-size: 22px; }
.connect-banner p { margin: 0; max-width: 680px; color: var(--muted); line-height: 1.55; }
.plan-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.plan-row h2 { margin-bottom: 0; font-size: 36px; }
.status-pill { border-radius: 999px; padding: 5px 9px; color: #065f46; background: #ecfdf5; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.account-email { margin: 7px 0 25px !important; font-size: 13px; }
.usage-block { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--soft); }
.usage-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.meter { height: 8px; margin: 11px 0 10px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #6366f1); transition: width .35s; }
.usage-block p { margin: 0; }
.upgrade-actions { display: grid; gap: 9px; margin-top: 18px; }
#manage-billing { width: 100%; margin-top: 18px; }

.privacy-card { background: linear-gradient(150deg, white, #f8fafc); }
.mode-row { display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin-top: 20px; }
.mode-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.mode-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-weight: 900; }
.mode-icon.private { color: #047857; background: #d1fae5; }
.mode-icon.pro { color: white; background: linear-gradient(135deg, var(--brand), var(--indigo)); }

.library-panel { margin-top: 20px; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.library-head h2 { margin-bottom: 0; }
.library-head input { max-width: 260px; }
.report-list { display: grid; gap: 10px; margin-top: 22px; }
.report-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.report-card h3 { margin: 0 0 6px; font-size: 16px; }
.report-card p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.report-meta { margin-top: 9px; color: #94a3b8; font-size: 11px; }
.report-actions { display: flex; align-items: flex-start; gap: 7px; }
.report-actions button { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: #475569; background: white; font: inherit; font-size: 11px; cursor: pointer; }
.empty-state { padding: 46px 12px 28px; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 10px 0 6px; color: var(--ink); }
.empty-state p { margin: 0 auto; max-width: 500px; line-height: 1.55; }
.empty-icon { margin: auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand); background: #ecfeff; font-size: 22px; }

footer { padding: 22px; border-top: 1px solid var(--line); color: #94a3b8; background: white; text-align: center; font-size: 12px; }
footer a { color: #64748b; }

@media (max-width: 760px) {
  .account-header { padding: 0 18px; }
  nav a:first-child { display: none; }
  .account-shell { padding-top: 38px; }
  .account-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .connect-banner, .library-head { align-items: stretch; flex-direction: column; }
  .connect-banner { display: flex; }
  .library-head input { max-width: none; }
  .report-card { grid-template-columns: 1fr; }
}
