/* ═══════════════════════════════════════════════════
   Wevitos Design System
   ═══════════════════════════════════════════════════ */

:root {
    /* Sidebar */
    --sidebar-bg: #1a1f36;
    --sidebar-text: #a3acb9;
    --sidebar-hover: rgba(255,255,255,.08);
    --sidebar-active: rgba(99,91,255,.25);
    --sidebar-width: 240px;

    /* Surface */
    --bg: #f6f8fa;
    --surface: #ffffff;
    --border: #e3e8ee;

    /* Brand */
    --primary: #635bff;
    --primary-hover: #5249e6;

    /* Status */
    --status-open: #df1b41;
    --status-resolved: #30b566;
    --status-ignored: #8792a2;
    --status-regression: #f5a623;

    /* Text */
    --text-primary: #1a1f36;
    --text-secondary: #697386;
    --text-muted: #8792a2;

    /* Misc */
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-card: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
    --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

/* ── Reset & Base ── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    margin: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.9em; color: var(--status-open); }
a code { color: inherit; }

/* ── Layout ── */
.w-layout { display: flex; min-height: 100vh; }

.w-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .2s ease;
}

.w-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.w-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
}

.w-content {
    padding: 28px 32px 80px;
    flex: 1;
}

/* ── Sidebar elements ── */
.w-sidebar-brand {
    padding: 20px 20px 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.w-sidebar-brand a { color: #fff; text-decoration: none; }

.w-sidebar-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.w-sidebar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(163,172,185,.5);
    padding: 16px 12px 6px;
}

.w-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.w-sidebar-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.w-sidebar-link.active { background: var(--sidebar-active); color: #fff; }

.w-sidebar-link svg {
    width: 18px;
    height: 18px;
    opacity: .6;
    flex-shrink: 0;
}
.w-sidebar-link.active svg { opacity: 1; }

.w-sidebar-divider {
    border-top: 1px solid rgba(255,255,255,.08);
    margin: 12px 20px;
}

.w-sidebar-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.w-sidebar-back:hover { color: #fff; text-decoration: none; }

.w-sidebar-project-name {
    padding: 4px 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w-sidebar-bottom {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.w-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13px;
    overflow: hidden;
}
.w-sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Breadcrumb ── */
.w-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    list-style: none;
    padding: 0;
    margin: 0;
}
.w-breadcrumb a { color: var(--text-secondary); }
.w-breadcrumb a:hover { color: var(--primary); }
.w-breadcrumb .separator { margin: 0 2px; color: var(--border); }

/* ── Page Header ── */
.w-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.w-page-header h1,
.w-page-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

/* ── Cards ── */
.w-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}
.w-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
}
.w-card-body { padding: 20px; }

/* Stat card */
.w-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
}
.w-stat-card.open    { border-left-color: var(--status-open); }
.w-stat-card.resolved{ border-left-color: var(--status-resolved); }
.w-stat-card.ignored { border-left-color: var(--status-ignored); }
.w-stat-card.primary { border-left-color: var(--primary); }
.w-stat-card .stat-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.w-stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.w-stat-card .stat-value.open    { color: var(--status-open); }
.w-stat-card .stat-value.resolved{ color: var(--status-resolved); }
.w-stat-card .stat-value.ignored { color: var(--status-ignored); }

/* ── Tables ── */
.w-table {
    width: 100%;
    border-collapse: collapse;
}
.w-table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.w-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}
.w-table tbody tr:hover { background: rgba(99,91,255,.02); }
.w-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.w-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
}
.w-badge.open       { background: rgba(223,27,65,.1);  color: var(--status-open); }
.w-badge.resolved   { background: rgba(48,181,102,.1); color: var(--status-resolved); }
.w-badge.ignored    { background: rgba(135,146,162,.12); color: var(--status-ignored); }
.w-badge.regression { background: rgba(245,166,35,.12); color: var(--status-regression); }
.w-badge.primary    { background: rgba(99,91,255,.1);  color: var(--primary); }
.w-badge.dark       { background: var(--text-primary);  color: #fff; }
.w-badge.count      { background: var(--bg); color: var(--text-primary); border: 1px solid var(--border); font-weight: 700; }

/* View toggle */
.w-view-toggle { background:none; border:none; padding:6px 8px; cursor:pointer; color:var(--text-muted); display:flex; align-items:center; transition:background .15s,color .15s; }
.w-view-toggle:hover { background:var(--bg-hover); color:var(--text-primary); }
.w-view-toggle.active { background:var(--primary); color:#fff; }

/* Role badges */
.w-badge.owner  { background: var(--text-primary); color: #fff; }
.w-badge.admin  { background: rgba(99,91,255,.1);  color: var(--primary); }
.w-badge.member { background: rgba(48,181,102,.1); color: var(--status-resolved); }
.w-badge.viewer { background: rgba(135,146,162,.12); color: var(--status-ignored); }

/* ── Buttons ── */
.w-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    line-height: 1.4;
}
.w-btn:hover { text-decoration: none; }
.w-btn.primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.w-btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.w-btn.secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.w-btn.secondary:hover { background: var(--bg); }
.w-btn.danger    { background: rgba(223,27,65,.08); color: var(--status-open); border-color: rgba(223,27,65,.2); }
.w-btn.danger:hover { background: rgba(223,27,65,.15); }
.w-btn.success   { background: rgba(48,181,102,.08); color: var(--status-resolved); border-color: rgba(48,181,102,.2); }
.w-btn.success:hover { background: rgba(48,181,102,.15); }
.w-btn.sm { padding: 5px 10px; font-size: 12.5px; }
.w-btn.ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.w-btn.ghost:hover { background: var(--bg); color: var(--text-primary); }

/* ── Filter pills ── */
.w-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.w-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
}
.w-pill:hover { border-color: var(--text-muted); color: var(--text-primary); }
.w-pill.active-open     { background: var(--status-open); color: #fff; border-color: var(--status-open); }
.w-pill.active-resolved { background: var(--status-resolved); color: #fff; border-color: var(--status-resolved); }
.w-pill.active-ignored  { background: var(--status-ignored); color: #fff; border-color: var(--status-ignored); }
.w-pill.active-all      { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Bulk bar (floating) ── */
.w-bulk-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    z-index: 1050;
    background: var(--text-primary);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-shadow: 0 8px 32px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.12);
    transition: transform .22s ease, opacity .22s ease;
    min-width: 340px;
    max-width: calc(100vw - 48px);
}
@media (min-width: 768px) {
    .w-bulk-bar {
        bottom: auto;
        top: 68px;
        transform: translateX(-50%) translateY(-20px);
    }
    .w-bulk-bar.is-visible {
        transform: translateX(-50%) translateY(0);
    }
}
.w-bulk-bar.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.w-bulk-bar .bulk-main-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
}
.w-bulk-bar .count-text { font-size: 13px; color: rgba(255,255,255,.7); font-weight: 500; }
.w-bulk-bar .w-btn.success { background: rgba(48,181,102,.15); color: #5ee89c; border-color: rgba(48,181,102,.25); }
.w-bulk-bar .w-btn.success:hover { background: rgba(48,181,102,.25); }
.w-bulk-bar .w-btn.secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.15); }
.w-bulk-bar .w-btn.secondary:hover { background: rgba(255,255,255,.18); }
.w-bulk-bar .w-btn.danger { background: rgba(223,27,65,.15); color: #ff7b93; border-color: rgba(223,27,65,.25); }
.w-bulk-bar .w-btn.danger:hover { background: rgba(223,27,65,.25); }
.w-bulk-bar .w-btn.ghost { color: rgba(255,255,255,.5); }
.w-bulk-bar .w-btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.w-bulk-bar .w-select-banner {
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255,255,255,.1);
    border-radius: 0;
    padding: 8px 18px;
    font-size: 12.5px;
    color: rgba(255,255,255,.6);
    margin: 0;
}
.w-bulk-bar .w-select-banner a { color: #818cf8; }

/* ── Error detail bar ── */
.w-error-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    gap: 16px;
}
.w-error-bar-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.w-error-bar-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.w-error-bar-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.w-error-bar-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.w-error-bar-sep {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}
.w-error-bar-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Stacktrace summary ── */
.w-stacktrace-summary {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    user-select: all;
}
.w-stacktrace-exc { color: var(--status-open); font-weight: 600; }
.w-stacktrace-msg { color: var(--text-secondary); margin-left: 6px; }

/* ── Stacktrace ── */
.w-stacktrace .frame {
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.w-stacktrace .frame:last-child { border-bottom: none; }
.w-stacktrace .frame-app {
    padding: 14px 20px;
    border-left: 3px solid var(--primary);
    background: rgba(99,91,255,.02);
}
.w-stacktrace .frame-location {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.w-stacktrace .frame-app .frame-location {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.w-stacktrace .frame-file { color: var(--text-secondary); font-weight: 400; }
.w-stacktrace .frame-app .frame-file { color: var(--text-primary); }
.w-stacktrace .frame-lineno { color: var(--primary); }
.w-stacktrace .frame-func { color: var(--primary); font-weight: 600; }
.w-stacktrace .frame pre {
    background: #f8f9fb;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid var(--border);
}
.w-stacktrace .context-line {
    background: rgba(245,166,35,.15);
    display: inline-block;
    width: 100%;
    margin: 0 -14px;
    padding: 0 14px;
}
.w-stacktrace .frame-lib {
    padding: 4px 20px 4px 23px;
    border-left: 3px solid transparent;
}
.w-stacktrace .frame-lib .frame-location {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11.5px;
}
.w-stacktrace .lib-toggle {
    padding: 6px 20px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.w-stacktrace .lib-toggle::before {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .15s;
}
.w-stacktrace .lib-toggle[data-expanded="1"]::before {
    transform: rotate(90deg);
}
.w-stacktrace .lib-toggle:hover { color: var(--primary); }

/* ── Code blocks (setup page) ── */
.w-code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px 20px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    position: relative;
    overflow-x: auto;
}
.w-code-block .comment { color: #64748b; }
.w-code-block .string  { color: #fbbf24; }
.w-code-block .keyword { color: #818cf8; }

.w-code-block .btn-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}
.w-code-block .btn-copy:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Token box */
.w-token-box {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ── Stepper (setup) ── */
.w-stepper .step {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    position: relative;
}
.w-stepper .step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 36px;
    bottom: -16px;
    width: 2px;
    background: var(--border);
}
.w-stepper .step-number {
    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;
}
.w-stepper .step-content { flex: 1; min-width: 0; }
.w-stepper .step-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; padding-top: 4px; }
.w-stepper .step-desc  { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }

/* ── Settings sections ── */
.w-settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.w-settings-section .section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}
.w-settings-section .section-body { padding: 20px; }

/* ── Forms ── */
.w-form-group { margin-bottom: 16px; }
.w-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.w-form-group .form-control,
.w-form-group .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.w-form-group .form-control:focus,
.w-form-group .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,91,255,.15);
}
.w-form-group .form-text { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ── Event timeline ── */
.w-timeline-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
    text-decoration: none;
    color: inherit;
}
.w-timeline-item:hover { background: var(--bg); text-decoration: none; color: inherit; }
.w-timeline-item:last-child { border-bottom: none; }

/* ── Empty state ── */
.w-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}
.w-empty svg { margin-bottom: 16px; opacity: .4; }
.w-empty h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.w-empty p { font-size: 14px; margin-bottom: 16px; }

/* ── Auth layout (login/invite) ── */
.w-auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.w-auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.w-auth-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.w-auth-card .auth-subtitle { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }

/* ── Status colors ── */
.status-open { color: var(--status-open); }
.status-resolved { color: var(--status-resolved); }
.status-ignored { color: var(--status-ignored); }

/* ── Key-value table (event detail) ── */
.w-kv-table { width: 100%; }
.w-kv-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 16px 8px 0;
    white-space: nowrap;
    vertical-align: top;
    width: 140px;
}
.w-kv-table td { padding: 8px 0; font-size: 14px; }

/* ── Alerts ── */
.w-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
}
.w-alert.success { background: rgba(48,181,102,.08); color: #1a6d3a; border: 1px solid rgba(48,181,102,.15); }
.w-alert.danger  { background: rgba(223,27,65,.06); color: #9b1c31; border: 1px solid rgba(223,27,65,.12); }
.w-alert.info    { background: rgba(99,91,255,.06); color: #4239b3; border: 1px solid rgba(99,91,255,.12); }
.w-alert.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Hamburger (mobile) ── */
.w-hamburger {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
}
.w-hamburger svg { width: 24px; height: 24px; }

.w-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
}

/* ── Row checkbox ── */
.row-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ── Pagination ── */
.w-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}
.w-pagination .page-info { font-size: 13px; color: var(--text-secondary); }

/* ── Mobile error cards ── */
.w-mobile-error {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background .1s;
}
.w-mobile-error:hover { background: var(--bg); text-decoration: none; color: inherit; }
.w-mobile-error:last-child { border-bottom: none; }
.w-me-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.w-me-exc { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--primary); word-break: break-all; }
.w-me-msg { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.w-me-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }

/* ── Global overflow guard ── */
html, body { overflow-x: hidden; }
.w-layout { overflow-x: hidden; }
.w-main { overflow-x: hidden; min-width: 0; }
.w-content { min-width: 0; }

/* ── Table scroll wrapper ── */
.w-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .w-sidebar { transform: translateX(-100%); }
    .w-sidebar.open { transform: translateX(0); }
    .w-main { margin-left: 0; }
    .w-hamburger { display: block; }
    .w-overlay.open { display: block; }
    .w-content { padding: 16px 12px; }
    .w-topbar { padding: 8px 12px; }

    /* Page header */
    .w-page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .w-page-header h1, .w-page-header h2 { font-size: 18px; }

    /* Breadcrumb: hide on mobile, topbar is enough */
    .w-breadcrumb { display: none; }

    /* Cards */
    .w-card { border-radius: var(--radius-sm); margin-bottom: 12px; }
    .w-card-header { padding: 12px 14px; font-size: 13px; }
    .w-card-body { padding: 14px; }

    /* Stat cards: 2-column grid */
    .w-stat-card { padding: 12px 14px; }
    .w-stat-card .stat-value { font-size: 22px; }

    /* Error detail bar */
    .w-error-bar { flex-direction: column; align-items: stretch; padding: 12px 14px; }
    .w-error-bar-stats { gap: 12px; }
    .w-error-bar-sep { width: 100%; height: 1px; }
    .w-error-bar-actions { justify-content: flex-end; }

    /* Tables → card list on mobile */
    .w-table.mobile-cards { display: block; }
    .w-table.mobile-cards thead { display: none; }
    .w-table.mobile-cards tbody { display: block; }
    .w-table.mobile-cards tbody tr {
        display: block;
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
    }
    .w-table.mobile-cards tbody tr:last-child { border-bottom: none; }
    .w-table.mobile-cards tbody td {
        display: block;
        padding: 2px 0;
        border: none;
        font-size: 13px;
    }
    .w-table.mobile-cards tbody td:first-child { padding-top: 0; }

    /* Errors mobile: stacked layout */
    .w-error-row { display: block !important; padding: 12px 14px !important; }
    .w-error-row td { display: block !important; padding: 1px 0 !important; border: none !important; }
    .w-error-row .td-checkbox { display: none; }
    .w-error-row .td-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

    /* Bulk bar */
    .w-bulk-bar { left: 12px; right: 12px; bottom: 12px; transform: translateY(20px); min-width: 0; }
    .w-bulk-bar.is-visible { transform: translateY(0); }
    .w-bulk-bar .bulk-main-row { flex-wrap: wrap; padding: 10px 12px; gap: 6px; }
    .w-bulk-bar .count-text { width: 100%; }

    /* Filters */
    .w-filters { gap: 4px; }
    .w-pill { padding: 4px 10px; font-size: 12px; }

    /* Pagination */
    .w-pagination { flex-direction: column; gap: 8px; align-items: stretch; }
    .w-pagination .page-info { text-align: center; }
    .w-pagination > div { display: flex; gap: 4px; }
    .w-pagination > div .w-btn { flex: 1; justify-content: center; }

    /* Timeline */
    .w-timeline-item { flex-direction: column; gap: 4px; padding: 10px 14px; }

    /* Stacktrace */
    .w-stacktrace .frame { font-size: 11.5px; word-break: break-all; }
    .w-stacktrace .frame-app { padding: 10px 12px; border-left-width: 2px; }
    .w-stacktrace .frame-lib { padding: 3px 12px 3px 14px; }
    .w-stacktrace .frame pre { font-size: 11px; padding: 8px 10px; }
    .w-stacktrace .frame-location { flex-direction: column; gap: 2px; }
    .w-stacktrace .lib-toggle { padding: 5px 12px; }

    /* Auth */
    .w-auth-card { padding: 24px 20px; margin: 16px; }

    /* Settings */
    .w-settings-section .section-header { padding: 12px 14px; }
    .w-settings-section .section-body { padding: 14px; }

    /* Stepper */
    .w-stepper .step { gap: 12px; margin-bottom: 24px; }
    .w-stepper .step-number { width: 28px; height: 28px; font-size: 12px; }
    .w-stepper .step:not(:last-child)::before { left: 13px; }

    /* Code blocks */
    .w-code-block { padding: 14px; font-size: 12px; }

    /* KV table */
    .w-kv-table th { width: auto; display: block; padding: 6px 0 0; }
    .w-kv-table td { display: block; padding: 0 0 8px; }

    /* Bootstrap grid override for stat cards */
    .row.g-3 > [class*="col-md-3"] { flex: 0 0 50%; max-width: 50%; }
    .row.g-3 > [class*="col-md-4"] { flex: 0 0 100%; max-width: 100%; }
    .row.g-3 > [class*="col-md-6"] { flex: 0 0 100%; max-width: 100%; }
}
