/* ===== Compliance Singularity — Professional UI (Figma / PandaDoc inspired) ===== */

:root {
    /* Primary — confident teal/green (PandaDoc-style) */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --primary-muted: rgba(13, 148, 136, 0.08);
    --primary-accent: #14b8a6;
    /* Neutrals — clean grays */
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-subtle: #e2e8f0;
    --border-default: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-placeholder: #94a3b8;
    /* Semantic */
    --success: #059669;
    --success-bg: #d1fae5;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0284c7;
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition);
}

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

/* ===== LOGO (Compliance Singularity) ===== */
.app-logo-link,
.landing-logo-link,
.auth-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.app-logo-img,
.landing-logo-img,
.auth-logo-img,
.hero-logo-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}
/* Sidebar: icon-only logo */
.app-logo-link .app-logo-img { width: 36px; height: 36px; object-position: center; mix-blend-mode: multiply; }
.app-logo-fallback { display: none; }

/* Landing page nav: full logo, slim */
.landing-nav .landing-logo-img { max-height: 120px; max-width: 600px; mix-blend-mode: multiply; }
.landing-logo-fallback { display: none; }

/* Landing hero: icon-only PNG, large focal point */
.landing-hero .hero-logo-img {
    width: 136px;
    height: 136px;
    object-fit: contain;
    margin: 0 auto 28px;
    mix-blend-mode: multiply;
}

/* Login / Signup: full logo, centered, compact */
.auth-logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}
.auth-logo-link .auth-logo-img { max-width: 460px; max-height: 116px; }
.auth-logo-fallback { display: none; }

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-area {
    padding: 28px 32px 40px;
    background: var(--bg-app);
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    z-index: 20;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header .app-logo-link {
    margin-bottom: 0;
    flex-shrink: 0;
}

.sidebar-company-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-header h1::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.sidebar-menu li a i {
    margin-right: 12px;
    font-size: 16px;
    opacity: 0.85;
}

.sidebar-menu li a:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.sidebar-menu li.active a {
    background: var(--primary-muted);
    color: var(--primary);
}

.sidebar-menu li.nav-sub-item { margin-bottom: 0; }
.sidebar-menu li.nav-sub-item > a {
    padding-left: 2.4rem;
    font-size: 13px;
    color: #9ca3af;
}
.sidebar-menu li.nav-sub-item > a:hover { color: var(--text-primary); }
.sidebar-menu li.nav-sub-item.active > a {
    background: var(--primary-muted);
    color: var(--primary);
}

/* AI Assistant: primary way to interact — always visible in sidebar */
.sidebar-item-ai {
    margin-bottom: 8px;
}

.sidebar-link-ai {
    background: var(--primary-muted) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.sidebar-link-ai:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary);
}

.sidebar-link-ai i {
    color: var(--primary);
    opacity: 1;
}

.sidebar-link-ai:hover i {
    color: #fff;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-logout {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}

.sidebar-logout:hover {
    color: var(--primary);
}

/* ===== HAMBURGER + OVERLAY (mobile) ===== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 19;
}
.sidebar-overlay-visible {
    display: block;
}

/* ===== TOP HEADER ===== */
.top-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

.top-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
}

.user-profile-dropdown {
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.user-profile-trigger:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.user-profile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px 0;
    padding-top: 12px;
    z-index: 1000;
}

.user-profile-dropdown:hover .user-profile-menu {
    display: block;
}

.user-profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #334155);
    text-decoration: none;
    transition: background 0.1s;
}

.user-profile-menu-item:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.user-profile-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

.user-profile-menu-logout {
    border-top: 1px solid var(--border-subtle, #e2e8f0);
    margin-top: 4px;
    padding-top: 10px;
    color: var(--danger, #dc3545);
}

.user-profile-menu-logout i {
    color: var(--danger, #dc3545);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    min-width: 0;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-content {
    padding: 24px;
}

/* ===== DASHBOARD ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.company-overview {
    grid-column: span 4;
}

.company-overview .card-content h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.compliance-summary {
    grid-column: span 8;
}

/* ===== DASHBOARD — Company structure (Lucid-style) ===== */
.dashboard-wrapper {
    max-width: 1400px;
    min-width: 0;
    overflow-x: hidden;
}

.dashboard-section {
    margin-bottom: 32px;
    min-width: 0;
}

/* Compliance first (top of dashboard) */
.dashboard-grid-compliance {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

.dashboard-grid-compliance .compliance-summary-dash {
    grid-column: span 12;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 20px;
}

.section-header-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary);
}

.section-subtitle {
    width: 100%;
    font-size: 14px;
    color: var(--text-muted);
    margin: -4px 0 0 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    margin-left: auto;
}

/* Lucid-style tree: parent → vertical line → horizontal line → children */
.lucid-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    min-width: 0;
}

.lucid-tree-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.lucid-tree-label-parent {
    text-align: center;
}

.lucid-tree-parent-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
}

.lucid-root-tags-inline {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    justify-content: center;
    max-width: 100%;
}

.lucid-children-block {
    width: 100%;
    position: relative;
    padding-top: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Vertical stem from bottom of parent down to horizontal bar */
.lucid-children-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 44px;
    background: var(--border-default);
}

/* "Subsidiaries" label floats above the connector line, centred */
.lucid-tree-label-children {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0 8px;
    background: var(--bg-surface);
    white-space: nowrap;
    z-index: 1;
}

.lucid-tree-root {
    margin-bottom: 0;
}

.lucid-node-root {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    background: var(--primary-muted);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: box-shadow var(--transition), transform var(--transition);
}

.lucid-node-root:hover {
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.lucid-node-root .lucid-node-icon {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 6px;
}

.lucid-node-root .lucid-node-name {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.lucid-node-root .lucid-node-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Connector: DOM divs hidden — replaced by pseudo-elements */
.lucid-connector-v,
.lucid-connector-h,
.lucid-connector-v-child {
    display: none;
}

/* No stem on parent-block — children-block::before owns the full stem */
.lucid-tree-parent-block::after {
    content: none;
}

/* Children row: equal columns so each child center is predictable */
.lucid-children {
    display: grid;
    grid-template-columns: repeat(var(--child-count, 3), minmax(180px, 280px));
    gap: 16px;
    justify-content: center;
    margin: 0 auto;
    max-width: 960px;
    margin-bottom: 0;
    position: relative;
    padding-top: 24px;
}

/* Horizontal bar: spans exactly from center of first child to center of last — hidden for single child */
.lucid-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: calc(50% / var(--child-count, 3));
    right: calc(50% / var(--child-count, 3));
    height: 2px;
    background: var(--border-default);
}

/* Single child: no horizontal bar needed, just the vertical stem */
.lucid-children[style*="--child-count: 1"]::before {
    display: none;
}

/* Vertical drop from horizontal bar down to each child card */
.lucid-child-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    position: relative;
}

.lucid-child-wrap::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 24px;
    background: var(--border-default);
}

.lucid-node-child {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px 12px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.lucid-node-child:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.lucid-node-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.lucid-node-link:hover {
    color: inherit;
}

.lucid-node .lucid-node-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: 16px;
    margin: 0 auto 8px;
}

.lucid-node .lucid-node-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.lucid-node .lucid-node-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.lucid-node-employees {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    padding: 6px 10px;
    background: var(--primary-muted);
    border-radius: var(--radius-md);
}

.lucid-node-employees i {
    font-size: 12px;
}
.lucid-node-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.lucid-node-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    padding: 4px 10px;
    background: var(--primary-muted);
    border-radius: var(--radius-md);
}
.lucid-node-stat i {
    font-size: 11px;
}

.lucid-node-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.lucid-node-view-all {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 8px;
    text-decoration: none;
}

.lucid-node-view-all:hover {
    text-decoration: underline;
}

.lucid-root-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 960px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.lucid-root-tags-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}

.structure-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.structure-tag:hover {
    background: var(--primary-muted);
    color: var(--primary);
    border-color: rgba(13, 148, 136, 0.3);
}

.structure-tag-view-all {
    background: var(--primary-muted);
    color: var(--primary);
    border-color: rgba(13, 148, 136, 0.3);
}
.stag-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-right: 2px;
}
.structure-tag-summary {
    border-style: dashed;
    font-weight: 500;
}
.structure-tag-summary .stag-count {
    font-variant-numeric: tabular-nums;
    margin-left: 2px;
}

@media (max-width: 900px) {
    .lucid-children {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .lucid-children {
        grid-template-columns: 1fr;
    }
}

/* Legacy structure (if used elsewhere) */
.structure-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

.structure-entity-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

/* Structure diagram — tree layout, contained (legacy / fallback) */
.structure-diagram {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 20px 32px;
    box-shadow: var(--shadow-sm);
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.structure-diagram-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: visible;
}

.structure-node-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.structure-node-link:hover {
    color: inherit;
}

.structure-node-link .node-drill {
    display: block;
    font-size: 11px;
    color: var(--primary);
    margin-top: 8px;
}

.structure-node-link .node-drill i {
    font-size: 10px;
    margin-left: 4px;
}

.node-list-item-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-list-item-link:hover {
    background: var(--primary-muted);
    color: var(--text-primary);
}

.node-link-arrow {
    margin-left: auto;
    font-size: 11px;
    color: var(--primary);
    flex-shrink: 0;
}

.node-list-scroll {
    max-height: 160px;
    overflow-y: auto;
    min-width: 0;
}

.node-list-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-list-item-sub.node-list-item-link span {
    flex: 1;
    min-width: 0;
}

.structure-root {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.structure-node {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.structure-node:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.structure-node-root {
    min-width: 200px;
    max-width: 320px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
    border-color: var(--primary);
    border-width: 2px;
}

.structure-node-root .node-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--primary-muted);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.structure-node-root .node-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.structure-node-root .node-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.node-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary-muted);
    color: var(--primary);
}

.node-badge-state {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.structure-node-root .node-status {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Connectors */
.structure-connector {
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.structure-connector-main {
    height: 28px;
    align-items: flex-end;
}

.connector-line {
    display: block;
    background: var(--border-default);
}

.connector-vertical {
    width: 2px;
    height: 100%;
    min-height: 24px;
}

.connector-horizontal {
    flex: 1;
    max-width: 80px;
    height: 2px;
}

.structure-level-branches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
    padding: 0 8px;
    min-width: 0;
}

.structure-level-branches .structure-node-branch {
    min-width: 0;
}

.structure-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.structure-branch .connector-horizontal {
    margin-bottom: 12px;
    max-width: 100%;
}

.structure-node-branch {
    flex: 1;
    width: 100%;
    min-width: 0;
    text-align: center;
}

/* Collapsible branch: toggle button + content */
.structure-branch-collapsible .structure-node-branch {
    min-height: 0;
    padding: 0;
}

.structure-branch-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.structure-branch-toggle:hover {
    background: var(--border-subtle);
}

.structure-branch-toggle .node-icon {
    width: 36px;
    height: 36px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 16px;
}

.structure-branch-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.structure-branch-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.structure-branch-collapsible.is-expanded .structure-branch-chevron {
    transform: rotate(180deg);
}

.structure-branch-content {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 0;
}

.structure-branch-content[hidden] {
    display: none;
}

.node-list-contained {
    max-height: 200px;
    overflow-y: auto;
    min-width: 0;
}

.node-list-contained .node-list-item {
    min-width: 0;
}

.node-list-contained .node-list-item-link {
    min-width: 0;
}

.structure-node-branch .node-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    background: var(--bg-subtle);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.structure-node-branch .node-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.node-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.node-chips .chip,
.node-chips .chip-fq {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.chip-state {
    background: var(--primary-muted);
    color: var(--primary);
}

.chip-fq {
    font-size: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-list {
    text-align: left;
    margin-top: 8px;
}

.node-list-locations {
    margin-top: 4px;
}

.node-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.node-list-item:last-child {
    border-bottom: none;
}

.node-list-item i {
    color: var(--primary);
    flex-shrink: 0;
}

.node-list-item small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.location-item span {
    font-weight: 500;
    color: var(--text-primary);
}

.node-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
}

/* Physical locations grid */
.locations-section .section-header {
    margin-bottom: 16px;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.location-card-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

.location-card-mini:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.location-card-mini-link {
    text-decoration: none;
    color: inherit;
}

.location-card-mini-link:hover {
    color: inherit;
}

.location-card-arrow {
    color: var(--primary);
    font-size: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.location-card-body {
    min-width: 0;
}

.location-card-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sales Tax Nexus chips */
.nexus-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nexus-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #166534;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}

.nexus-chip:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
}

.nexus-chip i {
    font-size: 11px;
    opacity: 0.7;
}

/* International VAT table */
.vat-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.vat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.vat-table th {
    background: var(--bg-subtle);
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.vat-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.vat-table tr:last-child td {
    border-bottom: none;
}

.vat-table td i.fa-flag {
    margin-right: 6px;
    color: var(--text-muted);
}

.vat-table code {
    background: var(--bg-subtle);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
    color: var(--text-primary);
}

.vat-notes {
    color: var(--text-muted);
    font-size: 13px;
}

.vat-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.vat-status-registered   { background: #d1fae5; color: #065f46; }
.vat-status-pending      { background: #fef9c3; color: #854d0e; }
.vat-status-not-required { background: #f1f5f9; color: #475569; }
.vat-status-deregistered { background: #fee2e2; color: #991b1b; }

.location-card-pin {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.location-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.location-card-body strong {
    font-size: 14px;
    color: var(--text-primary);
}

.location-zip {
    font-size: 12px;
    color: var(--text-muted);
}

.empty-state-inline {
    padding: 24px;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}

.empty-state-inline p {
    margin: 0;
    font-size: 14px;
}

/* ===== International subsidiaries & offices ===== */
.international-section {
    margin-bottom: 36px;
}

.section-badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 6px 12px;
    border-radius: 20px;
    margin-left: auto;
}

.subsidiaries-viz {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.subsidiary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

/* Contained card: header link + optional offices expand */
.subsidiary-card-contained {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
    max-width: 100%;
}

.subsidiary-card-contained:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.subsidiary-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.subsidiary-offices-wrap {
    border-top: 1px solid var(--border-subtle);
    min-width: 0;
}

.subsidiary-offices-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: var(--bg-subtle);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.subsidiary-offices-toggle:hover {
    background: var(--border-subtle);
}

.subsidiary-offices-toggle .sub-offices-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.subsidiary-offices-toggle[aria-expanded="true"] .sub-offices-chevron {
    transform: rotate(180deg);
}

.subsidiary-offices.subsidiary-offices-collapsed {
    overflow: hidden;
    min-width: 0;
}

.subsidiary-offices.subsidiary-offices-collapsed[hidden] {
    display: none;
}

.subsidiary-offices.subsidiary-offices-collapsed:not([hidden]) {
    max-height: 220px;
    overflow-y: auto;
}

.subsidiary-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.subsidiary-card-link:hover {
    color: inherit;
}

.subsidiary-drill {
    display: block;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
}

.subsidiary-drill i {
    font-size: 10px;
    margin-left: 6px;
}

.subsidiary-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
}

.subsidiary-flag {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.subsidiary-title {
    flex: 1;
    min-width: 0;
}

.subsidiary-title strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subsidiary-meta {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subsidiary-employees {
    text-align: right;
    flex-shrink: 0;
}

.subsidiary-employees i {
    display: block;
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 2px;
}

.subsidiary-employees span {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.subsidiary-employees small {
    font-size: 11px;
    color: var(--text-muted);
}

.subsidiary-offices {
    padding: 14px 20px 18px;
    margin: 0 20px 18px;
    border-top: 1px solid var(--border-subtle);
}

.subsidiary-offices-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subsidiary-offices-label i {
    color: var(--primary);
}

.office-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.office-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.office-item:last-child {
    border-bottom: none;
}

.office-item i {
    color: var(--primary);
    flex-shrink: 0;
}

.office-item em {
    font-size: 12px;
    color: var(--text-muted);
    font-style: normal;
}

.offices-map-viz {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.viz-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.viz-title i {
    color: var(--primary);
}

.offices-by-country {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.country-office-block {
    padding: 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.country-office-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-default);
}

.country-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.country-employees {
    font-size: 12px;
    color: var(--text-muted);
}

.office-pins {
    list-style: none;
    padding: 0;
    margin: 0;
}

.office-pins li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
}

.office-pins li i {
    color: var(--primary);
    flex-shrink: 0;
}

.office-label {
    font-size: 11px;
    background: var(--primary-muted);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.node-list-item-sub small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}


@media (max-width: 900px) {
    .structure-level-branches {
        grid-template-columns: 1fr;
    }
    .structure-branch .connector-horizontal {
        display: none;
    }
}

.company-details {
    margin-top: 12px;
}

.detail-item {
    margin-bottom: 10px;
    display: flex;
    font-size: 14px;
}

.detail-item .label {
    flex: 0 0 42%;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-item .value {
    flex: 1;
    color: var(--text-primary);
}

.summary-stats {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.stat-box {
    text-align: center;
    padding: 20px 16px;
    flex: 1;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}

.stat-box-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition), color var(--transition);
}

.stat-box-link:hover {
    background: var(--primary-muted);
    color: var(--primary);
}
    border: 1px solid var(--border-subtle);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== REQUIREMENTS LIST ===== */
.requirements-list {
    list-style: none;
    padding: 0;
}

.requirement-item {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}

.requirement-item:last-child {
    border-bottom: none;
}

.requirement-item:hover {
    background: var(--bg-subtle);
}

.requirement-details {
    flex: 1;
}

.requirement-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.requirement-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}

.requirement-category,
.requirement-jurisdiction {
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

.requirement-deadline {
    font-size: 13px;
    color: var(--text-muted);
}

.requirement-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.requirement-item.completed .requirement-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.requirement-item.not-applicable .requirement-name {
    color: var(--text-muted);
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===== CALENDAR ===== */
.tools-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--bg-surface);
    padding: 18px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-select,
.search-input {
    padding: 9px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-muted);
}

.view-options {
    display: flex;
    gap: 6px;
}

.view-btn {
    padding: 9px 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.view-btn:hover {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.calendar-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.month-section {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.month-header {
    background: var(--primary);
    padding: 14px 24px;
    color: #fff;
}

.month-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.month-items {
    padding: 0;
}

.calendar-item {
    display: flex;
    align-items: flex-start;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.calendar-item:last-child {
    border-bottom: none;
}

.calendar-item.completed {
    background: var(--success-bg);
}

.calendar-item.past-due {
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
}

.item-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
    width: 52px;
}

.date-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.date-day {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.item-details {
    flex: 1;
}

.item-details .item-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.item-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.item-category,
.item-jurisdiction {
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.item-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.45;
}

.item-status {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.completed {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.not-applicable {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.status-badge.past-due {
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 600;
}

/* ===== TABLES ===== */
.compliance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.compliance-table th {
    background: var(--bg-subtle);
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.compliance-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.compliance-thead-clone {
    position: fixed;
    top: 0;
    z-index: 100;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.compliance-thead-clone.visible {
    visibility: visible;
    pointer-events: auto;
}

.compliance-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.compliance-table tbody tr:hover {
    background: var(--bg-subtle);
}

.compliance-row.completed {
    background: var(--success-bg);
}

.compliance-row.not-applicable {
    background: var(--bg-subtle);
}

.compliance-row.not-applicable .item-name {
    color: var(--text-muted);
}

.requirement-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.date-cell {
    white-space: nowrap;
    color: var(--text-secondary);
}

.status-cell {
    vertical-align: middle;
}

.status-cell .status-badge {
    display: inline-block;
    margin-right: 8px;
}

.status-cell .quick-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.status-cell .quick-actions .btn-primary,
.status-cell .quick-actions .btn-quick {
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 8px;
}

.btn-quick {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-quick-complete {
    background: #047857;
    color: #fff;
    border-color: #065f46;
}

.btn-quick-complete:hover {
    background: #065f46;
    color: #fff;
    transform: translateY(-1px);
}

.btn-quick-complete-for-me {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-hover, #0f766e);
}

.btn-quick-complete-for-me:hover {
    background: var(--primary-hover, #0f766e);
    color: #fff;
    transform: translateY(-1px);
}

.btn-quick-na {
    background: var(--bg-surface);
    color: var(--text-muted);
    border-color: var(--border-default);
}

.btn-quick-na:hover {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.status-cell .btn-action-sm {
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 12px;
}

.actions-cell {
    white-space: nowrap;
}

.actions-menu {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-intro {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ===== BUTTONS ===== */
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    padding: 4px 0;
    transition: color var(--transition);
}

.btn-link:hover {
    color: var(--primary-hover);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 0;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* Buttons: match link text exactly (browsers often use system font on button) */
button.btn-primary {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.btn-complete,
.btn-uncomplete,
.btn-not-applicable,
.btn-applicable {
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-complete {
    background: var(--success);
    color: #fff;
}

.btn-complete:hover {
    background: #047857;
    color: #fff;
}

.btn-uncomplete {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-uncomplete:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.btn-not-applicable {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-default);
}

.btn-not-applicable:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.btn-applicable {
    background: var(--primary);
    color: #fff;
}

.btn-applicable:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-action {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: 7px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action:hover {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.complete-action {
    color: var(--success);
    border-color: var(--success);
}

.complete-action:hover {
    background: var(--success-bg);
}

/* Primary-style Complete buttons: keep white text on teal (don't use .complete-action green) */
.btn-primary.complete-action {
    color: #fff;
    border: none;
    background: var(--primary);
}

.btn-primary.complete-action:hover {
    color: #fff;
    background: var(--primary-hover);
}

.uncomplete-action {
    color: var(--warning);
    border-color: var(--warning);
}

.uncomplete-action:hover {
    background: var(--warning-bg);
}

.not-applicable-action {
    color: var(--text-muted);
    border-color: var(--border-default);
}

.not-applicable-action:hover {
    background: var(--bg-subtle);
}

.applicable-action {
    color: var(--primary);
    border-color: var(--primary);
}

.applicable-action:hover {
    background: var(--primary-muted);
}

.edit-action {
    color: var(--primary);
    border-color: var(--primary);
}

.edit-action:hover {
    background: var(--primary-muted);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select,
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-muted);
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 22px;
}

.form-column {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.profile-form,
.compliance-form {
    max-width: 960px;
}

.help-text,
.form-help {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== COMPLETION SECTION ===== */
.completion-section {
    margin-top: 24px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.completion-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-muted);
    border-bottom: 1px solid var(--border-default);
}
.completion-section-body {
    padding: 20px;
}
.completion-section-body .form-group:last-child {
    margin-bottom: 0;
}
.na-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    color: var(--text-secondary) !important;
    font-size: 14px !important;
}
.na-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(5, 150, 105, 0.2);
}

.alert-error,
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.2);
}

.close-alert {
    background: none;
    border: none;
    font-size: 22px;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.close-alert:hover {
    opacity: 1;
}

/* ===== INTEGRATIONS ===== */
.integrations-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.integration-intro {
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 15px;
}

.integration-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.integration-card {
    display: flex;
    padding: 24px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    transition: all var(--transition);
    gap: 18px;
    align-items: flex-start;
}

.integration-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-default);
}

.integration-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.integration-icon.large {
    width: 64px;
    height: 64px;
    font-size: 28px;
}

.integration-icon.quickbooks {
    background: #2CA01C;
}

.integration-icon.gusto {
    background: #F45D48;
}

.integration-icon.rippling {
    background: #4A5AF8;
}

.integration-icon.carta {
    background: #206BC4;
}

.integration-details {
    flex: 1;
    min-width: 0;
}

.integration-details h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.integration-details p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.integration-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-badge.connected {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.not-connected {
    background: var(--danger-bg);
    color: var(--danger);
}

.last-sync {
    font-size: 13px;
    color: var(--text-muted);
}

.integration-actions {
    margin-top: 4px;
}

.impact-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.impact-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.impact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-muted);
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}

.impact-details h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.impact-details p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.integration-details-container {
    max-width: 720px;
}

.header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.integration-provider-detail {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.provider-info h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.provider-info p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-default);
    border-radius: 999px;
    transition: 0.25s ease;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: 0.25s ease;
}

input:checked + .slider {
    background: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 999px;
}

.sync-history {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.sync-history h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.sync-results {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.sync-result-item {
    flex: 1;
    min-width: 140px;
    padding: 14px 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.sync-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sync-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sync-value.success {
    color: var(--success);
}

.sync-value.error {
    color: var(--danger);
}

.sync-value.pending {
    color: var(--warning);
}

/* ===== COMPANY PROFILE ===== */
.company-profile-container {
    max-width: 960px;
}

.location-card {
    margin-top: 28px;
}

.location-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-item {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    background: var(--bg-subtle);
    transition: all var(--transition);
}

.location-item:hover {
    border-color: var(--border-default);
}

.location-item .form-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.location-item .form-column {
    flex: 1;
    min-width: 140px;
}

.location-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
    margin-left: 8px;
}

.remove-location {
    color: var(--danger);
    border-color: var(--danger);
}

.remove-location:hover {
    background: var(--danger-bg);
}

.empty-state-text {
    color: var(--text-muted);
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}

.sync-indicator {
    color: var(--primary);
    font-size: 13px;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-surface);
    margin: 10vh auto;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    width: 90%;
    max-width: 480px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== COMPLIANCE PAGE HELPERS ===== */
.compliance-container {
    max-width: 100%;
    min-width: 0;
}

.compliance-drill-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    background: var(--primary-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.compliance-drill-banner .drill-label {
    font-size: 14px;
    color: var(--text-muted);
}

.compliance-drill-banner strong {
    color: var(--text-primary);
}

.compliance-drill-banner .btn-link {
    margin-left: auto;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.list-view-content {
    margin-top: 0;
}

.compliance-list {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: visible;
    box-shadow: var(--shadow-sm);
}

.compliance-list .compliance-table {
    margin-top: 0;
}

.compliance-table .item-name {
    color: var(--text-primary);
}
.item-name-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .company-overview,
    .compliance-summary,
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 240px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .content-area {
        padding: 20px 24px 32px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    .hamburger-btn {
        display: block;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 260px;
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
        z-index: 1500;
    }
    .sidebar-overlay-visible {
        z-index: 1450;
    }
    .main-content {
        margin-left: 0;
    }
    .content-area {
        padding: 16px 12px 28px;
    }
    .top-header {
        padding: 0 12px;
    }
    .header-left {
        display: flex;
        align-items: center;
    }
    .header-left h2 {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .user-name {
        display: none;
    }
    .user-profile-trigger > span[style] {
        display: none !important;
    }
    .tools-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex-wrap: wrap;
    }
    .calendar-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .item-date {
        flex-direction: row;
        width: auto;
        margin-bottom: 12px;
        gap: 8px;
    }
    .item-status {
        margin-left: 0;
        margin-top: 12px;
        align-items: flex-start;
    }
    .integration-cards {
        grid-template-columns: 1fr;
    }
    .impact-list {
        grid-template-columns: 1fr;
    }
    .integration-provider-detail {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .sync-results {
        flex-direction: column;
    }
    .summary-stats {
        flex-wrap: wrap;
    }
    .stat-box {
        min-width: calc(50% - 8px);
    }
    .ai-chat-widget {
        bottom: 12px;
        right: 12px;
    }
    .ai-chat-widget.chat-mobile-open {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 1400;
    }
    .ai-chat-widget.chat-mobile-open .ai-chat-toggle {
        display: none;
    }
    .ai-chat-widget.chat-mobile-open .ai-chat-panel {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        margin-bottom: 0;
        border-radius: 0;
        border: none;
    }
    .ai-chat-widget.chat-mobile-open .ai-chat-messages {
        max-height: none;
        flex: 1;
    }
    .ai-chat-widget.chat-mobile-open .ai-chat-input-wrap {
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .ai-chat-input {
        font-size: 16px;
    }
}

/* ===== KB link (used in templates) ===== */
.kb-link {
    margin-left: 6px;
    color: var(--primary);
    opacity: 0.9;
}
.kb-link:hover {
    opacity: 1;
    color: var(--primary-hover);
}

.kb-action {
    color: var(--primary);
    border-color: var(--primary);
}
.kb-action:hover {
    background: var(--primary-muted);
}

/* ===== Dropdown (Compliance page) ===== */
.btn-group {
    position: relative;
    display: inline-block;
}
.dropdown-toggle {
    cursor: pointer;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: var(--bg-surface);
    min-width: 240px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    padding: 6px;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: block;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.dropdown-item:hover {
    background: var(--bg-subtle);
}
.dropdown-item.disabled {
    color: var(--text-placeholder);
    cursor: not-allowed;
}
.dropdown-item.disabled:hover {
    background: transparent;
}

/* ===== Knowledge base tooltip / modal ===== */
.kb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}
.kb-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.kb-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}
.kb-tooltip-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.kb-tooltip-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.kb-tooltip-close:hover {
    color: var(--text-primary);
}
.kb-tooltip-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.kb-tooltip-content h4 {
    margin-top: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.kb-tooltip-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    text-align: right;
}
.kb-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}
.kb-collapsible {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
.kb-collapsible-header {
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--text-primary);
    transition: background var(--transition);
}
.kb-collapsible-header:hover {
    background: var(--border-subtle);
}
.kb-collapsible-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}
.kb-collapsible-content.active {
    padding: 14px;
    max-height: 400px;
}
.kb-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    margin-right: 8px;
    margin-top: 8px;
    color: #fff;
}
.kb-badge.tax {
    background: var(--success);
}
.kb-badge.business {
    background: var(--primary);
}
.kb-badge.regulatory {
    background: var(--danger);
}

/* ===== AI Chat widget ===== */
.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1400;
    font-family: inherit;
}

.ai-chat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35);
}

.ai-chat-toggle i {
    font-size: 20px;
}

.ai-chat-toggle-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .ai-chat-toggle-label {
        display: none;
    }
}

.ai-chat-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 12px;
    width: 440px;
    max-width: calc(100vw - 48px);
    max-height: 620px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.ai-chat-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ai-chat-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.ai-chat-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 28px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-header h3 i {
    color: var(--primary);
}

.ai-chat-subtitle-ticker {
    margin: 6px 0 0 0;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.ai-chat-ticker-track {
    display: flex;
    flex-direction: column;
    animation: ticker-scroll 36s ease-in-out infinite;
}

.ai-chat-ticker-track span {
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes ticker-scroll {
    0%, 3.5%      { transform: translateY(0); }
    7%, 10.5%     { transform: translateY(-20px); }
    14%, 17.5%    { transform: translateY(-40px); }
    21%, 24.5%    { transform: translateY(-60px); }
    28%, 31.5%    { transform: translateY(-80px); }
    35%, 38.5%    { transform: translateY(-100px); }
    42%, 45.5%    { transform: translateY(-120px); }
    49%, 52.5%    { transform: translateY(-140px); }
    56%, 59.5%    { transform: translateY(-160px); }
    63%, 66.5%    { transform: translateY(-180px); }
    70%, 73.5%    { transform: translateY(-200px); }
    77%, 80.5%    { transform: translateY(-220px); }
    90%, 100%     { transform: translateY(0); }
}

/* ── Expand button ── */
.ai-chat-expand {
    position: absolute;
    top: 14px;
    right: 90px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-chat-expand:hover {
    color: var(--text-primary);
    background: var(--border-subtle);
}
/* ── Expanded state: full-height side panel like item-info ── */
.ai-chat-panel.is-expanded {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    margin-bottom: 0;
    width: 440px;
    max-width: 92vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: -4px 0 24px rgba(0,0,0,0.13);
    z-index: 1201;
}
.ai-chat-panel.is-expanded .ai-chat-messages {
    max-height: none;
    flex: 1;
}
.ai-chat-widget.chat-expanded .ai-chat-toggle { display: none; }

.ai-chat-new {
    position: absolute;
    top: 14px;
    right: 52px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-new:hover {
    color: var(--text-primary);
    background: var(--border-subtle);
}

.ai-chat-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-close:hover {
    color: var(--text-primary);
    background: var(--border-subtle);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    min-height: 180px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-chat-msg {
    max-width: 88%;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
}

.ai-chat-msg-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.ai-chat-msg-user .ai-chat-msg-inner {
    background: var(--primary);
    color: #fff;
    border-radius: 14px 4px 14px 14px;
}

.ai-chat-msg-assistant .ai-chat-msg-inner {
    background: var(--bg-subtle, #f1f5f9);
    color: var(--text-primary);
    border-radius: 4px 14px 14px 14px;
}

.ai-chat-msg-inner {
    padding: 8px 12px;
    border-radius: 14px;
}

.ai-chat-msg-inner strong {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.ai-chat-msg-user .ai-chat-msg-inner strong {
    color: rgba(255,255,255,0.7);
}

.ai-chat-msg-inner p {
    margin: 0;
}

.ai-chat-msg-inner p br {
    display: block;
    content: "";
    margin-top: 6px;
}

.ai-chat-input-wrap {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.ai-chat-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    resize: none;
    transition: border-color 0.2s ease;
}

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

.ai-chat-send {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chat-send:hover:not(:disabled) {
    background: var(--primary-hover);
}

.ai-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== DEPARTMENT STATS GRID (Dashboard) ===== */
.dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
}
@media (max-width: 1100px) {
    .dept-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .dept-stats-grid { grid-template-columns: 1fr 1fr; }
}

.dept-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: box-shadow 0.15s, transform 0.15s;
}
.dept-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-primary);
}
.dept-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}
.dept-stat-card-blue   .dept-stat-icon { background: #dbeafe; color: #1d4ed8; }
.dept-stat-card-purple .dept-stat-icon { background: #ede9fe; color: #7c3aed; }
.dept-stat-card-green  .dept-stat-icon { background: #d1fae5; color: #059669; }
.dept-stat-card-orange .dept-stat-icon { background: #fef3c7; color: #d97706; }
.dept-stat-card-red    .dept-stat-icon { background: #fee2e2; color: #dc2626; }
.dept-stat-card-teal   .dept-stat-icon { background: #ccfbf1; color: #0d9488; }

.dept-stat-body { flex: 1; min-width: 0; }
.dept-stat-name    { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.dept-stat-numbers { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.dept-stat-rate    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dept-stat-pending { font-size: 12px; color: var(--warning); margin-top: 2px; font-weight: 500; }

/* ===== DEPARTMENT + PRIORITY BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge-dept-tax        { background: #dbeafe; color: #1d4ed8; }
.badge-dept-legal      { background: #ede9fe; color: #7c3aed; }
.badge-dept-hr         { background: #d1fae5; color: #059669; }
.badge-dept-accounting { background: #fef3c7; color: #b45309; }
.badge-dept-security   { background: #fee2e2; color: #dc2626; }
.badge-dept-regulatory { background: #ccfbf1; color: #0d9488; }

.badge-priority-high   { background: #fee2e2; color: #dc2626; }
.badge-priority-medium { background: #fef3c7; color: #d97706; }
.badge-priority-low    { background: #f1f5f9; color: #64748b; }

/* ===== PRIORITY DOT (inline indicator on item name) ===== */
.item-name-row { }
.priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}
.priority-dot-high   { background: #dc2626; }
.priority-dot-medium { background: #d97706; }
.priority-dot-ok     { background: #16a34a; }

/* ===== HIGH PRIORITY SECTION (Dashboard) ===== */
.high-priority-section .compliance-table { margin-top: 0; }

/* ===== COMPLIANCE STALE BANNER ===== */
.compliance-stale-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 12px;
}
.compliance-stale-banner i { color: #d97706; flex-shrink: 0; }

/* ===== DEPRECATED COMPLIANCE ROWS ===== */
.deprecated-row {
    opacity: 0.55;
    background: #f8fafc !important;
}
.deprecated-row td { color: #94a3b8 !important; text-decoration: line-through; }
.deprecated-row .badge-dept,
.deprecated-row .item-description { text-decoration: none; }

/* ===== DEPRECATED BADGE ===== */
.badge-deprecated {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 2px;
}
.status-badge.deprecated-badge {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    text-decoration: none;
}

/* Program hierarchy */
.program-main-step .item-name { padding-left: 24px; }
.program-sub-step .item-name { padding-left: 48px; }
.badge-program {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 4px;
}

/* ===== WINDING DOWN (SUNSET) ===== */
.winding-down-row {
    background: #fffbeb !important;
}
.winding-down-row td { color: #92400e; }
.badge-sunset {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 2px;
}
.status-badge.sunset-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    text-decoration: none;
}
.info-sunset-section {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
}
.info-sunset-section h4 { color: #92400e; }

/* ===== AI REVIEW CHANGES ===== */
.compliance-review-banner {
    display: flex; align-items: center; gap: 12px; padding: 12px 18px;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
    margin-bottom: 16px; font-size: 14px; color: #1e40af;
}
.compliance-review-banner i { font-size: 16px; flex-shrink: 0; }
.compliance-review-banner .review-count { font-weight: 600; }
.compliance-review-banner .review-actions { margin-left: auto; display: flex; gap: 8px; }
.compliance-review-banner .btn-review { padding: 5px 12px; font-size: 12px; border-radius: 6px; border: 1px solid #93c5fd; background: #fff; color: #1e40af; cursor: pointer; font-weight: 500; }
.compliance-review-banner .btn-review:hover { background: #dbeafe; }
.compliance-review-banner .btn-review-accept { background: #1e40af; color: #fff; border-color: #1e40af; }
.compliance-review-banner .btn-review-accept:hover { background: #1e3a8a; }
.compliance-review-banner .btn-review-reject-all { background: #fff; color: #dc2626; border-color: #fca5a5; }
.compliance-review-banner .btn-review-reject-all:hover { background: #fef2f2; }
.needs-review-row { border-left: 3px solid #3b82f6 !important; background: #f0f7ff !important; }
.needs-review-row:hover { background: #e0efff !important; }
.badge-review { background: #dbeafe; color: #1e40af; font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.badge-new-item { background: #dcfce7; color: #166534; font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.review-changes-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.review-changes-table th { text-align: left; padding: 6px 10px; background: #f1f5f9; color: #475569; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.review-changes-table td { padding: 6px 10px; border-top: 1px solid #e2e8f0; vertical-align: top; }
.review-changes-table .old-val { color: #dc2626; text-decoration: line-through; }
.review-changes-table .new-val { color: #16a34a; font-weight: 500; }
.review-actions-bar { display: flex; gap: 8px; margin-top: 12px; }
.review-actions-bar .btn-accept { padding: 6px 14px; font-size: 13px; border-radius: 6px; border: none; background: #16a34a; color: #fff; cursor: pointer; font-weight: 500; }
.review-actions-bar .btn-accept:hover { background: #15803d; }
.review-actions-bar .btn-dismiss { padding: 6px 14px; font-size: 13px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; color: #64748b; cursor: pointer; font-weight: 500; }
.review-actions-bar .btn-dismiss:hover { background: #f1f5f9; }

.btn-review-inline { padding: 3px 10px; font-size: 12px; border-radius: 5px; border: none; cursor: pointer; font-weight: 500; }
.btn-review-accept-one { background: #16a34a; color: #fff; }
.btn-review-accept-one:hover { background: #15803d; }
.btn-review-reject-one { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.btn-review-reject-one:hover { background: #fef2f2; }

/* ===== SETTINGS PAGE ===== */
.settings-page { max-width: 680px; }
.settings-card { margin-bottom: 0; }
.settings-card .card-body { padding: 20px 24px 24px; }
.settings-card .card-header { display: block; border-bottom: 1px solid var(--border-subtle); padding-bottom: 14px; margin-bottom: 0; }
.settings-card .card-header h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 6px; }
.settings-card .card-header h3 i { margin-right: 8px; color: var(--primary); }
.settings-card .card-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.api-key-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.api-key-set { background: var(--success-bg); color: var(--success); }
.api-key-missing { background: var(--warning-bg); color: var(--warning); }
.form-control-narrow { max-width: 160px; }
.toggle-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-primary); font-weight: 500; user-select: none; }
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider { position: relative; width: 40px; height: 22px; background: var(--border-default); border-radius: 11px; transition: background 0.2s; flex-shrink: 0; }
.toggle-slider::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left 0.2s; }
.toggle-label input[type="checkbox"]:checked + .toggle-slider { background: var(--primary); }
.toggle-label input[type="checkbox"]:checked + .toggle-slider::after { left: 21px; }
.last-run-note { margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.last-run-note i { margin-right: 5px; }
.settings-run-result { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.run-ok { background: var(--success-bg); color: var(--success); }
.run-err { background: var(--danger-bg); color: var(--danger); }
.settings-toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,0.15); animation: toast-in 0.2s ease; }
.toast-ok { background: var(--success); color: #fff; }
.toast-err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== AI ITEM INFO PANEL ===== */
.info-btn { background: none; border: none; cursor: pointer; color: var(--primary); padding: 0 4px; font-size: 13px; opacity: 0.7; transition: opacity 0.15s; vertical-align: middle; }
.info-btn:hover { opacity: 1; }
.item-info-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 1200; }
.item-info-backdrop.is-open { display: block; }
.item-info-panel { position: fixed; top: 0; right: -420px; width: 440px; max-width: 92vw; height: 100vh; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,0.13); z-index: 1201; display: flex; flex-direction: column; transition: right 0.25s ease; }
.item-info-panel.is-open { right: 0; }
.item-info-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border-subtle); gap: 10px; }
.item-info-minimize { background: var(--bg-subtle); border: none; width: 30px; height: 30px; border-radius: var(--radius-md); cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.item-info-minimize:hover { color: var(--text-primary); background: var(--border-subtle); }
.item-info-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0; flex-shrink: 0; }
.item-info-close:hover { color: var(--text-primary); }
.item-info-unified-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }
#item-info-body { padding: 18px 20px; overflow: visible; }
.item-info-loading { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 14px; }
.info-section { margin-bottom: 18px; }
.info-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 8px; font-weight: 600; }
.info-section h4 i { margin-right: 5px; }
.info-section p { margin: 0; font-size: 14px; color: var(--text-primary); line-height: 1.55; }
.info-section ul, .info-section ol { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-primary); line-height: 1.65; }
.info-section li { margin-bottom: 4px; }
.info-tip { background: var(--warning-bg, #fffbeb); border-left: 3px solid var(--warning, #f59e0b); padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--text-primary); }
.info-tip i { color: var(--warning, #f59e0b); margin-right: 6px; }
/* ── Chat section inside unified scroll ── */
.item-info-chat-section { padding: 0; }
.item-info-chat-heading { padding: 10px 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: var(--bg-app, #f8fafc); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.item-info-chat-heading i { margin-right: 5px; color: var(--primary); }
.item-info-chat-msgs { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overflow: visible !important; }
.iic-msg { font-size: 13px; line-height: 1.5; display: flex; }
.iic-msg-user { justify-content: flex-end; }
.iic-bubble { padding: 8px 12px; border-radius: 14px; max-width: 88%; }
.iic-msg-assistant .iic-bubble { background: var(--bg-subtle, #f1f5f9); color: var(--text-primary); border-radius: 4px 14px 14px 14px; }
.iic-msg-user .iic-bubble { background: var(--primary); color: #fff; border-radius: 14px 4px 14px 14px; }
.iic-thinking { opacity: .6; font-style: italic; }
.iic-bubble ul { margin: 4px 0; padding-left: 16px; }
.iic-bubble li { margin-bottom: 2px; }
.iic-bubble code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.iic-bubble a { color: var(--primary); text-decoration: underline; }
/* ── Sticky input at bottom ── */
.item-info-chat-input-wrap { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border-subtle); align-items: flex-end; flex-shrink: 0; }
.item-info-chat-textarea { flex: 1; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; resize: none; outline: none; line-height: 1.4; min-height: 34px; max-height: 80px; }
.item-info-chat-textarea:focus { border-color: var(--primary); }
.item-info-chat-send-btn { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 13px; cursor: pointer; font-size: 14px; flex-shrink: 0; transition: opacity .15s; }
.item-info-chat-send-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== Agent credentials card (in AI chat) ===== */
.agent-creds-card { background: var(--bg-subtle, #f8fafc); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px 16px; margin-top: 10px; }
.agent-creds-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin: 0 0 10px; }
.agent-creds-input { display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 6px; font-size: 13px; font-family: inherit; color: var(--text-primary); background: #fff; margin-bottom: 8px; outline: none; }
.agent-creds-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light, rgba(79,70,229,.12)); }
.agent-creds-note { font-size: 11px; color: var(--text-muted); margin: 4px 0 10px; }
.agent-creds-note i { margin-right: 4px; }
.agent-launch-btn { width: 100%; }
.agent-creds-wrap p { margin: 0 0 6px; }

/* ===== COMPLETE WITH AGENT — slide-in panel ===== */
.agent-panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 1300;
}
.agent-panel-backdrop.is-open { display: block; }

.agent-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 560px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    box-shadow: -6px 0 32px rgba(0, 0, 0, 0.14);
    z-index: 1301;
    display: flex;
    flex-direction: column;
    transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.agent-panel.is-open { right: 0; }

/* Header */
.agent-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    flex-shrink: 0;
}
.agent-panel-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--primary);
    opacity: 0.85;
}
.agent-panel-label i { font-size: 12px; }
.agent-panel-title {
    margin: 5px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.agent-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    margin-top: -2px;
}
.agent-panel-close:hover { color: var(--text-primary); }

/* Body */
.agent-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

/* Footer */
.agent-panel-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-subtle);
}

/* Stages */
.agent-stage { display: flex; flex-direction: column; flex: 1; }

/* Loading / Running centered layout */
.agent-stage-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    text-align: center;
}
.agent-spinner-wrap { margin-bottom: 20px; }
.agent-big-icon {
    font-size: 52px;
    color: var(--primary);
}
@keyframes agent-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.55; transform: scale(0.92); }
}
.pulsing { animation: agent-pulse 1.8s ease-in-out infinite; }
.agent-stage-label {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.agent-stage-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    max-width: 340px;
}

/* Plan stage — sections */
.agent-section { margin-bottom: 24px; }
.agent-section:last-child { margin-bottom: 0; }
.agent-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.agent-section-label i { color: var(--primary); }

.agent-plan-text {
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.65;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.agent-site-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 12px;
}

.agent-field-group { margin-bottom: 12px; }
.agent-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.agent-field-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.agent-field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.agent-privacy-note {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 8px 0 0;
}
.agent-privacy-note i { margin-right: 4px; color: var(--success); }

/* Footer elements */
.agent-launch-full-btn {
    width: 100%;
    padding: 11px 16px;
    font-size: 15px;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agent-footer-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0 0;
    text-align: center;
}
.agent-footer-note i { margin-right: 4px; }

/* Running stage log */
.agent-log {
    margin-top: 18px;
    background: #0f172a;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    max-height: 180px;
    overflow-y: auto;
    width: 100%;
    text-align: left;
}
.agent-log-line {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #86efac;
    margin: 0 0 4px;
    line-height: 1.4;
}
.agent-log-line:last-child { margin-bottom: 0; }

/* Result stage */
.agent-result-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 50px 24px 24px;
    text-align: center;
}
.agent-result-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
}
.agent-result-icon.success { color: var(--success); }
.agent-result-icon.error   { color: var(--danger); }
.agent-result-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}
.agent-result-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 440px;
}
.ai-chat-thinking { opacity: 0.7; }

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #f1f5f9;
    z-index: 10000;
    padding: 20px 24px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
}
.cookie-banner-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner-content p {
    flex: 1;
    min-width: 200px;
    margin: 0;
    line-height: 1.5;
    color: #cbd5e1;
}
.cookie-banner-content p a {
    color: #5eead4;
    text-decoration: underline;
}
.cookie-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.cookie-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.cookie-btn-accept {
    background: #16a34a;
    color: #fff;
}
.cookie-btn-accept:hover {
    background: #15803d;
}
.cookie-btn-reject {
    background: #fff;
    color: #1e293b;
    border: 1px solid #94a3b8;
}
.cookie-btn-reject:hover {
    background: #f1f5f9;
}
.cookie-btn-customize {
    background: none;
    color: #94a3b8;
    padding: 10px 12px;
    text-decoration: underline;
}
.cookie-btn-customize:hover {
    color: #e2e8f0;
}
.cookie-customize-panel {
    display: none;
    max-width: 1100px;
    margin: 16px auto 0;
    padding-top: 16px;
    border-top: 1px solid #334155;
}
.cookie-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}
.cookie-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #f1f5f9;
    cursor: pointer;
}
.cookie-toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0d9488;
}
.cookie-toggle-desc {
    font-size: 13px;
    color: #64748b;
}
.cookie-customize-panel .cookie-btn-accept {
    margin-top: 12px;
}
@media (max-width: 640px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner-actions {
        flex-direction: column;
    }
    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-app) 0%, var(--border-subtle) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: var(--auth-card-max-width, 400px);
    width: 100%;
}
.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}
.auth-card .form-group {
    margin-bottom: 14px;
}
.auth-card label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
    margin-bottom: 6px;
}
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
}
.auth-card input:focus,
.auth-card select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.auth-card .btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.auth-card .btn-primary {
    background: var(--primary);
    color: #fff;
}
.auth-card .btn-primary:hover {
    background: var(--primary-hover);
}
.auth-card .btn-secondary {
    background: var(--bg-subtle);
    color: #334155;
    border: 1px solid var(--border-subtle);
}
.auth-card .btn-secondary:hover {
    background: var(--border-subtle);
}
.auth-card .links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}
.auth-card .links a {
    color: var(--primary);
    text-decoration: none;
}
.auth-card .links a:hover {
    text-decoration: underline;
}
.auth-card .alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.auth-card .alert-error {
    background: var(--danger-bg);
    color: #b91c1c;
}
.auth-card .alert-success {
    background: var(--success-bg);
    color: #065f46;
}
.auth-card .alert-warning {
    background: var(--warning-bg);
    color: #92400e;
}
.auth-card .alert-info {
    background: #dbeafe;
    color: #1e40af;
}
.auth-card .note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}
.org-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    background: #f0fdfa;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid var(--primary-light);
    margin-bottom: 20px;
    text-align: center;
}
.org-badge {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: #f0fdfa;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--primary-light);
    margin-bottom: 20px;
    text-align: center;
}
.auth-progress {
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}
.auth-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.pw-checks {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}
.pw-check {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pw-check i {
    font-size: 11px;
    color: var(--border-default);
}
.pw-check.met {
    color: var(--success);
}
.pw-check.met i {
    color: var(--success);
}
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 16px;
}
.auth-back:hover {
    color: var(--primary);
}
.pulse-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f59e0b;
    animation: pulse-anim 1.5s ease-in-out infinite;
}
@keyframes pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}
.auth-card .form-row {
    display: flex;
    gap: 12px;
}
.auth-card .form-row > .form-group {
    flex: 1;
}

/* Google OAuth button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: #fff;
    color: #334155;
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-google:hover {
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-decoration: none;
}
.btn-google svg {
    flex-shrink: 0;
}

/* Auth divider ("or") */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle, #e2e8f0);
}
.auth-divider span {
    padding: 0 12px;
}

/* ===== FEEDBACK WIDGET ===== */
.feedback-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    cursor: pointer;
    text-decoration: none;
}
.feedback-link:hover { color: var(--primary, #14b8a6); }
.feedback-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(4px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback-modal {
    background: var(--bg-surface, #fff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.12));
    padding: 24px;
    width: 100%;
    max-width: 400px;
}
.feedback-modal h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
}
.feedback-type-group {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.feedback-type-group input[type="radio"] { display: none; }
.feedback-type-group label {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-secondary, #555);
    transition: all 0.15s;
}
.feedback-type-group input:checked + label {
    background: var(--primary, #14b8a6);
    color: #fff;
    border-color: var(--primary, #14b8a6);
}
.feedback-modal textarea {
    width: 100%;
    min-height: 90px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.feedback-modal textarea:focus {
    outline: none;
    border-color: var(--primary, #14b8a6);
    box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}
.feedback-screenshot-row { margin-top: 10px; }
.feedback-screenshot-label {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 4px 0;
}
.feedback-screenshot-label:hover { color: var(--primary, #14b8a6); }
.feedback-preview-wrap {
    position: relative;
    display: inline-block;
    margin-top: 6px;
}
.feedback-preview-wrap img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e2e8f0);
}
.feedback-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}
.feedback-actions button {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}
.feedback-actions .feedback-cancel {
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-secondary, #555);
}
.feedback-actions .feedback-submit {
    background: var(--primary, #14b8a6);
    color: #fff;
}
.feedback-actions .feedback-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@media (max-width: 768px) {
    .feedback-modal { max-width: 95%; margin: 0 10px; }
}

/* ===== LANDING PAGE ===== */
body.landing {
    min-height: 100vh;
    background: #fff;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-primary);
}
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    max-width: 1200px;
    margin: 0 auto;
}
.landing-nav .links {
    display: flex;
    gap: 20px;
    align-items: center;
}
.landing-nav .links a {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    font-size: 15px;
}
.landing-nav .links a:hover {
    color: var(--primary);
}
.landing-nav .links .nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
}
.landing-nav .links .nav-cta:hover {
    background: var(--primary-hover);
}
.landing-hero {
    text-align: center;
    padding: 80px 24px 0;
    max-width: 1100px;
    margin: 0 auto;
}
.landing-hero h1 {
    font-size: 3.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}
.landing-hero h1 .hero-accent {
    color: var(--primary);
}
.landing-hero .hero-sub {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.65;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}
.landing-cta {
    display: inline-flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.landing-cta .btn {
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.landing-cta .btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}
.landing-cta .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
}
.landing-cta .btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.landing-cta .btn-secondary:hover {
    background: rgba(13, 148, 136, 0.06);
}
.landing-hero-icons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 32px 48px;
    margin-top: 64px;
    padding: 48px 0 56px;
}
.landing-hero-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.landing-hero-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #f0fdfa;
    border: 1px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.landing-hero-icon-circle i {
    font-size: 1.35rem;
    color: var(--primary);
}
.landing-stats {
    background: var(--text-primary);
}
.landing-stats-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.landing-stats .stat-item {
    text-align: center;
    flex: 1;
}
.landing-stats .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-accent);
    letter-spacing: -0.02em;
}
.landing-stats .stat-label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 6px;
    font-weight: 500;
}
.stat-divider {
    width: 1px;
    height: 52px;
    background: #334155;
    flex-shrink: 0;
}
.landing-eyebrow {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    margin-bottom: 14px;
}
.section-heading {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}
.section-sub {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 64px;
    line-height: 1.65;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.landing-how {
    max-width: 1100px;
    margin: 0 auto;
    padding: 96px 24px 80px;
}
.landing-steps {
    display: flex;
    flex-direction: column;
    gap: 96px;
}
.landing-step {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: center;
}
.landing-step.reverse {
    direction: rtl;
}
.landing-step.reverse > * {
    direction: ltr;
}
.step-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.step-text h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.step-text > p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 22px;
}
.step-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.step-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    background: #f0fdfa;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--primary-light);
}
.mockup {
    border-radius: 12px;
    border: 1px solid #d1d5db;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.04);
    background: #fff;
}
.mockup-chrome {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border-subtle);
}
.mockup-chrome .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.mockup-chrome .dot.r { background: #ef4444; }
.mockup-chrome .dot.y { background: #f59e0b; }
.mockup-chrome .dot.g { background: #22c55e; }
.mockup-tab {
    margin-left: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}
.mockup-body {
    padding: 18px;
}
.mockup-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.mockup-int-card {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
}
.mockup-int-card.synced {
    border-color: #a7f3d0;
    background: #f0fdf4;
    color: #166534;
}
.mockup-int-card.synced i { color: #22c55e; }
.mockup-int-card i {
    font-size: 0.75rem;
    color: #94a3b8;
}
.mockup-sync-label {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 400;
    opacity: 0.7;
}
.mockup-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 14px 0;
}
.mockup-extracted-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 10px;
}
.mockup-field {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--bg-app);
}
.mockup-field span:first-child {
    color: #94a3b8;
    font-weight: 500;
}
.mockup-field span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}
.mockup-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--bg-app);
}
.mockup-item i {
    font-size: 0.85rem;
    flex-shrink: 0;
}
.mockup-item.done i { color: #22c55e; }
.mockup-item.pending i { color: #f59e0b; }
.mockup-item.na i { color: #cbd5e1; }
.mockup-item span:first-of-type {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}
.mockup-item.done span:first-of-type { color: #94a3b8; }
.mockup-due {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 500;
}
.mockup-progress {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    margin-top: 14px;
    overflow: hidden;
}
.mockup-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-accent));
    border-radius: 3px;
    width: 0;
    transition: width 1.8s ease;
}
.mockup-progress-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
    font-weight: 500;
}
.mockup-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mockup-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.78rem;
    line-height: 1.55;
}
.mockup-msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.mockup-msg.ai {
    background: var(--bg-subtle);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.landing-features {
    background: var(--bg-app);
    padding: 96px 24px;
}
.landing-features-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 820px;
    margin: 0 auto;
}
.feature-card {
    padding: 32px 24px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.06);
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f0fdfa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.feature-icon i {
    font-size: 1.2rem;
    color: var(--primary);
}
.feature-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.feature-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.landing-bottom-cta {
    background: var(--text-primary);
    padding: 96px 24px;
    text-align: center;
}
.landing-bottom-cta h2 {
    color: #fff;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}
.landing-bottom-cta p {
    color: #94a3b8;
    font-size: 1.15rem;
    margin-bottom: 36px;
}
.btn-cta-primary {
    background: var(--primary);
    color: #fff;
    padding: 16px 36px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 17px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}
.btn-cta-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}
.landing-footer-v2 {
    background: var(--text-primary);
    border-top: 1px solid #1e293b;
}
.landing-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-logo {
    height: 36px;
    border-radius: 8px;
    mix-blend-mode: screen;
}
.footer-brand-name {
    color: #e2e8f0;
    font-size: 1.05rem;
    font-weight: 700;
    margin-left: 12px;
}
.footer-brand-top {
    display: flex;
    align-items: center;
}
.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}
.footer-links {
    display: flex;
    gap: 28px;
}
.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}
.footer-links a:hover {
    color: #fff;
}
.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
    border-top: 1px solid #1e293b;
}
.footer-bottom p {
    color: #475569;
    font-size: 0.78rem;
    text-align: center;
}
.landing-alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.landing-alert-error {
    background: var(--danger-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 900px) {
    .landing-hero h1 { font-size: 2.5rem; }
    .landing-step { grid-template-columns: 1fr; gap: 36px; }
    .landing-step.reverse { direction: ltr; }
    .section-heading { font-size: 1.85rem; }
}
@media (max-width: 640px) {
    .landing-nav { padding: 16px 16px; }
    .landing-nav .landing-logo-img { max-height: 108px; }
    .landing-nav .links { gap: 12px; flex-shrink: 0; white-space: nowrap; }
    .landing-nav .links a { font-size: 14px; }
    .landing-nav .links .nav-cta { padding: 8px 16px; }
    .nav-desktop { display: none; }
    .landing-hero h1 { font-size: 2rem; }
    .landing-hero-icons { flex-wrap: wrap; gap: 20px; }
    .landing-hero-icon-circle { width: 48px; height: 48px; border-radius: 12px; }
    .landing-hero-icon-circle i { font-size: 1.1rem; }
    .landing-stats-inner { flex-wrap: wrap; gap: 20px; padding: 36px 24px; }
    .stat-divider { display: none; }
    .landing-stats .stat-item { min-width: 42%; }
    .landing-stats .stat-number { font-size: 2rem; }
    .features-grid { grid-template-columns: 1fr; }
    .landing-footer-inner { flex-direction: column; text-align: center; gap: 24px; }
    .landing-bottom-cta h2 { font-size: 1.75rem; }
}

/* ===== DEVELOPER DOCS PORTAL ===== */

/* Layout: sidebar + main content */
.dev-docs-page .landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border-subtle);
}

.dev-layout {
    display: flex;
    max-width: 100%;
    min-height: calc(100vh - 72px);
}

.dev-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    border-right: 1px solid var(--border-subtle);
    background: #fafbfc;
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
}

.dev-sidebar::-webkit-scrollbar { width: 4px; }
.dev-sidebar::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }

.dev-sidebar-inner {
    padding: 28px 0 40px;
}

.dev-sidebar-section {
    margin-bottom: 8px;
    padding: 0 20px;
}

.dev-sidebar-section h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 12px 0 4px;
}

.dev-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.15s;
    text-decoration: none;
}

.dev-nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-subtle);
}

.dev-nav-link.active {
    color: var(--primary);
    background: var(--primary-muted);
    font-weight: 600;
}

.dev-method-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dev-method-dot.dev-method-get { background: #059669; }
.dev-method-dot.dev-method-post { background: #2563eb; }

/* Main content area */
.dev-main {
    flex: 1;
    min-width: 0;
    max-width: 880px;
    padding: 0 48px 80px;
    margin: 0 auto;
}

/* Hero */
.dev-hero {
    padding: 64px 0 56px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 48px;
}

.dev-hero-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 16px;
}

.dev-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.dev-hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 560px;
    margin-bottom: 32px;
}

.dev-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.dev-hero-base-url {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    border-radius: 8px;
    padding: 10px 16px;
}

.dev-hero-base-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.dev-hero-base-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #e2e8f0;
    background: none;
    padding: 0;
}

/* Buttons */
.dev-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.dev-btn-primary {
    background: var(--primary);
    color: #fff;
}

.dev-btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.dev-btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.dev-btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.dev-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
}

.dev-btn-ghost:hover {
    color: var(--primary);
    background: var(--primary-muted);
}

/* Sections */
.dev-section {
    padding: 48px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.dev-section h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.dev-section p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 20px;
}

.dev-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 28px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dev-section code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #be185d;
}

/* Section divider */
.dev-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px 0 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.dev-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Badges */
.dev-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.dev-badge-free {
    background: #d1fae5;
    color: #065f46;
}

.dev-badge-paid {
    background: #dbeafe;
    color: #1e40af;
}

/* Endpoint blocks */
.dev-endpoint {
    padding: 40px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.dev-endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.dev-method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
    min-width: 52px;
    text-align: center;
}

.dev-method-get {
    background: #d1fae5;
    color: #065f46;
}

.dev-method-post {
    background: #dbeafe;
    color: #1e40af;
}

.dev-endpoint-path {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    padding: 0;
}

.dev-path-param {
    color: var(--primary);
    font-style: italic;
}

.dev-endpoint p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 20px;
}

/* Parameter tables */
.dev-params-table {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.dev-param {
    display: grid;
    grid-template-columns: 240px 1fr;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    gap: 16px;
}

.dev-param:last-child {
    border-bottom: none;
}

.dev-param:hover {
    background: #fafbfc;
}

.dev-param-name {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.dev-param-name code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    padding: 0;
}

.dev-param-type {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 3px;
}

.dev-param-required {
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dev-param-default {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 3px;
}

.dev-param-default::before {
    content: 'default: ';
}

.dev-param-desc {
    color: var(--text-secondary);
    line-height: 1.5;
}

.dev-param-desc code {
    font-size: 12px;
    padding: 1px 5px;
}

/* Code blocks */
.dev-code-block {
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    font-size: 13px;
}

.dev-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

.dev-code-block pre {
    padding: 16px 20px;
    margin: 0;
    overflow-x: auto;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.dev-code-block pre::-webkit-scrollbar { height: 4px; }
.dev-code-block pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.dev-code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #e2e8f0;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Syntax highlighting (inline classes) */
.hl-kw { color: #c084fc; }
.hl-str { color: #86efac; }
.hl-num { color: #fbbf24; }
.hl-bool { color: #fb923c; }
.hl-key { color: #7dd3fc; }
.hl-comment { color: #64748b; font-style: italic; }

/* Response blocks */
.dev-response-block {
    border-left: 3px solid var(--primary);
}

.dev-status-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.dev-status-err {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.1);
}

/* Copy button */
.dev-copy-btn {
    background: none;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
}

.dev-hero-base-url .dev-copy-btn {
    border-color: #475569;
}

.dev-copy-btn:hover {
    color: #e2e8f0;
    border-color: #64748b;
    background: rgba(255,255,255,0.05);
}

/* Tabs */
.dev-code-tabs {
    margin-bottom: 16px;
}

.dev-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-subtle);
    margin-bottom: 0;
}

.dev-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    font-family: inherit;
}

.dev-tab:hover {
    color: var(--text-primary);
}

.dev-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.dev-tab-panel {
    display: none;
}

.dev-tab-panel.active {
    display: block;
}

/* Quick start steps */
.dev-steps {
    counter-reset: none;
}

.dev-step {
    display: flex;
    gap: 20px;
    margin-bottom: 36px;
}

.dev-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.dev-step-content {
    flex: 1;
    min-width: 0;
}

.dev-step-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dev-step-content p {
    font-size: 14.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Errors table */
.dev-errors-table {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.dev-error-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    color: var(--text-secondary);
}

.dev-error-row:last-child { border-bottom: none; }
.dev-error-row:hover { background: #fafbfc; }

.dev-error-row .dev-status-code {
    min-width: 44px;
    text-align: center;
    flex-shrink: 0;
}

/* API Explorer */
.dev-explorer {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dev-explorer-bar {
    display: flex;
    gap: 0;
    padding: 12px 16px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border-subtle);
}

.dev-explorer-method {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-right: none;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    outline: none;
}

.dev-explorer-path {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 8px 14px;
    border: 1px solid var(--border-default);
    border-right: none;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.dev-explorer-path:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.dev-explorer-send {
    border-radius: 0 8px 8px 0;
    padding: 8px 20px;
}

.dev-explorer-key-row,
.dev-explorer-body-row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
}

.dev-explorer-key-row label,
.dev-explorer-body-row label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    min-width: 130px;
    padding-top: 8px;
    flex-shrink: 0;
}

.dev-explorer-key-input {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.dev-explorer-key-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.dev-explorer-body {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    min-width: 0;
    line-height: 1.5;
}

.dev-explorer-body:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.dev-explorer-result {
    background: #0f172a;
}

.dev-explorer-result pre {
    padding: 16px 20px;
    margin: 0;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.dev-explorer-result code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #e2e8f0;
    white-space: pre;
}

.dev-explorer-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #64748b;
}

/* Pricing */
.dev-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.dev-pricing-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.dev-pricing-popular {
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.12);
}

.dev-pricing-popular-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.dev-pricing-tier {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dev-pricing-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.dev-pricing-price span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.dev-pricing-period {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.dev-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}

.dev-pricing-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.dev-pricing-features li i.fa-check {
    color: var(--primary);
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.dev-pricing-features li i.fa-times {
    color: var(--text-muted);
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.dev-pricing-muted {
    opacity: 0.5;
}

.dev-pricing-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* ── Developer Docs Responsive ─────────────────────────────────── */
@media (max-width: 1100px) {
    .dev-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .dev-sidebar {
        display: none;
    }

    .dev-sidebar.dev-sidebar-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 200;
        height: 100vh;
        width: 280px;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }

    .dev-main {
        padding: 0 24px 60px;
    }

    .dev-hero h1 {
        font-size: 2rem;
    }

    .dev-param {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .dev-explorer-bar {
        flex-wrap: wrap;
    }

    .dev-explorer-method {
        border-radius: 8px;
        border-right: 1px solid var(--border-default);
        margin-bottom: 8px;
    }

    .dev-explorer-path {
        border-radius: 8px 0 0 8px;
        border-right: none;
        width: 100%;
    }

    .dev-explorer-send {
        border-radius: 0 8px 8px 0;
    }

    .dev-explorer-key-row,
    .dev-explorer-body-row {
        flex-direction: column;
        gap: 6px;
    }

    .dev-explorer-key-row label,
    .dev-explorer-body-row label {
        min-width: auto;
        padding-top: 0;
    }
}

@media (max-width: 640px) {
    .dev-main {
        padding: 0 16px 40px;
    }

    .dev-hero {
        padding: 40px 0 36px;
    }

    .dev-hero h1 {
        font-size: 1.7rem;
    }

    .dev-hero-sub {
        font-size: 1rem;
    }

    .dev-hero-actions {
        flex-direction: column;
    }

    .dev-hero-base-url {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dev-section {
        padding: 32px 0;
    }

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

    .dev-endpoint-header {
        gap: 8px;
    }

    .dev-code-block pre {
        padding: 12px 14px;
        font-size: 12px;
    }

    .dev-code-block code {
        font-size: 12px;
    }

    .dev-step {
        flex-direction: column;
        gap: 12px;
    }

    .dev-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ===== PRICING PAGE ===== */

.pricing-hero {
    text-align: center;
    padding: 80px 24px 0;
    max-width: 720px;
    margin: 0 auto;
}
.pricing-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.12;
    margin-bottom: 20px;
    letter-spacing: -0.025em;
}
.pricing-hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 540px;
    margin: 0 auto;
}

/* Platform card */
.pricing-platform {
    max-width: 680px;
    margin: 56px auto 0;
    padding: 0 24px;
}
.pricing-platform-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}
.pricing-platform-header {
    padding: 36px 40px 32px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}
.pricing-platform-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.pricing-platform-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.pricing-beta-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: #f0fdfa;
    border: 1px solid var(--primary-light);
    padding: 5px 12px;
    border-radius: 20px;
}
.pricing-amount {
    text-align: right;
    flex-shrink: 0;
}
.pricing-dollar {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}
.pricing-cents {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    vertical-align: top;
    position: relative;
    top: 4px;
}
.pricing-period {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Included features list */
.pricing-platform-body {
    padding: 32px 40px;
}
.pricing-includes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.pricing-include-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.pricing-include-item i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f0fdfa;
    color: var(--primary);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.pricing-include-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pricing-include-item strong {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}
.pricing-include-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Platform card footer */
.pricing-platform-footer {
    padding: 24px 40px 32px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 16px;
}
.pricing-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 32px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}
.pricing-cta-btn:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}
.pricing-cta-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Usage-based section */
.pricing-usage {
    max-width: 1000px;
    margin: 0 auto;
    padding: 96px 24px 0;
}
.pricing-usage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}
.pricing-usage-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s, transform 0.25s;
}
.pricing-usage-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.pricing-usage-card-header {
    padding: 32px 28px 24px;
    border-bottom: 1px solid var(--border-subtle);
}
.pricing-usage-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f0fdfa;
    border: 1px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.pricing-usage-icon i {
    font-size: 1.1rem;
    color: var(--primary);
}
.pricing-usage-card-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.pricing-usage-card-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.pricing-usage-card-body {
    padding: 0 28px 28px;
    flex: 1;
}

/* Pricing table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}
.pricing-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 0 10px;
    border-bottom: 1px solid var(--border-subtle);
}
.pricing-table td {
    padding: 14px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.pricing-table tr:last-child td {
    border-bottom: none;
}
.pricing-table td:first-child {
    width: 70px;
}
.pricing-table td:nth-child(2) {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Tier labels */
.pricing-tier-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
}
.pricing-tier-free {
    background: #f0fdfa;
    color: var(--primary);
}
.pricing-tier-paid {
    background: #f0f9ff;
    color: #0284c7;
}
.pricing-tier-simple {
    background: #f0fdf4;
    color: #16a34a;
}
.pricing-tier-moderate {
    background: #fffbeb;
    color: #d97706;
}
.pricing-tier-complex {
    background: #fef2f2;
    color: #dc2626;
}
.pricing-usage-note {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* Calculator */
.pricing-calculator {
    max-width: 1000px;
    margin: 0 auto;
    padding: 96px 24px 0;
}
.pricing-calculator-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 56px;
    align-items: start;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 44px 48px;
    box-shadow: var(--shadow-sm);
}
.pricing-calculator-left h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.pricing-calculator-left p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.pricing-calc-row {
    margin-bottom: 24px;
}
.pricing-calc-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.pricing-calc-slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pricing-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.pricing-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s;
}
.pricing-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.pricing-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.pricing-calc-value {
    min-width: 48px;
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.pricing-calc-result {
    background: var(--bg-subtle);
    border-radius: 12px;
    padding: 24px;
    margin-top: 8px;
}
.pricing-calc-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pricing-calc-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.pricing-calc-line span:last-child {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}
.pricing-calc-total {
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid var(--border-default);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.pricing-calc-total span:last-child {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}
.pricing-calc-beta-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 14px;
    background: #f0fdfa;
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
}
.pricing-calc-beta-note i {
    font-size: 0.85rem;
}

/* FAQ */
.pricing-faq {
    max-width: 680px;
    margin: 0 auto;
    padding: 96px 24px 0;
}
.pricing-faq-list {
    margin-top: 48px;
}
.pricing-faq-item {
    border-bottom: 1px solid var(--border-subtle);
}
.pricing-faq-item:first-child {
    border-top: 1px solid var(--border-subtle);
}
.pricing-faq-q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    gap: 16px;
}
.pricing-faq-q span {
    flex: 1;
}
.pricing-faq-q i {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.25s;
    flex-shrink: 0;
}
.pricing-faq-item.open .pricing-faq-q i {
    transform: rotate(180deg);
}
.pricing-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.pricing-faq-item.open .pricing-faq-a {
    max-height: 300px;
    padding-bottom: 20px;
}
.pricing-faq-a p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.pricing-faq-a a {
    color: var(--primary);
    font-weight: 500;
}

/* Bottom CTA spacing override for pricing page */
.pricing-page .landing-bottom-cta {
    margin-top: 96px;
}

/* Responsive: pricing page */
@media (max-width: 900px) {
    .pricing-usage-grid {
        grid-template-columns: 1fr;
    }
    .pricing-calculator-inner {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px 28px;
    }
    .pricing-platform-header {
        flex-direction: column;
        gap: 12px;
    }
    .pricing-amount {
        text-align: left;
    }
}
@media (max-width: 640px) {
    .pricing-hero h1 {
        font-size: 2.15rem;
    }
    .pricing-hero-sub {
        font-size: 1.02rem;
    }
    .pricing-includes {
        grid-template-columns: 1fr;
    }
    .pricing-platform-card {
        border-radius: 12px;
    }
    .pricing-platform-header,
    .pricing-platform-body,
    .pricing-platform-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
    .pricing-usage-card-header,
    .pricing-usage-card-body {
        padding-left: 20px;
        padding-right: 20px;
    }
    .pricing-calculator-inner {
        padding: 24px 20px;
    }
    .pricing-table td,
    .pricing-table th {
        font-size: 0.8rem;
    }
    .pricing-dollar {
        font-size: 2.25rem;
    }
}
