:root {
  color-scheme: light;
  --ink: #18161d;
  --muted: #77727f;
  --line: #e9e6ed;
  --paper: #faf9fb;
  --white: #fff;
  --violet: #7139d4;
  --violet-dark: #5226aa;
  --violet-soft: #f0eafd;
  --green: #23805c;
  --danger: #b64050;
  --shadow: 0 12px 34px rgba(33, 22, 48, .055);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: 'Montserrat', 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; width: 258px; display: flex; flex-direction: column; padding: 25px 19px 18px; background: #17151b; color: #f5f2f8; }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 14px; font-weight: 700; letter-spacing: 0; }
.brand-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--violet); color: white; font-size: 12px; font-weight: 800; }
.sidebar-label { margin: 46px 0 10px 9px; color: #898490; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.org-switch { padding: 0 8px 20px; border-bottom: 1px solid #302d35; }
.org-switch label, .field label { display: block; margin-bottom: 7px; color: #68636e; font-size: 11px; font-weight: 700; }
.org-switch label { color: #a7a2ae; }
.org-switch-row { position: relative; }
.org-switch select { width: 100%; min-height: 39px; appearance: none; padding: 0 31px 0 11px; border: 1px solid #3a3640; border-radius: 6px; outline: none; background: #211e26; color: #fff; font-size: 12px; }
.org-switch-row > span { position: absolute; top: 7px; right: 11px; color: #aba5b4; pointer-events: none; }
.main-nav { display: grid; gap: 5px; padding-top: 16px; }
.nav-link { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 11px; border-radius: 6px; color: #bbb6c2; font-size: 12px; font-weight: 600; transition: background .16s ease, color .16s ease; }
.nav-link:hover, .nav-link.is-active { background: #2b2435; color: white; }
.nav-link.is-active { box-shadow: inset 2px 0 #a678ff; }
.nav-icon { width: 17px; color: #b38af4; font-size: 17px; text-align: center; }
.sidebar-spacer { flex: 1; min-height: 20px; }
.sidebar-note { display: flex; gap: 10px; margin: 16px 1px; padding: 12px 10px; border: 1px solid #393440; border-radius: 6px; background: #211e26; }
.note-dot, .status-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #aa80fa; }
.sidebar-note strong, .sidebar-note small, .user-meta strong, .user-meta small { display: block; }
.sidebar-note strong { font-size: 10px; }
.sidebar-note small { margin-top: 3px; color: #aaa4b0; font-size: 9px; line-height: 1.5; }
.user-panel { display: flex; align-items: center; gap: 9px; padding: 13px 2px 0; border-top: 1px solid #302d35; }
.avatar { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #49356a; color: #dfd0f6; font-size: 12px; font-weight: 700; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { overflow: hidden; color: #f5f2f8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { overflow: hidden; margin-top: 2px; color: #aaa4b0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #b9b3c0; cursor: pointer; font-size: 16px; }
.icon-button:hover { background: #302d35; color: #fff; }
.main-area { grid-column: 2; min-width: 0; }
.topbar { display: flex; height: 66px; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); }
.topbar > div { display: flex; align-items: center; gap: 12px; }
.topbar-kicker { color: #8c8792; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.topbar-organization { padding-left: 12px; border-left: 1px solid var(--line); color: #4d4853; font-size: 11px; font-weight: 600; }
.topbar-link, .subtle-link { color: var(--violet); font-size: 11px; font-weight: 700; }
.content-wrap { width: min(1120px, 100%); margin: 0 auto; padding: 38px 42px 64px; }
.messages { display: grid; gap: 8px; margin-bottom: 21px; }
.message { padding: 11px 14px; border: 1px solid #cce8da; border-radius: 5px; background: #effaf4; color: #216746; font-size: 12px; }
.message-error { border-color: #f0ccd1; background: #fff3f4; color: #9d3545; }
.page-heading { margin-bottom: 27px; }
.page-heading h1 { margin: 7px 0 7px; font-size: 27px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.page-heading p strong { color: #514b57; font-weight: 600; }
.page-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.eyebrow { display: block; color: var(--violet); font-size: 9px; font-weight: 800; letter-spacing: 1.1px; }
.dashboard-intro { position: relative; display: flex; min-height: 154px; align-items: center; justify-content: space-between; overflow: hidden; padding: 27px 30px; border-radius: 7px; background: #211d27; color: white; }
.dashboard-intro:after { position: absolute; top: -78px; right: 90px; width: 250px; height: 250px; border: 1px solid rgba(199,171,247,.13); border-radius: 50%; content: ''; box-shadow: 0 0 0 30px rgba(199,171,247,.025), 0 0 0 60px rgba(199,171,247,.02); }
.dashboard-intro .eyebrow { color: #c1a3f0; }
.dashboard-intro h2 { margin: 5px 0 2px; font-size: 21px; }
.dashboard-intro p { margin: 0; color: #bbb5c2; font-size: 11px; }
.intro-mark { z-index: 1; display: grid; width: 61px; height: 61px; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: #d8c4f7; font-size: 22px; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 17px 0 34px; }
.surface { border: 1px solid var(--line); border-radius: 6px; background: var(--white); box-shadow: var(--shadow); }
.metric-card { display: flex; min-height: 130px; flex-direction: column; padding: 17px 19px; }
.metric-label { color: #8a8490; font-size: 9px; font-weight: 800; letter-spacing: .8px; }
.metric-card strong { margin-top: 7px; font-size: 27px; font-weight: 700; line-height: 1.3; }
.metric-foot { margin-top: auto; color: #928d97; font-size: 10px; }
.metric-next strong { font-size: 17px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.section-heading h2 { margin: 2px 0 0; font-size: 17px; }
.subtle-link span { margin-left: 5px; }
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.brand-card { min-width: 0; padding: 17px; transition: border-color .18s ease, transform .18s ease; }
.brand-card:hover { transform: translateY(-2px); border-color: #d5c5ef; }
.brand-card-top { display: flex; align-items: center; gap: 11px; }
.brand-avatar { display: grid; width: 41px; height: 41px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: var(--brand-color, var(--violet)); color: white; font-size: 15px; font-weight: 700; }
.brand-card-top h2 { overflow-wrap: anywhere; margin: 0; font-size: 13px; }
.muted { color: var(--muted); font-size: 10px; }
.status-dot { margin: 0 0 auto auto; background: #41a575; box-shadow: 0 0 0 3px #e6f5ed; }
.brand-description { min-height: 34px; margin: 15px 0; color: #69636f; font-size: 10px; line-height: 1.7; }
.swatches { display: flex; align-items: center; gap: 5px; }
.swatches > span { width: 14px; height: 14px; border: 1px solid rgba(20,15,25,.1); border-radius: 50%; }
.swatches small { overflow: hidden; margin-left: auto; color: #89838f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.card-link { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0edf2; color: var(--violet); font-size: 10px; font-weight: 700; }
.brand-actions { display: flex; gap: 17px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #f0edf2; }
.brand-actions a, .text-button { padding: 0; border: 0; background: none; color: var(--violet); cursor: pointer; font-size: 10px; font-weight: 700; }
.text-button { color: #8e5861; }
.empty-state { display: grid; justify-items: center; padding: 48px 20px; text-align: center; }
.empty-glyph { color: var(--violet); font-size: 29px; }
.empty-state h2 { margin: 9px 0 0; font-size: 16px; }
.empty-state p { margin: 5px 0 18px; color: var(--muted); font-size: 11px; }
.onboarding-layout { display: grid; grid-template-columns: minmax(200px, .75fr) minmax(0, 1.5fr); align-items: start; gap: 28px; }
.step-rail { padding: 13px 0; }
.step-item { display: flex; align-items: center; gap: 12px; color: #938e99; }
.step-item > span { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid #ddd8e3; border-radius: 50%; font-size: 10px; font-weight: 700; }
.step-item.is-current { color: var(--ink); }
.step-item.is-current > span { border-color: var(--violet); background: var(--violet); color: white; }
.step-item strong, .step-item small { display: block; }
.step-item strong { font-size: 11px; }
.step-item small { color: #918b97; font-size: 9px; }
.step-line { height: 28px; margin-left: 15px; border-left: 1px solid #ded9e4; }
.form-card { padding: 24px; }
.surface-heading { margin-bottom: 23px; }
.surface-heading h2 { margin: 5px 0 4px; font-size: 17px; }
.surface-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.form-stack { display: grid; gap: 16px; }
.field { min-width: 0; }
.field input:not([type=color]):not([type=file]), .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #ded9e3; border-radius: 5px; outline: none; background: white; color: var(--ink); font-size: 12px; transition: border-color .16s ease, box-shadow .16s ease; }
.field textarea { resize: vertical; }
.field input[type=color] { display: block; width: 54px; height: 39px; padding: 3px; border: 1px solid #ded9e3; border-radius: 5px; background: white; cursor: pointer; }
.field input[type=file] { width: 100%; padding: 8px; border: 1px dashed #d6d0dd; border-radius: 5px; color: #6d6672; font-size: 11px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #9b76dc; box-shadow: 0 0 0 3px rgba(113,57,212,.1); }
.field-error, .form-errors { margin-top: 5px; color: var(--danger); font-size: 10px; }
.help-text { margin-top: 6px; color: var(--muted); font-size: 9px; }
.help-text ul { margin: 3px 0 0; padding-left: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: end; gap: 9px; margin-top: 24px; padding-top: 17px; border-top: 1px solid #efedf1; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--violet); color: white; }
.button-primary:hover { background: var(--violet-dark); }
.button-quiet { border-color: var(--line); background: white; color: #5f5966; }
.button-full { width: 100%; margin-top: 4px; }
.back-link { display: block; margin-bottom: 13px; color: #77717d; font-size: 10px; font-weight: 600; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .9fr) minmax(400px, 1.1fr); background: white; }
.auth-art { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 31px 8%; background: #19161e; color: white; }
.auth-art:before { position: absolute; right: -140px; bottom: 11%; width: 440px; height: 440px; border: 1px solid rgba(181,143,238,.17); border-radius: 50%; content: ''; box-shadow: 0 0 0 32px rgba(181,143,238,.035), 0 0 0 70px rgba(181,143,238,.025), 0 0 0 120px rgba(181,143,238,.018); }
.auth-art .brand-mark { position: relative; z-index: 1; }
.art-copy { position: relative; z-index: 1; max-width: 410px; margin: 0 auto; padding: 30px 0 80px; }
.art-copy .eyebrow { color: #c7a9f4; }
.art-copy h1 { margin: 14px 0; font-size: 39px; line-height: 1.25; letter-spacing: 0; }
.art-copy h1 em { color: #c09aef; font-style: normal; }
.art-copy p { max-width: 320px; color: #c5becb; font-size: 12px; }
.art-foot { position: relative; color: #a39ca9; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.art-foot span { margin: 0 7px; color: #b58beb; }
.auth-main { display: grid; place-items: center; padding: 35px 24px; }
.auth-card { width: min(390px, 100%); }
.auth-card h2 { margin: 7px 0 2px; font-size: 24px; }
.auth-intro { margin: 0 0 24px; color: var(--muted); font-size: 11px; }
.auth-switch { margin-top: 20px; color: #77717d; font-size: 10px; text-align: center; }
.auth-switch a { color: var(--violet); font-weight: 700; }
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { width: 218px; padding-right: 14px; padding-left: 14px; }
  .topbar { padding: 0 25px; }
  .content-wrap { padding: 30px 25px 52px; }
  .auth-shell { grid-template-columns: minmax(270px, .8fr) minmax(350px, 1.2fr); }
  .art-copy h1 { font-size: 33px; }
}
@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; min-height: 0; padding: 12px 16px; }
  .sidebar-label, .org-switch, .sidebar-spacer, .sidebar-note, .user-panel { display: none; }
  .brand-mark { font-size: 13px; }
  .main-nav { display: flex; gap: 5px; padding-top: 12px; }
  .nav-link { min-height: 36px; padding: 0 10px; }
  .main-area { min-height: calc(100vh - 104px); }
  .topbar { height: 52px; padding: 0 17px; }
  .topbar-kicker { display: none; }
  .topbar > div { gap: 0; }
  .topbar-organization { padding-left: 0; border: 0; }
  .content-wrap { padding: 26px 17px 40px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading-row { align-items: start; flex-direction: column; }
  .dashboard-intro { min-height: 130px; padding: 20px; }
  .dashboard-intro h2 { font-size: 18px; }
  .intro-mark { width: 48px; height: 48px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 27px; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card strong { font-size: 23px; }
  .metric-next strong { font-size: 15px; }
  .brand-grid { grid-template-columns: 1fr; }
  .onboarding-layout { grid-template-columns: 1fr; gap: 17px; }
  .step-rail { display: flex; align-items: center; justify-content: center; padding: 0; }
  .step-item { gap: 7px; }
  .step-item > span { width: 27px; height: 27px; }
  .step-item small { display: none; }
  .step-line { width: 19px; height: 0; margin: 0 7px; border-top: 1px solid #ded9e4; border-left: 0; }
  .form-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .field-wide { grid-column: auto; }
  .auth-shell { display: block; }
  .auth-art { min-height: 215px; padding: 18px 20px; }
  .auth-art:before { right: -110px; bottom: -220px; width: 330px; height: 330px; }
  .brand-symbol { width: 31px; height: 31px; }
  .art-copy { display: none; }
  .art-foot { margin-top: 42px; }
  .auth-main { min-height: calc(100vh - 215px); align-items: start; padding: 37px 22px; }
  .auth-card h2 { font-size: 22px; }
}

.brand-picker { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -6px 0 20px; padding: 14px 17px; }
.brand-picker label { display: block; color: #56515c; font-size: 11px; font-weight: 700; }
.brand-picker p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.brand-picker-controls { display: flex; align-items: center; gap: 8px; }
.brand-picker select { min-width: 205px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); font-size: 11px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 14px; margin-top: 16px; }
.plan-card { position: relative; display: flex; min-width: 0; flex-direction: column; overflow: hidden; padding: 21px 19px 18px; }
.plan-featured { border-color: #b996eb; box-shadow: 0 12px 36px rgba(92,48,153,.12); }
.plan-ribbon { position: absolute; top: 13px; right: -29px; width: 119px; padding: 4px 0; transform: rotate(34deg); background: var(--violet); color: white; font-size: 7px; font-weight: 800; letter-spacing: .45px; text-align: center; }
.plan-card-heading { min-height: 93px; padding-right: 20px; }
.plan-card-heading h2 { margin: 5px 0 4px; font-size: 19px; }
.plan-card-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.plan-price { display: flex; align-items: baseline; gap: 5px; padding: 13px 0 15px; border-top: 1px solid #f0edf2; border-bottom: 1px solid #f0edf2; }
.plan-price strong { font-size: 23px; line-height: 1.3; }
.plan-price span { color: var(--muted); font-size: 10px; }
.plan-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 16px 0 13px; }
.plan-metrics > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.plan-metrics strong { color: var(--violet-dark); font-size: 18px; line-height: 1.2; }
.plan-metrics span { color: var(--muted); font-size: 8px; line-height: 1.4; }
.plan-features { display: grid; gap: 9px; margin: 0 0 18px; padding: 13px 0 18px; border-top: 1px solid #f0edf2; list-style: none; }
.plan-features li { position: relative; padding-left: 16px; color: #5e5864; font-size: 9px; line-height: 1.45; }
.plan-features li:before { position: absolute; left: 0; color: var(--violet); content: '✓'; font-weight: 800; }
.plan-card > .button { margin-top: auto; }
.plans-note { margin: 17px 0 0; color: #8a8490; font-size: 10px; text-align: center; }
.checkout-placeholder { width: min(660px, 100%); margin: 12px auto 0; padding: 29px; }
.checkout-symbol { display: grid; width: 42px; height: 42px; margin-bottom: 20px; place-items: center; border-radius: 7px; background: var(--violet-soft); color: var(--violet); font-size: 21px; }
.checkout-placeholder h2 { max-width: 470px; margin: 7px 0; font-size: 21px; line-height: 1.4; }
.checkout-placeholder > p { max-width: 510px; margin: 0; color: var(--muted); font-size: 11px; }
.checkout-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 5px; background: #fcfbfd; }
.checkout-summary span, .checkout-summary strong { display: block; }
.checkout-summary span { margin-bottom: 4px; color: #89838f; font-size: 9px; }
.checkout-summary strong { overflow-wrap: anywhere; font-size: 11px; }
.checkout-current { margin-bottom: 16px; padding: 10px 12px; border-left: 2px solid var(--violet); background: var(--violet-soft); color: #57456d; font-size: 10px; }
.subscription-summary { margin-top: 12px; padding: 11px 10px 9px; border: 1px solid #efedf2; border-radius: 5px; background: #fdfcfe; }
.subscription-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.subscription-heading .eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 20px; background: #f0edf2; color: #655e6c; font-size: 8px; font-weight: 700; }
.subscription-status.is-active { background: #e7f5ed; color: #27704f; }
.quota-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 11px 0 7px; }
.quota-numbers span { color: #77717d; font-size: 8px; }
.quota-numbers strong { display: block; color: #302a36; font-size: 13px; }
.quota-progress { display: block; width: 100%; height: 6px; overflow: hidden; appearance: none; border: 0; border-radius: 99px; background: #eae6ef; }
.quota-progress::-webkit-progress-bar { border-radius: 99px; background: #eae6ef; }
.quota-progress::-webkit-progress-value { border-radius: 99px; background: var(--violet); }
.quota-progress::-moz-progress-bar { border-radius: 99px; background: var(--violet); }
.quota-caption { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: #8c8691; font-size: 8px; }
.billing-alert { margin: 8px 0 2px; color: #716978; font-size: 9px; line-height: 1.5; }
.brand-picker + .plans-grid { margin-top: 0; }
@media (max-width: 850px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .brand-picker { align-items: stretch; flex-direction: column; gap: 10px; padding: 13px; }
  .brand-picker-controls { align-items: stretch; }
  .brand-picker select { min-width: 0; flex: 1; }
  .plans-grid { grid-template-columns: 1fr; gap: 11px; }
  .plan-card { padding: 19px 17px 16px; }
  .plan-card-heading { min-height: 0; padding-bottom: 13px; }
  .checkout-placeholder { padding: 20px; }
  .checkout-placeholder h2 { font-size: 18px; }
  .checkout-summary { grid-template-columns: 1fr; gap: 11px; }
}
