* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

dialog:focus-visible {
    outline: none;
}

:root {
    color-scheme: light;
    --font-sans: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", Arial, sans-serif;
    --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --primary: #1a1d21;
    --secondary: #6b7280;
    --tertiary: #9ca3af;
    --background: #ffffff;
    --accent: #009443;
    --on-accent: #ffffff;
    --stroke: rgba(0, 0, 0, 0.1);
    --stroke-muted: rgba(0, 0, 0, 0.07);
    --stroke-hover: rgba(0, 0, 0, 0.25);
    --fill: rgba(0, 0, 0, 0.05);
    --fill-hover: rgba(0, 0, 0, 0.03);
    --surface: #ffffff;
    --sunken: #fcfcfc;
    --danger: #b91c1c;
    --danger-stroke: #fca5a5;
    --warn: #b45309;
    --elev: 0 1px 2px rgba(0, 0, 0, 0.04);
    --container-max: 1124px;
    --gutter: 32px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-lead: 16px;
    --text-md: 18px;
    --text-lg: 24px;
    --text-xl: 28px;
    --text-2xl: 36px;
    --text-3xl: 52px;
    --text-4xl: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --primary: #eeeeee;
        --secondary: #9aa1a9;
        --tertiary: #6f757d;
        --background: #141514;
        --accent: #54e696;
        --on-accent: #141514;
        --stroke: rgba(255, 255, 255, 0.1);
        --stroke-muted: rgba(255, 255, 255, 0.07);
        --stroke-hover: rgba(255, 255, 255, 0.25);
        --fill: rgba(255, 255, 255, 0.06);
        --fill-hover: rgba(255, 255, 255, 0.04);
        --surface: #191a1a;
        --sunken: #121212;
        --danger: #ff6058;
        --danger-stroke: #7f2d29;
        --warn: #e0a24a;
        --elev: 0 1px 2px rgba(0, 0, 0, 0.4);
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* no rubber-band bounce or scroll chaining in the dashboard */
html:has(#app:not(.hidden)) {
    overscroll-behavior: none;
}

.sidebar {
    overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
    }
}

html {
    overflow-x: clip;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: fade-in 0.4s ease both;
    background: var(--background);
    color: var(--primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--text-base);
    line-height: 1.6;
    overflow-x: clip;
}

.text-sm {
    font-size: var(--text-sm);
    line-height: 1.5;
}

.text-base {
    font-size: var(--text-base);
    line-height: 1.6;
}

.text-md {
    font-size: var(--text-md);
    line-height: 1.5;
}

.text-lg {
    font-size: var(--text-lg);
    line-height: 1.4;
}

.text-xl {
    font-size: var(--text-xl);
    line-height: 1.3;
}

.text-2xl {
    font-size: var(--text-2xl);
    line-height: 1.2;
}

.text-3xl {
    font-size: var(--text-3xl);
    line-height: 1.15;
}

.text-4xl {
    font-size: var(--text-4xl);
    line-height: 1.1;
}

.muted {
    color: var(--secondary);
}

.accent {
    color: var(--accent);
}

.mt-8 {
    margin-top: 8px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: var(--text-lead);
    font-weight: 500;
}

.auth-logo {
    align-self: center;
    margin-bottom: 8px;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
}

button.primary,
a.primary {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    padding: 0 20px;
    background: var(--primary);
    color: var(--background);
    border: none;
    border-radius: 8px;
}

button.accent,
a.accent {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    padding: 0 20px;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 8px;
}

button.outline,
a.outline {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    padding: 0 20px;
    background: var(--background);
    color: var(--primary);
    border: 1px solid var(--stroke);
    border-radius: 8px;
}

h1,
h2,
h3 {
    font-weight: 500;
}

header {
    max-width: var(--container-max);
    height: 80px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--stroke);
}

.framed {
    position: relative;
}

.framed header {
    border-bottom: none;
}

.framed::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: 0 auto;
    max-width: var(--container-max);
    border-left: 1px solid var(--stroke-muted);
    border-right: 1px solid var(--stroke-muted);
    pointer-events: none;
}

.thatch {
    height: 24px;
    border-top: 1px solid var(--stroke-muted);
    border-bottom: 1px solid var(--stroke-muted);
    background-image: repeating-linear-gradient(45deg, var(--stroke-muted) 0, var(--stroke-muted) 1px, transparent 1px, transparent 7px);
    background-size: min(100%, var(--container-max)) 100%;
    background-position: center;
    background-repeat: no-repeat;
}

@media (max-width: 1164px) {
    .framed::before {
        display: none;
    }
}

main {
    max-width: var(--container-max);
    margin: 0 auto;
}

.hero {
    position: relative;
    isolation: isolate;
    padding: 64px var(--gutter) 0;
}

.pixel-field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.hero .pixel-field {
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent 70%);
}

#cta {
    isolation: isolate;
}

#cta .pixel-field {
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 70%);
}

.site-chip {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--background);
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--stroke), var(--elev);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1;
    white-space: nowrap;
}

.site-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: chip-pulse 2s ease-in-out infinite;
}

@keyframes chip-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-chip::before {
        animation: none;
    }
}

.artifact-stack {
    position: relative;
    width: 100%;
}

.artifact-stack .site-chip:nth-of-type(1) {
    top: -14px;
    right: -16px;
}

.artifact-stack .site-chip:nth-of-type(2) {
    bottom: -14px;
    left: -16px;
}

.artifact-stack .site-chip:nth-of-type(2)::before {
    animation-delay: 0.7s;
}

.stats-strip {
    /* positioned so it paints after the hero, otherwise the hero terminal's
       bottom fade overlays and chops this border (same reason .section has it) */
    position: relative;
    display: grid;
    /* outer cells drop their outside padding, so trade 16px of column width
       inward to keep every content box the same size (as .pricing-grid does) */
    grid-template-columns: calc(25% - 16px) calc(25% + 16px) calc(25% + 16px) calc(25% - 16px);
    padding: 0 var(--gutter);
    border-top: 1px solid var(--stroke-muted);
    text-align: left;
}

.stat {
    /* vertical padding lives on the cell so the dividers span the full band */
    padding: 32px;
}

.stat:first-child {
    padding-left: 0;
}

.stat:last-child {
    padding-right: 0;
}

.stat + .stat {
    border-left: 1px solid var(--stroke-muted);
}

.stat-value {
    display: block;
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--accent);
    /* fixed-width digits so the count-up does not jitter the layout */
    font-variant-numeric: tabular-nums;
}

.stat-label {
    display: block;
    margin-bottom: 4px;
    color: var(--secondary);
}

.section {
    position: relative;
    padding: 64px var(--gutter);
    border-top: 1px solid var(--stroke-muted);
}

.section-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* gap, not cell padding: the outer columns then sit flush with the gutter
       instead of starting 24px inside it and aligning to nothing */
    gap: 48px;
    margin-top: 64px;
    text-align: left;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: var(--fill);
    color: var(--accent);
}

.feature h3 {
    margin-bottom: 8px;
}

.steps-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    margin-top: 64px;
    text-align: left;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 56px;
    bottom: -20px;
    left: 22px;
    width: 1px;
    background: var(--stroke);
}

.step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 56px;
    bottom: -20px;
    left: 22px;
    width: 1px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    z-index: 1;
}

.step.active::before {
    animation: step-progress 6s linear forwards;
}

@keyframes step-progress {
    to {
        transform: scaleY(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .step.active::before {
        animation: none;
    }
}

.step-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid var(--stroke);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: var(--text-base);
    color: var(--secondary);
}

.step.active .step-circle {
    color: var(--accent);
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

.step-text p {
    color: var(--secondary);
}

.steps-visual {
    position: relative;
    height: 356px;
}

.steps-visual::before {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    height: 25%;
    background: linear-gradient(to bottom, transparent 0%, var(--background) 66%);
    pointer-events: none;
    z-index: 1;
}

.steps-visual::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    bottom: -1px;
    width: 45%;
    background: linear-gradient(to right, transparent 0%, var(--background) 66%);
    pointer-events: none;
    z-index: 1;
}

.visual-pane {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.visual-pane.active {
    opacity: 1;
}

.visual-pane .terminal {
    align-self: stretch;
}

.visual-pane .terminal-stream {
    white-space: normal;
}

.pricing-grid {
    display: grid;
    grid-template-columns: calc(25% - 16px) calc(25% + 16px) calc(25% + 16px) calc(25% - 16px);
    row-gap: 16px;
    margin-top: 64px;
    text-align: left;
}

.plan {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    padding: 0 32px;
}

.plan:first-child {
    padding-left: 0;
}

.plan:last-child {
    padding-right: 0;
}

.plan:not(:first-child) {
    border-left: 1px solid var(--stroke);
}

.plan-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-price {
    font-weight: 500;
}

.plan-price span {
    font-weight: 400;
}

.plan-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--secondary);
}

.plan-list svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 3px;
}

.code-card {
    display: block;
    width: 100%;
    padding: 24px;
    border-radius: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    box-shadow: 0 0 0 1px var(--stroke), var(--elev);
    white-space: pre-wrap;
    word-break: break-word;
}

.hero .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.hero-terminal-mock {
    position: relative;
    max-width: 800px;
    margin: 64px auto 0;
}

.hero-terminal-mock::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    height: 25%;
    background: linear-gradient(to bottom, transparent 0%, var(--background) 66%);
    pointer-events: none;
}

.terminal {
    position: relative;
    width: 100%;
    border-radius: 16px 16px 0 0;
    background: var(--background);
    overflow: hidden;
    text-align: left;
    box-shadow: 0 0 0 1px var(--stroke), var(--elev);
}

.terminal-chrome {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-bottom: 1px solid var(--stroke);
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--stroke);
}

.terminal-body {
    height: 320px;
    padding: 20px 24px 0;
    overflow: hidden;
    position: relative;
}

.terminal-stream {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--primary);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    transform: translateY(0);
    transition: transform 0.4s ease-out;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .terminal-stream {
        transition: none;
    }
}

.terminal-stream .terminal-line {
    display: flex;
    gap: 8px;
}

.terminal-stream .role {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 22px;
}

.terminal-stream .role-user {
    color: var(--accent);
}

.terminal-stream .role-assistant {
    color: var(--secondary);
}

.terminal-stream .line-user {
    background: var(--fill);
    margin: 0 -8px;
    padding: 0 8px;
    border-radius: 6px;
}

.terminal-stream .line-thinking {
    font-style: italic;
    color: var(--accent);
}

.terminal-stream .line-thinking .role {
    color: var(--accent);
}

.terminal-stream .stream-word {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terminal-stream .stream-word.visible {
    opacity: 1;
}

.terminal-stream .caret {
    display: inline-block;
    margin-left: 1px;
    color: var(--primary);
}

footer {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 48px var(--gutter) 64px;
    border-top: 1px solid var(--stroke);
}

.framed footer {
    border-top: none;
}

.footer-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.eyebrow {
    font-weight: 500;
    color: var(--tertiary);
}

.footer-column a {
    font-size: 14px;
    color: var(--secondary);
    text-decoration: none;
}

.footer-column a:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links .nav-button {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--primary);
    border: 1px solid var(--stroke);
    border-radius: 6px;
    transition: border-color 0.15s ease;
}

.nav-links .nav-button:hover {
    color: var(--primary);
    border-color: var(--stroke-hover);
}

.nav-links a {
    color: var(--secondary);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary);
}

.dash {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.dash.hidden {
    display: none !important;
}

.dash-topbar {
    display: none;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary);
}

.menu-toggle:hover:not(:disabled) {
    transform: none;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-shrink: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 8px 0;
    border-right: 1px solid var(--stroke-muted);
}

.sidebar-brand {
    padding: 0 10px;
    font-weight: 500;
}

.dash .sidebar {
    background: var(--background);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-bar {
    position: sticky;
    bottom: 0;
    margin: auto -8px 0;
    padding: 8px;
    background: var(--background);
    box-shadow: 0 -1px 0 var(--stroke-muted);
}

.user-chip {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 8px;
    text-align: left;
}

.user-chip:hover:not(:disabled) {
    transform: none;
    background: var(--fill-hover);
}

.user-chip[aria-expanded="true"],
.user-chip[aria-expanded="true"]:hover:not(:disabled) {
    background: none;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fill);
    font-size: var(--text-sm);
    font-weight: 500;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-plan {
    font-size: var(--text-sm);
}

.user-menu {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 64px;
    z-index: 30;
    padding: 8px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 0 0 1px var(--stroke-muted), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.user-menu-header {
    padding: 8px 10px;
    border-bottom: 1px solid var(--stroke-muted);
    margin-bottom: 8px;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
}

.user-menu a svg {
    flex-shrink: 0;
    color: var(--secondary);
}

.user-menu a:hover {
    background: var(--fill-hover);
}

.sidebar-heading {
    padding: 16px 10px 6px;
    font-weight: 500;
    color: var(--tertiary);
}

/* docs sidebar spaces its sections with gaps rather than padding spacers */
.docs .sidebar-nav {
    gap: 24px;
}

.docs .sidebar-heading {
    padding: 0 10px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#site-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    color: var(--secondary);
    text-decoration: none;
}

.sidebar-link:hover {
    color: var(--primary);
    background: var(--fill-hover);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--fill);
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
}

.sidebar-icon img {
    width: 16px;
    height: 16px;
}

.sidebar-label {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-main {
    flex: 1;
    min-width: 0;
    padding: 48px;
}

.dash-main [data-view-panel] {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: var(--container-max);
}

.dash-main [data-view-panel].hidden {
    display: none !important;
}

.view-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.view-header p {
    font-size: var(--text-lead);
}

.dash-main h1 {
    font-size: var(--text-xl);
    line-height: 1.3;
}

.view-header a {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-lead);
    color: var(--secondary);
    text-decoration: underline;
}

.view-header a:hover {
    color: var(--primary);
}

.settings-card {
}

.settings-card-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 0;
    border-bottom: 1px solid var(--stroke-muted);
}

.settings-card-header h2 {
    font-size: var(--text-md);
    line-height: 1.5;
    font-weight: 500;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 52px;
    padding: 10px 0;
}

.settings-row > .settings-item,
.settings-row > .label {
    flex: 0 0 200px;
    min-width: 0;
}

.settings-value {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-value-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-row > button,
.settings-row > .settings-actions {
    margin-left: auto;
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}


.settings-row + .settings-row {
    border-top: 1px solid var(--stroke-muted);
}

/* the per-site rows sit in a wrapper, so the adjacency rule above cannot
   reach across it to separate them from the All sites row */
#usage-sites:not(:empty) {
    border-top: 1px solid var(--stroke-muted);
}

.settings-card .muted {
    font-size: 14px;
}

.settings-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.danger-card .settings-card-header {
    border-bottom-color: var(--danger-stroke);
}

.label {
    font-weight: 400;
    color: var(--secondary);
}

button.small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--stroke);
    border-radius: 6px;
}

button.small.primary {
    background: var(--primary);
    color: var(--background);
    border: none;
}

button.danger {
    color: var(--danger);
    border-color: var(--danger-stroke);
}

.chip-field {
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 8px 16px;
    background: var(--fill);
}

.chip-field code {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-connect {
    flex-direction: column;
    align-items: stretch;
}

.client-connect > .settings-item {
    flex: none;
}

.snippet-block {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 16px 8px;
}

.snippet-hint {
    margin-top: -8px;
    font-size: var(--text-sm);
    color: var(--tertiary);
}

.snippet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chip-field .segmented button {
    background: none;
    border: 1px solid transparent;
    padding: 0;
    font-size: 13px;
    color: var(--secondary);
    opacity: 0.6;
}

.chip-field .segmented button:hover:not(:disabled),
.chip-field .segmented button.active {
    opacity: 1;
}

.chip-field .segmented button:hover:not(:disabled) {
    color: var(--primary);
    border-color: transparent;
}

.chip-field .segmented button.active {
    color: var(--primary);
    background: none;
}

.segmented {
    display: flex;
    flex-shrink: 0;
    gap: 16px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
    display: none;
}

.segmented button {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 8px;
    font-size: 13px;
    color: var(--secondary);
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
}

.segmented button:hover:not(:disabled) {
    transform: none;
    color: var(--primary);
}

.segmented button.active {
    color: var(--primary);
    background: var(--fill);
}

.client-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: var(--secondary);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.segmented button.active[data-client="claude"] .client-icon {
    background: #d97757;
}

.segmented button.active[data-client="cursor"] .client-icon {
    background: var(--primary);
}

.segmented button.active[data-client="codex"] .client-icon {
    background: linear-gradient(to top, #3941ff, #7a9dff, #b1a7ff);
}

#client-snippet {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 6px 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.chip-field button {
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 28px;
    padding: 0 8px;
    font-size: var(--text-sm);
    background: var(--background);
    color: var(--primary);
    border: 1px solid var(--stroke);
}

.chip-field button svg {
    width: 14px;
    height: 14px;
}

.chip-field button.icon {
    padding: 0 2px;
    background: none;
    border: none;
    color: var(--secondary);
}

.chip-field button.icon:hover:not(:disabled) {
    color: var(--primary);
}

.chip-field button.icon svg {
    width: 16px;
    height: 16px;
}

.settings-controls:has(.chip-field) {
    flex: 1;
}

button.small,
.chip-field button {
    transition: border-color 0.15s ease;
}

button.small:hover:not(:disabled),
.chip-field button:hover:not(:disabled) {
    transform: none;
    border-color: var(--stroke-hover);
}

button.small.primary:hover:not(:disabled) {
    transform: none;
}

button.small.accent {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
}

button.small.accent:hover:not(:disabled) {
    transform: none;
}

button.danger:hover:not(:disabled) {
    transform: none;
    border-color: var(--danger);
}

.settings-row .label {
    flex-shrink: 0;
}

.settings-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.meter {
    flex: 1;
    min-width: 96px;
    height: 6px;
    border-radius: 999px;
    background: var(--fill);
    overflow: hidden;
}

.meter-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.meter-fill.warn {
    background: var(--warn);
}

.meter-fill.crit {
    background: var(--danger);
}

.plan-warning.warn {
    color: var(--warn);
}

.plan-warning.crit {
    color: var(--danger);
}

.newsite {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0 0;
}

.newsite input {
    height: 36px;
    padding: 0 12px;
    font: inherit;
    color: var(--primary);
    background: none;
    border: 1px solid var(--stroke);
    border-radius: 8px;
}

.newsite input:focus {
    outline: none;
    border-color: var(--primary);
}

dialog {
    border-radius: 24px;
    margin: auto;
    width: min(400px, calc(100vw - 32px));
    padding: 24px;
    border: none;
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.plans-dialog {
    width: min(350px, 100vw);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.sheet-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding: 16px 16px 16px 24px;
    border-bottom: 1px solid var(--stroke);
}

.sheet-topbar button.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    color: var(--secondary);
}

.sheet-topbar button.icon:hover:not(:disabled) {
    color: var(--primary);
    transform: none;
}

.sheet-topbar button.icon svg {
    width: 16px;
    height: 16px;
}

.sheet-body {
    flex: 1;
    padding: 16px 24px 24px;
    overflow-y: auto;
}

.sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--stroke);
}

.sheet-footer .muted {
    font-size: 14px;
}

.sheet-footer a {
    flex-shrink: 0;
}

.sheet-footer button {
    white-space: nowrap;
}

button.small:disabled {
    opacity: 0.5;
    cursor: default;
}

.plans-dialog[open] {
    display: flex;
    flex-direction: column;
}

@starting-style {
    .plans-dialog[open] {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .plans-dialog {
        transition: none;
    }
}

.plans-dialog-grid {
    text-align: left;
}

/* the landing pricing cards, one size down and stacked — high specificity so
   the landing's responsive .plan overrides can't restyle them in the dialog */
.plans-dialog .plans-dialog-grid .plan,
.plans-dialog .plans-dialog-grid .plan:first-child,
.plans-dialog .plans-dialog-grid .plan:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border: none;
}

.plans-dialog .plans-dialog-grid .plan:first-child {
    padding-top: 0;
}

.plans-dialog .plans-dialog-grid .plan:last-child {
    padding-bottom: 0;
}

.plans-dialog .plans-dialog-grid .plan:not(:first-child) {
    border-top: 1px solid var(--stroke);
}

.plans-dialog .plan .muted {
    font-size: 14px;
}

.plans-dialog .plan .plan-list li {
    font-size: 14px;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.dialog-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dialog-header h2 {
    font-size: 16px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

#status {
    border-radius: 8px;
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 30;
    padding: 10px 16px;
    background: var(--primary);
    color: var(--background);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#status.show {
    opacity: 1;
}

.menu-btn {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary);
}

.menu-btn:hover:not(:disabled) {
    transform: none;
}

.menu-btn::before,
.menu-btn::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: currentColor;
    transition: transform 0.3s ease;
}

.menu-btn::before {
    top: 15px;
}

.menu-btn::after {
    top: 23px;
}

.menu-btn.open::before {
    transform: translateY(4px) rotate(45deg);
}

.menu-btn.open::after {
    transform: translateY(-4px) rotate(-45deg);
}

.scrim {
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 900px) {

    .dash {
        flex-direction: column;
    }

    .dash-topbar {
        display: flex;
        align-items: center;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 10;
        height: 56px;
        padding: 0 16px;
        background: var(--background);
        border-bottom: 1px solid var(--stroke);
        /* own compositing layer: iOS Safari repaints sticky elements per
           scroll frame otherwise, which shows as jitter */
        transform: translateZ(0);
    }

    .dash .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 20;
        height: auto;
        width: 280px;
        background: var(--surface);
        border-right: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .dash .sidebar.open {
        transform: none;
    }

    .dash-main {
        padding: 32px 20px;
    }

    .dash-main h1 {
        font-size: var(--text-lg);
    }

    .dash-main [data-view-panel] {
        gap: 24px;
    }

    /* Only rows carrying a value have too much for one narrow line. Those
       stack, and their control sits under the label rather than diagonally
       opposite it. A plain label + control row fits, so it keeps its single
       line. (Team rows match :has(.settings-value) but are pinned nowrap by
       their higher-specificity #share-rows rules.) */
    .settings-row:has(.settings-value) {
        flex-wrap: wrap;
    }

    .settings-row:has(.settings-value) > .settings-item,
    .settings-row:has(.settings-value) > .label {
        flex-basis: 100%;
    }

    .settings-row:has(.settings-value) > button,
    .settings-row:has(.settings-value) > .settings-actions {
        margin-left: 0;
    }

    /* the fixed 200px label column would crowd the control off a narrow
       single-line row */
    .settings-row:not(:has(.settings-value)) > .label {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    header .nav-links,
    header .nav-links a,
    .menu-btn::before,
    .menu-btn::after {
        transition: none;
    }
}

@media (max-width: 900px) {
    :root {
        --text-4xl: 52px; /* = --text-3xl step */
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-layout {
        grid-template-columns: 1fr;
    }

    .steps-visual::after {
        content: none;
    }

    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0;
        row-gap: 0;
    }

    .plan,
    .plan:first-child,
    .plan:last-child {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0;
        border-left: none;
    }

    .plan:nth-child(odd) {
        padding-right: 32px;
    }

    .plan:nth-child(even) {
        border-left: 1px solid var(--stroke);
        padding-left: 32px;
    }

    .plan:nth-child(-n + 2) {
        padding-bottom: 32px;
    }

    .plan:nth-child(n + 3) {
        border-top: 1px solid var(--stroke);
        padding-top: 32px;
    }
}

@media (max-width: 600px) {
    :root {
        --gutter: 20px;
    }


    :root {
        --text-4xl: 36px;
        --text-2xl: 28px;
    }

    .menu-btn {
        display: block;
        position: relative;
        z-index: 16;
    }

    header .brand {
        position: relative;
        z-index: 16;
    }

    header .nav-links {
        position: fixed;
        inset: 0;
        z-index: 15;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: var(--background);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    header .nav-links.open {
        opacity: 1;
        visibility: visible;
    }

    header .nav-links a {
        font-size: var(--text-lg);
        transform: translateY(16px);
        transition: transform 0.35s ease, color 0.15s ease;
    }

    header .nav-links.open a {
        transform: translateY(0);
    }

    header .nav-links .nav-button {
        height: auto;
        padding: 0;
        border: none;
        border-radius: 0;
        font-size: var(--text-lg);
        color: var(--secondary);
        transition: transform 0.35s ease, color 0.15s ease;
    }

    .section {
        padding: 32px var(--gutter);
    }

    .stats-strip {
        grid-template-columns: calc(50% - 8px) calc(50% + 8px);
    }

    /* two columns: the left edge is every odd cell, the right edge every even */
    .stat:nth-child(odd) {
        padding-left: 0;
    }

    .stat:nth-child(even) {
        padding-right: 0;
        border-left: 1px solid var(--stroke-muted);
    }

    .stat {
        padding: 32px 16px;
    }

    /* on two columns the third cell starts a new row, so it loses its divider */
    .stat:nth-child(3) {
        border-left: none;
        padding-left: 0;
    }

    /* ...and the second row needs a divider above it instead */
    .stat:nth-child(n+3) {
        border-top: 1px solid var(--stroke-muted);
    }

    .hero {
        padding-top: 32px;
    }

    .hero-terminal-mock {
        margin-top: 32px;
    }

    .terminal-body {
        height: 240px;
    }

    .steps-visual {
        height: 276px;
    }

    .features-grid,
    .steps-layout,
    .pricing-grid {
        margin-top: 48px;
    }

    .steps-layout {
        gap: 32px;
    }

    .features-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    /* one column: match .step exactly, icon left of the text at the same
       44px / 16px gap, so this section and the steps below it line up */
    .features-grid {
        gap: 32px;
    }

    .feature {
        display: grid;
        grid-template-columns: 44px 1fr;
        column-gap: 16px;
        align-items: start;
    }

    .feature-icon {
        grid-row: span 2;
        width: 44px;
        height: 44px;
        margin-bottom: 0;
    }

    .feature h3 {
        /* same 8px nudge .step-text uses to sit level with the circle */
        padding-top: 8px;
    }

    .pricing-grid {
        row-gap: 24px;
    }

    .plan:nth-child(odd),
    .plan:nth-child(even),
    .plan:nth-child(-n + 2) {
        border-left: none;
        padding: 0;
    }

    .plan:not(:first-child) {
        border-top: 1px solid var(--stroke);
        padding-top: 24px;
    }

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}


a.primary,
a.accent,
a.outline {
    text-decoration: none;
}

a.primary:hover,
a.accent:hover,
a.outline:hover {
    transform: translateY(-2px);
    transition: transform 0.15s ease;
}

.dash-home {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 0;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(360px, 100%);
    text-align: center;
}

.auth-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-card a {
    color: var(--secondary);
}

.docs {
    display: grid;
    grid-template-columns: 250px 1fr;
    padding: 0 max(var(--gutter), calc((100% - var(--container-max)) / 2 + var(--gutter)));
}

.docs .sidebar {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
    max-height: 100vh;
    overflow-y: auto;
    border-right: none;
    margin-left: -10px;
    padding: 32px 0 32px 0;
}

.docs-main {
    min-width: 0;
    padding: 48px 0 48px 32px;
}

.docs-article {
    max-width: 760px;
}

.legal {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 48px var(--gutter);
}

.legal .docs-article {
    margin: 0 auto;
}

.prose h1 {
    font-size: var(--text-xl);
    line-height: 1.3;
    margin-bottom: 8px;
}

.prose .lead {
    font-size: var(--text-lead);
    color: var(--secondary);
    margin-bottom: 24px;
}

.prose h2 {
    font-size: var(--text-md);
    margin: 40px 0 8px;
}

.prose p {
    margin-bottom: 16px;
}

.prose ul,
.prose ol {
    margin: 0 0 16px;
    padding-left: 20px;
}

.prose li {
    margin-bottom: 4px;
}

.prose code {
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 1px 5px;
    background: var(--fill);
}

.prose pre {
    border-radius: 12px;
    margin: 16px 0;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.7;
    background: var(--fill);
    overflow-x: auto;
    scrollbar-width: none;
}

.prose pre::-webkit-scrollbar {
    display: none;
}

.prose pre code {
    padding: 0;
    font-size: inherit;
    background: none;
    box-shadow: none;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.prose th {
    text-align: left;
    font-weight: 500;
    padding: 8px 16px 8px 0;
    border-bottom: 1px solid var(--stroke);
    white-space: nowrap;
}

.prose td {
    padding: 8px 16px 8px 0;
    border-bottom: 1px solid var(--stroke);
    vertical-align: top;
}

.prose a {
    color: var(--primary);
}

.prose a:hover {
    color: var(--accent);
}

/* .prose a lands after a.primary at equal specificity, so it would otherwise
   repaint button text in the button's own background colour */
.prose a.primary,
.prose a.primary:hover {
    color: var(--background);
}

@media (max-width: 900px) {
    .docs {
        display: block;
        padding: 0;
    }

    .docs .sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        transform: none;
        border-right: none;
        border-bottom: 1px solid var(--stroke);
        margin-left: 0;
        padding: 16px var(--gutter);
    }

    .docs-main {
        padding: 32px var(--gutter);
    }

    .prose table {
        display: block;
        overflow-x: auto;
    }
}

.faq-list {
    display: flex;
    flex-direction: column;
    max-width: 650px;
    margin: 64px auto 0;
    text-align: left;
}

.faq-item {
    border-bottom: 1px solid var(--stroke);
}

.faq-item:last-of-type {
    border-bottom: none;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    font-size: var(--text-lead);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary svg {
    flex-shrink: 0;
    color: var(--secondary);
}

.faq-item summary svg .v {
    transition: opacity 0.15s ease;
}

.faq-item[open] summary svg .v {
    opacity: 0;
}

.faq-item p {
    padding: 0 32px 16px 0;
    color: var(--secondary);
}

.hidden {
    display: none !important;
}

#share-rows:not(:empty) + .settings-row {
    border-top: 1px solid var(--stroke-muted);
}

/* team rows keep one line on small screens: the generic settings-row wrap
   rules would orphan the avatar on its own line */
@media (max-width: 900px) {
    #share-rows .settings-row {
        flex-wrap: nowrap;
    }

    #share-rows .settings-row .label {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* the Owner/Member column is the first thing to give: at phone widths
       it costs the name the room it needs, and the roster still reads
       (the owner is listed first, and only members carry a Remove button) */
    #share-rows .settings-value {
        display: none;
    }
}



.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
