:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --line: #d7e1e7;
  --ink: #172026;
  --muted: #60707a;
  --green: #1f7a4d;
  --green-strong: #126338;
  --amber: #a86c16;
  --red: #b3261e;
  --blue: #255e91;
  --shadow: 0 14px 32px rgba(25, 42, 55, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, #eaf1f5, var(--bg)); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; }
button, input, textarea { font: inherit; }
select { font: inherit; }
body.access-active { background: linear-gradient(180deg, #2b5c8f 0%, #0d1f38 42%, #050b14 100%); color: #fff; }
[hidden] { display: none !important; }
.access-shell { width: min(620px, calc(100vw - 28px)); margin: 52px auto 24px; text-align: center; }
.brand h1 { color: #fff; font-size: 30px; letter-spacing: 2px; text-transform: uppercase; }
.brand p { color: rgba(255, 255, 255, 0.76); font-size: 12px; letter-spacing: 1px; margin-top: 6px; text-transform: uppercase; }
.access-card { margin-top: 34px; padding: 34px 30px; background: rgba(13, 27, 48, 0.88); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44); }
.auth-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.tab-btn { min-height: 42px; margin: 0; border: 2px solid rgba(255, 255, 255, 0.16); border-radius: 8px; padding: 0 22px; color: rgba(255, 255, 255, 0.68); background: transparent; font-size: 15px; font-weight: 900; transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.tab-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.32); }
.tab-btn.active { color: #fff; border-color: #00aeca; background: #00aeca; box-shadow: 0 0 14px rgba(0, 174, 202, 0.34); }
.auth-section { text-align: center; }
.access-heading { margin-bottom: 14px; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.access-note { color: rgba(255, 255, 255, 0.78); font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
.access-form { display: grid; gap: 12px; }
.access-form input, .access-form select { height: 44px; border-color: rgba(255, 255, 255, 0.2); background: rgba(5, 11, 20, 0.72); color: #fff; text-align: center; }
.access-form input::placeholder { color: rgba(255, 255, 255, 0.52); }
.access-form select { padding: 0 12px; }
.access-form button { margin: 0; color: #fff; background: #00aeca; border-color: #00aeca; }
.access-form button:hover { background: #0096b0; }
.btn-secondary { background: #23877c !important; border-color: #23877c !important; }
.btn-secondary:hover { background: #1c7168 !important; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: rgba(255, 255, 255, 0.82); font-size: 12px; line-height: 1.45; text-align: left; }
.check-row input { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto; }
.access-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; color: rgba(255, 255, 255, 0.55); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.access-divider::before, .access-divider::after { content: ""; height: 1px; flex: 1; background: rgba(255, 255, 255, 0.14); }
.success-message { margin-top: 12px; padding: 11px 12px; border: 1px solid rgba(42, 157, 143, 0.65); border-radius: 6px; background: rgba(42, 157, 143, 0.15); color: #d7fff7; font-size: 13px; line-height: 1.45; text-align: left; }
.error-message { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(179, 38, 30, 0.6); border-radius: 6px; background: rgba(179, 38, 30, 0.16); color: #ffd0cc; font-size: 13px; }
.shell { width: min(1280px, calc(100vw - 28px)); margin: 0 auto; padding: 20px 0 28px; }
.topbar, .section-title, .status, .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar { flex-wrap: wrap; }
.customer-brand { min-width: 120px; min-height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.customer-brand img { max-width: 120px; max-height: 52px; object-fit: contain; display: block; }
.customer-brand-meta { max-width: 180px; color: var(--muted); font-size: 12px; line-height: 1.35; text-align: right; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bulk-toggle-button { min-height: 42px; margin: 0; color: #fff; background: var(--blue); border-color: var(--blue); }
.bulk-toggle-button:hover { background: #1d4f7e; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 17px; }
.topbar p, .section-title span, label, .muted { color: var(--muted); }
.status, .panel, .warning { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.status { min-width: 190px; padding: 11px 12px; }
.status span { color: var(--muted); }
.warning { margin: 14px 0 12px; padding: 12px; }
.business-note { margin-top: 14px; padding: 10px 12px; border: 1px solid rgba(42, 157, 143, 0.45); border-radius: 8px; background: rgba(42, 157, 143, 0.1); color: var(--muted); font-size: 13px; line-height: 1.45; }
.bulk-panel { margin-bottom: 12px; border-color: #c8d9ea; background: linear-gradient(180deg, #fbfdff, #f2f7fb); }
.bulk-intro { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.bulk-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; margin-top: 12px; }
.bulk-drop { min-height: 84px; display: flex; flex-direction: column; justify-content: center; gap: 6px; border: 2px dashed #93b7d7; border-radius: 8px; padding: 14px; background: #fff; color: var(--ink); cursor: pointer; }
.bulk-drop input { display: none; }
.bulk-drop span { font-weight: 900; }
.bulk-drop small { color: var(--muted); line-height: 1.35; }
.bulk-upload-row button { min-width: 160px; margin: 0; color: #fff; background: var(--green-strong); border-color: #0b4f2b; }
.bulk-summary { display: grid; gap: 12px; margin-top: 12px; }
.bulk-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bulk-summary-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.bulk-summary-card span { display: block; color: var(--muted); font-size: 12px; }
.bulk-summary-card strong { display: block; margin-top: 4px; font-size: 20px; }
.bulk-summary-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bulk-summary-actions button { min-height: 38px; margin: 0; color: var(--blue); background: #fff; }
.bulk-summary-actions button.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.bulk-portfolio-summary { display: grid; gap: 12px; padding: 12px; border: 1px solid #dbe6ee; border-radius: 8px; background: #fff; }
.bulk-portfolio-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bulk-portfolio-meta { color: var(--ink); font-size: 13px; line-height: 1.5; }
.bulk-external-compare { display: grid; gap: 12px; padding: 12px; border: 1px solid #dbe6ee; border-radius: 8px; background: #f9fbfd; }
.bulk-external-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bulk-external-head strong { color: var(--ink); font-size: 14px; }
.bulk-external-head span { color: var(--muted); font-size: 12px; font-weight: 700; }
.bulk-external-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bulk-external-inputs label { min-width: 0; font-size: 13px; }
.bulk-external-inputs input { height: 40px; }
.bulk-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-pills span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: #fff; color: var(--blue); font-weight: 800; font-size: 12px; }
.bulk-meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.bulk-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bulk-detail-box { border: 1px solid #dbe6ee; border-radius: 8px; background: #f9fbfd; padding: 12px; display: grid; gap: 10px; }
.bulk-detail-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bulk-detail-head strong { color: var(--ink); font-size: 14px; }
.bulk-detail-head span { color: var(--muted); font-size: 12px; font-weight: 800; }
.bulk-detail-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding-right: 4px; }
.bulk-detail-item { border: 1px solid #e1eaf1; border-radius: 8px; background: #fff; padding: 10px; display: grid; gap: 4px; color: var(--ink); font-size: 13px; line-height: 1.35; }
.bulk-detail-item strong { color: var(--ink); }
.bulk-detail-item small { color: var(--muted); }
.bulk-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; padding: 12px; border: 1px solid #dbe6ee; border-radius: 8px; background: #fff; }
.bulk-filters label { min-width: 160px; font-size: 13px; }
.bulk-filters select { height: 38px; }
.bulk-filters .check-row { margin: 0; color: var(--ink); font-size: 13px; }
.bulk-filters .check-row input { margin-top: 1px; }
.bulk-filter-stats { color: var(--muted); font-size: 13px; font-weight: 700; }
.bulk-results { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.bulk-results-head { display: grid; grid-template-columns: minmax(220px, 1.8fr) minmax(88px, 0.8fr) minmax(84px, 0.7fr) minmax(120px, 0.8fr) minmax(220px, 1.5fr) auto; gap: 10px; padding: 10px 12px; background: #edf4fa; color: #2b475d; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.bulk-result-row { display: grid; grid-template-columns: minmax(220px, 1.8fr) minmax(88px, 0.8fr) minmax(84px, 0.7fr) minmax(120px, 0.8fr) minmax(220px, 1.5fr) auto; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: center; }
.bulk-result-row strong { display: block; color: var(--ink); }
.bulk-result-row small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.bulk-result-row .signal { min-height: 34px; padding: 6px 12px; font-size: 12px; justify-self: start; }
.bulk-market { font-weight: 900; color: var(--ink); }
.bulk-warnings { color: var(--muted); font-size: 13px; line-height: 1.4; }
.bulk-result-row button { min-height: 34px; margin: 0; color: var(--blue); white-space: nowrap; }
.support-panel { margin-top: 14px; padding: 12px; border: 1px solid rgba(212, 122, 0, 0.32); border-radius: 8px; background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 239, 218, 0.88)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84); }
.support-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.support-head strong { color: #7a4200; font-size: 14px; }
.support-head span { color: #a85a00; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px; }
.support-panel p { margin-top: 8px; color: #7a5a39; font-size: 13px; line-height: 1.45; }
.support-button { width: 100%; min-height: 48px; margin-top: 10px; color: #fff; background: #d47a00; border-color: #b56600; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.support-button:hover { background: #bf6d00; }
.support-button:disabled { background: #dfb378; border-color: #dfb378; cursor: progress; }
.support-status { margin-top: 10px; padding: 10px 11px; border: 1px solid rgba(212, 122, 0, 0.22); border-radius: 8px; background: rgba(255, 255, 255, 0.76); color: #7a5a39; font-size: 13px; line-height: 1.45; }
.support-status.is-ok { border-color: rgba(31, 122, 77, 0.28); background: rgba(31, 122, 77, 0.08); color: #185336; font-weight: 700; }
.support-status.is-error { border-color: rgba(179, 38, 30, 0.32); background: rgba(179, 38, 30, 0.08); color: #8e221d; font-weight: 700; }
.support-status.is-note { border-color: rgba(37, 94, 145, 0.26); background: rgba(37, 94, 145, 0.06); color: #204b73; font-weight: 700; }
.admin-monitor { margin-top: 14px; padding: 12px; border: 1px solid rgba(37, 94, 145, 0.24); border-radius: 8px; background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(236, 245, 253, 0.92)); }
.admin-monitor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-monitor-head strong { color: #1d4f7e; font-size: 14px; }
.admin-monitor-head button { min-height: 32px; margin: 0; color: #fff; background: var(--blue); border-color: var(--blue); }
.admin-monitor-sep { height: 1px; margin: 12px 0; background: #d8e5ef; }
.admin-activity-status { margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.admin-activity-list { display: grid; gap: 8px; margin-top: 10px; }
.admin-activity-item { border: 1px solid #d8e5ef; border-radius: 8px; padding: 9px 10px; background: #fff; }
.admin-activity-item strong { display: block; color: var(--ink); font-size: 13px; }
.admin-activity-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.quota-card { margin-top: 14px; padding: 12px; border: 1px solid #b9d4e9; border-radius: 8px; background: linear-gradient(180deg, #f8fcff, #eef7fd); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85); }
.quota-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid #d8e7f1; }
.quota-head span { color: var(--ink); font-size: 13px; font-weight: 900; line-height: 1.25; }
.quota-head strong { color: var(--blue); font-size: 12px; text-align: right; text-transform: uppercase; letter-spacing: 0.4px; }
.quota-label { margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.quota-bar { height: 13px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #dbe6ed; border: 1px solid #c9d8e0; }
.quota-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1f7a4d, #2da86c); transition: width 220ms ease; }
.quota-count { margin-top: 8px; color: var(--ink); font-size: 14px; font-weight: 900; }
.quota-foot { display: grid; gap: 4px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.api-limit { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; color: var(--muted); font-size: 13px; font-weight: 700; }
.api-limit.warning-limit { border-color: var(--amber); color: var(--amber); background: #fff8ed; }
.grid { display: grid; grid-template-columns: 280px minmax(420px, 1.4fr) minmax(360px, 1fr); gap: 12px; align-items: start; }
.panel { padding: 14px; }
.wide { grid-column: 1 / -1; }
.watch-list { display: grid; gap: 8px; margin-top: 12px; }
.watch-item, .metric { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
label { display: grid; gap: 6px; font-size: 14px; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
input, select { height: 42px; padding: 0 10px; }
textarea { min-height: 68px; padding: 9px 10px; resize: vertical; }
button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; font-weight: 800; padding: 0 12px; margin-top: 8px; }
button:disabled { cursor: progress; opacity: 0.65; }
.primary { color: #fff; background: var(--green-strong); border-color: #0b4f2b; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.primary:hover { background: #0f5a32; }
.small-action { justify-self: start; min-height: 32px; margin-top: 10px; color: var(--blue); }
.save-case { color: #fff; background: var(--blue); border-color: var(--blue); margin-left: 6px; }
.workflow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.full-workflow { grid-column: 1 / -1; }
.workflow-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fbfd; }
.scanner-card { background: linear-gradient(180deg, #f5fbff, #eef8fb); border-color: #b9dce8; }
.workflow-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.workflow-title strong { font-size: 15px; }
.workflow-title span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.search-box, .direct-import { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; }
.search-box label { min-width: 0; }
.search-box button, .direct-import button { min-width: 120px; margin: 0; color: #fff; background: var(--blue); border-color: var(--blue); }
.search-box button { white-space: nowrap; align-self: end; }
.search-box span, .direct-import span { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.reverse-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 22px; align-items: end; }
.reverse-box button { width: min(260px, 100%); margin: 0; color: #fff; background: var(--green-strong); border-color: #0b4f2b; }
.reverse-box span { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.azure-box { display: grid; gap: 10px; align-items: end; }
.azure-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.azure-actions button { min-width: 160px; margin: 0; }
.azure-actions button.secondary { color: var(--blue); background: #fff; border-color: var(--line); }
.azure-box span { color: var(--muted); font-size: 13px; }
.azure-output { border: 1px solid #dbe6ee; border-radius: 8px; background: #fff; padding: 12px; color: var(--ink); white-space: pre-wrap; line-height: 1.5; }
.scanner-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: stretch; }
.scanner-preview { position: relative; min-height: 196px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #0f1720; }
.scanner-preview video { width: 100%; height: 100%; min-height: 196px; display: block; object-fit: cover; }
.camera-guide-banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); width: min(92%, 520px); padding: 10px 14px; border-radius: 999px; background: rgba(15, 23, 32, 0.62); color: #fff; text-align: center; font-size: 14px; font-weight: 800; line-height: 1.35; backdrop-filter: blur(8px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2); z-index: 3; }
.camera-guide-banner.is-warning { background: rgba(168, 108, 22, 0.82); }
.camera-guide-banner.is-danger { background: rgba(179, 38, 30, 0.82); }
.camera-guide-banner.is-success { background: rgba(21, 128, 61, 0.84); }
.scanner-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; color: rgba(255, 255, 255, 0.88); text-align: center; font-weight: 700; line-height: 1.45; background: linear-gradient(180deg, rgba(15, 23, 32, 0.88), rgba(15, 23, 32, 0.68)); }
.scanner-preview.active .scanner-empty { display: none; }
.scanner-actions { display: grid; gap: 8px; align-content: start; }
.camera-drop { min-height: 118px; display: flex; flex-direction: column; justify-content: center; gap: 6px; border: 2px dashed #7cb8c8; border-radius: 8px; padding: 14px; background: rgba(255, 255, 255, 0.72); color: var(--ink); cursor: pointer; text-align: center; }
.camera-drop input { display: none; }
.camera-drop span { font-weight: 900; }
.camera-drop small { color: var(--muted); line-height: 1.35; }
.scanner-serial-input { grid-column: 1 / -1; }
.scanner-serial-input input { margin-top: 2px; }
.scanner-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scanner-upload-actions #scanButton { min-height: 50px; min-width: 180px; margin: 0; color: #fff; background: var(--green-strong); border-color: #0b4f2b; }
.scanner-upload-actions #scanClearButton { min-height: 50px; margin: 0; color: var(--red); background: #fff; border-color: var(--red); }
.scan-preview-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.scan-preview-item { position: relative; min-height: 96px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.scan-preview-item img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.scan-preview-item button { position: absolute; top: 5px; right: 5px; min-width: 0; min-height: 26px; margin: 0; padding: 0 7px; color: #fff; background: rgba(179, 38, 30, 0.9); border-color: rgba(179, 38, 30, 0.9); }
.scan-preview-item span { position: absolute; left: 5px; bottom: 5px; border-radius: 999px; padding: 3px 7px; color: #fff; background: rgba(23, 32, 38, 0.76); font-size: 12px; font-weight: 900; }
.scanner-box button { align-self: center; min-width: 142px; margin: 0; color: #fff; background: var(--green-strong); border-color: #0b4f2b; }
.scanner-box #torchButton[data-torch='on'] { background: #d47a00; border-color: #d47a00; }
.scanner-box > span { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.compact-label input { text-align: center; }
.keyword-results { display: grid; gap: 8px; margin: 12px 0 4px; }
.keyword-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #f8fbfd; }
.keyword-thumb { width: 72px; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.keyword-title { font-weight: 900; }
.keyword-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 13px; margin-top: 5px; }
.keyword-meta span { white-space: nowrap; }
.keyword-actions { display: flex; flex-direction: column; gap: 6px; }
.keyword-actions button { min-height: 32px; margin: 0; white-space: nowrap; color: var(--blue); }
.keyword-actions .detail-load { color: #fff; background: var(--blue); border-color: var(--blue); }
.fetch-ok { color: var(--green); font-weight: 800; }
.fetch-error { color: var(--red); font-weight: 800; }
.item-link { display: inline-block; margin-top: 8px; color: var(--blue); font-weight: 800; text-decoration: none; }
.item-link:hover { text-decoration: underline; }
.image-panel { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #f8fbfd; }
.image-panel-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); margin-bottom: 8px; }
.image-panel-title strong { color: var(--ink); }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.image-tile { position: relative; display: block; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.image-tile img, .watch-images img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile span { position: absolute; left: 6px; bottom: 6px; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: #fff; background: rgba(23, 32, 38, 0.78); font-size: 12px; font-weight: 800; }
.watch-images { display: grid; grid-template-columns: repeat(6, 58px); gap: 6px; margin-top: 8px; }
.watch-images a { display: block; width: 58px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.parts-box { margin-top: 12px; display: grid; gap: 8px; }
.parts-box h3 { margin: 0; font-size: 15px; }
.part-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #f8fbfd; }
.part-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.part-head span { color: var(--blue); font-weight: 900; white-space: nowrap; }
.part-item p { margin: 8px 0 0; color: var(--muted); }
.part-queries { display: grid; gap: 5px; margin-top: 8px; }
.part-queries code { display: block; padding: 6px 7px; border-radius: 6px; background: #fff; border: 1px solid var(--line); overflow-wrap: anywhere; }
.part-links, .watch-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.part-links a, .watch-parts span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; background: #fff; color: var(--blue); font-weight: 800; text-decoration: none; }
.market-button { width: 100%; margin-top: 12px; color: #fff; background: var(--blue); border-color: var(--blue); }
.market-button:hover { background: #1d4f7e; }
.market-box { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #f8fbfd; }
.market-box h3 { margin: 0 0 8px; font-size: 15px; }
.market-note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.market-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.market-stat { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fff; }
.market-stat span { display: block; color: var(--muted); font-size: 12px; }
.market-stat strong { display: block; margin-top: 4px; font-size: 18px; }
.market-list { display: grid; gap: 6px; margin-top: 10px; }
.market-list a { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; color: var(--blue); font-weight: 800; text-decoration: none; }
.market-list small { display: block; margin-top: 3px; color: var(--muted); font-weight: 600; }
.empty, .error { border: 1px dashed var(--line); border-radius: 8px; padding: 18px; color: var(--muted); margin-top: 12px; }
.error { color: var(--red); border-color: var(--red); }
.result-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; box-shadow: var(--shadow); }
.result-card.signal-gruen { border-color: rgba(31, 122, 77, 0.34); background: linear-gradient(180deg, rgba(31, 122, 77, 0.11), #fff 58%); }
.result-card.signal-rot { border-color: rgba(179, 38, 30, 0.32); background: linear-gradient(180deg, rgba(179, 38, 30, 0.11), #fff 58%); }
.result-card.signal-gelb { border-color: rgba(168, 108, 22, 0.32); background: linear-gradient(180deg, rgba(168, 108, 22, 0.1), #fff 58%); }
.result-headline { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-bottom: 12px; }
.result-price span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.result-price strong { display: block; margin-top: 3px; font-size: 24px; font-weight: 900; line-height: 1.1; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.metric { display: grid; gap: 6px; min-height: 72px; align-content: center; }
.metric span { color: var(--muted); }
.metric strong { font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.metric:first-child { grid-column: 1 / -1; min-height: 92px; }
.metric:first-child span { font-size: 15px; }
.metric:first-child strong { font-size: 28px; }
.result-card .metric:first-child { grid-column: auto; min-height: 72px; }
.result-card .metric:first-child span { font-size: inherit; }
.result-card .metric:first-child strong { font-size: 18px; }
.signal { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; border-radius: 999px; color: #fff; padding: 8px 16px; font-weight: 900; }
.gruen { background: var(--green); }
.gelb { background: var(--amber); }
.rot { background: var(--red); }
ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.verdict { margin-top: 10px; color: var(--ink); font-weight: 800; }
.defect-banner { margin-top: 10px; display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(179, 38, 30, 0.34); border-radius: 8px; background: linear-gradient(180deg, rgba(179, 38, 30, 0.12), rgba(179, 38, 30, 0.06)); color: #7b1f1a; font-weight: 700; }
.defect-line { display: grid; gap: 6px; }
.defect-line strong { color: #8e221d; }
.defect-line a { color: var(--blue); font-weight: 900; text-decoration: none; }
.defect-line a:hover { text-decoration: underline; }
.watch-item strong, .watch-item span { display: block; }
.watch-item span { color: var(--muted); }
.watch-item summary { cursor: pointer; list-style: none; }
.watch-item summary::-webkit-details-marker { display: none; }
.watch-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.watch-summary span { grid-column: 1 / -1; }
.watch-signal { justify-self: end; border-radius: 999px; color: #fff; font-weight: 900; padding: 5px 9px; font-size: 12px; }
.watch-details { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.wide-doc { grid-column: 1 / -1; }
.legal-footer { background: #050b14; color: rgba(255, 255, 255, 0.78); padding: 28px 20px 34px; text-align: center; font-size: 12px; line-height: 1.55; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
.footer-links a { color: #fff; font-weight: 800; text-decoration: underline; }
.copyright { margin-top: 12px; color: rgba(255, 255, 255, 0.55); font-size: 11px; }
.modal-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(2, 8, 18, 0.82); z-index: 1000; }
.modal-overlay.is-open { display: flex; }
.modal-window { width: min(780px, 100%); max-height: min(80vh, 720px); overflow-y: scroll; background: #fff; color: #102033; border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); text-align: left; }
.modal-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: #0d1b30; color: #fff; }
.modal-header h2 { font-size: 20px; margin: 0; }
.modal-close { min-height: 0; margin: 0; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; color: #fff; font-size: 18px; line-height: 1; }
.modal-body { padding: 22px; font-size: 15px; line-height: 1.65; }
.modal-body p { margin: 0 0 14px; }
.trial-modal { width: min(520px, 100%); }
@media (max-width: 920px) {
  body.camera-live {
    overflow: hidden;
  }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-tools { width: 100%; justify-content: flex-end; }
  .customer-brand { justify-content: flex-start; min-height: 0; }
  .status { width: 100%; min-width: 0; }
  .grid, .form-grid, .metrics, .workflow-grid, .search-box, .direct-import, .reverse-box, .scanner-box { grid-template-columns: 1fr; }
  .azure-actions { flex-direction: column; }
  .bulk-upload-row, .bulk-summary-grid, .bulk-portfolio-grid, .bulk-external-inputs, .bulk-results-head, .bulk-result-row, .bulk-detail-grid { grid-template-columns: 1fr; }
  .bulk-filters { display: grid; grid-template-columns: 1fr; }
  .bulk-results-head { display: none; }
  .bulk-result-row { gap: 6px; }
  .wide, .full-workflow { grid-column: auto; }
  .scanner-preview {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
  .scanner-preview video {
    min-height: 0;
  }
  .scanner-actions {
    order: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "capture scan"
      "start torch"
      "cancel clear";
    padding: 10px;
    border: 1px solid rgba(23, 32, 38, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 18px rgba(25, 42, 55, 0.08);
    backdrop-filter: blur(6px);
  }
  .scanner-actions #capturePhotoButton { grid-area: capture; }
  .scanner-actions #scanButton { grid-area: scan; }
  .scanner-actions #cameraStartButton { grid-area: start; }
  .scanner-actions #torchButton { grid-area: torch; }
  .scanner-actions #cameraCancelButton { grid-area: cancel; }
  .scanner-actions #scanClearButton { grid-area: clear; }
  .scanner-box button {
    width: 100%;
    min-width: 0;
  }
  .scanner-box #capturePhotoButton,
  .scanner-box #scanButton {
    min-height: 56px;
    font-size: 17px;
  }
  .camera-drop {
    order: 5;
    min-height: 92px;
    padding: 12px;
  }
  .scanner-box > span {
    order: 3;
  }
  .scan-preview-list {
    order: 4;
  }
  body.camera-live .scanner-card {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: #000;
    box-shadow: none;
  }
  body.camera-live .shell > :not(.grid),
  body.camera-live .panel.wide > :not(.workflow-grid),
  body.camera-live .workflow-grid > :not(.scanner-card),
  body.camera-live .scanner-card .workflow-title,
  body.camera-live .scanner-card .camera-drop,
  body.camera-live .scanner-card #scanStatus,
  body.camera-live .scanner-card #scanButton,
  body.camera-live .scanner-card #cameraStartButton,
  body.camera-live .scanner-card #scanClearButton {
    display: none !important;
  }
  body.camera-live .scanner-card .scanner-box {
    position: relative;
    display: block;
    width: 100vw;
    height: 100vh;
    padding: 0;
    background: #000;
  }
  body.camera-live .scanner-card .scanner-preview {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: #000;
  }
  body.camera-live .scanner-card .scanner-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  body.camera-live .scanner-card .camera-guide-banner {
    top: 24%;
    width: min(82%, 560px);
    font-size: 15px;
    z-index: 10001;
  }
  body.camera-live .scanner-card .scanner-actions {
    position: absolute;
    left: 0;
    bottom: 20px;
    width: 100%;
    z-index: 10002;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 8px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  body.camera-live .scanner-card .scanner-actions #torchButton,
  body.camera-live .scanner-card .scanner-actions #cameraCancelButton,
  body.camera-live .scanner-card .scanner-actions #capturePhotoButton {
    position: relative;
    margin: 0;
  }
  body.camera-live .scanner-card .scanner-actions #torchButton {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0;
    border-radius: 999px;
    background: rgba(212, 122, 0, 0.92);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0;
  }
  body.camera-live .scanner-card .scanner-actions #torchButton::before {
    content: "LED";
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.4px;
  }
  body.camera-live .scanner-card .scanner-actions #cameraCancelButton {
    width: 72px;
    min-width: 72px;
    height: 48px;
    min-height: 48px;
    border-radius: 999px;
    color: #fff;
    background: rgba(111, 118, 128, 0.76);
    border-color: rgba(255, 255, 255, 0.18);
    font-size: 12px;
  }
  body.camera-live .scanner-card .scanner-actions #capturePhotoButton {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: 6px solid rgba(255, 255, 255, 0.32);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    color: transparent;
    font-size: 0;
  }
  body.camera-live .scanner-card .scanner-actions #capturePhotoButton::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(8, 17, 27, 0.08);
  }
  body.camera-live .scanner-card .scanner-actions #capturePhotoButton:disabled::before {
    background: rgba(255, 255, 255, 0.56);
  }
  body.camera-live .scanner-card .scan-preview-list {
    position: absolute;
    top: max(16px, env(safe-area-inset-top, 0px) + 16px);
    left: 12px;
    z-index: 10001;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    width: auto;
  }
  body.camera-live .scanner-card .scan-preview-item {
    width: 42px;
    min-height: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0.74;
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  }
  body.camera-live .scanner-card .scan-preview-item img {
    aspect-ratio: 1;
  }
  body.camera-live .scanner-card .scan-preview-item button {
    display: none;
  }
  body.camera-live .scanner-card .scan-preview-item span {
    inset: auto 0 0 0;
    min-width: 0;
    height: 16px;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: rgba(8, 17, 27, 0.76);
  }
  .keyword-item { grid-template-columns: 64px 1fr; }
  .keyword-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .scanner-card {
    padding: 10px;
  }
  .scanner-preview {
    aspect-ratio: 4 / 3;
    max-height: 34vh;
  }
  .scanner-empty {
    padding: 14px;
    font-size: 13px;
  }
  .camera-drop small {
    font-size: 12px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121212;
    --surface: #1a1a1a;
    --line: #333;
    --ink: #e0e0e0;
    --muted: #aaa;
    --green: #20c36b;
    --green-strong: #16a75a;
    --amber: #ffb020;
    --red: #ff4d4d;
    --blue: #64b5f6;
    --shadow: none;
  }

  body { background: #121212; color: #e0e0e0; }
  .status, .panel, .warning { background: #1a1a1a; border-color: #333; box-shadow: none; }
  .workflow-card, .image-panel, .keyword-item, .market-box, .part-item, .api-limit { background: #2a2a2a; border-color: #333; }
  .watch-item, .metric, .market-stat, .market-list a, .part-queries code, .part-links a, .watch-parts span { background: #2a2a2a; border-color: #333; }
  input, textarea, select { background: #1e1e1e; border-color: #333; color: #fff; }
  input::placeholder, textarea::placeholder { color: #777; }
  button { background: #1e1e1e; border-color: #333; color: #e0e0e0; }
  .quota-card { background: #2a2a2a; border-color: #333; box-shadow: none; }
  .quota-head { border-bottom-color: #333; }
  .quota-head span, .quota-count, .image-panel-title strong, .verdict { color: #e0e0e0; }
  .quota-bar { background: #1e1e1e; border-color: #333; }
  .camera-drop, .scan-preview-item, .keyword-thumb, .image-tile, .watch-images a { background: #1e1e1e; border-color: #333; color: #e0e0e0; }
  .modal-window { background: #1e1e1e; color: #e0e0e0; }
  .modal-header { background: #121212; border-bottom: 1px solid #333; }
  .empty, .error { border-color: #333; }
  .gruen { background: #00c853; color: #06130b; }
  .gelb { background: #ffd54f; color: #231800; }
  .rot { background: #ff5252; color: #1f0505; }
}
