:root {
  color-scheme: dark;
  --bg: #08101b;
  --panel: #111827;
  --panel-soft: #0c1422;
  --line: #253755;
  --text: #eef4ff;
  --muted: #9aa8bd;
  --accent: #f28c28;
  --accent-strong: #ffab52;
  --blue: #68b7f2;
  --input: #0e1422;
  --shadow: rgba(0, 0, 0, .34);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #c9d4e5;
  --text: #121826;
  --muted: #5f6b7e;
  --accent: #e8751a;
  --accent-strong: #c85f0c;
  --blue: #2563eb;
  --input: #ffffff;
  --shadow: rgba(16, 24, 40, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px 0;
}
.brand { display: none; }
.unused-brand {
  color: #aebbd2;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
}
h1 { margin: 3px 0 0; font-size: clamp(30px, 4vw, 38px); line-height: 1.08; }
h2 { margin: 0; font-size: 24px; }
.top-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: inline; }
.scan-status {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  color: var(--muted);
  font-weight: 750;
}
.ghost, .icon-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  color: var(--text);
  font-weight: 750;
}
.icon-button { width: 54px; padding: 0; }
.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd27d, var(--accent));
  box-shadow: 0 0 10px var(--accent);
}
.workspace { padding: 18px; }
.search-form { display: grid; gap: 14px; }
.search-row { display: grid; grid-template-columns: 1fr 160px; gap: 14px; }
.search-row input {
  height: 56px;
  border: 1px solid #526cff;
  border-radius: 18px;
  padding: 0 18px;
  color: var(--text);
  background: var(--input);
  font-size: 17px;
  font-weight: 700;
  outline: none;
}
.search-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.search-row button, .login-form button {
  border: 0;
  border-radius: 16px;
  background: var(--blue);
  color: #07111f;
  font-weight: 850;
}
.chips, .filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.muted { color: var(--muted); }
select {
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 800;
}
.filter-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.filter-row select {
  min-width: 220px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: var(--input);
}
.panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 28vw);
  gap: 20px;
  margin-top: 20px;
}
.panel {
  height: calc(100vh - 286px);
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 18px 42px var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}
.result-list {
  display: grid;
  gap: 10px;
  max-height: calc(100% - 48px);
  overflow: auto;
  padding-right: 4px;
}
.result-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px;
  text-align: left;
  color: var(--text);
  background: var(--panel-soft);
}
.result-item:hover, .result-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--panel-soft) 84%, var(--accent));
}
.result-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 13px;
}
.result-copy { display: grid; gap: 4px; min-width: 0; }
.result-title {
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-meta, .result-path {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-box {
  min-height: 88px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: var(--panel-soft);
}
.preview-box img, .preview-box video {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  border-radius: 12px;
}
.metadata { display: grid; gap: 8px; margin-top: 16px; }
.metadata dt { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metadata dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-panel { width: min(440px, 100%); border: 1px solid var(--line); border-radius: 22px; padding: 28px; background: var(--panel); }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; }
.login-form input { height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; color: var(--text); background: var(--input); }
.login-form button { height: 48px; }
.alert { color: #fecaca; }
.empty { color: var(--muted); }
@media (max-width: 900px) {
  .topbar { display: grid; }
  .search-row { grid-template-columns: 1fr; }
  .search-row button { height: 52px; }
  .panes { grid-template-columns: 1fr; }
  .panel { height: auto; min-height: 340px; border-radius: 16px; }
}
@media (max-width: 560px) {
  .workspace, .topbar { padding-left: 12px; padding-right: 12px; }
  .top-actions { justify-content: stretch; }
  .top-actions form, .ghost, .icon-button, .scan-status { width: 100%; }
  .filter-row select { min-width: min(100%, 260px); }
}
