:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #25243b;
    background: #f7f7fc;
    line-height: 1.55;
    font-size: 14px;
    --ink: #25243b;
    --muted: #717086;
    --line: #e7e6f0;
    --purple: #7042c8;
    /* Palette sampled from the supplied WebOptimize SVG. Dark stops keep button labels legible. */
    --brand-gradient: linear-gradient(115deg, #275cc8 0%, #494ad8 38%, #7632c7 72%, #8f45e1 100%);
    --logo-gradient: linear-gradient(105deg, #286acf 0%, #494ad8 36%, #8f45e1 73%, #9e50ef 100%);
    --soft-gradient: linear-gradient(115deg, #f0f7ff, #f4f0fd 65%, #fbf2ff);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.25; letter-spacing: -.9px; margin: 0 0 10px; font-weight: 750; }
h2 { font-size: 18px; margin: 26px 0 14px; letter-spacing: -.3px; }
h3 { font-size: 15px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.muted, small { color: var(--muted); }
.eyebrow, .sidebar-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; color: #858299; }
.eyebrow { margin-bottom: 12px; }
.topbar { height: 78px; display: flex; align-items: center; gap: 30px; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand, .auth-brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand { min-width: 220px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: auto; flex-shrink: 0; }
.brand-word { font-size: 23px; font-weight: 800; letter-spacing: -1px; color: #7042c8; background: var(--logo-gradient); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.search { flex: 1; max-width: 580px; position: relative; }
.search > .icon { position: absolute; top: 13px; left: 14px; color: #89869b; }
.search input { background: #f7f7fb; border-color: transparent; padding-left: 44px; border-radius: 12px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.nav form { margin: 0; }
.account-link { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 12px; font-weight: 600; }
.account-link:hover { text-decoration: none; color: var(--purple); }
.account-name { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft-gradient); color: var(--purple); border: 1px solid #e6dcf6; font-size: 15px; font-weight: 700; }
.link-button { border: 0; background: none; cursor: pointer; padding: 8px; color: #78758d; border-radius: 8px; }
.link-button:hover { background: #f3effa; color: var(--purple); }
.app-shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.sidebar { display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); padding: 26px 18px 14px; position: sticky; top: 78px; align-self: start; height: calc(100vh - 78px); overflow: auto; }
.sidebar-label { padding: 0 14px; margin: 0 0 12px; }
.sidebar-home, .sidebar-project { display: flex; align-items: center; gap: 12px; color: #6e6a80; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 3px; overflow-wrap: anywhere; }
.sidebar-project span { min-width: 0; }
.sidebar-home .icon, .sidebar-project .icon { width: 18px; height: 18px; }
.sidebar-home:hover, .sidebar-project:hover { background: #f7f5fc; text-decoration: none; color: var(--purple); }
.sidebar .selected { background: var(--soft-gradient); color: #6840bc; font-weight: 650; }
.sidebar-projects { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 22px 0; padding: 4px 0 18px; }
.sidebar h2 { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #8d889e; margin: 20px 14px 10px; }
.sidebar-hint { padding: 14px 14px 0; font-size: 12px; color: var(--muted); }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.sidebar-footer { font-size: 10px; color: #9390a2; padding: 18px 14px 0; }
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 38px 42px 80px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.breadcrumbs { margin-bottom: 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px 10px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: baseline; gap: 10px; min-width: 0; max-width: 100%; }
.breadcrumbs a, .breadcrumbs span { overflow-wrap: anywhere; min-width: 0; }
.breadcrumbs a { color: var(--purple); }
.breadcrumbs [aria-current=page] { color: var(--ink); font-weight: 600; }
.breadcrumb-separator { color: #b4abc4; flex-shrink: 0; }
.environment-section[id] { scroll-margin-top: 100px; }
.page-head p { font-size: 13px; }
.heading-count { display: inline-flex; align-items: center; justify-content: center; font-size: 14px; letter-spacing: 0; vertical-align: middle; padding: 3px 10px; min-width: 30px; background: #ece8f6; color: #786099; border-radius: 9px; margin-left: 6px; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 15px; }
.section-head h2 { margin: 0; }
.section-head > .muted { font-size: 12px; }
.workspace-note { display: flex; align-items: center; gap: 16px; padding: 19px 22px; border: 1px solid #e1d9f5; border-radius: 14px; background: var(--soft-gradient); color: #69518f; }
.workspace-note > .icon { width: 28px; height: 28px; color: #8f45e1; }
.workspace-note strong, .workspace-note span { display: block; }
.workspace-note strong { font-size: 13px; margin-bottom: 3px; }
.workspace-note span { font-size: 12px; }
.grid { display: grid; gap: 20px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.card, .panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 12px #33235403; }
.card { padding: 24px; color: inherit; transition: border-color .18s, box-shadow .18s, transform .18s; }
.card:hover { text-decoration: none; border-color: #cfb9ef; box-shadow: 0 10px 30px #643b9410; transform: translateY(-2px); }
.project-card { display: flex; flex-direction: column; gap: 6px; }
.project-card > strong { font-size: 18px; letter-spacing: -.4px; overflow-wrap: anywhere; }
.project-domain { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.project-card-top, .project-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-card-top { margin-bottom: 20px; }
.project-card-bottom { border-top: 1px solid #f0edf5; margin-top: 20px; padding-top: 16px; color: #9772b8; }
.project-card-bottom small { font-size: 11px; }
.tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; color: #7845c5; background: var(--soft-gradient); flex-shrink: 0; }
.tile-icon .icon { width: 22px; height: 22px; }
.panel { padding: 28px; }
.panel + .panel { margin-top: 20px; }
.panel h2:first-child { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > h2, .stack > h3, .stack > p { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 1px solid #ddd3ec; border-radius: 10px; background: linear-gradient(115deg, #fff, #fcfaff); color: #665078; font-weight: 650; font-size: 12px; cursor: pointer; line-height: 1.4; transition: box-shadow .18s, filter .18s, transform .18s; }
.btn .icon { width: 17px; height: 17px; }
.btn:hover { background: var(--soft-gradient); text-decoration: none; border-color: #baa0dc; }
.btn.primary { background: var(--brand-gradient); color: #fff; border: 1px solid transparent; box-shadow: 0 4px 12px #7632c71c; }
.btn.primary:hover { background: var(--brand-gradient); filter: brightness(1.08); box-shadow: 0 6px 18px #7632c730; transform: translateY(-1px); }
.btn.danger { background: #fff7f7; color: #aa343b; border-color: #f0d7d9; }
.btn.danger:hover { background: #ffeded; }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 11px; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px; background: #f2eff8; color: #7b678f; font-size: 10px; font-weight: 600; white-space: nowrap; }
.badge.danger { background: #fff0ef; color: #a33e39; }
.status-working { background: #eaf7f0; color: #24744c; }
.status-stale { background: #fff7e4; color: #886311; }
.status-failed { background: #fff0f0; color: #a33e39; }
.environment-section { margin-bottom: 24px; padding: 0; overflow: hidden; }
.environment-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; background: linear-gradient(110deg, #fdfcff, #f8f6fc); border-bottom: 1px solid var(--line); }
.environment-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.environment-title h2 { margin: 0; font-size: 16px; }
.environment-title p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.environment-dot { width: 9px; height: 9px; border-radius: 50%; background: #9474c6; box-shadow: 0 0 0 5px #9474c610; flex-shrink: 0; }
.environment-dot.production { background: #31936d; box-shadow: 0 0 0 5px #31936d10; }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.environment-section .list { border: 0; border-radius: 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 24px; border-bottom: 1px solid #eeecf5; color: inherit; min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fcfaff; text-decoration: none; }
.list-row > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.list-row small { font-size: 11px; }
.credential-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.credential-title > div { min-width: 0; overflow-wrap: anywhere; }
.credential-title strong, .credential-title small { display: block; }
.credential-title .tile-icon { width: 36px; height: 36px; border-radius: 10px; }
.credential-meta { display: flex; flex: 1; justify-content: flex-end; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; min-width: 0; }
.credential-meta > span { max-width: 220px; overflow-wrap: anywhere; }
.empty { grid-column: 1 / -1; padding: 42px 24px; background: #fff; border: 1px dashed #d6c9e8; border-radius: 16px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 15px 0 8px; }
.empty p { max-width: 450px; margin: 0 auto 18px; }
.environment-empty { padding: 28px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.environment-empty strong { display: block; font-size: 13px; margin-bottom: 4px; }
.environment-empty p { color: var(--muted); font-size: 12px; margin: 0; }
.alert { padding: 14px 18px; border-radius: 11px; border: 1px solid; margin-bottom: 20px; font-size: 13px; }
.stack .alert { margin-bottom: 0; }
.alert.success { background: #effaf4; color: #27734c; border-color: #c9e9d7; }
.alert.warning { background: #fffaec; color: #856323; border-color: #efdfac; }
.alert.danger { background: #fff3f3; color: #a53939; border-color: #eccbcb; }
.alert ul { margin-bottom: 0; }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 550; font-size: 12px; color: #575166; min-width: 0; }
input, select, textarea { width: 100%; border: 1px solid #dedbe8; border-radius: 9px; background: #fff; color: var(--ink); padding: 12px 13px; outline: none; min-width: 0; }
input::placeholder, textarea::placeholder { color: #a4a0b2; }
input:focus, select:focus, textarea:focus { border-color: #a77cd9; box-shadow: 0 0 0 3px #8f45e112; }
input[type=checkbox] { accent-color: var(--purple); }
textarea { resize: vertical; }
select[multiple] { min-height: 150px; }
.checkbox { flex-direction: row; align-items: center; font-weight: 500; }
.checkbox input { width: auto; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.span-2 { grid-column: span 2; }
.input-action { display: flex; gap: 10px; }
.input-action .btn { flex-shrink: 0; }
.form-section { border: 0; padding: 0 0 26px; margin: 0 0 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.form-section > legend { font-size: 16px; font-weight: 700; margin-bottom: 8px; padding: 0; color: var(--ink); }
.form-section > p { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.step-number { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 8px; border-radius: 8px; background: var(--soft-gradient); color: #8252b9; font-size: 12px; }
.extra-fields { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #fdfcff; }
.extra-fields summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.extra-fields .form-grid { margin-top: 22px; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 8px; }
.form-intro { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.credential-form { max-width: 900px; }
.generator-options { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; border: 1px solid var(--line); background: #faf9fd; border-radius: 10px; margin: 20px 0 0; padding: 14px 16px; }
.generator-options input[type=number] { max-width: 78px; padding: 6px 9px; }
.generator-options legend { font-size: 11px; color: var(--muted); padding: 0 5px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.detail-grid > div { min-width: 0; }
.detail-grid > div > span { display: block; color: #8b829b; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 9px; }
.detail-grid code, .secret-row code { font-size: 13px; word-break: break-all; }
.detail-grid a { overflow-wrap: anywhere; }
.detail-grid .actions { margin-top: 12px; }
.secret-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.secret-row:last-child { border-bottom: 0; }
.secret-row > span { font-size: 12px; font-weight: 600; }
.secret-row code { white-space: pre-wrap; max-height: 260px; overflow: auto; background: #f7f5fb; padding: 12px; border-radius: 8px; }
.secret-line { display: flex; align-items: center; gap: 12px; }
.masked { letter-spacing: 2px; color: #9d8dac; }
.inline { display: inline; }
.danger-zone { margin-top: 36px; padding-top: 20px; border-top: 1px solid #ecdede; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { background: #f9f7fc; color: #746682; font-weight: 600; }
.guest-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(ellipse at 15% 20%, #dff3fc 0%, transparent 45%), radial-gradient(ellipse at 85% 75%, #eee0fb 0%, transparent 50%), #f7f7fc; }
.auth-card { width: min(460px, 100%); background: #fff; border: 1px solid #e6dff0; border-radius: 22px; padding: 40px; box-shadow: 0 24px 80px #5e378412; }
.auth-brand { margin-bottom: 34px; }
.auth-card h1 { font-size: 27px; margin-bottom: 24px; }
.auth-card .muted { font-size: 12px; margin-top: 22px; line-height: 1.7; }
.auth-card .btn { min-height: 46px; }
.qr svg { max-width: 260px; width: 100%; height: auto; background: white; padding: 10px; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recovery-codes code { padding: 9px; background: #f5f2fa; border-radius: 7px; overflow-wrap: anywhere; }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.security-grid > .panel { margin: 0; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #332544; color: #fff; padding: 13px 20px; border-radius: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; z-index: 50; box-shadow: 0 8px 30px #33254422; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateY(0); }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.environment-form { margin-top: 30px; border-style: dashed; background: transparent; box-shadow: none; }
.environment-form summary { cursor: pointer; font-size: 13px; color: #827092; }
.environment-form form { margin-top: 22px; }
.menu-toggle { display: none; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 100; background: #fff; padding: 12px; border: 2px solid var(--purple); border-radius: 8px; }
.skip-link:focus { top: 12px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #a470df; outline-offset: 4px; }
@media (max-width: 1200px) {
    .topbar { gap: 20px; padding: 0 22px; }
    .brand { min-width: 204px; }
    .app-shell { grid-template-columns: 236px minmax(0, 1fr); }
    .container { padding: 30px 28px 64px; }
    .account-name { display: none; }
    .page-head { align-items: flex-start; }
    .page-head > .actions { justify-content: flex-end; }
    .credential-meta { gap: 10px; }
}
@media (max-width: 960px) {
    .page-head { flex-wrap: wrap; }
    .page-head > .actions { justify-content: flex-start; }
    .security-grid, .two-col { grid-template-columns: 1fr; }
    .secret-row { grid-template-columns: 1fr; gap: 10px; }
    .credential-meta > span { max-width: 150px; }
}
@media (max-width: 800px) {
    .environment-section[id] { scroll-margin-top: 150px; }
    .topbar { height: auto; min-height: 70px; flex-wrap: wrap; padding: 16px; gap: 12px; }
    .brand { min-width: 0; gap: 7px; }
    .brand-word { font-size: 21px; }
    .brand-mark { width: 32px; }
    .nav { gap: 8px; }
    .nav .avatar { display: none; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .app-shell { display: block; }
    .sidebar { display: none; position: relative; top: 0; height: auto; border-bottom: 1px solid var(--line); }
    .sidebar.sidebar-open { display: flex; }
    .sidebar-bottom { margin-top: 0; }
    .menu-toggle { display: inline-flex; padding: 6px; width: 34px; border: 0; background: transparent; }
    .container { padding: 26px 18px 60px; }
    .page-head { flex-direction: column; gap: 18px; margin-bottom: 24px; }
    .form-grid, .detail-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .panel { padding: 20px; }
    .environment-section { padding: 0; }
    .environment-head { padding: 18px; flex-wrap: wrap; }
    .environment-empty { flex-direction: column; align-items: flex-start; padding: 22px 18px; }
    .list-row { align-items: flex-start; flex-wrap: wrap; padding: 18px; gap: 12px; }
    .credential-meta { flex-basis: 100%; justify-content: flex-start; padding-left: 50px; flex-wrap: wrap; }
    .credential-meta > span { max-width: 100%; }
    .credential-meta > .icon { display: none; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .workspace-note { align-items: flex-start; padding: 18px; }
    .input-action { flex-wrap: wrap; }
    .input-action input { flex-basis: 100%; }
    .generator-options { gap: 12px; }
    .generator-options .checkbox { font-size: 11px; }
    .recovery-codes { grid-template-columns: 1fr; }
    .auth-card { padding: 30px 24px; }
    .detail-grid code { overflow-wrap: anywhere; }
    .form-footer { flex-wrap: wrap; }
    input, select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .brand-word { -webkit-text-fill-color: CanvasText; background: none; } .btn.primary { border: 1px solid ButtonText; } }
