:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --line: #dfe4ea;
    --line-strong: #c9d1da;
    --primary: #1859d9;
    --primary-dark: #1247b1;
    --primary-soft: #eaf1ff;
    --success: #157347;
    --success-soft: #e8f7ef;
    --warning: #9a6700;
    --warning-soft: #fff4ce;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --shadow: 0 18px 50px rgba(20, 32, 56, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[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; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .13em; }

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button.primary { color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(24, 89, 217, .18); }
.button.primary:hover { background: var(--primary-dark); }
.button.primary.has-changes::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ffdf6c; }
.button.secondary { color: var(--text); background: #fff; border-color: var(--line-strong); }
.button.ghost { color: #475467; background: transparent; border-color: transparent; }
.button.danger-outline { color: var(--danger); background: #fff; border-color: #efb4ad; }
.button.wide { width: 100%; }

.alert { margin: 0 0 18px; padding: 13px 16px; border-radius: 12px; font-size: 14px; }
.alert.success { color: var(--success); background: var(--success-soft); }
.alert.error { color: var(--danger); background: var(--danger-soft); }
.validation-summary { color: var(--danger); font-size: 14px; }
.validation-summary ul { margin: 0; padding-left: 20px; }

/* Login */
.login-body { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #e7efff, transparent 36%), #f4f6f8; }
.login-shell { width: min(100%, 440px); }
.login-card { padding: 36px; border: 1px solid rgba(216, 222, 231, .85); border-radius: 22px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow); }
.login-brand { display: grid; width: 48px; height: 48px; margin-bottom: 22px; place-items: center; border-radius: 14px; color: #fff; background: var(--primary); font-weight: 900; }
.login-card h1 { margin: 0 0 8px; font-size: 30px; }
.login-card > p { margin-top: 0; }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
.login-form label, .settings-form label { display: grid; gap: 7px; color: #344054; font-size: 14px; font-weight: 700; }
.login-form input, .settings-form input, .settings-form textarea, #photoUrlInput {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
    color: var(--text);
    background: #fff;
}
.login-form input:focus, .settings-form input:focus, .settings-form textarea:focus, #photoUrlInput:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24, 89, 217, .12); }
.quiet-link { display: block; margin-top: 20px; color: var(--muted); font-size: 14px; text-align: center; text-decoration: none; }

/* Admin */
.admin-topbar { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.admin-topbar-main { display: flex; width: min(100% - 32px, 1800px); min-height: 78px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 20px; }
.admin-topbar h1 { margin: 0; font-size: 22px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.admin-shell { width: min(100% - 28px, 1800px); margin: 24px auto 48px; }
.admin-panel { overflow: hidden; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(20, 32, 56, .045); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 5px; font-size: 20px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.database-indicator { display: inline-flex; align-items: center; gap: 8px; color: var(--success); font-size: 13px; font-weight: 800; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 4px #def7ea; }
.inventory-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.toolbar-search { flex: 1; max-width: 560px; }
.toolbar-search input { width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 10px; outline: none; background: #fff; }
.toolbar-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,89,217,.1); }
.toolbar-buttons { display: flex; gap: 8px; }
.paste-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; border-bottom: 1px solid #d8e4ff; background: var(--primary-soft); }
.paste-strip > div:first-child { display: grid; gap: 3px; }
.paste-strip span { color: #50617f; font-size: 13px; }
.kdocs-paste-zone { position: relative; display: flex; min-width: 230px; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 8px 14px; overflow: hidden; border: 1px dashed #7ca5fa; border-radius: 10px; color: #17459f; background: #fff; cursor: text; font-weight: 750; }
.kdocs-paste-zone.focused { border-style: solid; box-shadow: 0 0 0 3px rgba(24,89,217,.13); }
.kdocs-paste-zone textarea { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.paste-key { padding: 4px 7px; border: 1px solid #b8cffb; border-radius: 6px; background: #eff5ff; font-family: ui-monospace, monospace; font-size: 12px !important; }
.admin-status { margin: 12px 18px 0; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.admin-status[data-type="working"] { color: #17459f; background: var(--primary-soft); }
.admin-status[data-type="success"] { color: var(--success); background: var(--success-soft); }
.admin-status[data-type="warning"] { color: var(--warning); background: var(--warning-soft); }
.admin-status[data-type="error"] { color: var(--danger); background: var(--danger-soft); }
.grid-guide { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 18px; color: var(--muted); font-size: 13px; }
.inventory-grid-wrap { position: relative; max-height: 68vh; min-height: 280px; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.inventory-grid { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.inventory-grid th, .inventory-grid td { min-width: 130px; max-width: 260px; height: 48px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; background: #fff; white-space: pre-wrap; word-break: break-word; }
.inventory-grid th { position: sticky; z-index: 10; top: 0; height: 44px; color: #344054; background: #f6f8fa; font-size: 12px; font-weight: 800; text-align: left; white-space: nowrap; }
.inventory-grid tr.selected td { background: #f0f5ff; }
.inventory-grid .select-column { left: 0; min-width: 42px; width: 42px; max-width: 42px; text-align: center; }
.inventory-grid .row-number-column { left: 42px; min-width: 46px; width: 46px; max-width: 46px; color: var(--muted); text-align: center; }
.inventory-grid th.select-column, .inventory-grid th.row-number-column { z-index: 13; }
.inventory-grid td.sticky-cell { position: sticky; z-index: 5; }
.inventory-grid th[data-column="vin"], .inventory-grid td[data-field="vin"] { min-width: 110px; width: 110px; }
.inventory-grid th[data-column="brandModel"], .inventory-grid td[data-field="brandModel"] { min-width: 170px; }
.inventory-grid th[data-column="configurationZh"], .inventory-grid th[data-column="configurationEn"], .inventory-grid th[data-column="configurationRu"],
.inventory-grid th[data-column="conditionZh"], .inventory-grid th[data-column="conditionEn"], .inventory-grid th[data-column="conditionRu"] { min-width: 230px; }
.editable-cell { outline: none; cursor: text; }
.editable-cell:hover { box-shadow: inset 0 0 0 1px #a9b9d3; }
.editable-cell:focus { position: relative; z-index: 8; box-shadow: inset 0 0 0 2px var(--primary); background: #fff; }
.editable-cell:empty::before { content: "点击编辑"; color: #b1b8c3; }
.photo-cell { min-width: 220px !important; }
.photo-cell-previews { display: flex; height: 34px; align-items: center; gap: 3px; margin-bottom: 5px; }
.photo-cell-previews img { width: 42px; height: 32px; border: 1px solid var(--line); border-radius: 4px; object-fit: cover; background: #eef1f5; }
.photo-cell-previews span { display: grid; width: 34px; height: 32px; place-items: center; border-radius: 4px; color: #475467; background: #eef1f5; font-size: 11px; }
.photo-edit-button { padding: 0; border: 0; color: var(--primary); background: none; cursor: pointer; font-size: 12px; font-weight: 750; }
.status-cell select { width: 100%; padding: 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.empty-grid { position: absolute; inset: 0; display: grid; place-content: center; gap: 5px; color: var(--muted); text-align: center; pointer-events: none; }
.empty-grid strong { color: var(--text); font-size: 18px; }
.save-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; color: var(--muted); font-size: 13px; background: var(--surface-soft); }
.settings-form { padding: 22px 24px 26px; }
.language-settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.language-settings-grid fieldset { display: grid; gap: 13px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.language-settings-grid legend { padding: 0 7px; font-weight: 850; }
.settings-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }

/* Modals */
.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px); }
.modal-card { position: relative; z-index: 1; width: min(100%, 860px); max-height: calc(100vh - 40px); overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(4, 12, 30, .28); }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; color: #475467; background: #eef1f5; cursor: pointer; font-size: 24px; }
.photo-editor-toolbar { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; color: var(--muted); font-size: 13px; }
.file-button input { display: none; }
#photoUrlInput { display: block; width: calc(100% - 40px); margin: 0 20px 14px; }
.photo-editor-gallery { display: grid; min-height: 140px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 6px 20px 20px; }
.photo-draft-item { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 9px; background: #eef1f5; }
.photo-draft-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-draft-item button { position: absolute; top: 5px; right: 5px; display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.7); cursor: pointer; font-size: 20px; }
.modal-open { overflow: hidden; }

/* Public catalog */
.public-body { background: #f3f5f8; }
.public-header { border-bottom: 1px solid rgba(218,224,232,.9); background: #fff; }
.public-header-inner { display: flex; width: min(100% - 32px, 1240px); min-height: 92px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 24px; }
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 120px; height: 72px; border-radius: 12px; object-fit: contain; }
.brand-lockup h1 { margin: 0 0 4px; font-size: 25px; }
.brand-lockup p { margin: 0; color: var(--muted); font-size: 14px; }
.language-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.language-switch a { padding: 8px 11px; border-radius: 8px; color: #5e6878; font-size: 13px; font-weight: 750; text-decoration: none; }
.language-switch a.active { color: #fff; background: var(--primary); }
.public-shell { width: min(100% - 32px, 1240px); margin: 24px auto 64px; }
.catalog-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.public-search { position: relative; flex: 1; max-width: 650px; }
.public-search input { width: 100%; min-height: 48px; padding: 11px 15px 11px 42px; border: 1px solid var(--line-strong); border-radius: 13px; outline: none; background: #fff; box-shadow: 0 5px 18px rgba(20,32,56,.035); }
.public-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,89,217,.1); }
.search-icon { position: absolute; top: 11px; left: 15px; color: #7a8596; font-size: 22px; }
.catalog-meta { display: grid; justify-items: end; color: var(--muted); font-size: 12px; }
.catalog-meta strong { color: var(--text); font-size: 14px; }
.vehicle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.vehicle-card { overflow: hidden; align-self: start; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 9px 30px rgba(20,32,56,.055); }
.vehicle-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #e9edf2; }
.vehicle-cover > img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.vehicle-card:hover .vehicle-cover > img { transform: scale(1.025); }
.vehicle-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #9aa4b2; background: linear-gradient(145deg,#f0f3f7,#e2e7ee); font-weight: 900; letter-spacing: .2em; }
.vehicle-status, .photo-count { position: absolute; top: 12px; padding: 6px 9px; border-radius: 999px; color: #fff; background: rgba(12,18,31,.75); backdrop-filter: blur(7px); font-size: 11px; font-weight: 800; }
.vehicle-status { left: 12px; }
.photo-count { right: 12px; }
.status-available { background: rgba(21,115,71,.86); }
.status-reserved { background: rgba(154,103,0,.86); }
.status-sold { background: rgba(98,104,116,.88); }
.vehicle-card-body { padding: 17px; }
.vehicle-title-row h2 { margin: 0 0 4px; font-size: 19px; }
.vehicle-title-row p { margin: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.vehicle-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.vehicle-facts div { padding: 9px 10px; border-radius: 9px; background: #f6f8fa; }
.vehicle-facts dt { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.vehicle-facts dd { margin: 3px 0 0; font-size: 13px; font-weight: 800; }
.details-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 11px 0 0; border: 0; border-top: 1px solid var(--line); color: var(--primary); background: none; cursor: pointer; font-weight: 800; }
.details-toggle .chevron { transition: transform .2s ease; }
.details-toggle.open .chevron { transform: rotate(180deg); }
.vehicle-expanded { padding-top: 8px; }
.detail-block { padding-top: 13px; }
.detail-block h3 { margin: 0 0 7px; font-size: 13px; }
.detail-block p { margin: 0; color: #475467; font-size: 13px; line-height: 1.65; white-space: pre-line; }
.vehicle-gallery { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.gallery-button { flex: 0 0 86px; height: 64px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #eef1f5; cursor: zoom-in; }
.gallery-button img { width: 100%; height: 100%; object-fit: cover; }
.no-results { padding: 70px 20px; color: var(--muted); text-align: center; }
.contact-banner { position: sticky; z-index: 20; bottom: 16px; display: flex; width: min(100%, 720px); margin: 28px auto 0; padding: 15px 20px; border-radius: 14px; color: #fff; background: #172033; box-shadow: 0 16px 38px rgba(12,18,31,.2); }
.contact-banner div { display: grid; gap: 3px; }
.contact-banner span { color: #bfc7d4; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.contact-banner strong { white-space: pre-line; }
.public-footer { display: flex; width: min(100% - 32px, 1240px); margin: 0 auto; padding: 24px 0 30px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.public-footer a { text-decoration: none; }
.lightbox { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(5,10,20,.9); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); cursor: pointer; font-size: 28px; }
.simple-page { width: min(100% - 32px, 600px); margin: 80px auto; padding: 28px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }

@media (max-width: 980px) {
    .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .language-settings-grid { grid-template-columns: 1fr; }
    .settings-bottom-grid { grid-template-columns: 1fr; }
    .inventory-toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-search { max-width: none; }
    .toolbar-buttons { flex-wrap: wrap; }
}

@media (max-width: 700px) {
    .admin-topbar-main, .public-header-inner { width: min(100% - 22px, 100%); }
    .admin-topbar-main { min-height: 66px; }
    .admin-topbar .eyebrow { display: none; }
    .admin-topbar h1 { font-size: 18px; }
    .topbar-actions .button.secondary, .topbar-actions .button.ghost[href] { display: none; }
    .admin-shell { width: min(100% - 14px, 100%); margin-top: 10px; }
    .admin-panel { border-radius: 13px; }
    .panel-heading { align-items: flex-start; padding: 17px; }
    .database-indicator { display: none; }
    .paste-strip { align-items: stretch; flex-direction: column; }
    .kdocs-paste-zone { width: 100%; }
    .grid-guide { align-items: flex-start; flex-direction: column; }
    .save-footer { align-items: stretch; flex-direction: column; }
    .save-footer .button { width: 100%; }
    .settings-form { padding: 17px; }
    .photo-editor-toolbar { align-items: stretch; flex-direction: column; }
    .modal { padding: 0; }
    .modal-card { width: 100%; max-height: 100vh; min-height: 100vh; border-radius: 0; }

    .public-header-inner { min-height: 0; padding: 15px 0; align-items: stretch; flex-direction: column; gap: 13px; }
    .brand-lockup h1 { font-size: 21px; }
    .language-switch { align-self: flex-start; }
    .public-shell { width: min(100% - 20px, 100%); margin-top: 14px; }
    .catalog-controls { align-items: stretch; flex-direction: column; gap: 9px; }
    .catalog-meta { grid-auto-flow: column; justify-content: space-between; justify-items: start; }
    .vehicle-grid { grid-template-columns: 1fr; gap: 13px; }
    .vehicle-card { border-radius: 14px; }
    .vehicle-cover { aspect-ratio: 16 / 9; }
    .contact-banner { bottom: 8px; }
}

/* V2: Chinese-only admin table, reliable search and photo carousel */
.compact-button { min-height: 42px; }
.inventory-grid th[data-column="brandZh"],
.inventory-grid td[data-field="brandZh"] { min-width: 120px; width: 140px; }
.inventory-grid th[data-column="modelZh"],
.inventory-grid td[data-field="modelZh"] { min-width: 150px; width: 180px; }
.inventory-grid th[data-column="configurationZh"],
.inventory-grid td[data-field="configurationZh"],
.inventory-grid th[data-column="conditionZh"],
.inventory-grid td[data-field="conditionZh"] { min-width: 240px; width: 280px; }
#noAdminSearchResults { border-top: 1px solid var(--line); }

.public-search { display: flex; }
.public-search input { padding-right: 92px; }
.public-search > button {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 76px;
    height: 36px;
    padding: 0 13px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}
.vehicle-card.search-hidden { display: none !important; }

.vehicle-carousel {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9edf2;
    touch-action: pan-y;
}
.carousel-viewport { width: 100%; height: 100%; overflow: hidden; }
.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .32s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
}
.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #e9edf2;
    cursor: zoom-in;
    overflow: hidden;
}
.carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.vehicle-card:hover .carousel-slide[aria-hidden="false"] img { transform: scale(1.025); }
.carousel-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    display: grid;
    width: 38px;
    height: 46px;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: rgba(8,15,28,.58);
    backdrop-filter: blur(6px);
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
}
.carousel-arrow:hover { background: rgba(8,15,28,.78); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-counter {
    position: absolute;
    z-index: 5;
    right: 12px;
    bottom: 11px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(8,15,28,.68);
    backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 800;
}
.vehicle-carousel .vehicle-placeholder { height: 100%; }
.vehicle-carousel .vehicle-status { z-index: 6; }

.lightbox-arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 52px;
    height: 64px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    font-size: 42px;
}
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-counter {
    position: absolute;
    z-index: 3;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,.14);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 700px) {
    .vehicle-carousel { aspect-ratio: 16 / 9; }
    .carousel-arrow { width: 34px; height: 42px; font-size: 28px; }
    .carousel-prev { left: 7px; }
    .carousel-next { right: 7px; }
    .lightbox { padding: 14px; }
    .lightbox-arrow { width: 42px; height: 54px; font-size: 34px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* V3: extended inventory, salesperson routes, pricing and media downloads */
.inventory-grid-v3 th,
.inventory-grid-v3 td { min-width: 120px; }
.inventory-grid-v3 th[data-column="seq"],
.inventory-grid-v3 td[data-field="seq"] { min-width: 64px; width: 64px; max-width: 72px; text-align: center; }
.inventory-grid-v3 th[data-column="vin"],
.inventory-grid-v3 td[data-field="vin"] { min-width: 125px; width: 135px; }
.inventory-grid-v3 th[data-column="brandModelZh"],
.inventory-grid-v3 td[data-field="brandModelZh"] { min-width: 190px; width: 210px; }
.inventory-grid-v3 th[data-column="configurationZh"],
.inventory-grid-v3 td[data-field="configurationZh"],
.inventory-grid-v3 th[data-column="conditionZh"],
.inventory-grid-v3 td[data-field="conditionZh"] { min-width: 250px; width: 290px; }
.inventory-grid-v3 th[data-column="exteriorPhotos"],
.inventory-grid-v3 th[data-column="plateDashboardPhotos"],
.inventory-grid-v3 th[data-column="videos"] { min-width: 170px; }
.inventory-grid-v3 th[data-column="stockInTime"] { min-width: 150px; }
.inventory-grid-v3 th[data-column="carCost"],
.inventory-grid-v3 th[data-column="ussuriyskPrice"] { min-width: 170px; }
.inventory-grid-v3 th[data-column="notes"],
.inventory-grid-v3 td[data-field="notes"] { min-width: 220px; width: 260px; }

.brand-model-cell { min-width: 200px !important; padding: 5px !important; }
.brand-model-line {
    min-height: 31px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: none;
    white-space: pre-wrap;
}
.brand-model-line + .brand-model-line { margin-top: 4px; border-top-color: var(--line); }
.brand-model-line:empty::before { content: attr(data-placeholder); color: #98a2b3; }
.brand-model-line:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(24,89,217,.1); }
.numeric-cell { text-align: right; font-variant-numeric: tabular-nums; }
.computed-price-cell { color: #0b6b42; background: #f0fbf5 !important; font-weight: 850; }
.computed-price-cell:empty::before { content: "自动计算"; color: #98a2b3; font-weight: 500; }
.video-cell { display: grid; gap: 7px; align-content: start; min-width: 160px !important; }
.video-count-chip { color: #475467; font-size: 12px; font-weight: 800; }

#videoUrlInput {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
    color: var(--text);
    background: #fff;
}
#videoUrlInput:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24, 89, 217, .12); }
.video-editor-gallery { display: grid; gap: 12px; max-height: 42vh; overflow: auto; margin-top: 16px; }
.video-draft-item {
    display: grid;
    grid-template-columns: minmax(180px, 300px) minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}
.video-draft-item video { width: 100%; max-height: 170px; border-radius: 8px; background: #111827; }
.video-draft-item span { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }

.sales-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.sales-table-wrap { overflow: auto; }
.sales-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sales-table th, .sales-table td { min-width: 145px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; background: #fff; }
.sales-table th { position: sticky; z-index: 2; top: 0; color: #344054; background: #f6f8fa; text-align: left; white-space: nowrap; }
.sales-table th:first-child, .sales-table td:first-child { min-width: 60px; text-align: center; }
.sales-table th:nth-last-child(-n+2), .sales-table td:nth-last-child(-n+2) { min-width: 85px; }
.sales-table input:not([type="checkbox"]), .sales-table textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    resize: vertical;
}
.sales-table input:focus, .sales-table textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(24,89,217,.1); }
.sales-empty-cell { padding: 36px !important; color: var(--muted); text-align: center !important; }
.sales-preview-cell { text-align: center; }
.settings-bottom-grid-v3 { grid-template-columns: 1fr 1fr minmax(150px, .35fr); }

.salesperson-name { display: inline-flex; margin-top: 5px; padding: 3px 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.vehicle-seq { position: absolute; z-index: 6; right: 12px; top: 12px; padding: 6px 9px; border-radius: 999px; color: #fff; background: rgba(12,18,31,.72); backdrop-filter: blur(7px); font-size: 11px; font-weight: 850; }
.vehicle-facts .price-fact { grid-column: 1 / -1; background: #edf9f2; }
.vehicle-facts .price-fact dt { color: #177245; }
.vehicle-facts .price-fact dd { color: #0e5f39; font-size: 15px; }
.vehicle-action-row { display: grid; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.vehicle-action-row .details-toggle { padding: 0; border-top: 0; }
.media-download-button {
    display: flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border: 1px solid #b9c9e8;
    border-radius: 9px;
    color: #174a9c;
    background: #f1f6ff;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
}
.media-download-button:hover { background: #e6efff; }
.compact-detail-block { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.compact-detail-block h3, .compact-detail-block p { margin: 0; }
.vehicle-video-grid { display: grid; gap: 10px; }
.vehicle-video-grid video { width: 100%; max-height: 280px; border-radius: 10px; background: #111827; }
.contact-banner { align-items: center; gap: 14px; }
.contact-banner > img { width: 54px; height: 54px; flex: 0 0 54px; object-fit: contain; border-radius: 12px; background: #fff; }
.contact-banner-link { text-decoration: none; }
.contact-banner-link:hover { background: #202b43; }

@media (max-width: 980px) {
    .settings-bottom-grid-v3 { grid-template-columns: 1fr; }
    .sales-toolbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 700px) {
    .video-draft-item { grid-template-columns: 1fr; }
    .video-draft-item video { max-height: 230px; }
    .contact-banner > img { width: 46px; height: 46px; flex-basis: 46px; }
}

/* V4: account management, panel-level CRUD permissions and read-only states */
.admin-current-user {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    color: rgba(255,255,255,.84);
    font-size: 12px;
    font-weight: 750;
}
.read-only-cell {
    color: #667085;
    background: #f8fafc !important;
}
.read-only-cell[contenteditable="false"] { cursor: default; }
.admin-users-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .9fr);
    gap: 20px;
    padding: 20px;
}
.admin-users-table-wrap,
.permission-matrix-wrap { overflow: auto; }
.admin-users-table,
.permission-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.admin-users-table th,
.admin-users-table td,
.permission-matrix th,
.permission-matrix td {
    padding: 10px 11px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    background: #fff;
    text-align: left;
}
.admin-users-table th,
.permission-matrix thead th {
    color: #344054;
    background: #f6f8fa;
    white-space: nowrap;
}
.admin-users-table tr > :first-child,
.permission-matrix tr > :first-child { border-left: 1px solid var(--line); }
.admin-users-table thead tr:first-child > *,
.permission-matrix thead tr:first-child > * { border-top: 1px solid var(--line); }
.admin-users-table thead tr:first-child > :first-child,
.permission-matrix thead tr:first-child > :first-child { border-top-left-radius: 10px; }
.admin-users-table thead tr:first-child > :last-child,
.permission-matrix thead tr:first-child > :last-child { border-top-right-radius: 10px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 128px; }
.admin-user-editor {
    align-self: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}
.compact-heading { padding: 0 0 14px; border-bottom: 0; }
.admin-user-basic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.admin-user-basic-grid label:not(.check-label) { display: grid; gap: 6px; }
.admin-user-basic-grid label > span { color: #475467; font-size: 12px; font-weight: 800; }
.admin-user-basic-grid input:not([type="checkbox"]) {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    outline: none;
    background: #fff;
}
.admin-user-basic-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,89,217,.1); }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.permission-matrix-wrap { margin-top: 16px; }
.permission-matrix th:not(:first-child),
.permission-matrix td:not(:first-child) { width: 62px; text-align: center; }
.permission-matrix input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.permission-chip {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}
.success-chip { color: #067647; background: #ecfdf3; }
.muted-chip { color: #475467; background: #f2f4f7; }
.super-chip { color: #6941c6; background: #f4f3ff; }
.media-download-button:disabled { cursor: wait; opacity: .72; }

@media (max-width: 1100px) {
    .admin-users-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .admin-users-layout { padding: 14px; }
    .admin-user-basic-grid { grid-template-columns: 1fr; }
    .admin-user-editor { padding: 14px; }
}

/* V4.2: native stock-in date picker and iPhone Photos-oriented media sharing */
.inventory-grid th[data-column="stockInTime"],
.inventory-grid td[data-field="stockInTime"] {
    min-width: 150px;
    width: 150px;
}
.date-cell { padding: 6px 8px !important; vertical-align: middle !important; }
.inventory-date-input {
    width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
    font: inherit;
}
.inventory-date-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(24,89,217,.1);
}
.inventory-date-input:disabled { color: #667085; background: #f2f4f7; cursor: not-allowed; }
.mobile-media-actions { display: none; gap: 8px; }
.mobile-media-save-button { width: 100%; }
.mobile-media-fallback {
    position: fixed;
    z-index: 130;
    inset: 0;
    display: grid;
    place-items: end center;
    padding: 14px;
}
.mobile-media-fallback-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.68); backdrop-filter: blur(3px); }
.mobile-media-fallback-card {
    position: relative;
    z-index: 1;
    width: min(100%, 720px);
    max-height: 88vh;
    overflow: auto;
    border-radius: 18px 18px 12px 12px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(4,12,30,.3);
}
.mobile-media-fallback-card > header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.mobile-media-fallback-card h2 { margin: 0; font-size: 18px; }
.mobile-media-fallback-card header button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #eef2f7;
    cursor: pointer;
    font-size: 24px;
}
.mobile-media-fallback-card > p { margin: 0; padding: 13px 18px; color: #475467; background: #f7f9fc; font-size: 13px; }
.mobile-media-fallback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.mobile-media-fallback-item {
    display: grid;
    gap: 6px;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
}
.mobile-media-fallback-item img,
.mobile-media-fallback-item video {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    object-fit: cover;
    background: #111827;
}
.mobile-media-fallback-item span { overflow: hidden; color: #667085; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 980px) {
    .desktop-media-download { display: none; }
    .mobile-media-actions { display: grid; }
}

@media (max-width: 520px) {
    .mobile-media-fallback-grid { grid-template-columns: 1fr; }
    .mobile-media-fallback-item img,
    .mobile-media-fallback-item video { aspect-ratio: 4 / 3; }
}

@media (pointer: coarse) {
    .desktop-media-download { display: none; }
    .mobile-media-actions { display: grid; }
}

/* V4.4 外部 API 管理 */
.api-clients-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr);
    gap: 18px;
    align-items: start;
}
.api-clients-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.api-clients-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.api-clients-table th,
.api-clients-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
.api-clients-table thead th { position: sticky; top: 0; z-index: 1; background: #f7f9fc; color: #344054; }
.api-public-key { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-client-editor { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbff; }
.api-client-basic-grid { display: grid; gap: 12px; margin-bottom: 14px; }
.api-client-basic-grid label:not(.check-label) { display: grid; gap: 7px; }
.api-client-basic-grid input[type="text"],
.api-client-basic-grid input:not([type]) { width: 100%; }
.api-secret-reveal {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 12px;
    margin: 0 0 18px;
    padding: 15px;
    border: 1px solid #fdb022;
    border-radius: 14px;
    background: #fffaeb;
}
.api-secret-reveal[hidden] { display: none; }
.api-secret-reveal > div { display: grid; gap: 5px; align-content: center; }
.api-secret-reveal > div span { color: #7a2e0e; font-size: 12px; }
.api-secret-reveal label { display: grid; gap: 6px; color: #344054; font-size: 12px; }
.copy-field { display: flex; gap: 7px; }
.copy-field input { min-width: 0; flex: 1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.api-docs { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.api-docs summary { cursor: pointer; font-weight: 700; }
.api-docs pre { overflow: auto; padding: 12px; border-radius: 10px; background: #101828; color: #e4e7ec; }
.api-endpoint-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(180px, 1.1fr); gap: 8px 14px; align-items: baseline; }
.api-endpoint-grid code { overflow-wrap: anywhere; color: #175cd3; }
.api-endpoint-grid span { color: #475467; font-size: 13px; }

@media (max-width: 1120px) {
    .api-clients-layout { grid-template-columns: 1fr; }
    .api-secret-reveal { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .api-endpoint-grid { grid-template-columns: 1fr; gap: 3px; }
    .api-endpoint-grid span { margin-bottom: 8px; }
    .copy-field { align-items: stretch; }
}

/* V4.5 price visibility and sales-specific pricing */
.sales-table select {
    width: 100%;
    min-height: 38px;
    padding: 8px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    background: #fff;
}
.sales-table select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(24,89,217,.1); }
.sales-table .sales-checkbox-cell { min-width: 92px; text-align: center; vertical-align: middle; }
.sales-table .sales-checkbox-cell input { width: 18px; height: 18px; }
.sales-table .sales-checkbox-cell[data-inherited="true"] { background: #f5f8ff; }
.default-price-settings {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(170px, .65fr) minmax(260px, 1fr) minmax(210px, .8fr);
    gap: 16px;
    align-items: end;
    margin: 18px 0 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}
.default-price-settings h3 { margin: 0 0 6px; }
.default-price-settings p, .default-price-settings small { color: var(--muted); }
.default-price-settings p { margin: 0; font-size: 13px; }
.default-price-settings label { display: grid; gap: 7px; }
.default-price-settings select,
.default-price-settings input[type="number"] {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
}
.default-price-settings .price-toggle-label {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
}
.default-price-settings .price-toggle-label input { width: 18px; height: 18px; }
@media (max-width: 1050px) {
    .default-price-settings { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .default-price-settings { grid-template-columns: 1fr; }
}
.default-price-settings[data-price-hidden="true"] label:not(.price-toggle-label) { opacity: .68; }
.default-price-settings input[readonly] { color: var(--muted); background: #eef2f6; cursor: not-allowed; }
.sales-table input:disabled, .sales-table textarea:disabled, .sales-table select:disabled { color: #7a8492; background: #f2f4f7; cursor: not-allowed; }

/* V4.6 salesperson titles, catalog sorting, upload progress and visit analytics */
.catalog-sort {
    display: grid;
    min-width: 220px;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}
.catalog-sort select {
    min-height: 48px;
    padding: 10px 38px 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    outline: none;
    color: var(--text);
    background: #fff;
    box-shadow: 0 5px 18px rgba(20,32,56,.035);
}
.catalog-sort select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,89,217,.1); }

.sales-logo-cell { min-width: 170px !important; }
.sales-logo-uploader { display: grid; justify-items: start; gap: 7px; }
.sales-logo-uploader img { width: 72px; height: 54px; object-fit: contain; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.sales-logo-remove { padding: 0; border: 0; color: #b42318; background: transparent; cursor: pointer; font-size: 12px; }
.sales-logo-remove:disabled { color: #98a2b3; cursor: not-allowed; }

.video-upload-progress-panel {
    display: grid;
    gap: 8px;
    margin: 0 20px 12px;
    padding: 13px 14px;
    border: 1px solid #b9c9e8;
    border-radius: 11px;
    background: #f1f6ff;
}
.video-upload-progress-panel[hidden] { display: none; }
.video-upload-progress-panel > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.video-upload-progress-panel progress { width: 100%; height: 14px; accent-color: var(--primary); }
.video-upload-progress-panel p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.video-upload-progress-panel.complete { border-color: #86d4a5; background: #eefbf3; }
.compact-status { margin: 0 20px 12px; }

.visits-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.visits-toolbar .toolbar-search { flex: 1; max-width: 560px; }
.visits-toolbar > span { margin-left: auto; color: var(--muted); font-size: 12px; }
.visit-table-wrap { max-height: 650px; overflow: auto; }
.visit-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.visit-table th, .visit-table td { min-width: 125px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; background: #fff; font-size: 12px; }
.visit-table th { position: sticky; z-index: 2; top: 0; color: #344054; background: #f6f8fa; text-align: left; white-space: nowrap; }
.visit-table td { max-width: 280px; overflow-wrap: anywhere; }
.visit-table td strong, .visit-table td span, .visit-table td small { display: block; }
.visit-table td span, .visit-table td small { margin-top: 4px; color: var(--muted); }
.visit-table td a { display: inline-block; margin-top: 5px; }
.visit-table .visit-ip { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

@media (max-width: 900px) {
    .catalog-sort { width: 100%; min-width: 0; }
    .visits-toolbar { align-items: stretch; flex-direction: column; }
    .visits-toolbar .toolbar-search { width: 100%; max-width: none; }
    .visits-toolbar > span { margin-left: 0; }
}

/* V4.6.2 API output controls and visit refresh */
.panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.api-client-basic-grid input[type="number"] { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.api-client-basic-grid small { color: var(--muted); line-height: 1.45; }
@media (max-width: 700px) {
    .panel-heading-actions { width: 100%; justify-content: flex-start; }
    .visits-panel .panel-heading { flex-direction: column; }
}
