/* 用车无忧 - 样式 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --blue-bg: #eff6ff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* 内联 SVG 图标 */
.ico {
  width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; flex-shrink: 0;
}
.btn .ico { margin-right: 4px; }
.nav-item .ico { width: 17px; height: 17px; margin-right: 9px; opacity: .85; }
.nav-item.active .ico { opacity: 1; }
.tab .ico { width: 15px; height: 15px; margin-right: 5px; }
.qi .ico { width: 24px; height: 24px; margin: 0; color: var(--primary); display: block; margin: 0 auto 6px; }
.empty .icon .ico { width: 40px; height: 40px; margin: 0; color: #cbd5e1; stroke-width: 1.4; }
.tip-box .ico, .diag-note .ico { width: 14px; height: 14px; margin-right: 5px; }
.summary-card .s-title .ico { width: 15px; height: 15px; margin-right: 5px; color: var(--primary); }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; background: #fff; border-right: 1px solid var(--border);
  padding: 16px 10px; flex-shrink: 0;
}
.sidebar .logo { font-size: 18px; font-weight: 700; color: var(--primary); padding: 6px 12px 18px; }
.nav-item {
  display: block; width: 100%; text-align: left; padding: 11px 14px; margin-bottom: 4px;
  border: none; background: transparent; border-radius: 8px; font-size: 14px; color: var(--text-2);
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.main { flex: 1; min-width: 0; padding: 20px 28px; } /* 主区随浏览器宽度自适应，不再固定 1200px 上限 */

/* ===== 顶栏 ===== */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 12px 28px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.topbar .title { font-size: 16px; font-weight: 700; white-space: nowrap; }
.vehicle-switcher { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.vehicle-switcher select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  max-width: 240px;
}
.brand-tag {
  color: var(--text-3); font-size: 12px;
  max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-tag .ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }

/* ===== 通用组件 ===== */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; }
.vendor-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vendor-card:hover { border-color: var(--primary, #4f6ef2); }
/* 车况日历 */
.calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  width: 100%; /* 铺满卡片宽度，避免右侧留白 */
}
.cal-head { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0; font-weight: 600; }
.cal-day {
  aspect-ratio: 3 / 1; min-height: 48px; /* 等宽 + 固定比例 = 所有格子大小一致 */
  border: 1px solid var(--border); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13px; position: relative; background: #fff; color: var(--text);
  overflow: hidden; white-space: nowrap;
}
.cal-day.empty { background: transparent; border-color: transparent; }
.cal-day.has-rec { background: #eef7ee; border-color: #bfe3bf; cursor: pointer; }
.cal-day.has-rec:hover { border-color: #7ec97e; }
.cal-day.has-rec .dot { width: 6px; height: 6px; border-radius: 50%; background: #3a9d3a; position: absolute; bottom: 4px; }
.cal-day.today { border: 2px solid var(--primary, #4f6ef2); font-weight: 700; }
.cal-day.selected { background: var(--primary, #4f6ef2); border-color: var(--primary, #4f6ef2); color: #fff; cursor: pointer; }
.cal-day.selected .dot { background: #fff; }
.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text-2); font-size: 13px;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fff; border-color: #fca5a5; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.info { background: var(--blue-bg); color: var(--primary); }
.badge.gray { background: var(--bg); color: var(--text-3); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--text-3);
}
.empty .icon { font-size: 40px; margin-bottom: 10px; }
.empty .hint { margin-bottom: 16px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
table.list th { color: var(--text-3); font-weight: 500; font-size: 12px; white-space: nowrap; }
table.list tr:last-child td { border-bottom: none; }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 18px; border: none; background: transparent; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.form-row label .req { color: var(--red); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.form-row textarea { resize: vertical; min-height: 64px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer; font-size: 13px; user-select: none;
}
.check-item.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar .spacer { flex: 1; }
.chip {
  padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff;
  font-size: 12px; color: var(--text-2);
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 首页 ===== */
.hero-card { display: flex; justify-content: space-between; align-items: flex-start; }
.hero-card .v-name { font-size: 20px; font-weight: 700; }
.hero-card .v-meta { color: var(--text-2); margin-top: 6px; font-size: 13px; }
.hero-card .v-mile { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.summary-card { cursor: pointer; transition: box-shadow .15s; }
.summary-card:hover { box-shadow: 0 3px 10px rgba(37, 99, 235, .12); border-color: var(--primary); }
.summary-card .s-title { font-size: 13px; color: var(--text-3); margin-bottom: 8px; display: flex; justify-content: space-between; }
.summary-card .s-body { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-btn {
  padding: 16px 10px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--text-2);
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); }
.quick-btn .qi { font-size: 22px; display: block; margin-bottom: 6px; }
.other-vehicle {
  display: flex; justify-content: space-between; align-items: center; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer;
}
.other-vehicle:hover { border-color: var(--primary); }

/* ===== 弹窗 / Toast ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 14px; width: 520px; max-width: 92vw; max-height: 88vh;
  overflow-y: auto; padding: 22px;
}
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-text { color: var(--text-2); line-height: 1.8; font-size: 14px; }
.confirm-text .danger { color: var(--red); font-weight: 600; }
#toast-box { position: fixed; top: 18px; right: 18px; z-index: 200; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 8px; margin-bottom: 8px;
  font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: slidein .2s;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; } }

/* ===== 诊断 ===== */
.diag-result { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.diag-item { padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fff; }
.diag-item:last-child { border-bottom: none; }
.diag-item .d-head { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 600; }
.diag-item .d-line { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.diag-note { background: var(--amber-bg); color: var(--amber); padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-top: 12px; line-height: 1.7; }
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { width: 90px; color: var(--text-3); flex-shrink: 0; }
.detail-row .v { flex: 1; color: var(--text); word-break: break-all; }
.muted { color: var(--text-3); font-size: 12px; }
.tip-box { background: var(--blue-bg); color: var(--primary-dark); padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 14px; line-height: 1.7; }
.section-title { font-size: 15px; font-weight: 600; margin: 20px 0 10px; }

/* ===== 响应式自适应 ===== */
/* 中窄屏：侧边栏折叠为顶部横向导航，主区占满宽度 */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .sidebar .logo { padding: 2px 10px 10px; width: 100%; }
  .nav-item {
    width: auto; flex: 1 1 auto; text-align: center; margin-bottom: 0;
    padding: 9px 10px; white-space: nowrap;
  }
  .main { max-width: 100%; padding: 16px 14px; }
  .topbar { padding: 10px 14px; }
  .topbar .title { font-size: 15px; }
}
/* 手机窄屏：表单/摘要卡单列，快捷入口两列，表格横向滚动 */
@media (max-width: 640px) {
  body { font-size: 13px; }
  .topbar { padding: 8px 10px; }
  .vehicle-switcher { width: 100%; }
  .vehicle-switcher select { max-width: 100%; flex: 1 1 140px; }
  .brand-tag { max-width: 100%; }
  .main { padding: 12px 10px; }
  .card { padding: 14px; overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card { flex-direction: column; gap: 10px; }
  .modal { width: 94vw; padding: 16px; }
  .tabs { overflow-x: auto; }
  .tab { padding: 9px 12px; white-space: nowrap; }
}

/* ===== 深色主题 ===== */
body[data-theme="dark"] {
  --bg: #0f172a; --card: #1e293b; --border: #334155;
  --text: #e2e8f0; --text-2: #a9b6c7; --text-3: #7f8c9e;
  --primary-light: #1e3a8a; --blue-bg: #172554;
  --green-bg: #14532d; --red-bg: #4c1d1d; --amber-bg: #422006;
}
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .card,
body[data-theme="dark"] .modal,
body[data-theme="dark"] .btn,
body[data-theme="dark"] .cal-day,
body[data-theme="dark"] .diag-item,
body[data-theme="dark"] .chip,
body[data-theme="dark"] select,
body[data-theme="dark"] input,
body[data-theme="dark"] textarea {
  background: var(--card); color: var(--text); border-color: var(--border);
}
body[data-theme="dark"] .nav-item { background: transparent; color: var(--text-2); }
body[data-theme="dark"] .nav-item:hover { background: #273449; }
body[data-theme="dark"] .nav-item.active { background: var(--primary-light); color: #bfdbfe; }
body[data-theme="dark"] .cal-day.has-rec { background: #14361f; border-color: #2f6b3f; }
body[data-theme="dark"] .cal-day.empty { background: transparent; border-color: transparent; }
body[data-theme="dark"] .cal-day.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
body[data-theme="dark"] .toast { background: #334155; color: #f8fafc; }
body[data-theme="dark"] table.list th { color: var(--text-3); }
body[data-theme="dark"] .tip-box { color: #bfdbfe; }

/* ===== 登录页与云端同步 ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 26px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
.auth-logo { display: flex; justify-content: center; }
.auth-logo .ico { width: 42px; height: 42px; color: var(--primary); }
.auth-card .form-row { margin-bottom: 10px; }
.auth-card input { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.sync-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); white-space: nowrap; }
.sync-badge.saved { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.sync-badge.syncing { color: #1e40af; background: #dbeafe; border-color: #bfdbfe; }
.sync-badge.error { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.sync-badge.idle { color: var(--text-3); }
body[data-theme="dark"] .sync-badge.saved { color: #86efac; background: #14532d; border-color: #166534; }
body[data-theme="dark"] .sync-badge.syncing { color: #93c5fd; background: #172554; border-color: #1e3a8a; }
body[data-theme="dark"] .sync-badge.error { color: #fca5a5; background: #450a0a; border-color: #7f1d1d; }

/* ===== 应急处理模块 ===== */
.scen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.scen-card { cursor: pointer; margin: 0; }
.scen-card:hover { border-color: var(--primary); }
.scen-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.progress-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.progress-bar { flex: 1; height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 6px; transition: width .25s; }
.emg-steps { margin-top: 8px; }
.step-item {
  display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: var(--card);
  align-items: flex-start; transition: background .15s;
}
.step-item:hover { background: var(--primary-light); }
.step-item.done { opacity: .62; }
.step-item.done .step-body b { text-decoration: line-through; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; margin-top: 1px;
}
.step-num .ico { margin: 0; width: 14px; height: 14px; }
.step-body b { font-size: 14px; }
.step-body .muted { font-size: 12.5px; margin-top: 2px; line-height: 1.6; }
.call-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.phone-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--red);
  color: var(--red); border-radius: 20px; padding: 3px 10px; font-size: 12.5px; background: var(--red-bg);
}
.phone-chip .ico { width: 13px; height: 13px; margin: 0; }
.phone-chip .call-link { color: var(--red); text-decoration: none; font-weight: 600; }
.phone-chip .copy-btn { border: none; background: transparent; color: var(--text-3); font-size: 12px; padding: 0 2px; cursor: pointer; }
.phone-chip .copy-btn:hover { color: var(--text); }
.phone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.phone-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.phone-num { font-size: 24px; font-weight: 800; color: var(--red); letter-spacing: 1px; }
.call-link { text-decoration: none; }
.ins-item { padding: 12px 0; border-bottom: 1px dashed var(--border); line-height: 1.7; }
.ins-item:last-child { border-bottom: none; }
.ins-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ins-price { color: var(--primary-dark); background: var(--blue-bg); display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; margin: 2px 0 4px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chat-box {
  height: 380px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px;
}
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .bubble {
  max-width: 78%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.7;
  background: var(--card); border: 1px solid var(--border);
}
.chat-msg.user .bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); }
.btn.listening { background: var(--red); border-color: var(--red); color: #fff; animation: pulse-red 1.2s infinite; }
@keyframes pulse-red { 0%,100% { opacity: 1; } 50% { opacity: .65; } }

@media (max-width: 900px) {
  .scen-grid, .phone-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .scen-grid, .phone-grid { grid-template-columns: 1fr; }
  .chat-box { height: 300px; }
  .chat-input-row { flex-wrap: wrap; }
  .chat-input-row input { min-width: 0; }
}
body[data-theme="dark"] .step-item:hover { background: #273449; }
body[data-theme="dark"] .chat-msg .bubble { background: #1e293b; border-color: #334155; }
body[data-theme="dark"] .chat-msg.user .bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
body[data-theme="dark"] .chat-box { background: #0f172a; }
body[data-theme="dark"] .phone-chip { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
body[data-theme="dark"] .phone-chip .call-link { color: #fca5a5; }
body[data-theme="dark"] .phone-num { color: #f87171; }
body[data-theme="dark"] .ins-price { background: #172554; color: #93c5fd; }
body[data-theme="dark"] .progress-bar { background: #273449; }

/* ===== 三端模块：角色导航 / 订单 / 店铺 / 管理后台 ===== */
.role-tag { font-size: 11px; color: var(--text-3); padding: 2px 12px 10px; letter-spacing: 2px; }
.order-card .scen-head b { font-size: 15px; }
.order-timeline { margin: 8px 0 4px; border-left: 2px solid var(--border); padding-left: 12px; }
.tl-item { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 13px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; margin-left: -17px; box-shadow: 0 0 0 3px var(--card); }
.tl-time { font-size: 11.5px; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border);
  border-radius: 16px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; user-select: none;
}
.brand-chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.brand-chip input { display: none; }
.warn-box { border-color: #f59e0b; color: #92600a; background: #fffbeb; }
body[data-theme="dark"] .warn-box { background: #3b2f0b; color: #fde68a; border-color: #92600a; }
body[data-theme="dark"] .tl-dot { box-shadow: 0 0 0 3px #1e293b; }
@media (max-width: 640px) {
  .order-timeline { padding-left: 10px; }
}

/* ===== 入口分离：登录页入口选择 + 顶栏入口切换 ===== */
.portal-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.portal-opt {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 6px;
  background: var(--card); cursor: pointer; transition: border-color .15s, background .15s;
}
.portal-opt .ico { width: 20px; height: 20px; margin: 0; }
.portal-opt b { font-size: 13px; }
.portal-opt span { font-size: 11px; color: var(--text-3); }
.portal-opt:hover { border-color: var(--primary); }
.portal-opt.on { border-color: var(--primary); background: var(--primary-light); }
.portal-opt.on b { color: var(--primary-dark); }
.portal-switch { display: inline-flex; gap: 4px; margin-right: 6px; }
.portal-chip {
  border: 1px solid var(--border); background: var(--card); color: var(--text-3);
  border-radius: 16px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.portal-chip:hover { border-color: var(--primary); color: var(--primary); }
.portal-chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }
body[data-theme="dark"] .portal-opt.on b { color: #93c5fd; }
@media (max-width: 640px) {
  .portal-pick { grid-template-columns: 1fr; }
  .portal-switch { flex-wrap: wrap; }
}
