*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body, h1, h2, h3, h4, p, ul, ol { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

    :root {
        --ink: #0f172a;
        --ink-2: #334155;
        --muted: #64748b;
        --soft: #94a3b8;
        --line: #e2e8f0;
        --line-soft: #edf1f6;
        --line-strong: #cbd5e1;
        --paper: #f6f8fb;
        --surface: #ffffff;
        --surface-2: #f8fafc;
        --surface-3: #f1f5f9;
        --accent: #2563eb;
        --accent-deep: #1d4ed8;
        --accent-soft: #eff6ff;
        --danger: #b91c1c;
        --danger-soft: #fef2f2;
        --warning: #b45309;
        --warning-soft: #fffbeb;
        --success: #047857;
        --success-soft: #ecfdf5;
        --shadow-xs: 0 1px 2px rgb(15 23 42 / 4%);
        --shadow-sm: 0 8px 24px rgb(15 23 42 / 6%);
        --shadow-lg: 0 24px 70px rgb(15 23 42 / 20%);
        --radius-sm: 5px;
        --radius: 8px;
        --radius-lg: 12px;
        --sidebar-w: 240px;
        --topbar-h: 60px;
        --font: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
        --mono: "Maple Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    }

    html[data-theme="dark"] {
        color-scheme: dark;
        --ink: #f1f5f9;
        --ink-2: #cbd5e1;
        --muted: #94a3b8;
        --soft: #64748b;
        --line: #334155;
        --line-soft: #263244;
        --line-strong: #475569;
        --paper: #0f172a;
        --surface: #172033;
        --surface-2: #1e293b;
        --surface-3: #273449;
        --accent: #60a5fa;
        --accent-deep: #3b82f6;
        --accent-soft: #172554;
        --danger: #fca5a5;
        --danger-soft: #3f1d25;
        --warning: #fcd34d;
        --warning-soft: #3d2e12;
        --success: #6ee7b7;
        --success-soft: #12372e;
        --shadow-xs: 0 1px 2px rgb(0 0 0 / 18%);
        --shadow-sm: 0 10px 28px rgb(0 0 0 / 20%);
        --shadow-lg: 0 28px 80px rgb(0 0 0 / 45%);
    }

    html { background: var(--paper); }
    body {
        min-width: 1024px;
        min-height: 100vh;
        background: var(--paper);
        color: var(--ink);
        font-family: var(--font);
        font-size: 14px;
        line-height: 1.6;
        letter-spacing: 0;
    }
    a { color: inherit; text-decoration: none; }
    button { color: inherit; }
    ::selection { color: var(--ink); background: #bfdbfe; }
    :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    code, .mono { font-family: var(--mono); }

    .app-shell { min-height: 100vh; }
    .sidebar {
        position: fixed;
        z-index: 40;
        inset: 0 auto 0 0;
        width: var(--sidebar-w);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: var(--surface);
        border-right: 1px solid var(--line);
        box-shadow: none;
        transition: transform 180ms ease;
    }
    .brand {
        height: var(--topbar-h);
        flex: 0 0 var(--topbar-h);
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 0 16px;
        border-bottom: 1px solid var(--line);
    }
    .brand:hover { background: var(--surface-2); }
    .brand-mark {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        display: grid;
        place-items: center;
        border-radius: var(--radius);
        color: #fff;
        background: linear-gradient(145deg, #2563eb, #0ea5e9);
        box-shadow: 0 5px 14px rgb(37 99 235 / 22%);
        font-size: 17px;
        font-weight: 800;
    }
    .brand-copy { min-width: 0; }
    .brand strong { display: block; color: var(--ink); font-size: 15px; font-weight: 750; line-height: 1.2; }
    .brand small { display: block; margin-top: 3px; color: var(--soft); font-size: 10px; line-height: 1.25; }
    .sidebar-context { padding: 17px 20px 11px; }
    .sidebar-context span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
    .sidebar-context strong { display: block; margin-top: 3px; color: var(--ink-2); font-size: 11px; font-weight: 500; }
    .sidebar-caption { margin: 10px 20px 6px; color: var(--soft); font-size: 10px; font-weight: 700; }
    .main-nav { display: grid; gap: 2px; padding: 0 10px; }
    .main-nav a {
        min-height: 42px;
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 0 11px;
        border-radius: 6px;
        color: var(--ink-2);
        font-size: 13px;
        transition: color 140ms ease, background-color 140ms ease;
    }
    .main-nav a:hover { color: var(--ink); background: var(--surface-3); }
    .main-nav a.active { color: var(--accent-deep); background: var(--accent-soft); font-weight: 650; }
    .main-nav i { width: 18px; flex: 0 0 18px; color: var(--muted); font-size: 18px; text-align: center; }
    .main-nav a.active i { color: var(--accent); }
    .main-nav span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-foot {
        min-height: 52px;
        margin-top: auto;
        padding: 9px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-top: 1px solid var(--line);
        background: var(--surface-2);
    }
    .sidebar-foot div { min-width: 0; }
    .sidebar-foot strong, .sidebar-foot small { display: block; }
    .sidebar-foot strong { color: var(--ink-2); font-size: 10px; font-weight: 650; line-height: 1.3; }
    .sidebar-foot small { margin-top: 2px; color: var(--soft); font-size: 9px; line-height: 1.3; }
    .sidebar-version { margin-left: auto; color: var(--soft); font: 9px/1 var(--mono); }
    .live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
    .sidebar-backdrop { display: none; }
    .workspace { min-height: 100vh; margin-left: var(--sidebar-w); }
    .topbar {
        position: sticky;
        z-index: 30;
        top: 0;
        height: var(--topbar-h);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 0 22px;
        background: color-mix(in srgb, var(--surface) 96%, transparent);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(12px);
    }
    .topbar-left, .topbar-tools, .topbar-context { display: flex; align-items: center; }
    .topbar-left { min-width: 0; gap: 8px; }
    .topbar-context { min-width: 0; gap: 9px; color: var(--muted); font-size: 11px; }
    .topbar-context b { color: var(--line-strong); font-weight: 400; }
    .topbar-context strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
    .topbar-tools { flex: 0 0 auto; gap: 5px; }
    .sidebar-toggle { display: none !important; }
    .page-wrap { width: min(1540px, 100%); margin: 0 auto; padding: 24px 28px 56px; }
    .page-heading {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 22px;
        margin-bottom: 20px;
    }
    .page-heading > div:first-child { min-width: 0; flex: 1 1 520px; }
    .page-heading h1 { margin-top: 3px; color: var(--ink); font-size: 24px; font-weight: 740; line-height: 1.3; letter-spacing: -.5px; }
    .page-lead { max-width: 760px; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.7; }
    .page-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
    .eyebrow { color: var(--accent); font-size: 10px; font-weight: 750; line-height: 1.2; }
    .grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 340px); gap: 16px; align-items: start; }
    .grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .stack { min-width: 0; display: grid; gap: 16px; }

    .icon-btn {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        transition: color 140ms ease, background-color 140ms ease;
    }
    .icon-btn:hover { color: var(--ink); background: var(--surface-3); }
    .env-pill { height: 26px; margin-right: 4px; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success); font-size: 10px; font-weight: 650; white-space: nowrap; }
    .env-pill i { width: 5px; height: 5px; border-radius: 50%; background: #10b981; }
    .user-chip { min-width: 128px; height: 38px; display: flex; align-items: center; gap: 8px; margin-left: 4px; padding: 2px 8px 2px 10px; border-left: 1px solid var(--line); }
    .user-chip > img, .user-chip > span { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 6px; object-fit: cover; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); font-weight: 750; }
    .user-chip div { min-width: 0; }
    .user-chip strong, .user-chip small { display: block; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-chip strong { color: var(--ink); font-size: 11px; line-height: 1.35; }
    .user-chip small { color: var(--soft); font-size: 9px; line-height: 1.35; }
    .btn {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 0 14px;
        border: 1px solid var(--line-strong);
        border-radius: 6px;
        background: var(--surface);
        color: var(--ink-2);
        font-size: 13px;
        font-weight: 650;
        line-height: 1.2;
        white-space: nowrap;
        cursor: pointer;
        transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
    }
    .btn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
    .btn.primary { border-color: var(--accent-deep); background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgb(37 99 235 / 16%); }
    .btn.primary:hover { border-color: var(--accent-deep); background: var(--accent-deep); color: #fff; }
    .btn.dark { border-color: var(--ink); background: var(--ink); color: var(--surface); }
    .btn.dark:hover { opacity: .9; }
    .btn.danger { border-color: #fecaca; background: var(--surface); color: var(--danger); }
    .btn.danger:hover { border-color: #fca5a5; background: var(--danger-soft); color: var(--danger); }
    .btn.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
    .btn.ghost { border-color: transparent; background: transparent; }
    .btn:disabled { opacity: .5; cursor: not-allowed; }
    .panel { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
    .panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
    .panel-head > div:first-child { min-width: 0; }
    .panel-head h2, .panel-head h3 { color: var(--ink); font-size: 15px; font-weight: 680; line-height: 1.4; }
    .panel-head h2 .badge, .panel-head h3 .badge { margin-left: 5px; vertical-align: 2px; }
    .panel-head p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.55; }
    .panel-head a:not(.btn) { color: var(--accent-deep); }
    .panel-body { min-width: 0; padding: 18px; }
    .panel.flush .panel-body { padding: 0; overflow-x: auto; }
    .panel-body code { overflow-wrap: anywhere; word-break: break-word; }
    .panel-body > .mt-16 code { display: block; margin-top: 4px; }
    .section-code { display: block; margin-bottom: 3px; color: var(--accent); font-size: 10px; font-weight: 700; line-height: 1.3; }
    .stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
    .stat { min-width: 0; min-height: 104px; padding: 16px; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--line-soft); }
    .stat:last-child { border-right: 0; }
    .stat-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
    .stat:nth-child(2) .stat-icon { background: var(--success-soft); color: var(--success); }
    .stat:nth-child(3) .stat-icon { background: var(--warning-soft); color: var(--warning); }
    .stat:nth-child(4) .stat-icon { background: #f5f3ff; color: #7c3aed; }
    .stat:nth-child(5) .stat-icon { background: #fff1f2; color: #be123c; }
    .stat-icon i { font-size: 18px; }
    .stat-copy { min-width: 0; }
    .stat-copy small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
    .stat-copy strong { display: block; margin: 5px 0 2px; color: var(--ink); font-size: 24px; font-weight: 740; line-height: 1; font-variant-numeric: tabular-nums; }
    .stat-copy > span { display: block; overflow: hidden; color: var(--soft); font-size: 10px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
    .data-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
    .data-table th { height: 42px; padding: 8px 14px; text-align: left; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
    .data-table td { min-height: 54px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); line-height: 1.55; vertical-align: middle; overflow-wrap: anywhere; }
    .data-table tr:last-child td { border-bottom: 0; }
    .data-table tbody tr:hover td { background: var(--accent-soft); }
    .data-table td > strong { color: var(--ink); }
    .data-table .actions { min-width: max-content; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
    .path-cell { min-width: 0; display: flex; align-items: center; gap: 10px; }
    .path-cell > i { flex: 0 0 auto; color: var(--accent); font-size: 17px; }
    .path-cell > div { min-width: 0; }
    .path-cell strong, .truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .file-meta { display: block; margin-top: 2px; overflow-wrap: anywhere; color: var(--soft); font-size: 10px; line-height: 1.5; }
    .badge { min-height: 22px; padding: 2px 7px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.3; white-space: nowrap; }
    .badge + .badge { margin-left: 3px; }
    .badge.green { border-color: #bbf7d0; background: var(--success-soft); color: var(--success); }
    .badge.red { border-color: #fecaca; background: var(--danger-soft); color: var(--danger); }
    .badge.amber { border-color: #fde68a; background: var(--warning-soft); color: var(--warning); }
    .alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid; border-radius: var(--radius); background: var(--surface); font-size: 13px; }
    .alert > i { margin-top: 1px; font-size: 17px; }
    .alert > span, .alert > div { min-width: 0; flex: 1; }
    .alert button { border: 0; background: none; color: inherit; cursor: pointer; }
    .alert ul { margin: 5px 0 0 18px; }
    .alert.success { border-color: #a7f3d0; background: var(--success-soft); color: var(--success); }
    .alert.warning { border-color: #fde68a; background: var(--warning-soft); color: var(--warning); }
    .alert.danger { border-color: #fecaca; background: var(--danger-soft); color: var(--danger); }
    .field { min-width: 0; display: grid; gap: 7px; }
    .field label { color: var(--ink-2); font-size: 12px; font-weight: 650; }
    .field small { color: var(--muted); line-height: 1.55; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
    .form-grid .wide { grid-column: 1 / -1; }
    .input, .select, .textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; background: var(--surface); color: var(--ink); }
    .textarea { min-height: 96px; resize: vertical; }
    .input::placeholder, .textarea::placeholder { color: var(--soft); }
    .input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(37 99 235 / 12%); }
    .search { position: relative; min-width: 220px; }
    .search i { position: absolute; z-index: 1; left: 11px; top: 50%; transform: translateY(-50%); color: var(--soft); }
    .search .input { padding-left: 34px; }
    dialog.modal { width: min(680px, calc(100vw - 44px)); max-height: calc(100vh - 44px); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
    .modal::backdrop { background: rgb(15 23 42 / 58%); backdrop-filter: blur(3px); }
    .modal-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
    .modal-head h2 { font-size: 17px; line-height: 1.4; }
    .modal-close { width: 34px; height: 34px; flex: 0 0 34px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
    .modal-close:hover { background: var(--surface-3); color: var(--ink); }
    .modal-body { padding: 20px; }
    .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
    .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .grid-2 .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-card { min-width: 0; min-height: 174px; display: flex; flex-direction: column; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
    .project-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: var(--shadow-sm); }
    .project-card .project-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .project-id { min-width: 0; overflow: hidden; color: var(--soft); font: 10px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
    .project-card h3 { margin-top: 20px; overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 680; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
    .project-card p { max-height: 43px; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.7; }
    .project-card footer { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line-soft); color: var(--soft); font: 10px/1.4 var(--mono); }
    .project-card footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .project-card-shell { min-width: 0; position: relative; }
    .project-card-shell .project-card { height: 100%; }
    .project-card-shell .project-top .badge { margin-right: 36px; }
    .project-card-shell.is-pinned .project-card { border-color: #fbbf24; box-shadow: inset 0 3px 0 #fbbf24, var(--shadow-xs); }
    .project-pin-form { position: absolute; z-index: 2; top: 10px; right: 10px; }
    .project-pin-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--soft); cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease; }
    .project-pin-button:hover { border-color: #fbbf24; background: #fffbeb; color: #d97706; }
    .project-card-shell.is-pinned .project-pin-button { border-color: #fbbf24; background: #fffbeb; color: #d97706; }
    html[data-theme="dark"] .project-pin-button:hover, html[data-theme="dark"] .project-card-shell.is-pinned .project-pin-button { background: #422006; color: #fbbf24; }
    .empty { min-height: 190px; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
    .empty i { display: block; margin-bottom: 12px; color: var(--line-strong); font-size: 36px; }
    .empty strong { display: block; color: var(--ink); font-size: 14px; }
    .empty p { max-width: 460px; margin-top: 5px; line-height: 1.7; }
    .activity { display: grid; }
    .activity-item { position: relative; min-width: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 12px 15px 12px 27px; border-bottom: 1px solid var(--line-soft); }
    .activity-item:last-child { border-bottom: 0; }
    .activity-item::before { content: ""; position: absolute; left: 14px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
    .activity-item time { color: var(--soft); font: 10px/1.6 var(--mono); }
    .activity-item > div { min-width: 0; }
    .activity-item strong { display: block; overflow: hidden; color: var(--ink-2); font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
    .activity-item p { margin-top: 1px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
    .upload-zone { position: relative; padding: 24px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); text-align: center; }
    .upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
    .upload-zone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
    .upload-zone strong { display: block; color: var(--ink); }
    .upload-zone small { display: block; margin-top: 3px; color: var(--muted); }
    .upload-progress { display: none; margin-top: 12px; text-align: left; }
    .upload-progress.active { display: block; }
    .progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: var(--line); }
    .progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 120ms linear; }
    .progress-text { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }
    .revision { border-bottom: 1px solid var(--line-soft); }
    .revision:last-child { border-bottom: 0; }
    .revision summary { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 12px 15px; cursor: pointer; list-style: none; }
    .revision summary:hover { background: var(--surface-2); }
    .revision summary::-webkit-details-marker { display: none; }
    .revision summary > span:first-child { color: var(--accent); font: 10px/1 var(--mono); }
    .revision summary strong { font-size: 12px; }
    .revision summary time { color: var(--soft); font: 9px/1 var(--mono); }
    .revision-items { padding: 0 14px 12px 65px; }
    .revision-file { min-width: 0; display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
    .revision-file .truncate { min-width: 0; flex: 1; }
    .token-display { display: flex; align-items: center; gap: 12px; padding: 14px; overflow: hidden; border: 1px solid #a7f3d0; border-radius: var(--radius); background: var(--success-soft); color: var(--success); }
    .token-display > div, .token-display code { min-width: 0; flex: 1; overflow-wrap: anywhere; }
    .token-display code { font-size: 12px; }

    .agent-new-token > div { display: grid; gap: 2px; }
    .agent-new-token span { color: var(--muted); font-size: 11px; }
    .agent-new-token code { display: block; margin-top: 6px; color: var(--success); }
    .agent-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(135deg, var(--surface), var(--surface-2)); box-shadow: var(--shadow-xs); }
    .agent-benefits > div { min-width: 0; min-height: 82px; display: flex; align-items: center; gap: 12px; padding: 15px 17px; border-right: 1px solid var(--line-soft); }
    .agent-benefits > div:last-child { border-right: 0; }
    .agent-benefit-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
    .agent-benefits > div:nth-child(2) .agent-benefit-icon { background: var(--success-soft); color: var(--success); }
    .agent-benefits > div:nth-child(3) .agent-benefit-icon { background: #f5f3ff; color: #7c3aed; }
    html[data-theme="dark"] .agent-benefits > div:nth-child(3) .agent-benefit-icon { background: #2e2051; color: #c4b5fd; }
    .agent-benefit-icon i { font-size: 18px; }
    .agent-benefits p { min-width: 0; }
    .agent-benefits strong, .agent-benefits p > span { display: block; }
    .agent-benefits strong { color: var(--ink); font-size: 13px; font-weight: 700; }
    .agent-benefits p > span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
    .agent-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
    .agent-panel-head { min-height: 78px; align-items: center; }
    .agent-panel-head h2 { font-size: 16px; }
    .agent-token-panel { min-height: 410px; }
    .agent-token-table { min-width: 810px; }
    .agent-token-table tr.is-revoked td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); color: var(--muted); }
    .agent-token-table tr.is-revoked:hover td { background: var(--surface-3); }
    .agent-ability-list { display: flex; flex-wrap: wrap; gap: 4px; }
    .agent-ability-list .badge + .badge { margin-left: 0; }
    .agent-empty { min-height: 330px; }
    .agent-empty .btn { margin-top: 17px; }
    .agent-endpoint-list { display: grid; }
    .agent-endpoint { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--line-soft); }
    .agent-endpoint:last-child { border-bottom: 0; }
    .agent-endpoint-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
    .agent-endpoint:nth-child(2) .agent-endpoint-icon { background: #f5f3ff; color: #7c3aed; }
    .agent-endpoint:nth-child(3) .agent-endpoint-icon { background: var(--success-soft); color: var(--success); }
    html[data-theme="dark"] .agent-endpoint:nth-child(2) .agent-endpoint-icon { background: #2e2051; color: #c4b5fd; }
    .agent-endpoint h3 { color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.4; }
    .agent-endpoint h3 small { margin-left: 5px; color: var(--soft); font-size: 9px; font-weight: 600; }
    .agent-endpoint p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
    .agent-copy-row { min-width: 0; display: flex; align-items: center; gap: 7px; margin-top: 10px; }
    .agent-copy-row code { min-width: 0; flex: 1; padding: 7px 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 9px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
    .agent-steps { display: grid; padding: 5px 17px 12px; list-style: none; }
    .agent-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
    .agent-steps li:last-child { border-bottom: 0; }
    .agent-steps li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-size: 10px; font-weight: 750; }
    .agent-steps strong { display: block; color: var(--ink); font-size: 12px; }
    .agent-steps p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.55; }
    .agent-permission-options { gap: 8px; }
    .agent-permission-options label { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-weight: 550; cursor: pointer; }
    .agent-permission-options label:hover { border-color: #bfdbfe; background: var(--accent-soft); }
    .vault-secret { font-family: var(--mono); letter-spacing: 2px; }
    .reveal-box { display: none; max-width: 100%; margin-top: 8px; padding: 10px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-family: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
    .reveal-box.active { display: block; }
    .icon-only { width: 32px; padding: 0; }
    .bookmark-manager { overflow: visible; }
    .bookmark-pathbar {
        min-height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--line);
        background: var(--surface-2);
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .bookmark-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); }
    .bookmark-breadcrumb a, .bookmark-breadcrumb strong { min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bookmark-breadcrumb a { display: inline-flex; align-items: center; gap: 6px; }
    .bookmark-breadcrumb a:hover { color: var(--accent-deep); }
    .bookmark-breadcrumb a:first-child { color: var(--ink-2); font-weight: 650; }
    .bookmark-breadcrumb strong { color: var(--ink); font-weight: 680; }
    .bookmark-breadcrumb .bookmark-separator { flex: 0 0 auto; color: var(--soft); font-size: 11px; }
    .bookmark-path-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
    .bookmark-summary { min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
    .bookmark-summary > div:first-child { min-width: 0; }
    .bookmark-summary h2 { overflow: hidden; color: var(--ink); font-size: 19px; font-weight: 720; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .bookmark-summary p { margin-top: 4px; color: var(--muted); font-size: 12px; }
    .bookmark-totals { flex: 0 0 auto; display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
    .bookmark-totals span { min-width: 108px; padding: 9px 13px; color: var(--muted); font-size: 11px; text-align: center; }
    .bookmark-totals span + span { border-left: 1px solid var(--line); }
    .bookmark-totals strong { margin-right: 3px; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
    .bookmark-content { min-width: 0; padding: 20px; }
    .bookmark-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
    .bookmark-section-head.with-gap { margin-top: 25px; }
    .bookmark-section-head h3 { color: var(--ink); font-size: 13px; font-weight: 680; }
    .bookmark-section-head > span { color: var(--soft); font: 10px/1.4 var(--mono); }
    .bookmark-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
    .bookmark-folder-card { min-width: 0; min-height: 68px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; }
    .bookmark-folder-card:hover { border-color: #bfdbfe; background: var(--accent-soft); box-shadow: var(--shadow-xs); }
    .bookmark-folder-main { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; align-self: stretch; padding: 11px 5px 11px 12px; }
    .bookmark-folder-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 7px; background: #fff7ed; color: #f59e0b; }
    html[data-theme="dark"] .bookmark-folder-icon { background: #422006; color: #fbbf24; }
    .bookmark-folder-icon i { font-size: 21px; }
    .bookmark-folder-copy { min-width: 0; }
    .bookmark-folder-copy strong, .bookmark-folder-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bookmark-folder-copy strong { color: var(--ink); font-size: 13px; font-weight: 670; }
    .bookmark-folder-copy small { margin-top: 3px; color: var(--soft); font-size: 10px; }
    .bookmark-folder-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 1px; padding-right: 6px; }
    .bookmark-folder-actions .icon-btn { width: 30px; height: 30px; flex-basis: 30px; opacity: .55; }
    .bookmark-folder-card:hover .bookmark-folder-actions .icon-btn, .bookmark-folder-actions .icon-btn:focus-visible { opacity: 1; }
    .bookmark-folder-actions .danger-icon:hover { color: var(--danger); background: var(--danger-soft); }
    .bookmark-table-wrap { min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
    .bookmark-table th:last-child { text-align: right; }
    .bookmark-table td { height: 67px; }
    .bookmark-name { min-width: 0; display: flex; align-items: center; gap: 10px; }
    .bookmark-name > div { min-width: 0; }
    .bookmark-name strong, .bookmark-name span:not(.bookmark-link-icon) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bookmark-name strong { color: var(--ink); font-size: 13px; }
    .bookmark-name span:not(.bookmark-link-icon) { margin-top: 2px; color: var(--soft); font-size: 10px; }
    .bookmark-link-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
    .bookmark-host { display: block; overflow: hidden; color: var(--ink-2); font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
    .bookmark-host:hover { color: var(--accent-deep); }
    .bookmark-location { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .bookmark-location:hover { color: var(--accent-deep); }
    .bookmark-location i { flex: 0 0 auto; color: #f59e0b; }
    .bookmark-empty { min-height: 270px; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--surface-2); }
    .empty-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
    .pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; margin: 14px 0 0; padding: 0 2px 2px; }
    .pagination a, .pagination span { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 11px; }
    .pagination a:hover { border-color: var(--accent); color: var(--accent); }
    .pagination span[aria-current=page] { border-color: var(--accent); background: var(--accent); color: #fff; }
    .pagination-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
    .pagination-row .pagination { margin: 0; }
    .pagination-summary { color: var(--soft); font: 10px/1.4 var(--mono); }
    .audit-log-body { padding-top: 0; }
    .audit-log-body .table-scroll { margin: 0 -17px; }

    .software-search { display: flex; align-items: center; gap: 8px; }
    .software-search-input { width: min(360px, 28vw); }
    .software-sort { width: 116px; min-height: 40px; }
    .software-discovery { min-height: 74px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; margin-bottom: 16px; padding: 12px 16px; }
    .software-library-summary { flex: 0 0 auto; display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
    .software-library-summary > div { min-width: 104px; padding: 8px 13px; border-right: 1px solid var(--line); }
    .software-library-summary > div:last-child { border-right: 0; }
    .software-library-summary span, .software-library-summary strong { display: block; }
    .software-library-summary span { color: var(--soft); font-size: 10px; line-height: 1.3; }
    .software-library-summary strong { margin-top: 3px; color: var(--ink); font-size: 17px; font-weight: 730; line-height: 1.2; font-variant-numeric: tabular-nums; }
    .software-tag-filter { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
    .software-tag-filter a { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 620; }
    .software-tag-filter a:hover { border-color: #bfdbfe; background: var(--accent-soft); color: var(--accent-deep); }
    .software-tag-filter a.active { border-color: var(--accent); background: var(--accent); color: #fff; }
    .software-tag-filter a span { min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 99px; background: var(--surface-3); color: var(--soft); font: 9px/1 var(--mono); }
    .software-tag-filter a.active span { background: rgb(255 255 255 / 18%); color: #fff; }
    .software-result-note { min-height: 38px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: -4px 0 14px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--muted); font-size: 11px; }
    .software-result-note strong { color: var(--ink); }
    .software-result-note a { margin-left: auto; color: var(--accent-deep); font-weight: 650; }
    .software-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 16px; align-items: start; }
    .software-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
    .software-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: var(--shadow-sm); }
    .software-card-head { min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 16px 10px; }
    .software-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-size: 20px; font-weight: 760; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%), 0 5px 14px rgb(15 23 42 / 10%); }
    .software-icon img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: inherit; background: #fff; }
    .software-icon.tone-1 { background: linear-gradient(145deg, #2563eb, #0ea5e9); }
    .software-icon.tone-2 { background: linear-gradient(145deg, #7c3aed, #c026d3); }
    .software-icon.tone-3 { background: linear-gradient(145deg, #059669, #14b8a6); }
    .software-icon.tone-4 { background: linear-gradient(145deg, #ea580c, #f59e0b); }
    .software-icon.tone-5 { background: linear-gradient(145deg, #e11d48, #f43f5e); }
    .software-icon.tone-6 { background: linear-gradient(145deg, #475569, #0f172a); }
    .software-identity { min-width: 0; }
    .software-identity .section-code { margin-bottom: 2px; }
    .software-identity h2 { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 720; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .software-card-tools { display: flex; align-items: center; gap: 2px; }
    .software-card-tools .icon-btn { width: 32px; height: 32px; flex-basis: 32px; }
    .software-card-tools .danger-icon:hover { color: var(--danger); background: var(--danger-soft); }
    .software-tags { min-height: 28px; display: flex; flex-wrap: wrap; gap: 5px; padding: 0 16px; }
    .software-tags a, .software-tags > span { min-height: 23px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 10px; line-height: 1.45; }
    .software-tags a:hover { border-color: #bfdbfe; background: var(--accent-soft); color: var(--accent-deep); }
    .software-description { min-height: 48px; max-height: 48px; margin: 8px 16px 13px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.65; }
    .software-latest { margin: 0 12px; padding: 14px; border: 1px solid #dbeafe; border-radius: 9px; background: linear-gradient(155deg, var(--accent-soft), var(--surface) 68%); }
    html[data-theme="dark"] .software-latest { border-color: #1e3a5f; }
    .software-latest-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .software-latest-head > span:first-child { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-deep); font-size: 10px; font-weight: 720; }
    .software-latest-head > span:first-child i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
    .software-version-title { min-width: 0; margin-top: 10px; }
    .software-version-title h3 { color: var(--ink); font-size: 20px; font-weight: 750; line-height: 1.3; }
    .software-version-title > span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font: 10px/1.5 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
    .software-metrics { display: grid; grid-template-columns: .9fr 1.3fr .8fr; margin: 13px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--surface) 90%, transparent); }
    .software-metrics > div { min-width: 0; min-height: 63px; padding: 8px 10px; border-right: 1px solid var(--line); }
    .software-metrics > div:last-child { border-right: 0; }
    .software-metrics span, .software-metrics strong, .software-metrics time, .software-metrics small { display: block; }
    .software-metrics span { color: var(--soft); font-size: 9px; line-height: 1.35; }
    .software-metrics strong, .software-metrics time { margin-top: 5px; overflow: hidden; color: var(--ink-2); font-size: 12px; font-weight: 680; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .software-metrics small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; }
    .software-download { width: 100%; }
    .software-history { margin-top: 10px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
    .software-history > summary { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; color: var(--muted); cursor: pointer; list-style: none; font-size: 11px; font-weight: 650; }
    .software-history > summary:hover { background: var(--surface-2); color: var(--ink-2); }
    .software-history > summary::-webkit-details-marker { display: none; }
    .software-history > summary span { display: inline-flex; align-items: center; gap: 6px; }
    .software-history[open] > summary .layui-icon-down { transform: rotate(180deg); }
    .software-version-list { border-top: 1px solid var(--line-soft); background: var(--surface-2); }
    .software-version-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
    .software-version-row:last-child { border-bottom: 0; }
    .software-version-file { min-width: 0; display: flex; align-items: center; gap: 9px; }
    .software-version-file > i { color: var(--accent); font-size: 17px; }
    .software-version-file > div { min-width: 0; }
    .software-version-file strong, .software-version-file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .software-version-file strong { color: var(--ink); font-size: 12px; }
    .software-version-file span { margin-top: 2px; color: var(--soft); font: 9px/1.4 var(--mono); }
    .software-version-meta { text-align: right; }
    .software-version-meta span, .software-version-meta time { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
    .software-version-meta time { margin-top: 2px; color: var(--soft); font-size: 9px; }
    .software-version-row > p { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.55; }
    .software-no-version { min-height: 128px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0 12px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface-2); }
    .software-no-version > i { color: var(--soft); font-size: 28px; }
    .software-no-version strong { display: block; color: var(--ink); font-size: 12px; }
    .software-no-version p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
    .software-card-foot { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; color: var(--soft); font-size: 9px; }
    .software-card-foot a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-deep); font-size: 10px; font-weight: 650; }
    .software-empty { min-height: 320px; }

    .markdown-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); }
    .markdown-toolbar { min-height: 86px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
    .markdown-file-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
    .markdown-file-icon i { font-size: 22px; }
    .markdown-toolbar > div:nth-child(2) { min-width: 0; }
    .markdown-toolbar h2 { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 720; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .markdown-toolbar p { margin-top: 2px; overflow: hidden; color: var(--muted); font: 10px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
    .markdown-toolbar dl { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
    .markdown-toolbar dl > div { min-width: 115px; padding: 7px 11px; border-right: 1px solid var(--line); }
    .markdown-toolbar dl > div:last-child { border-right: 0; }
    .markdown-toolbar dt { color: var(--soft); font-size: 9px; }
    .markdown-toolbar dd { margin: 3px 0 0; overflow: hidden; color: var(--ink-2); font: 10px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
    .markdown-security-note { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 8px 20px; border-bottom: 1px solid #d1fae5; background: var(--success-soft); color: var(--success); font-size: 10px; }
    .markdown-content { width: min(980px, calc(100% - 56px)); min-height: 520px; margin: 0 auto; padding: 42px 0 72px; color: var(--ink-2); font-size: 15px; line-height: 1.8; }
    .markdown-content > :first-child { margin-top: 0; }
    .markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4 { margin: 1.8em 0 .7em; color: var(--ink); font-weight: 730; line-height: 1.35; }
    .markdown-content h1 { padding-bottom: .38em; border-bottom: 1px solid var(--line); font-size: 30px; }
    .markdown-content h2 { padding-bottom: .3em; border-bottom: 1px solid var(--line-soft); font-size: 23px; }
    .markdown-content h3 { font-size: 19px; }
    .markdown-content h4 { font-size: 16px; }
    .markdown-content p, .markdown-content ul, .markdown-content ol, .markdown-content blockquote, .markdown-content pre, .markdown-content table { margin: 0 0 1.15em; }
    .markdown-content ul, .markdown-content ol { padding-left: 1.7em; }
    .markdown-content li + li { margin-top: .3em; }
    .markdown-content a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
    .markdown-content blockquote { padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); color: var(--muted); }
    .markdown-content code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: #be123c; font-size: .88em; overflow-wrap: anywhere; }
    .markdown-content pre { padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #0f172a; color: #e2e8f0; line-height: 1.6; }
    .markdown-content pre code { padding: 0; border: 0; background: transparent; color: inherit; overflow-wrap: normal; }
    .markdown-content table { width: 100%; overflow: hidden; border-collapse: collapse; border: 1px solid var(--line); border-radius: 7px; }
    .markdown-content th, .markdown-content td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
    .markdown-content th { background: var(--surface-2); color: var(--ink); }
    .markdown-content img { display: block; height: auto; margin: 20px auto; border: 1px solid var(--line); border-radius: 8px; }
    .markdown-content hr { height: 1px; margin: 2em 0; border: 0; background: var(--line); }

    .muted { color: var(--muted); }
    .soft { color: var(--soft); }
    .text-right { text-align: right !important; }
    .flex { display: flex; }
    .items-center { align-items: center; }
    .justify-between { justify-content: space-between; }
    .gap-6 { gap: 6px; }
    .gap-8 { gap: 8px; }
    .mt-12 { margin-top: 12px; }
    .mt-16 { margin-top: 16px; }
    .mb-16 { margin-bottom: 16px; }
    .w-full { width: 100%; }
    .danger-text { display: block; margin-top: 3px; color: var(--danger); font-size: 11px; }
    .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

    @media (max-width: 1440px) {
        .agent-layout { grid-template-columns: minmax(0, 1fr); }
        .agent-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 1180px) {
        .page-wrap { padding-inline: 22px; }
        .page-heading { align-items: flex-start; flex-wrap: wrap; }
        .page-actions { justify-content: flex-start; }
        .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .stat { border-bottom: 1px solid var(--line-soft); }
        .stat:nth-child(3n) { border-right: 0; }
        .stat:nth-last-child(-n + 2) { border-bottom: 0; }
        .grid-2 { grid-template-columns: minmax(0, 1fr) 310px; }
        .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .software-discovery { grid-template-columns: minmax(0, 1fr); gap: 10px; }
        .software-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .markdown-toolbar { grid-template-columns: 44px minmax(0, 1fr); }
        .markdown-toolbar dl { grid-column: 1 / -1; }
        .markdown-toolbar dl > div { flex: 1; }
    }

    @media (max-width: 900px) {
        body { min-width: 0; }
        .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
        body.sidebar-open { overflow: hidden; }
        body.sidebar-open .sidebar { transform: translateX(0); }
        .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; border: 0; background: rgb(15 23 42 / 45%); }
        body.sidebar-open .sidebar-backdrop { display: block; }
        .workspace { margin-left: 0; }
        .sidebar-toggle { display: grid !important; }
        .topbar { padding: 0 12px; }
        .topbar-context > span, .topbar-context > b, .env-pill, .user-chip div { display: none; }
        .user-chip { min-width: auto; padding-right: 2px; }
        .page-wrap { width: 100%; padding: 18px 14px 40px; }
        .page-heading { gap: 14px; margin-bottom: 16px; }
        .page-heading h1 { font-size: 21px; }
        .page-actions { width: 100%; }
        .page-actions .search { flex: 1 1 220px; }
        .software-search { min-width: 0; flex: 1 1 100%; }
        .software-search-input { width: auto; }
        .software-grid { grid-template-columns: minmax(0, 1fr); }
        .software-card:hover { transform: none; }
        .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .stat { min-height: 90px; padding: 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft) !important; }
        .stat:nth-child(2n) { border-right: 0; }
        .stat:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0 !important; }
        .stat-icon { width: 34px; height: 34px; flex-basis: 34px; }
        .stat-copy strong { font-size: 21px; }
        .grid-2, .grid-equal, .form-grid { grid-template-columns: minmax(0, 1fr); }
        .form-grid .wide { grid-column: auto; }
        .card-grid, .grid-2 .card-grid { grid-template-columns: minmax(0, 1fr); }
        .panel-head { align-items: flex-start; flex-wrap: wrap; }
        .panel-head > form, .panel-head .search { width: 100%; }
        .data-table { min-width: 720px; }
        .bookmark-pathbar, .bookmark-summary { align-items: flex-start; flex-wrap: wrap; }
        .bookmark-path-actions { flex-wrap: wrap; }
        .bookmark-summary { min-height: 0; }
        .bookmark-totals { width: 100%; }
        .bookmark-totals span { flex: 1; }
        .bookmark-folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .bookmark-table { min-width: 980px; }
        .activity-item { grid-template-columns: 72px minmax(0, 1fr); }
        .markdown-content { width: min(100% - 34px, 820px); padding-top: 28px; }
        .agent-side { grid-template-columns: minmax(0, 1fr); }
        .agent-benefits p > span { white-space: normal; }
    }

    @media (max-width: 620px) {
        .bookmark-pathbar, .bookmark-summary, .bookmark-content { padding-inline: 13px; }
        .bookmark-breadcrumb { width: 100%; overflow-x: auto; padding-bottom: 2px; }
        .bookmark-path-actions { width: 100%; }
        .bookmark-folder-grid { grid-template-columns: minmax(0, 1fr); }
        .bookmark-totals span { min-width: 0; }
        .software-search { flex-wrap: wrap; }
        .software-search-input { flex: 1 1 100% !important; }
        .software-library-summary { width: 100%; }
        .software-library-summary > div { min-width: 0; flex: 1; }
        .software-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .software-metrics > div:nth-child(2) { border-right: 0; }
        .software-metrics > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
        .software-version-row { grid-template-columns: minmax(0, 1fr) auto; }
        .software-version-row > .btn { grid-column: 1 / -1; }
        .markdown-toolbar { padding-inline: 14px; }
        .markdown-toolbar dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .markdown-toolbar dl > div { min-width: 0; border-bottom: 1px solid var(--line); }
        .markdown-toolbar dl > div:nth-child(2) { border-right: 0; }
        .markdown-toolbar dl > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
        .markdown-content { width: calc(100% - 26px); font-size: 14px; }
        .agent-benefits { grid-template-columns: minmax(0, 1fr); }
        .agent-benefits > div { min-height: 72px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
        .agent-benefits > div:last-child { border-bottom: 0; }
        .agent-new-token { align-items: stretch; flex-direction: column; }
        .agent-new-token .btn { width: 100%; }
    }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    }
