/* ShadowBrowse — Distyl-aligned Home design system */

:root {
    --seal-parchment: #f7f2e8;
    --seal-parchment-deep: #efe9dc;
    --seal-ink: #13283f;
    --seal-ink-hover: #313e4e;
    --seal-ink-soft: rgba(19, 40, 63, 0.08);
    --seal-text: #13283f;
    --seal-muted: #5c6e6c;
    --seal-faint: #8a9795;
    --seal-card: #fcfbf4;
    --seal-live: #1b2837;
    --seal-sky: #6ba6da;
    --seal-sky-mist: #c0d7db;
    --seal-beige: #e1dcd2;

    --bg-primary: var(--seal-parchment);
    --bg-secondary: var(--seal-parchment-deep);
    --bg-elevated: var(--seal-card);
    --bg-input: var(--seal-parchment-deep);
    --bg-input-focus: #ffffff;

    --ink: var(--seal-parchment-deep);
    --ink-elevated: var(--seal-card);
    --ink-panel: rgba(252, 251, 244, 0.94);
    --ink-panel-solid: var(--seal-card);

    --line: rgba(19, 40, 63, 0.1);
    --line-strong: rgba(19, 40, 63, 0.16);
    --border-color: var(--line);
    --border-subtle: rgba(19, 40, 63, 0.08);

    --accent: var(--seal-ink);
    --accent-hover: var(--seal-ink-hover);
    --accent-pressed: #0d1c2c;
    --accent-dim: var(--seal-ink-soft);
    --accent-glow: rgba(19, 40, 63, 0.12);

    --signal: var(--seal-ink);
    --signal-hot: var(--seal-ink-hover);
    --signal-dim: var(--seal-ink-soft);
    --signal-glow: var(--accent-glow);
    --primary: var(--seal-ink);
    --primary-glow: var(--accent-glow);
    --primary-dark: var(--accent-pressed);

    --mint: #3a7a5a;
    --mint-dim: rgba(58, 122, 90, 0.12);
    --success: var(--mint);
    --success-glow: var(--mint-dim);

    --danger: #a33b32;
    --danger-dim: rgba(163, 59, 50, 0.1);
    --danger-glow: var(--danger-dim);

    --warning: #ae873f;
    --warning-dim: rgba(174, 135, 63, 0.12);

    --text: var(--seal-text);
    --text-main: var(--seal-text);
    --text-muted: var(--seal-muted);
    --text-faint: var(--seal-faint);
    --text-dark: var(--seal-parchment-deep);

    --font-display: "Newsreader", "Times New Roman", Georgia, serif;
    --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", Menlo, monospace;
    --font-heading: var(--font-display);

    --bg-dark: var(--seal-live);
    --bg-card: var(--seal-card);
    --bg-card-hover: #f3eee3;
    --border-glow: var(--seal-ink-soft);
    --border-radius: 4px;
    --radius-sm: 2px;
    --radius-pill: 2px;
    --shadow-soft: 0 1px 0 rgba(19, 40, 63, 0.04);
    --shadow-panel: 0 12px 40px rgba(19, 40, 63, 0.06);
    --shadow-card: 0 16px 48px rgba(19, 40, 63, 0.07);
    --shadow-header: 0 1px 0 rgba(19, 40, 63, 0.08);
    --transition-speed: 0.22s;
    --transition-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --header-blur: saturate(1.1) blur(14px);

    --sandbox-bg: #1b2837;
    --sandbox-panel: #243445;
    --sandbox-border: rgba(247, 242, 232, 0.1);
    --sandbox-text: #f7f2e8;
    --sandbox-muted: #8a9795;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--seal-parchment);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.55;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-dim);
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ── Atmosphere ── */
.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.atmosphere-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 20%, black 15%, transparent 70%);
    opacity: 0.5;
}

.atmosphere-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
}

.atmosphere-glow-a {
    width: 50vw;
    height: 50vw;
    top: -20%;
    left: -10%;
    background: rgba(0, 113, 227, 0.06);
    animation: driftA 24s ease-in-out infinite alternate;
}

.atmosphere-glow-b {
    width: 40vw;
    height: 40vw;
    bottom: -15%;
    right: -8%;
    background: rgba(52, 199, 89, 0.04);
    animation: driftB 28s ease-in-out infinite alternate;
}

.atmosphere-grain {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes driftA {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(3%, 5%) scale(1.05); }
}

@keyframes driftB {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-4%, -3%) scale(1.03); }
}

/* ── App shell ── */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ── Header ── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 0.95rem 2rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--seal-parchment) 86%, transparent);
    backdrop-filter: var(--header-blur);
    -webkit-backdrop-filter: var(--header-blur);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-header);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: transparent;
    color: var(--seal-ink);
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: none;
    flex-shrink: 0;
}

.logo-mark svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.logo-ring {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 3s linear infinite;
}

.logo-core {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.logo-wordmark h1 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.1;
    color: var(--text);
}

.logo-wordmark h1 span {
    color: var(--accent);
}

.logo-tag {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

.app-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    padding: 0.45rem 0.85rem;
    border-radius: 2px;
    cursor: pointer;
    transition: color var(--transition-speed), background var(--transition-speed), border-color var(--transition-speed);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-btn:hover {
    color: var(--text);
    background: rgba(19, 40, 63, 0.04);
}

.nav-btn.active {
    color: var(--seal-parchment);
    background: var(--accent);
    border-color: var(--accent);
}

.nav-btn-ghost {
    border: 1px solid var(--line);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 280px;
}

.status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(174, 174, 178, 0.2);
    transition: background 0.3s, box-shadow 0.3s;
}

.status-indicator.online {
    background: var(--mint);
    box-shadow: 0 0 0 3px var(--mint-dim), 0 0 8px rgba(52, 199, 89, 0.4);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.license-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 113, 227, 0.2);
    margin-right: 0.5rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Banners ── */
.remote-access-banner {
    display: none;
    padding: 0.75rem 2rem;
    font-size: 0.84rem;
    line-height: 1.45;
    border-bottom: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.remote-access-banner.active {
    display: block;
}

.remote-access-banner:not(.local) {
    background: rgba(52, 199, 89, 0.08);
    border-bottom-color: rgba(52, 199, 89, 0.2);
    color: #1d6f42;
}

.remote-access-banner.local {
    background: rgba(255, 149, 0, 0.08);
    border-bottom-color: rgba(255, 149, 0, 0.2);
    color: #8a5a00;
}

.remote-access-banner code {
    font-size: 0.78rem;
    word-break: break-all;
    color: inherit;
}

.device-seal-banner {
    max-width: 1100px;
    margin: 0 auto 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.45;
    border: 1px solid var(--line);
}

.device-seal-info {
    background: var(--accent-dim);
    border-color: rgba(0, 113, 227, 0.2);
    color: var(--text-muted);
}

.device-seal-ok {
    background: var(--mint-dim);
    border-color: rgba(52, 199, 89, 0.25);
    color: var(--text-muted);
}

.device-seal-warn {
    background: var(--danger-dim);
    border-color: rgba(255, 59, 48, 0.25);
    color: var(--text);
}

.subscription-banner {
    max-width: 1100px;
    margin: 0 auto 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid var(--line);
}

.subscription-active {
    background: var(--mint-dim);
    border-color: rgba(52, 199, 89, 0.25);
    color: var(--text-muted);
}

.subscription-expiring {
    background: var(--warning-dim);
    border-color: rgba(255, 149, 0, 0.3);
    color: var(--text);
}

.subscription-expired {
    background: var(--danger-dim);
    border-color: rgba(255, 59, 48, 0.3);
    color: var(--text);
}

.subscription-countdown {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
}

/* ── Main layout ── */
.app-main {
    flex: 1;
    padding: 2rem 2rem 3.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.content-view {
    display: none;
}

.content-view.active {
    display: block;
    animation: viewIn 0.45s var(--transition-smooth);
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.reveal {
    animation: revealUp 0.7s var(--transition-smooth) both;
}

@keyframes revealUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
}

/* ── Typography utilities ── */
.eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.dash-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.05;
    color: var(--text);
}

.dash-title em {
    font-style: normal;
    color: var(--accent);
}

.dash-lede {
    margin-top: 0.85rem;
    max-width: 42ch;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger-custom {
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 500;
}

.color-highlight {
    color: var(--accent);
}

.lead-text {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 60ch;
}

.info-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.small {
    font-size: 0.75rem;
}


/* ── Hero card ── */
.hero-card {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem 2.25rem;
    border-radius: 22px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-panel);
}

.hero-copy .dash-title {
    max-width: 14ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--accent-dim);
    color: var(--text-muted);
    font-size: 0.8rem;
    border: 1px solid rgba(0, 113, 227, 0.08);
}

.trust-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.hero-preview {
    display: flex;
    justify-content: center;
}

.hero-browser {
    width: 100%;
    max-width: 460px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-card);
}

.hero-browser-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg-secondary);
}

.hero-browser-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d1d6;
}

.hero-browser-body {
    padding: 1rem;
}

.hero-browser-nav {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.hero-browser-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
}

.hero-browser-pill:hover,
.hero-browser-pill:focus-visible {
    background: var(--accent-dim);
    color: var(--text);
    outline: none;
}

.hero-browser-pill.active {
    background: var(--accent);
    color: #ffffff;
}

.hero-browser-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}

.hero-browser-panel[data-preview="shared"] {
    background: linear-gradient(145deg, rgba(6,182,212,0.08), rgba(99,102,241,0.06));
    border-color: rgba(6, 182, 212, 0.2);
}

.hero-browser-panel[data-preview="done"] {
    background: linear-gradient(145deg, rgba(239,68,68,0.07), rgba(236,72,153,0.05));
    border-color: rgba(239, 68, 68, 0.18);
}

.hero-browser-panel.is-switching {
    transform: scale(0.98);
}

.hero-preview-visual {
    position: relative;
    min-height: 88px;
    margin-bottom: 0.85rem;
}

.hero-preview-scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-browser-panel[data-preview="session"] .scene-session,
.hero-browser-panel[data-preview="shared"] .scene-shared,
.hero-browser-panel[data-preview="done"] .scene-done {
    opacity: 1;
    transform: none;
}

.hero-scene-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.hero-scene-lines {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: min(200px, 100%);
}

.hero-scene-lines span {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
}

.hero-scene-lines span:nth-child(1) { width: 72%; }
.hero-scene-lines span:nth-child(2) { width: 100%; }
.hero-scene-lines span:nth-child(3) { width: 48%; }

.hero-scene-chip {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
}

.hero-scene-chip.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.hero-scene-link,
.hero-scene-claim {
    width: min(240px, 100%);
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-align: center;
}

.hero-scene-link {
    background: rgba(255, 255, 255, 0.85);
    border: 1px dashed rgba(6, 182, 212, 0.35);
    color: #0e7490;
}

.hero-scene-claim {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--text-muted);
}

.hero-preview-cta {
    margin-top: 0.85rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.hero-preview-cta:hover,
.hero-preview-cta:focus-visible {
    color: #4f46e5;
    transform: translateX(3px);
}

.hero-browser-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.022em;
    margin-bottom: 0.25rem;
}

.hero-browser-panel p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ── Dashboard hero (runbook) ── */
.dash-hero {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.75rem;
    padding: 1.75rem 0 0.5rem;
}

.dash-hero-copy {
    max-width: 52ch;
}

.dash-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

/* ── Workspace grid ── */
.workspace-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: start;
}

.workspace-main,
.workspace-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.25rem;
    align-items: start;
}

.col-main,
.col-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Cards & panels ── */
.card,
.panel,
.card-mini {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--border-radius);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed), transform var(--transition-speed);
}

.card:hover,
.panel:hover,
.card-mini:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-panel);
}

.card-glow {
    box-shadow: var(--shadow-panel), 0 0 0 1px var(--accent-dim);
}

.card-live {
    border-color: rgba(0, 113, 227, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.panel-head.compact {
    margin-bottom: 0.85rem;
}

.panel-head h2,
.panel-head h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.panel-head h3 {
    font-size: 1rem;
}

/* ── Buttons ── */
.btn {
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 2px;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed), transform 0.15s, box-shadow var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--seal-parchment);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    background: var(--accent-pressed);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-secondary:hover {
    background: #ebebed;
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    filter: brightness(1.05);
}

.btn-success {
    background: var(--mint);
    color: #ffffff;
}

.btn-success:hover {
    filter: brightness(1.05);
}

.btn-ghost-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-ghost-danger:hover {
    background: var(--danger-dim);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 0.7rem 1.35rem;
    font-size: 0.92rem;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

/* ── Profiles ── */
.profiles-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 113, 227, 0.1);
}

.empty-glyph {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    border: 1px dashed var(--line-strong);
    background:
        linear-gradient(var(--accent), var(--accent)) center/2px 16px no-repeat,
        linear-gradient(var(--accent), var(--accent)) center/16px 2px no-repeat;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.022em;
    margin-bottom: 0.35rem;
}

.profile-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-secondary);
    transition: border-color var(--transition-speed), background var(--transition-speed), box-shadow var(--transition-speed);
}

.profile-card:hover {
    border-color: var(--line-strong);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}

.profile-card.active {
    border-color: rgba(0, 113, 227, 0.35);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.12), var(--shadow-soft);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    min-width: 0;
}

.profile-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    background: linear-gradient(145deg, var(--accent), #40a9ff);
    flex-shrink: 0;
}

.profile-details h3 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.profile-details p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.profile-meta {
    display: flex;
    gap: 1rem;
    cursor: pointer;
    flex-wrap: wrap;
}

.meta-item .label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 0.15rem;
}

.meta-item .value,
.status-tag {
    font-size: 0.78rem;
    font-weight: 500;
}

.status-shared {
    color: var(--mint);
}

.status-paused {
    color: var(--warning);
}

.tunnel-mode-active {
    color: var(--accent);
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 113, 227, 0.15);
}

.tier-badge-inline {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
}


/* ── Share stack ── */
.share-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-stack label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

.url-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.url-row input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-input);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed);
}

.url-row input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.meta-pill {
    display: inline-flex;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    color: var(--text);
}

.meta-pill.muted,
.muted-row {
    color: var(--text-muted);
}

.share-claim-box {
    margin-top: 0.25rem;
}

.share-claim-box label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.share-url-box label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.url-copy {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.url-copy input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-input);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.88rem;
}

.url-copy input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
}

/* ── Live preview ── */
.preview-window {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #1d1d1f;
    margin-bottom: 1rem;
}

.preview-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    background: #2c2c2e;
    border-bottom: 1px solid var(--sandbox-border);
}

.preview-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mint);
    margin-left: auto;
}

.preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.preview-dot:nth-child(1) { background: #ff5f57; }
.preview-dot:nth-child(2) { background: #febc2e; }
.preview-dot:nth-child(3) { background: #28c840; }

.preview-url {
    flex: 1;
    font-size: 0.72rem;
    color: var(--sandbox-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0.35rem;
}

.preview-body {
    min-height: 180px;
    position: relative;
    background: #1d1d1f;
}

.preview-empty {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    min-height: 180px;
}

.preview-empty h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sandbox-text);
    margin-bottom: 0.35rem;
}

.preview-empty p {
    font-size: 0.82rem;
    color: var(--sandbox-muted);
}

.preview-cursor {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
    transition: top 0.12s ease-out, left 0.12s ease-out;
}

.preview-cursor span {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid var(--danger);
    transform: rotate(-35deg);
}

.preview-cursor small {
    background: var(--danger);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    margin-top: 2px;
    margin-left: 6px;
}

.active-profile-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.session-bar {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
    background: rgba(0, 0, 0, 0.03);
}

.session-bar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.session-bar-state {
    font-weight: 600;
    color: var(--primary);
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.84rem;
}

.control-row span:first-child {
    color: var(--text-muted);
}

.actions-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.revoke-hint {
    margin-top: 0.25rem;
    font-size: 0.78rem;
}

.helper-action-log {
    font-size: 0.78rem;
    color: var(--accent);
    max-width: 160px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Egress panel ── */
.egress-panel .egress-metrics {
    display: grid;
    gap: 0.85rem;
    margin: 0.75rem 0 1rem;
}

.egress-metric-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 0.25rem;
}

.egress-metric-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.022em;
    margin-bottom: 0.15rem;
}

.egress-metric-desc {
    font-size: 0.82rem;
    line-height: 1.4;
}

.egress-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    color: var(--text-muted);
}

.egress-status-badge.connected {
    color: var(--mint);
    border-color: rgba(52, 199, 89, 0.3);
    background: var(--mint-dim);
}

.egress-status-badge.offline {
    color: var(--text-faint);
}

.home-agent-setup {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.home-agent-setup-lead {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.65rem;
}

.home-agent-steps {
    margin: 0 0 0.85rem 1.1rem;
    padding: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.home-agent-steps li { margin-bottom: 0.35rem; }

.home-agent-actions {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.home-agent-online-msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.egress-preview {
    margin-top: 0.55rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.45;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 113, 227, 0.15);
    color: var(--text);
}

.share-egress-hint {
    margin: 0 0 0.75rem;
}

.egress-value {
    font-size: 0.78rem;
    line-height: 1.35;
}

/* ── Gateway metrics ── */
.gateway-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.metric-box {
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--line);
}

.metric-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.35rem;
}

.metric-val {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.metric-desc {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.gateway-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-pill);
}

.gateway-status-badge.connected {
    background: var(--mint-dim);
    color: var(--mint);
    border: 1px solid rgba(52, 199, 89, 0.25);
}

.gateway-status-badge.offline {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--line);
}

/* ── Advanced panel ── */
.advanced-panel summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-muted);
    list-style: none;
    padding: 0.15rem 0;
}

.advanced-panel summary::-webkit-details-marker {
    display: none;
}

.summary-icon {
    font-size: 1.1rem;
    color: var(--text-faint);
    transition: transform var(--transition-speed);
}

.advanced-panel[open] .summary-icon {
    transform: rotate(45deg);
}

.advanced-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.card-mini {
    padding: 1.15rem 1.25rem;
}

/* ── Audit log ── */
.audit-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.audit-empty {
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.audit-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.15rem 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    font-size: 0.8rem;
    transition: border-color var(--transition-speed);
}

.audit-row:hover {
    border-color: var(--line);
}

.audit-time {
    grid-row: 1 / 3;
    align-self: center;
    font-variant-numeric: tabular-nums;
    color: var(--text-faint);
    font-size: 0.72rem;
}

.audit-event {
    font-weight: 600;
    color: var(--text);
}

.audit-detail {
    color: var(--text-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Vault ── */
.vault-upload-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.vault-upload-row input[type="file"] {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.vault-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.vault-col h4,
.vault-col-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vault-file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vault-file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
}

.vault-file-list li:last-child {
    border-bottom: none;
}

.vault-file-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-file-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* ── Pending claims ── */
.pending-claims-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pending-claim-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    flex-wrap: wrap;
}

.pending-claim-meta {
    flex: 1;
    min-width: 0;
}

.pending-claim-meta strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.pending-claim-meta span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.pending-claim-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}


/* ── Runbook ── */
.runbook-container {
    max-width: 820px;
    margin: 0 auto;
}

.runbook-hero {
    grid-template-columns: 1fr;
    margin-bottom: 1.5rem;
}

.runbook-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.runbook-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.15rem;
    padding: 1.25rem 1.35rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}

.runbook-num {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    background: var(--accent);
    flex-shrink: 0;
}

.runbook-step h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.022em;
    margin-bottom: 0.35rem;
}

.runbook-step p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.runbook-note {
    margin-top: 0.55rem !important;
    margin-bottom: 0 !important;
}

.runbook-callouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.code-copy-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--line);
}

.code-copy-container code {
    flex: 1;
    font-size: 0.82rem;
    color: var(--accent);
    word-break: break-all;
}

/* ── Architecture ── */
.architecture-container {
    max-width: 920px;
    margin: 0 auto;
}

.architecture-container > .card > h2,
.arch-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.022em;
    margin-bottom: 0.75rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.feat-box {
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--line);
    background: var(--bg-secondary);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.feat-box:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.feat-box h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.022em;
    margin-bottom: 0.45rem;
}

.feat-box p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.arch-visual-section {
    margin-top: 2rem;
}

.arch-visual-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.diagram-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    overflow-x: auto;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-elevated);
    min-width: 120px;
    text-align: center;
}

.node-owner {
    border-color: rgba(0, 113, 227, 0.25);
}

.node-cloud {
    border-color: rgba(52, 199, 89, 0.25);
}

.node-target {
    border-color: var(--line-strong);
}

.node-title {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.022em;
}

.node-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.connector-line {
    position: relative;
    height: 2px;
    min-width: 48px;
    flex: 1;
    max-width: 80px;
    background: var(--line-strong);
    margin: 0 0.25rem;
}

.connector-line.active {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.connector-line.tunnel-active {
    background: var(--mint);
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.3);
}

.connector-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Steps / info grids ── */
.steps-grid,
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step-card,
.info-card {
    padding: 1.15rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--line);
    background: var(--bg-elevated);
}

.step-number {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    background: var(--accent);
    margin-bottom: 0.65rem;
}

.step-card h3,
.info-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.step-card p,
.info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Config grid ── */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
}

.config-cell {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--line);
}

.c-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 0.2rem;
}

.c-value {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Offers / pricing ── */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.offer-tile {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: var(--bg-elevated);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.offer-tile h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.offer-tile.offer-active {
    border-color: rgba(0, 113, 227, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.15);
}

.offer-bullets {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.pricing-hosting-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pricing-section-title {
    margin: 1.25rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.pricing-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1.15rem;
    background: var(--bg-elevated);
}

.pricing-card h3 {
    margin: 0.15rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.pricing-card .price {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.65rem;
}

.pricing-featured {
    border-color: rgba(0, 113, 227, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.12);
}

.plan-code {
    font-size: 0.78rem;
    margin: 0.75rem 0 0;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-success {
    background: var(--mint-dim);
    color: var(--mint);
    border: 1px solid rgba(52, 199, 89, 0.25);
}

/* ── Modals ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    place-items: center;
    padding: 1.5rem;
    animation: modalFadeIn 0.25s var(--transition-smooth);
}

.modal-overlay.active {
    display: grid;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border-radius: var(--border-radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    animation: modalSlideUp 0.3s var(--transition-smooth);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.35rem 1.5rem 0;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.modal-close,
.close-btn {
    background: var(--bg-secondary);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-speed), color var(--transition-speed);
    flex-shrink: 0;
}

.modal-close:hover,
.close-btn:hover {
    background: #ebebed;
    color: var(--text);
}

.modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.tier-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.tier-customize summary {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.tier-customize[open] summary {
    margin-bottom: 0.75rem;
}

.tier-desc {
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-input);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed);
    appearance: none;
}

.form-group input:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.form-group input[type="checkbox"] {
    margin-right: 0.45rem;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 1.25rem;
}

.modal-body .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 1rem 1.5rem 0.35rem;
    background: linear-gradient(to top, var(--bg-elevated) 85%, transparent);
    border-top: 1px solid var(--line);
}

/* ── Toast ── */
.notification-toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius-pill);
    background: rgba(29, 29, 31, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f5f5f7;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: bottom 0.35s var(--transition-smooth), opacity 0.35s;
    opacity: 0;
    pointer-events: none;
}

.notification-toast.active {
    bottom: 28px;
    opacity: 1;
}

.toast-message {
    font-size: 0.88rem;
    font-weight: 500;
}


/* ── Helper sandbox (darker contrast) ── */
.sandbox-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 130px);
    overflow: hidden;
    border-radius: var(--border-radius);
    display: flex;
    background: var(--sandbox-bg);
    border: 1px solid var(--sandbox-border);
}

.sandbox-shell {
    display: flex;
    width: 100%;
    height: 100%;
}

.sandbox-window {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sandbox-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    background: rgba(29, 29, 31, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--sandbox-border);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s var(--transition-smooth);
    color: var(--sandbox-text);
}

.sandbox-sidebar.open {
    transform: translateX(0);
}

.sandbox-sidebar-toggle {
    position: absolute;
    top: 25px;
    left: 100%;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0.8rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 0 16px var(--accent-glow);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 101;
    white-space: nowrap;
}

.sandbox-sidebar-toggle:hover {
    background: var(--accent-hover);
}

.sandbox-sidebar h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--sandbox-text);
}

.sidebar-desc {
    font-size: 0.85rem;
    color: var(--sandbox-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.panel-card {
    background: var(--sandbox-panel);
    border: 1px solid var(--sandbox-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.panel-card h4 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: var(--sandbox-text);
}

.control-group {
    margin-bottom: 0.85rem;
}

.control-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--sandbox-muted);
    margin-bottom: 0.35rem;
}

.control-group select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--sandbox-border);
    background: #3a3a3c;
    color: var(--sandbox-text);
    font-family: var(--font-body);
    font-size: 0.82rem;
}

.control-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.protocol-badge {
    display: inline-flex;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 113, 227, 0.2);
}

.console-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sandbox-browser-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #1d1d1f;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--sandbox-border);
}

.sandbox-browser-header {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #2c2c2e;
    border-bottom: 1px solid var(--sandbox-border);
}

.window-controls {
    display: flex;
    gap: 0.4rem;
}

.window-controls span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.window-controls span:nth-child(1) { background: #ff5f57; }
.window-controls span:nth-child(2) { background: #febc2e; }
.window-controls span:nth-child(3) { background: #28c840; }

.sandbox-address-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    background: #3a3a3c;
    border: 1px solid var(--sandbox-border);
}

.lock-icon {
    font-size: 0.75rem;
    color: var(--mint);
}

.sandbox-address-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sandbox-text);
    font-size: 0.82rem;
    font-family: var(--font-body);
    outline: none;
}

.sandbox-session-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--sandbox-muted);
    white-space: nowrap;
}

.tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    animation: pulseDot 2s ease-in-out infinite;
}

.sandbox-browser-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #1d1d1f;
}

.sandbox-website-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
}

/* ── Mock portal (demo site inside sandbox) ── */
.mock-portal {
    min-height: 100%;
    background: #ffffff;
    color: #1d1d1f;
    font-family: var(--font-body);
}

.mock-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e5ea;
    position: sticky;
    top: 0;
    z-index: 5;
}

.mock-logo {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
    letter-spacing: -0.022em;
}

.mock-nav-links {
    display: flex;
    gap: 0.75rem;
}

.nav-item {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: color var(--transition-speed), background var(--transition-speed);
}

.nav-item:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.nav-item.active {
    color: var(--accent);
    font-weight: 600;
}

.mock-body {
    padding: 1.25rem;
    max-width: 640px;
    margin: 0 auto;
}

.mock-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.mock-page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sandbox-website-container .text-muted {
    color: var(--text-muted);
}

.post-card {
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e5ea;
    background: #ffffff;
    margin-bottom: 0.85rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #d1d1d6;
    position: relative;
    flex-shrink: 0;
}

.avatar-blue {
    background: #a8d4f0;
}

.post-avatar::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}

.post-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.post-content {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.65rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.post-btn {
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-pill);
    border: 1px solid #e5e5ea;
    background: var(--bg-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.post-btn:hover {
    background: #ebebed;
}

.profile-hero {
    text-align: center;
    padding: 1.5rem 0;
}

.hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), #40a9ff);
    margin: 0 auto 0.85rem;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.85rem 0;
    border-top: 1px solid #e5e5ea;
    border-bottom: 1px solid #e5e5ea;
    margin-bottom: 1rem;
}

.p-stat {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.p-stat strong {
    color: var(--text);
}

.profile-body {
    padding: 1rem 0;
}

.profile-body h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.profile-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.message-threads {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e5ea;
    cursor: pointer;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

.thread-item:hover {
    background: var(--bg-secondary);
}

.thread-item.active {
    border-color: rgba(0, 113, 227, 0.3);
    background: var(--accent-dim);
}

.thread-details strong {
    font-size: 0.88rem;
}

.thread-details p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-block {
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e5ea;
    background: var(--bg-secondary);
    margin-bottom: 0.85rem;
}

.settings-block h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.settings-block p {
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

/* ── Revoked overlay ── */
.revoked-overlay {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 50;
}

.revoked-overlay.active {
    display: grid;
}

.revoked-card {
    text-align: center;
    padding: 2rem 2.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    max-width: 380px;
    margin: 1rem;
}

.revoked-icon {
    font-size: 2.5rem;
    margin-bottom: 0.85rem;
}

.revoked-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.revoked-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.revoked-card .small {
    font-size: 0.75rem;
}

/* ── Sim / mirror / supervision ── */
.sim-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--sandbox-text);
}

.sim-content p {
    color: var(--sandbox-muted);
    font-size: 0.85rem;
}

.sim-cursor {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: top 0.12s ease-out, left 0.12s ease-out;
    z-index: 20;
    pointer-events: none;
}

.cursor-pointer {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 12px solid var(--danger);
    transform: rotate(-35deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.cursor-label {
    background: var(--danger);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-top: 2px;
    margin-left: 8px;
}

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint);
    animation: pulseDot 1.5s ease-in-out infinite;
}

.live-screen-mirror {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #1d1d1f;
}

.mirror-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.mirror-canvas {
    position: relative;
    min-height: 180px;
}

.browser-address-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #2c2c2e;
    border-bottom: 1px solid var(--sandbox-border);
}

.browser-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.browser-dot:nth-child(1) { background: #ff5f57; }
.browser-dot:nth-child(2) { background: #febc2e; }
.browser-dot:nth-child(3) { background: #28c840; }

.url-input {
    flex: 1;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--sandbox-border);
    background: #3a3a3c;
    color: var(--sandbox-text);
    font-size: 0.78rem;
}

.browser-frame-content {
    padding: 1rem;
    min-height: 160px;
    background: #1d1d1f;
}

.supervision-controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.action-buttons-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@keyframes highlightLog {
    0% { background: var(--accent-dim); color: var(--text); }
    100% { background: transparent; color: var(--accent); }
}

/* ── Helper / split modes ── */
body.split-active .app-main {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    max-width: 100%;
    padding: 1.25rem;
}

body.split-active #view-dashboard,
body.split-active #view-helper {
    display: block !important;
}

body.split-active #view-dashboard .dashboard-grid,
body.split-active #view-dashboard .workspace-grid {
    grid-template-columns: 1fr;
}

body.split-active #view-helper .sandbox-sidebar {
    display: none;
}

body.split-active #view-architecture,
body.split-active #view-runbook {
    display: none !important;
}

body.helper-mode:not(.split-active) .app-header {
    display: none;
}

body.helper-mode:not(.split-active) .app-main {
    padding: 0;
    margin: 0;
    max-width: 100vw;
    width: 100vw;
}

body.helper-mode:not(.split-active) .sandbox-container {
    height: 100vh;
    border-radius: 0;
    border: none;
}

body.helper-mode:not(.split-active) .sandbox-browser-window {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.exit-helper-mode-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 150;
    background: rgba(29, 29, 31, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--sandbox-border);
    color: #f5f5f7;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    display: none;
}

body.helper-mode:not(.split-active) .exit-helper-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.exit-helper-mode-btn:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}


/* ── Guide page (/guide) ── */
body.guide-page .guide-main {
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

.guide-logo-link {
    text-decoration: none;
    color: inherit;
}

.guide-top-nav .nav-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.guide-top-nav .nav-btn.active {
    pointer-events: none;
}

.guide-loading,
.guide-error {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

.guide-error {
    color: var(--danger);
}

.guide-prose {
    line-height: 1.65;
    color: var(--text-muted);
}

.guide-prose h1,
.guide-prose h2,
.guide-prose h3 {
    font-family: var(--font-display);
    color: var(--text);
    margin: 2rem 0 0.75rem;
    scroll-margin-top: 5rem;
    letter-spacing: -0.022em;
}

.guide-prose h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.guide-prose h2 {
    font-size: 1.35rem;
    font-weight: 600;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
}

.guide-prose h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.guide-prose p,
.guide-prose li {
    margin: 0.65rem 0;
}

.guide-prose ul,
.guide-prose ol {
    padding-left: 1.35rem;
}

.guide-prose strong {
    color: var(--text);
    font-weight: 600;
}

.guide-prose a {
    color: var(--accent);
}

.guide-prose code {
    font-size: 0.88em;
    background: var(--bg-secondary);
    padding: 0.12em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--line);
}

.guide-prose pre {
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
}

.guide-prose pre code {
    background: none;
    border: none;
    padding: 0;
}

.guide-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 1rem 0;
}

.guide-prose th,
.guide-prose td {
    border: 1px solid var(--line);
    padding: 0.55rem 0.65rem;
    text-align: left;
    vertical-align: top;
}

.guide-prose th {
    background: var(--bg-secondary);
    color: var(--text);
    font-weight: 600;
}

.guide-prose blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-dim);
    color: var(--text);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guide-prose hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}

.guide-prose .mermaid {
    margin: 1.25rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    overflow-x: auto;
}

/* ── Responsive: 980px ── */
@media (max-width: 980px) {
    .hero-card,
    .workspace-grid,
    .dashboard-grid,
    .dash-hero {
        grid-template-columns: 1fr;
    }

    .dash-hero-actions {
        justify-content: flex-start;
    }

    .profile-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .profile-meta {
        justify-content: flex-start;
    }

    .profile-actions {
        justify-content: flex-start;
    }

    .app-header {
        flex-wrap: wrap;
        padding: 0.85rem 1.25rem;
        gap: 0.85rem;
    }

    .app-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .app-main {
        padding: 1.5rem 1.25rem 2.5rem;
    }

    .gateway-metrics {
        grid-template-columns: 1fr;
    }

    .runbook-callouts {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .vault-columns {
        grid-template-columns: 1fr;
    }

    body.split-active .app-main {
        grid-template-columns: 1fr;
    }

    .sandbox-container {
        height: calc(100vh - 100px);
    }

    .sandbox-browser-header {
        grid-template-columns: 60px 1fr;
    }

    .sandbox-session-tag {
        display: none;
    }
}

/* ── Responsive: 640px ── */
@media (max-width: 640px) {
    .hero-card {
        padding: 1.35rem;
        border-radius: var(--border-radius);
    }

    .dash-title {
        font-size: 1.75rem;
    }

    .card,
    .panel,
    .card-mini {
        padding: 1.15rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .url-row {
        flex-direction: column;
    }

    .actions-row {
        flex-direction: column;
    }

    .actions-row .btn {
        width: 100%;
    }

    .trust-strip {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .diagram-placeholder {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .connector-line {
        height: 32px;
        width: 2px !important;
        min-width: 2px;
        max-width: 2px;
        margin: 0.25rem 0;
    }

    .connector-label {
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
    }

    .audit-row {
        grid-template-columns: 3.5rem 1fr;
    }

    .pending-claim-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pending-claim-actions {
        justify-content: flex-end;
    }

    .modal-card {
        max-height: 95vh;
        border-radius: var(--radius-sm);
    }

    .modal-header,
    .modal-body {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .notification-toast {
        left: 1rem;
        right: 1rem;
        transform: none;
        text-align: center;
    }

    .notification-toast.active {
        bottom: 20px;
    }

    .exit-helper-mode-btn {
        bottom: 12px;
        right: 12px;
        left: 12px;
        justify-content: center;
    }

    .runbook-step {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .runbook-num {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85rem;
    }

    .code-copy-container {
        flex-direction: column;
        align-items: stretch;
    }

    .mock-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .mock-nav-links {
        flex-wrap: wrap;
    }
}

/* ── The Seal · Home layout ── */
.seal-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

.mesh-bg { display: none; }

.seal-mark {
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: transparent;
    color: var(--seal-ink);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0;
    display: grid;
    place-items: center;
    line-height: 1;
    box-shadow: none;
}

.seal-mark svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.logo-sub {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 2px;
}

.logo-wordmark h1 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.app-header {
    background: color-mix(in srgb, var(--seal-parchment) 88%, transparent);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-header);
}

.app-header h1 { font-family: var(--font-display); font-weight: 300; }

.home-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.75rem;
    align-items: start;
    min-height: calc(100vh - 120px);
}

.home-sidebar {
    position: sticky;
    top: 88px;
    background: var(--seal-card);
    border: 1px solid var(--line);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(100vh - 110px);
}

.home-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.home-license-foot {
    margin-top: auto;
    padding: 0.85rem 1rem;
    background: var(--seal-ink-soft);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.home-license-plan {
    display: block;
    font-weight: 600;
    color: var(--seal-ink);
}

.home-license-renew {
    display: block;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.profiles-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}

.profiles-sidebar .profile-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    gap: 0.35rem;
}

.profiles-sidebar .profile-card:hover {
    background: var(--seal-parchment-deep);
}

.profiles-sidebar .profile-card.active {
    background: var(--seal-ink-soft);
    border-color: rgba(92, 35, 32, 0.15);
    box-shadow: none;
}

.profiles-sidebar .profile-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.profiles-sidebar .profile-icon {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
    background: var(--seal-ink);
    color: var(--seal-parchment);
    border-radius: 50%;
}

.profiles-sidebar .profile-details h3 {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
}

.profiles-sidebar .profile-details p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.profiles-sidebar .profile-meta {
    display: none;
}

.profiles-sidebar .profile-sidebar-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.profiles-sidebar .profile-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.profiles-sidebar .profile-actions-sidebar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.1rem;
}

.profiles-sidebar .profile-actions-sidebar .btn-small {
    padding: 0.2rem 0.45rem;
    font-size: 0.68rem;
    min-height: 0;
    line-height: 1.3;
}

.home-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.home-tabs {
    display: inline-flex;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    width: fit-content;
}

.home-tab {
    position: relative;
    padding: 0.65rem 1.1rem;
    border: none;
    background: transparent;
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-speed);
}

.home-tab:hover { color: var(--text); }

.home-tab.active {
    background: transparent;
    color: var(--seal-ink);
    box-shadow: inset 0 -2px 0 var(--seal-ink);
}

.home-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    border-radius: var(--radius-pill);
    background: var(--seal-ink);
    color: var(--seal-parchment);
    font-size: 0.7rem;
    font-weight: 700;
}

.home-pending-focus {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.pending-hero-card {
    text-align: center;
    max-width: 420px;
    width: 100%;
    background: var(--seal-card);
    border: 1px solid var(--line);
    border-radius: calc(var(--border-radius) + 4px);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-card);
}

.pending-hero-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--seal-parchment-deep);
    border: 2px solid var(--line);
    position: relative;
}

.pending-hero-icon::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--seal-ink);
}

.pending-hero-card h2 {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.pending-claims-hero {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pending-claim-hero-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pending-claim-hero-row .btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.95rem;
}

.panel h2,
.panel h3,
.dash-title,
.arch-hero-title {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

.card {
    background: var(--seal-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.btn-primary {
    background: var(--seal-ink);
    color: var(--seal-parchment);
    border: none;
    border-radius: 2px;
}

.btn-primary:hover {
    background: var(--seal-ink-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text);
    border-radius: 2px;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 2px;
}

.preview-window {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--seal-live);
}

.preview-body {
    background: linear-gradient(160deg, #243445, #1b2837);
    min-height: 220px;
    position: relative;
}

.preview-body .owner-mirror-iframe {
    min-height: 260px;
}

.supervision-vault-hint {
    font-size: 0.8rem;
    margin-top: 0.65rem;
    line-height: 1.45;
}

.modal-unlock {
    text-align: left;
    max-width: 420px;
    border-radius: 2px;
    background: var(--seal-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-panel);
}

.modal-unlock .modal-header {
    text-align: left;
}

.modal-unlock .modal-header h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--seal-ink);
}

.modal-unlock .unlock-lede {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.modal-unlock .form-actions {
    margin-top: 0.5rem;
}

.modal-unlock .btn-full {
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--seal-faint);
}

#home-workspace.home-tab-hidden {
    display: none !important;
}

#helper-claims-card.home-pending-collapsed .pending-claims-list {
    max-height: 200px;
    overflow-y: auto;
}

@media (max-width: 960px) {
    .home-shell {
        grid-template-columns: 1fr;
    }

    .home-sidebar {
        position: static;
        max-height: none;
    }

    .profiles-sidebar .profile-meta {
        display: none;
    }

    .profiles-sidebar .profile-card {
        flex-direction: column;
    }
}

/* ── Print ── */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    * {
        background: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:link,
    a:visited {
        color: #000000 !important;
        text-decoration: underline !important;
    }

    pre,
    code {
        color: #000000 !important;
        background: #f8f8f8 !important;
        border: 1px solid #cccccc !important;
    }

    nav,
    .atmosphere,
    .preview,
    .btn,
    .modal-overlay,
    .panel-head,
    .atmosphere-grid,
    .atmosphere-glow,
    .atmosphere-grain,
    .notification-toast,
    .exit-helper-mode-btn {
        display: none !important;
    }

    .text-muted,
    .text-faint {
        color: #333333 !important;
    }

    .card,
    .panel {
        border: 1px solid #cccccc !important;
        break-inside: avoid;
    }
}

/* ── Share kit + onboarding wizard ── */
.share-kit-row {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.share-kit-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

.share-kit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-kit-actions .btn {
    flex: 1 1 auto;
    min-width: 5.5rem;
}

.share-kit-hint {
    font-size: 0.78rem;
    line-height: 1.4;
}

.onboard-card {
    max-width: 540px;
}

.onboard-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.5rem 0.5rem;
}

.onboard-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line);
    transition: background 0.2s, transform 0.2s;
}

.onboard-dot.active {
    background: var(--ink, #1a1a1a);
    transform: scale(1.15);
}

.onboard-body {
    padding-top: 0.25rem;
}

.onboard-lede {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 1rem;
}

.onboard-checklist {
    margin: 0 0 1rem 1.1rem;
    line-height: 1.7;
}

.onboard-kit-preview {
    width: 100%;
    margin: 0.75rem 0;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-secondary);
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    resize: vertical;
}

.onboard-kit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.onboard-claim-reminder {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(52, 199, 89, 0.12);
    border: 1px solid rgba(52, 199, 89, 0.25);
    font-size: 0.88rem;
}

.onboard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0 1.5rem 1.35rem;
    flex-wrap: wrap;
}

.home-onboard-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--line);
}

.home-onboard-banner p {
    margin: 0;
    font-size: 0.9rem;
}
