:root {
    --brand: #1e9e8f;
    --brand-dark: #188578;
    --brand-soft: rgba(30, 158, 143, 0.09);
    --ink: #1a1a2e;
    --text: #374151;
    --muted: #6b7280;
    --faint: #9ca3af;
    --line: #e5e7eb;
    --line-soft: #eef0f2;
    --surface: #ffffff;
    --sidebar: #f8f9fa;
    --canvas: #fbfcfd;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.09);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--surface);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--surface);
}

.sidebar {
    position: relative;
    z-index: 30;
    display: flex;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    flex-direction: column;
    overflow: visible;
    border-right: 1px solid var(--line-soft);
    background: var(--sidebar);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 16px;
}

.brand-logo {
    width: 30px;
    height: 30px;
}

.brand-name {
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.brand-product {
    margin-top: -2px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    margin: 0 12px 10px;
    border: 1px solid #dfe3e7;
    border-radius: var(--radius);
    color: var(--text);
    background: white;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 500;
    transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.sidebar-action:hover {
    color: var(--brand);
    border-color: rgba(30, 158, 143, 0.4);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.sidebar-action svg,
.nav-item svg {
    width: 17px;
    height: 17px;
}

.nav-list {
    display: grid;
    gap: 3px;
    padding: 4px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 9px;
    color: #5d6674;
    font-size: 13px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.7);
}

.nav-item.active {
    color: var(--brand);
    background: white;
    box-shadow: var(--shadow-sm);
}

.sidebar-note {
    margin: 18px 15px 0;
    padding: 12px;
    border: 1px solid rgba(30, 158, 143, 0.14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.56);
}

.sidebar-note-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #49645f;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.sidebar-note p {
    margin: 8px 0 0;
    color: #7b858f;
    font-size: 11px;
    line-height: 1.55;
}

.sidebar-spacer {
    flex: 1;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}

.user-avatar,
.avatar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

.user-copy {
    min-width: 0;
    flex: 1;
}

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

.user-name {
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.user-email {
    color: var(--faint);
    font-size: 10px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
}

.icon-button:hover {
    color: var(--brand);
    background: var(--brand-soft);
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

.account-menu {
    position: absolute;
    right: 12px;
    bottom: 58px;
    z-index: 45;
    width: 170px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    box-shadow: var(--shadow-md);
}

.account-menu a,
.account-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    font-size: 12px;
    cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
    background: var(--sidebar);
}

.app-column {
    display: flex;
    min-width: 0;
    flex: 1;
    height: 100vh;
    flex-direction: column;
}

.topbar {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.94);
}

.topbar-title {
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.topbar-eyebrow {
    margin-bottom: -2px;
    color: var(--faint);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar-spacer {
    flex: 1;
}

.privacy-badge,
.subtle-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid rgba(30, 158, 143, 0.16);
    border-radius: 999px;
    color: #47716b;
    background: var(--brand-soft);
    font-size: 10px;
    font-weight: 600;
}

.privacy-badge svg {
    width: 13px;
    height: 13px;
}

.avatar-button {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    cursor: pointer;
}

.mobile-menu {
    display: none;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background:
        radial-gradient(circle at 50% -120px, rgba(30, 158, 143, 0.06), transparent 330px),
        var(--canvas);
}

.content-wrap {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.content-wrap-narrow {
    width: min(900px, calc(100% - 48px));
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 26px;
    text-align: left;
}

.hero-mark {
    display: flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(30, 158, 143, 0.15);
    border-radius: 17px;
    background: white;
    box-shadow: 0 10px 30px rgba(30, 158, 143, 0.1);
}

.hero-mark img {
    width: 40px;
    height: 40px;
}

.section-kicker {
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero h1,
.page-heading h1 {
    margin: 3px 0 3px;
    color: var(--ink);
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.hero p,
.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.search-panel,
.results-card,
.import-card,
.schema-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow-sm);
}

.search-panel {
    padding: 14px;
}

.query-box {
    border: 1px solid #dde2e6;
    border-radius: 14px;
    background: white;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.query-box:focus-within {
    border-color: rgba(30, 158, 143, 0.55);
    box-shadow: 0 0 0 3px rgba(30, 158, 143, 0.08);
}

.query-box textarea {
    display: block;
    width: 100%;
    min-height: 76px;
    max-height: 180px;
    resize: vertical;
    padding: 17px 18px 8px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
}

.query-box textarea::placeholder,
.filter-grid input::placeholder {
    color: #a8afb8;
}

.query-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 8px 13px;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    cursor: pointer;
}

.text-button:hover,
.text-button[aria-expanded="true"] {
    color: var(--brand);
    background: var(--brand-soft);
}

.text-button svg {
    width: 15px;
    height: 15px;
}

.keyboard-hint {
    color: #b0b6be;
    font-size: 10px;
}

.button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:active:not(:disabled) {
    transform: translateY(1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button svg {
    width: 15px;
    height: 15px;
}

.button-primary {
    color: white;
    border-color: var(--brand);
    background: var(--brand);
}

.button-primary:hover:not(:disabled) {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
}

.button-secondary {
    color: var(--text);
    border-color: var(--line);
    background: white;
}

.button-secondary:hover:not(:disabled) {
    color: var(--brand);
    border-color: rgba(30, 158, 143, 0.36);
    background: #fbfefe;
}

.button-full {
    width: 100%;
}

.search-button {
    min-width: 94px;
    margin-left: auto;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 13px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--sidebar);
}

.filter-grid label > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.filter-grid input[type="text"] {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dde1e5;
    border-radius: 8px;
    outline: 0;
    color: var(--ink);
    background: white;
    font-size: 12px;
}

.filter-grid input[type="text"]:focus {
    border-color: rgba(30, 158, 143, 0.55);
    box-shadow: 0 0 0 2px rgba(30, 158, 143, 0.07);
}

.filter-checks {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-size: 11px;
}

.check-field input {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 2px 0;
}

.example-chip {
    padding: 6px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: #67717d;
    background: #fafbfc;
    font-size: 10px;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.example-chip:hover {
    color: var(--brand);
    border-color: rgba(30, 158, 143, 0.26);
    background: var(--brand-soft);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.stat-card {
    display: flex;
    min-height: 84px;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    display: flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
}

.stat-icon svg {
    width: 19px;
    height: 19px;
}

.stat-icon-teal {
    color: var(--brand);
    background: var(--brand-soft);
}

.stat-icon-sky {
    color: #2787bd;
    background: #eef8fd;
}

.stat-icon-violet {
    color: #7c5ac7;
    background: #f5f1fd;
}

.stat-value {
    color: var(--ink);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.stat-value.stat-date {
    font-size: 15px;
}

.stat-label {
    color: var(--faint);
    font-size: 10px;
}

.results-card {
    overflow: hidden;
}

.results-header {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 18px 20px 15px;
    border-bottom: 1px solid var(--line-soft);
}

.results-header h2,
.import-card h2,
.schema-card h2 {
    margin: 2px 0;
    color: var(--ink);
    font-size: 17px;
    letter-spacing: -0.02em;
}

.results-header p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.results-actions {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.inferred-filters {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.filter-tag {
    padding: 4px 7px;
    border-radius: 999px;
    color: #47716b;
    background: var(--brand-soft);
    font-size: 9px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.results-table th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: #858e99;
    background: #fafbfc;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

.results-table td {
    max-width: 260px;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f2f4;
    color: #56606b;
    font-size: 11px;
    vertical-align: top;
}

.results-table tbody tr {
    cursor: pointer;
    transition: background 130ms ease;
}

.results-table tbody tr:hover {
    background: #fbfdfd;
}

.results-table tbody tr:last-child td {
    border-bottom: 0;
}

.cell-title {
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.cell-subtitle,
.cell-muted {
    display: block;
    margin-top: 2px;
    color: var(--faint);
    font-size: 9px;
}

.cell-clamp {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.contact-link {
    display: block;
    max-width: 210px;
    overflow: hidden;
    color: #356e68;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-action {
    color: var(--brand);
    font-size: 10px;
    font-weight: 600;
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-icon {
    display: flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border-radius: 14px;
    color: var(--faint);
    background: var(--sidebar);
}

.empty-icon svg {
    width: 22px;
    height: 22px;
}

.empty-state h3 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
}

.empty-state p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 58px;
    padding: 10px 16px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 11px;
}

.pagination .button {
    min-height: 32px;
    padding: 0 11px;
}

.detail-dialog {
    width: min(760px, calc(100% - 32px));
    max-height: calc(100vh - 50px);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--text);
    background: white;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.detail-dialog::backdrop {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
}

.dialog-header,
.dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.dialog-header h2 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 19px;
}

.dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line-soft);
    border-bottom: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 6px 20px 18px;
}

.detail-field {
    padding: 13px 10px 13px 0;
    border-bottom: 1px solid #f1f3f4;
}

.detail-field-wide {
    grid-column: 1 / -1;
}

.detail-field dt {
    color: var(--faint);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.detail-field dd {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
}

.page-heading {
    margin-bottom: 22px;
}

.import-card {
    padding: 22px;
}

.import-guidance {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.guidance-icon {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--brand);
    background: var(--brand-soft);
}

.guidance-icon svg {
    width: 21px;
    height: 21px;
}

.import-guidance p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.dropzone {
    display: flex;
    min-height: 210px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 30px;
    border: 1.5px dashed #ccd3d8;
    border-radius: 14px;
    color: var(--muted);
    background: #fcfdfd;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.dropzone-icon {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 15px;
    color: var(--brand);
    background: white;
    box-shadow: 0 6px 18px rgba(30, 158, 143, 0.11);
}

.dropzone-icon svg {
    width: 23px;
    height: 23px;
}

.dropzone strong {
    color: var(--ink);
    font-size: 13px;
}

.dropzone > span:last-child {
    margin-top: 4px;
    color: var(--faint);
    font-size: 10px;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--sidebar);
}

.file-icon {
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--brand);
    background: white;
    font-size: 9px;
    font-weight: 700;
}

.file-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.file-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-copy span {
    color: var(--faint);
    font-size: 9px;
}

.import-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.muted-copy {
    color: var(--faint);
    font-size: 10px;
}

.import-result {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(30, 158, 143, 0.2);
    border-radius: 11px;
    background: var(--brand-soft);
}

.result-status-icon {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: var(--brand);
    font-weight: 700;
}

.import-result h3 {
    margin: 0;
    color: var(--ink);
    font-size: 12px;
}

.import-result p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.schema-card {
    margin-top: 14px;
    padding: 20px;
}

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

.schema-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.schema-list span {
    padding: 8px 9px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: #69737f;
    background: #fafbfc;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9px;
}

.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 10%, rgba(30, 158, 143, 0.12), transparent 340px),
        rgba(248, 249, 250, 0.97);
}

.auth-card {
    width: min(390px, 100%);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.auth-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 15px;
}

.auth-state h1 {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 19px;
    letter-spacing: -0.025em;
}

.auth-state p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 16px;
    border: 2px solid #dfe8e7;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-icon {
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 13px;
    border-radius: 50%;
    font-weight: 700;
}

.status-icon-danger {
    color: var(--danger);
    background: #fef2f2;
}

.status-icon-warning {
    color: var(--warning);
    background: #fffbeb;
}

.toast-region {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    display: grid;
    gap: 8px;
    width: min(340px, calc(100% - 36px));
}

.toast {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 10px;
    color: var(--text);
    background: white;
    box-shadow: var(--shadow-md);
    font-size: 11px;
    animation: toast-in 180ms ease-out;
}

.toast-error {
    border-left-color: var(--danger);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

.sidebar-scrim {
    display: none;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
        transition: transform 180ms ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(15, 23, 42, 0.36);
        transition: opacity 180ms ease, visibility 180ms ease;
    }

    body.sidebar-open .sidebar-scrim {
        visibility: visible;
        opacity: 1;
    }

    .mobile-menu {
        display: inline-flex;
    }

    .content-wrap,
    .content-wrap-narrow {
        width: min(100% - 28px, 760px);
        padding-top: 28px;
    }

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

    .results-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .results-actions {
        width: 100%;
        justify-content: space-between;
    }

    .inferred-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 0 12px;
    }

    .privacy-badge {
        display: none;
    }

    .content-wrap,
    .content-wrap-narrow {
        width: min(100% - 20px, 580px);
        padding: 22px 0 40px;
    }

    .hero {
        align-items: flex-start;
        justify-content: flex-start;
        gap: 12px;
    }

    .hero-mark {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    .hero-mark img {
        width: 32px;
        height: 32px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .keyboard-hint {
        display: none;
    }

    .filter-grid,
    .stats-grid,
    .schema-list,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-field-wide {
        grid-column: auto;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-card {
        min-height: 72px;
        padding: 12px 14px;
    }

    .results-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .import-card,
    .schema-card {
        padding: 16px;
    }

    .import-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .import-actions .button {
        width: 100%;
    }
}

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